From a89fa766eaaccab5d5a900f63698fcfb2f1516f8 Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Mon, 27 Jun 2022 00:02:33 +0200 Subject: [PATCH] support colon sign as normal char --- packages/mini/krill-parser.js | 322 +++++++++++++++++----------------- packages/mini/krill.pegjs | 2 +- 2 files changed, 165 insertions(+), 159 deletions(-) diff --git a/packages/mini/krill-parser.js b/packages/mini/krill-parser.js index d93258b2..f93c26c5 100644 --- a/packages/mini/krill-parser.js +++ b/packages/mini/krill-parser.js @@ -1,10 +1,4 @@ -/* -krill-parser.js - -Copyright (C) 2022 Strudel contributors - see -This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -*/ - -// Generated by Peggy 1.2.0. +// Generated by Peggy 2.0.1. // // https://peggyjs.org/ @@ -16,6 +10,7 @@ function peg$subclass(child, parent) { function peg$SyntaxError(message, expected, found, location) { var self = Error.call(this, message); + // istanbul ignore next Check is a necessary evil to support older environments if (Object.setPrototypeOf) { Object.setPrototypeOf(self, peg$SyntaxError.prototype); } @@ -51,14 +46,15 @@ peg$SyntaxError.prototype.format = function(sources) { var loc = this.location.source + ":" + s.line + ":" + s.column; if (src) { var e = this.location.end; - var filler = peg$padEnd("", s.line.toString().length); + var filler = peg$padEnd("", s.line.toString().length, ' '); var line = src[s.line - 1]; var last = s.line === e.line ? e.column : line.length + 1; + var hatLen = (last - s.column) || 1; str += "\n --> " + loc + "\n" + filler + " |\n" + s.line + " | " + line + "\n" - + filler + " | " + peg$padEnd("", s.column - 1) - + peg$padEnd("", last - s.column, "^"); + + filler + " | " + peg$padEnd("", s.column - 1, ' ') + + peg$padEnd("", hatLen, "^"); } else { str += "\n at " + loc; } @@ -79,7 +75,7 @@ peg$SyntaxError.buildMessage = function(expected, found) { : classEscape(part); }); - return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; + return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]"; }, any: function() { @@ -185,31 +181,32 @@ function peg$parse(input, options) { var peg$c7 = "#"; var peg$c8 = "^"; var peg$c9 = "_"; - var peg$c10 = "["; - var peg$c11 = "]"; - var peg$c12 = "<"; - var peg$c13 = ">"; - var peg$c14 = "@"; - var peg$c15 = "!"; - var peg$c16 = "("; - var peg$c17 = ")"; - var peg$c18 = "/"; - var peg$c19 = "*"; - var peg$c20 = "%"; - var peg$c21 = "struct"; - var peg$c22 = "target"; - var peg$c23 = "euclid"; - var peg$c24 = "slow"; - var peg$c25 = "rotL"; - var peg$c26 = "rotR"; - var peg$c27 = "fast"; - var peg$c28 = "scale"; - var peg$c29 = "//"; - var peg$c30 = "cat"; - var peg$c31 = "$"; - var peg$c32 = "setcps"; - var peg$c33 = "setbpm"; - var peg$c34 = "hush"; + var peg$c10 = ":"; + var peg$c11 = "["; + var peg$c12 = "]"; + var peg$c13 = "<"; + var peg$c14 = ">"; + var peg$c15 = "@"; + var peg$c16 = "!"; + var peg$c17 = "("; + var peg$c18 = ")"; + var peg$c19 = "/"; + var peg$c20 = "*"; + var peg$c21 = "%"; + var peg$c22 = "struct"; + var peg$c23 = "target"; + var peg$c24 = "euclid"; + var peg$c25 = "slow"; + var peg$c26 = "rotL"; + var peg$c27 = "rotR"; + var peg$c28 = "fast"; + var peg$c29 = "scale"; + var peg$c30 = "//"; + var peg$c31 = "cat"; + var peg$c32 = "$"; + var peg$c33 = "setcps"; + var peg$c34 = "setbpm"; + var peg$c35 = "hush"; var peg$r0 = /^[1-9]/; var peg$r1 = /^[eE]/; @@ -235,32 +232,33 @@ function peg$parse(input, options) { var peg$e14 = peg$literalExpectation("#", false); var peg$e15 = peg$literalExpectation("^", false); var peg$e16 = peg$literalExpectation("_", false); - var peg$e17 = peg$literalExpectation("[", false); - var peg$e18 = peg$literalExpectation("]", false); - var peg$e19 = peg$literalExpectation("<", false); - var peg$e20 = peg$literalExpectation(">", false); - var peg$e21 = peg$literalExpectation("@", false); - var peg$e22 = peg$literalExpectation("!", false); - var peg$e23 = peg$literalExpectation("(", false); - var peg$e24 = peg$literalExpectation(")", false); - var peg$e25 = peg$literalExpectation("/", false); - var peg$e26 = peg$literalExpectation("*", false); - var peg$e27 = peg$literalExpectation("%", false); - var peg$e28 = peg$literalExpectation("struct", false); - var peg$e29 = peg$literalExpectation("target", false); - var peg$e30 = peg$literalExpectation("euclid", false); - var peg$e31 = peg$literalExpectation("slow", false); - var peg$e32 = peg$literalExpectation("rotL", false); - var peg$e33 = peg$literalExpectation("rotR", false); - var peg$e34 = peg$literalExpectation("fast", false); - var peg$e35 = peg$literalExpectation("scale", false); - var peg$e36 = peg$literalExpectation("//", false); - var peg$e37 = peg$classExpectation(["\n"], true, false); - var peg$e38 = peg$literalExpectation("cat", false); - var peg$e39 = peg$literalExpectation("$", false); - var peg$e40 = peg$literalExpectation("setcps", false); - var peg$e41 = peg$literalExpectation("setbpm", false); - var peg$e42 = peg$literalExpectation("hush", false); + var peg$e17 = peg$literalExpectation(":", false); + var peg$e18 = peg$literalExpectation("[", false); + var peg$e19 = peg$literalExpectation("]", false); + var peg$e20 = peg$literalExpectation("<", false); + var peg$e21 = peg$literalExpectation(">", false); + var peg$e22 = peg$literalExpectation("@", false); + var peg$e23 = peg$literalExpectation("!", false); + var peg$e24 = peg$literalExpectation("(", false); + var peg$e25 = peg$literalExpectation(")", false); + var peg$e26 = peg$literalExpectation("/", false); + var peg$e27 = peg$literalExpectation("*", false); + var peg$e28 = peg$literalExpectation("%", false); + var peg$e29 = peg$literalExpectation("struct", false); + var peg$e30 = peg$literalExpectation("target", false); + var peg$e31 = peg$literalExpectation("euclid", false); + var peg$e32 = peg$literalExpectation("slow", false); + var peg$e33 = peg$literalExpectation("rotL", false); + var peg$e34 = peg$literalExpectation("rotR", false); + var peg$e35 = peg$literalExpectation("fast", false); + var peg$e36 = peg$literalExpectation("scale", false); + var peg$e37 = peg$literalExpectation("//", false); + var peg$e38 = peg$classExpectation(["\n"], true, false); + var peg$e39 = peg$literalExpectation("cat", false); + var peg$e40 = peg$literalExpectation("$", false); + var peg$e41 = peg$literalExpectation("setcps", false); + var peg$e42 = peg$literalExpectation("setbpm", false); + var peg$e43 = peg$literalExpectation("hush", false); var peg$f0 = function() { return parseFloat(text()); }; var peg$f1 = function(chars) { return chars.join("") }; @@ -294,7 +292,6 @@ function peg$parse(input, options) { var peg$f29 = function(v) { return new CommandStub("setcps", { value: v})}; var peg$f30 = function(v) { return new CommandStub("setcps", { value: (v/120/2)})}; var peg$f31 = function() { return new CommandStub("hush")}; - var peg$currPos = 0; var peg$savedPos = 0; var peg$posDetailsCache = [{ line: 1, column: 1 }]; @@ -810,6 +807,15 @@ function peg$parse(input, options) { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$e16); } } + if (s0 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 58) { + s0 = peg$c10; + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e17); } + } + } } } } @@ -852,11 +858,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); if (input.charCodeAt(peg$currPos) === 91) { - s2 = peg$c10; + s2 = peg$c11; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e17); } + if (peg$silentFails === 0) { peg$fail(peg$e18); } } if (s2 !== peg$FAILED) { s3 = peg$parsews(); @@ -864,11 +870,11 @@ function peg$parse(input, options) { if (s4 !== peg$FAILED) { s5 = peg$parsews(); if (input.charCodeAt(peg$currPos) === 93) { - s6 = peg$c11; + s6 = peg$c12; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e18); } + if (peg$silentFails === 0) { peg$fail(peg$e19); } } if (s6 !== peg$FAILED) { s7 = peg$parsews(); @@ -896,11 +902,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); if (input.charCodeAt(peg$currPos) === 60) { - s2 = peg$c12; + s2 = peg$c13; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e19); } + if (peg$silentFails === 0) { peg$fail(peg$e20); } } if (s2 !== peg$FAILED) { s3 = peg$parsews(); @@ -908,11 +914,11 @@ function peg$parse(input, options) { if (s4 !== peg$FAILED) { s5 = peg$parsews(); if (input.charCodeAt(peg$currPos) === 62) { - s6 = peg$c13; + s6 = peg$c14; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e20); } + if (peg$silentFails === 0) { peg$fail(peg$e21); } } if (s6 !== peg$FAILED) { s7 = peg$parsews(); @@ -976,11 +982,11 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 64) { - s1 = peg$c14; + s1 = peg$c15; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e21); } + if (peg$silentFails === 0) { peg$fail(peg$e22); } } if (s1 !== peg$FAILED) { s2 = peg$parsenumber(); @@ -1004,11 +1010,11 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 33) { - s1 = peg$c15; + s1 = peg$c16; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e22); } + if (peg$silentFails === 0) { peg$fail(peg$e23); } } if (s1 !== peg$FAILED) { s2 = peg$parsenumber(); @@ -1032,11 +1038,11 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 40) { - s1 = peg$c16; + s1 = peg$c17; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e23); } + if (peg$silentFails === 0) { peg$fail(peg$e24); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); @@ -1060,11 +1066,11 @@ function peg$parse(input, options) { } s12 = peg$parsews(); if (input.charCodeAt(peg$currPos) === 41) { - s13 = peg$c17; + s13 = peg$c18; peg$currPos++; } else { s13 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e24); } + if (peg$silentFails === 0) { peg$fail(peg$e25); } } if (s13 !== peg$FAILED) { peg$savedPos = s0; @@ -1098,11 +1104,11 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 47) { - s1 = peg$c18; + s1 = peg$c19; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e25); } + if (peg$silentFails === 0) { peg$fail(peg$e26); } } if (s1 !== peg$FAILED) { s2 = peg$parsenumber(); @@ -1126,11 +1132,11 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 42) { - s1 = peg$c19; + s1 = peg$c20; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e26); } + if (peg$silentFails === 0) { peg$fail(peg$e27); } } if (s1 !== peg$FAILED) { s2 = peg$parsenumber(); @@ -1154,11 +1160,11 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 37) { - s1 = peg$c20; + s1 = peg$c21; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e27); } + if (peg$silentFails === 0) { peg$fail(peg$e28); } } if (s1 !== peg$FAILED) { s2 = peg$parsenumber(); @@ -1332,12 +1338,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c21) { - s1 = peg$c21; + if (input.substr(peg$currPos, 6) === peg$c22) { + s1 = peg$c22; peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e28); } + if (peg$silentFails === 0) { peg$fail(peg$e29); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); @@ -1361,12 +1367,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c22) { - s1 = peg$c22; + if (input.substr(peg$currPos, 6) === peg$c23) { + s1 = peg$c23; peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e29); } + if (peg$silentFails === 0) { peg$fail(peg$e30); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); @@ -1402,12 +1408,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c23) { - s1 = peg$c23; + if (input.substr(peg$currPos, 6) === peg$c24) { + s1 = peg$c24; peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e30); } + if (peg$silentFails === 0) { peg$fail(peg$e31); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); @@ -1443,12 +1449,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c24) { - s1 = peg$c24; + if (input.substr(peg$currPos, 4) === peg$c25) { + s1 = peg$c25; peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e31); } + if (peg$silentFails === 0) { peg$fail(peg$e32); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); @@ -1472,12 +1478,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c25) { - s1 = peg$c25; + if (input.substr(peg$currPos, 4) === peg$c26) { + s1 = peg$c26; peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e32); } + if (peg$silentFails === 0) { peg$fail(peg$e33); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); @@ -1501,12 +1507,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c26) { - s1 = peg$c26; + if (input.substr(peg$currPos, 4) === peg$c27) { + s1 = peg$c27; peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e33); } + if (peg$silentFails === 0) { peg$fail(peg$e34); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); @@ -1530,12 +1536,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c27) { - s1 = peg$c27; + if (input.substr(peg$currPos, 4) === peg$c28) { + s1 = peg$c28; peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e34); } + if (peg$silentFails === 0) { peg$fail(peg$e35); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); @@ -1559,12 +1565,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; - if (input.substr(peg$currPos, 5) === peg$c28) { - s1 = peg$c28; + if (input.substr(peg$currPos, 5) === peg$c29) { + s1 = peg$c29; peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e35); } + if (peg$silentFails === 0) { peg$fail(peg$e36); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); @@ -1609,12 +1615,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c29) { - s1 = peg$c29; + if (input.substr(peg$currPos, 2) === peg$c30) { + s1 = peg$c30; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e36); } + if (peg$silentFails === 0) { peg$fail(peg$e37); } } if (s1 !== peg$FAILED) { s2 = []; @@ -1623,7 +1629,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e37); } + if (peg$silentFails === 0) { peg$fail(peg$e38); } } while (s3 !== peg$FAILED) { s2.push(s3); @@ -1632,7 +1638,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e37); } + if (peg$silentFails === 0) { peg$fail(peg$e38); } } } s1 = [s1, s2]; @@ -1649,21 +1655,21 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; s0 = peg$currPos; - if (input.substr(peg$currPos, 3) === peg$c30) { - s1 = peg$c30; + if (input.substr(peg$currPos, 3) === peg$c31) { + s1 = peg$c31; peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e38); } + if (peg$silentFails === 0) { peg$fail(peg$e39); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (input.charCodeAt(peg$currPos) === 91) { - s3 = peg$c10; + s3 = peg$c11; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e17); } + if (peg$silentFails === 0) { peg$fail(peg$e18); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); @@ -1705,11 +1711,11 @@ function peg$parse(input, options) { } s7 = peg$parsews(); if (input.charCodeAt(peg$currPos) === 93) { - s8 = peg$c11; + s8 = peg$c12; peg$currPos++; } else { s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e18); } + if (peg$silentFails === 0) { peg$fail(peg$e19); } } if (s8 !== peg$FAILED) { peg$savedPos = s0; @@ -1770,11 +1776,11 @@ function peg$parse(input, options) { if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (input.charCodeAt(peg$currPos) === 36) { - s3 = peg$c31; + s3 = peg$c32; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e39); } + if (peg$silentFails === 0) { peg$fail(peg$e40); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); @@ -1852,12 +1858,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c32) { - s1 = peg$c32; + if (input.substr(peg$currPos, 6) === peg$c33) { + s1 = peg$c33; peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e40); } + if (peg$silentFails === 0) { peg$fail(peg$e41); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); @@ -1881,12 +1887,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c33) { - s1 = peg$c33; + if (input.substr(peg$currPos, 6) === peg$c34) { + s1 = peg$c34; peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e41); } + if (peg$silentFails === 0) { peg$fail(peg$e42); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); @@ -1910,12 +1916,12 @@ function peg$parse(input, options) { var s0, s1; s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c34) { - s1 = peg$c34; + if (input.substr(peg$currPos, 4) === peg$c35) { + s1 = peg$c35; peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e42); } + if (peg$silentFails === 0) { peg$fail(peg$e43); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; @@ -1938,35 +1944,34 @@ function peg$parse(input, options) { } - var PatternStub = function(source, alignment) - { - this.type_ = "pattern"; - this.arguments_ = { alignment : alignment}; - this.source_ = source; - } + var PatternStub = function(source, alignment) + { + this.type_ = "pattern"; + this.arguments_ = { alignment : alignment}; + this.source_ = source; + } - var OperatorStub = function(name, args, source) - { - this.type_ = name; - this.arguments_ = args; - this.source_ = source; - } + var OperatorStub = function(name, args, source) + { + this.type_ = name; + this.arguments_ = args; + this.source_ = source; + } - var ElementStub = function(source, options) - { - this.type_ = "element"; - this.source_ = source; - this.options_ = options; - this.location_ = location(); - } - - var CommandStub = function(name, options) - { - this.type_ = "command"; - this.name_ = name; - this.options_ = options; - } + var ElementStub = function(source, options) + { + this.type_ = "element"; + this.source_ = source; + this.options_ = options; + this.location_ = location(); + } + var CommandStub = function(name, options) + { + this.type_ = "command"; + this.name_ = name; + this.options_ = options; + } peg$result = peg$startRuleFunction(); @@ -1990,5 +1995,6 @@ function peg$parse(input, options) { export { peg$SyntaxError as SyntaxError, + peg$parse as parse }; diff --git a/packages/mini/krill.pegjs b/packages/mini/krill.pegjs index 914855e6..5451cf01 100644 --- a/packages/mini/krill.pegjs +++ b/packages/mini/krill.pegjs @@ -87,7 +87,7 @@ quote = '"' / "'" // ------------------ steps and cycles --------------------------- // single step definition (e.g bd) -step_char = [0-9a-zA-Z~] / "-" / "#" / "." / "^" / "_" +step_char = [0-9a-zA-Z~] / "-" / "#" / "." / "^" / "_" / ":" step = ws chars:step_char+ ws { return chars.join("") } // define a sub cycle e.g. [1 2, 3 [4]]