@weborigami/language 0.0.73 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/index.ts +1 -0
  2. package/main.js +2 -2
  3. package/package.json +6 -4
  4. package/src/compiler/compile.js +42 -17
  5. package/src/compiler/origami.pegjs +248 -182
  6. package/src/compiler/parse.js +1569 -1231
  7. package/src/compiler/parserHelpers.js +180 -48
  8. package/src/runtime/HandleExtensionsTransform.js +1 -1
  9. package/src/runtime/ImportModulesMixin.js +1 -1
  10. package/src/runtime/codeFragment.js +2 -2
  11. package/src/runtime/errors.js +104 -0
  12. package/src/runtime/evaluate.js +3 -3
  13. package/src/runtime/expressionObject.js +8 -5
  14. package/src/runtime/{extensions.js → handlers.js} +6 -24
  15. package/src/runtime/internal.js +1 -0
  16. package/src/runtime/ops.js +156 -185
  17. package/src/runtime/typos.js +71 -0
  18. package/test/cases/ReadMe.md +1 -0
  19. package/test/cases/conditionalExpression.yaml +101 -0
  20. package/test/cases/logicalAndExpression.yaml +146 -0
  21. package/test/cases/logicalOrExpression.yaml +145 -0
  22. package/test/cases/nullishCoalescingExpression.yaml +105 -0
  23. package/test/compiler/compile.test.js +7 -7
  24. package/test/compiler/parse.test.js +506 -294
  25. package/test/generated/conditionalExpression.test.js +58 -0
  26. package/test/generated/logicalAndExpression.test.js +80 -0
  27. package/test/generated/logicalOrExpression.test.js +78 -0
  28. package/test/generated/nullishCoalescingExpression.test.js +64 -0
  29. package/test/generator/generateTests.js +80 -0
  30. package/test/generator/oriEval.js +15 -0
  31. package/test/runtime/fixtures/templates/greet.orit +1 -1
  32. package/test/runtime/{extensions.test.js → handlers.test.js} +2 -2
  33. package/test/runtime/ops.test.js +129 -26
  34. package/test/runtime/typos.test.js +21 -0
  35. package/src/runtime/formatError.js +0 -56
@@ -7,19 +7,29 @@
7
7
  //
8
8
  // Origami language parser
9
9
  //
10
+ // This generally follows the pattern of the JavaScript expression grammar at
11
+ // https://github.com/pegjs/pegjs/blob/master/examples/javascript.pegjs. Like
12
+ // that parser, this one uses the ECMAScript grammar terms where relevant.
13
+ //
10
14
  // Generate the parser via `npm build`.
15
+ //
11
16
  // @ts-nocheck
12
17
  //
13
18
 
14
19
  import * as ops from "../runtime/ops.js";
15
20
  import {
16
21
  annotate,
22
+ downgradeReference,
17
23
  makeArray,
18
- makeFunctionCall,
24
+ makeBinaryOperatorChain,
25
+ makeCall,
26
+ makeDeferredArguments,
19
27
  makeObject,
20
28
  makePipeline,
21
29
  makeProperty,
22
- makeTemplate
30
+ makeReference,
31
+ makeTemplate,
32
+ makeUnaryOperatorCall
23
33
  } from "./parserHelpers.js";
24
34
 
25
35
 
@@ -192,173 +202,177 @@ function peg$parse(input, options) {
192
202
  var peg$FAILED = {};
193
203
  var peg$source = options.grammarSource;
194
204
 
195
- var peg$startRuleFunctions = { __: peg$parse__, absoluteFilePath: peg$parseabsoluteFilePath, args: peg$parseargs, array: peg$parsearray, arrayEntries: peg$parsearrayEntries, arrayEntry: peg$parsearrayEntry, callTarget: peg$parsecallTarget, closingBrace: peg$parseclosingBrace, closingBracket: peg$parseclosingBracket, closingParen: peg$parseclosingParen, comment: peg$parsecomment, digits: peg$parsedigits, doubleArrow: peg$parsedoubleArrow, doubleQuoteString: peg$parsedoubleQuoteString, doubleQuoteStringChar: peg$parsedoubleQuoteStringChar, ellipsis: peg$parseellipsis, escapedChar: peg$parseescapedChar, expr: peg$parseexpr, expression: peg$parseexpression, float: peg$parsefloat, functionComposition: peg$parsefunctionComposition, group: peg$parsegroup, guillemetString: peg$parseguillemetString, guillemetStringChar: peg$parseguillemetStringChar, host: peg$parsehost, identifier: peg$parseidentifier, identifierChar: peg$parseidentifierChar, identifierList: peg$parseidentifierList, implicitParensArgs: peg$parseimplicitParensArgs, inlineSpace: peg$parseinlineSpace, integer: peg$parseinteger, lambda: peg$parselambda, leadingSlashPath: peg$parseleadingSlashPath, list: peg$parselist, multiLineComment: peg$parsemultiLineComment, newLine: peg$parsenewLine, number: peg$parsenumber, object: peg$parseobject, objectEntries: peg$parseobjectEntries, objectEntry: peg$parseobjectEntry, objectGetter: peg$parseobjectGetter, objectHiddenKey: peg$parseobjectHiddenKey, objectKey: peg$parseobjectKey, objectProperty: peg$parseobjectProperty, objectShorthandProperty: peg$parseobjectShorthandProperty, objectPublicKey: peg$parseobjectPublicKey, parameterizedLambda: peg$parseparameterizedLambda, parensArgs: peg$parseparensArgs, pipeline: peg$parsepipeline, path: peg$parsepath, pathElement: peg$parsepathElement, pathKeyChar: peg$parsepathKeyChar, pathTail: peg$parsepathTail, protocolCall: peg$parseprotocolCall, protocol: peg$parseprotocol, reservedProtocol: peg$parsereservedProtocol, scopeReference: peg$parsescopeReference, scopeTraverse: peg$parsescopeTraverse, separator: peg$parseseparator, shebang: peg$parseshebang, sign: peg$parsesign, singleArrow: peg$parsesingleArrow, singleLineComment: peg$parsesingleLineComment, singleQuoteString: peg$parsesingleQuoteString, singleQuoteStringChar: peg$parsesingleQuoteStringChar, spread: peg$parsespread, step: peg$parsestep, start: peg$parsestart, string: peg$parsestring, taggedTemplate: peg$parsetaggedTemplate, templateDocument: peg$parsetemplateDocument, templateDocumentChar: peg$parsetemplateDocumentChar, templateDocumentContents: peg$parsetemplateDocumentContents, templateDocumentText: peg$parsetemplateDocumentText, templateLiteral: peg$parsetemplateLiteral, templateLiteralChar: peg$parsetemplateLiteralChar, templateLiteralContents: peg$parsetemplateLiteralContents, templateLiteralText: peg$parsetemplateLiteralText, templateSubstitution: peg$parsetemplateSubstitution, textChar: peg$parsetextChar, whitespaceWithNewLine: peg$parsewhitespaceWithNewLine };
205
+ var peg$startRuleFunctions = { __: peg$parse__, arguments: peg$parsearguments, arrayLiteral: peg$parsearrayLiteral, arrayEntries: peg$parsearrayEntries, arrayEntry: peg$parsearrayEntry, arrowFunction: peg$parsearrowFunction, callExpression: peg$parsecallExpression, closingBrace: peg$parseclosingBrace, closingBracket: peg$parseclosingBracket, closingParenthesis: peg$parseclosingParenthesis, comment: peg$parsecomment, conditionalExpression: peg$parseconditionalExpression, digits: peg$parsedigits, doubleArrow: peg$parsedoubleArrow, doubleQuoteString: peg$parsedoubleQuoteString, doubleQuoteStringChar: peg$parsedoubleQuoteStringChar, ellipsis: peg$parseellipsis, equalityExpression: peg$parseequalityExpression, equalityOperator: peg$parseequalityOperator, escapedChar: peg$parseescapedChar, expression: peg$parseexpression, floatLiteral: peg$parsefloatLiteral, group: peg$parsegroup, guillemetString: peg$parseguillemetString, guillemetStringChar: peg$parseguillemetStringChar, homeDirectory: peg$parsehomeDirectory, host: peg$parsehost, identifier: peg$parseidentifier, identifierChar: peg$parseidentifierChar, identifierList: peg$parseidentifierList, implicitParenthesesCallExpression: peg$parseimplicitParenthesesCallExpression, implicitParensthesesArguments: peg$parseimplicitParensthesesArguments, inlineSpace: peg$parseinlineSpace, integerLiteral: peg$parseintegerLiteral, list: peg$parselist, literal: peg$parseliteral, logicalAndExpression: peg$parselogicalAndExpression, logicalOrExpression: peg$parselogicalOrExpression, multiLineComment: peg$parsemultiLineComment, namespace: peg$parsenamespace, newLine: peg$parsenewLine, numericLiteral: peg$parsenumericLiteral, nullishCoalescingExpression: peg$parsenullishCoalescingExpression, objectLiteral: peg$parseobjectLiteral, objectEntries: peg$parseobjectEntries, objectEntry: peg$parseobjectEntry, objectGetter: peg$parseobjectGetter, objectHiddenKey: peg$parseobjectHiddenKey, objectKey: peg$parseobjectKey, objectProperty: peg$parseobjectProperty, objectShorthandProperty: peg$parseobjectShorthandProperty, objectPublicKey: peg$parseobjectPublicKey, parenthesesArguments: peg$parseparenthesesArguments, path: peg$parsepath, pathArguments: peg$parsepathArguments, pathKey: peg$parsepathKey, pathSegment: peg$parsepathSegment, pathSegmentChar: peg$parsepathSegmentChar, pipelineExpression: peg$parsepipelineExpression, primary: peg$parseprimary, program: peg$parseprogram, protocolExpression: peg$parseprotocolExpression, qualifiedReference: peg$parsequalifiedReference, reference: peg$parsereference, rootDirectory: peg$parserootDirectory, scopeReference: peg$parsescopeReference, separator: peg$parseseparator, slashFollows: peg$parseslashFollows, shebang: peg$parseshebang, shorthandFunction: peg$parseshorthandFunction, sign: peg$parsesign, singleArrow: peg$parsesingleArrow, singleLineComment: peg$parsesingleLineComment, singleQuoteString: peg$parsesingleQuoteString, singleQuoteStringChar: peg$parsesingleQuoteStringChar, spread: peg$parsespread, stringLiteral: peg$parsestringLiteral, templateDocument: peg$parsetemplateDocument, templateDocumentChar: peg$parsetemplateDocumentChar, templateDocumentContents: peg$parsetemplateDocumentContents, templateDocumentText: peg$parsetemplateDocumentText, templateLiteral: peg$parsetemplateLiteral, templateLiteralChar: peg$parsetemplateLiteralChar, templateLiteralContents: peg$parsetemplateLiteralContents, templateLiteralText: peg$parsetemplateLiteralText, templateSubstitution: peg$parsetemplateSubstitution, textChar: peg$parsetextChar, unaryExpression: peg$parseunaryExpression, unaryOperator: peg$parseunaryOperator, whitespaceWithNewLine: peg$parsewhitespaceWithNewLine };
196
206
  var peg$startRuleFunction = peg$parse__;
197
207
 
198
- var peg$c0 = "//";
199
- var peg$c1 = "[";
200
- var peg$c2 = "}";
201
- var peg$c3 = "]";
202
- var peg$c4 = ")";
203
- var peg$c5 = "\u21D2";
204
- var peg$c6 = "=>";
205
- var peg$c7 = "\"";
206
- var peg$c8 = "...";
207
- var peg$c9 = "\u2026";
208
- var peg$c10 = "\\0";
209
- var peg$c11 = "\\b";
210
- var peg$c12 = "\\f";
211
- var peg$c13 = "\\n";
212
- var peg$c14 = "\\r";
213
- var peg$c15 = "\\t";
214
- var peg$c16 = "\\v";
215
- var peg$c17 = "\\";
216
- var peg$c18 = ".";
217
- var peg$c19 = "(";
218
- var peg$c20 = "\xAB";
219
- var peg$c21 = "\xBB";
220
- var peg$c22 = ":";
221
- var peg$c23 = "-";
222
- var peg$c24 = ">";
223
- var peg$c25 = "=";
224
- var peg$c26 = "/";
225
- var peg$c27 = "/*";
226
- var peg$c28 = "*/";
227
- var peg$c29 = "\n";
228
- var peg$c30 = "\r\n";
229
- var peg$c31 = "\r";
230
- var peg$c32 = "{";
231
- var peg$c33 = "explore";
232
- var peg$c34 = "https";
233
- var peg$c35 = "http";
234
- var peg$c36 = "new";
235
- var peg$c37 = "package";
236
- var peg$c38 = "treehttps";
237
- var peg$c39 = "treehttp";
238
- var peg$c40 = "tree";
239
- var peg$c41 = ",";
240
- var peg$c42 = "#!";
241
- var peg$c43 = "\u2192";
242
- var peg$c44 = "->";
243
- var peg$c45 = "'";
244
- var peg$c46 = "`";
245
- var peg$c47 = "${";
208
+ var peg$c0 = "[";
209
+ var peg$c1 = "(";
210
+ var peg$c2 = ")";
211
+ var peg$c3 = "}";
212
+ var peg$c4 = "]";
213
+ var peg$c5 = "?";
214
+ var peg$c6 = ":";
215
+ var peg$c7 = "\u21D2";
216
+ var peg$c8 = "=>";
217
+ var peg$c9 = "\"";
218
+ var peg$c10 = "...";
219
+ var peg$c11 = "\u2026";
220
+ var peg$c12 = "===";
221
+ var peg$c13 = "!==";
222
+ var peg$c14 = "==";
223
+ var peg$c15 = "!=";
224
+ var peg$c16 = "\\0";
225
+ var peg$c17 = "\\b";
226
+ var peg$c18 = "\\f";
227
+ var peg$c19 = "\\n";
228
+ var peg$c20 = "\\r";
229
+ var peg$c21 = "\\t";
230
+ var peg$c22 = "\\v";
231
+ var peg$c23 = "\\";
232
+ var peg$c24 = ".";
233
+ var peg$c25 = "\xAB";
234
+ var peg$c26 = "\xBB";
235
+ var peg$c27 = "~";
236
+ var peg$c28 = "-";
237
+ var peg$c29 = ">";
238
+ var peg$c30 = "&&";
239
+ var peg$c31 = "||";
240
+ var peg$c32 = "/*";
241
+ var peg$c33 = "*/";
242
+ var peg$c34 = "@";
243
+ var peg$c35 = "\n";
244
+ var peg$c36 = "\r\n";
245
+ var peg$c37 = "\r";
246
+ var peg$c38 = "??";
247
+ var peg$c39 = "{";
248
+ var peg$c40 = "=";
249
+ var peg$c41 = "/";
250
+ var peg$c42 = "//";
251
+ var peg$c43 = ",";
252
+ var peg$c44 = "#!";
253
+ var peg$c45 = "\u2192";
254
+ var peg$c46 = "->";
255
+ var peg$c47 = "'";
256
+ var peg$c48 = "${";
257
+ var peg$c49 = "`";
258
+ var peg$c50 = "!";
246
259
 
247
260
  var peg$r0 = /^[0-9]/;
248
- var peg$r1 = /^[^(){}[\]<>\-=,\/:`"'\xAB\xBB\\ \u2192\u21D2\t\n\r]/;
261
+ var peg$r1 = /^[^(){}[\]<>?!&|\-=,\/:`"'\xAB\xBB\\ \u2192\u21D2\t\n\r]/;
249
262
  var peg$r2 = /^[ \t]/;
250
- var peg$r3 = /^[^(){}[\],:\/\\ \t\n\r]/;
251
- var peg$r4 = /^[^\n\r]/;
252
- var peg$r5 = /^[+\-]/;
253
-
254
- var peg$e0 = peg$otherExpectation("absolute file path");
255
- var peg$e1 = peg$literalExpectation("//", false);
256
- var peg$e2 = peg$otherExpectation("function arguments");
257
- var peg$e3 = peg$otherExpectation("array");
258
- var peg$e4 = peg$literalExpectation("[", false);
263
+ var peg$r3 = /^[A-Za-z]/;
264
+ var peg$r4 = /^[^(){}[\],:\/\\ \t\n\r]/;
265
+ var peg$r5 = /^[^\n\r]/;
266
+ var peg$r6 = /^[+\-]/;
267
+
268
+ var peg$e0 = peg$otherExpectation("function arguments");
269
+ var peg$e1 = peg$otherExpectation("array");
270
+ var peg$e2 = peg$literalExpectation("[", false);
271
+ var peg$e3 = peg$literalExpectation("(", false);
272
+ var peg$e4 = peg$literalExpectation(")", false);
259
273
  var peg$e5 = peg$otherExpectation("function call");
260
274
  var peg$e6 = peg$literalExpectation("}", false);
261
275
  var peg$e7 = peg$anyExpectation();
262
276
  var peg$e8 = peg$literalExpectation("]", false);
263
- var peg$e9 = peg$literalExpectation(")", false);
264
- var peg$e10 = peg$otherExpectation("comment");
265
- var peg$e11 = peg$classExpectation([["0", "9"]], false, false);
266
- var peg$e12 = peg$literalExpectation("\u21D2", false);
267
- var peg$e13 = peg$literalExpectation("=>", false);
268
- var peg$e14 = peg$otherExpectation("double quote string");
269
- var peg$e15 = peg$literalExpectation("\"", false);
270
- var peg$e16 = peg$literalExpectation("...", false);
271
- var peg$e17 = peg$literalExpectation("\u2026", false);
272
- var peg$e18 = peg$otherExpectation("backslash-escaped character");
273
- var peg$e19 = peg$literalExpectation("\\0", false);
274
- var peg$e20 = peg$literalExpectation("\\b", false);
275
- var peg$e21 = peg$literalExpectation("\\f", false);
276
- var peg$e22 = peg$literalExpectation("\\n", false);
277
- var peg$e23 = peg$literalExpectation("\\r", false);
278
- var peg$e24 = peg$literalExpectation("\\t", false);
279
- var peg$e25 = peg$literalExpectation("\\v", false);
280
- var peg$e26 = peg$literalExpectation("\\", false);
281
- var peg$e27 = peg$otherExpectation("Origami expression");
282
- var peg$e28 = peg$otherExpectation("floating-point number");
283
- var peg$e29 = peg$literalExpectation(".", false);
284
- var peg$e30 = peg$otherExpectation("function composition");
285
- var peg$e31 = peg$otherExpectation("parenthetical group");
286
- var peg$e32 = peg$literalExpectation("(", false);
287
- var peg$e33 = peg$otherExpectation("guillemet string");
288
- var peg$e34 = peg$literalExpectation("\xAB", false);
289
- var peg$e35 = peg$literalExpectation("\xBB", false);
290
- var peg$e36 = peg$otherExpectation("HTTP/HTTPS host");
291
- var peg$e37 = peg$literalExpectation(":", false);
292
- var peg$e38 = peg$otherExpectation("identifier");
293
- var peg$e39 = peg$classExpectation(["(", ")", "{", "}", "[", "]", "<", ">", "-", "=", ",", "/", ":", "`", "\"", "'", "\xAB", "\xBB", "\\", " ", "\u2192", "\u21D2", "\t", "\n", "\r"], true, false);
294
- var peg$e40 = peg$literalExpectation("-", false);
295
- var peg$e41 = peg$literalExpectation(">", false);
296
- var peg$e42 = peg$otherExpectation("arguments with implicit parentheses");
297
- var peg$e43 = peg$classExpectation([" ", "\t"], false, false);
298
- var peg$e44 = peg$otherExpectation("integer");
299
- var peg$e45 = peg$otherExpectation("lambda function");
300
- var peg$e46 = peg$literalExpectation("=", false);
301
- var peg$e47 = peg$otherExpectation("path with a leading slash");
302
- var peg$e48 = peg$literalExpectation("/", false);
303
- var peg$e49 = peg$otherExpectation("list");
277
+ var peg$e9 = peg$otherExpectation("comment");
278
+ var peg$e10 = peg$literalExpectation("?", false);
279
+ var peg$e11 = peg$literalExpectation(":", false);
280
+ var peg$e12 = peg$classExpectation([["0", "9"]], false, false);
281
+ var peg$e13 = peg$literalExpectation("\u21D2", false);
282
+ var peg$e14 = peg$literalExpectation("=>", false);
283
+ var peg$e15 = peg$otherExpectation("double quote string");
284
+ var peg$e16 = peg$literalExpectation("\"", false);
285
+ var peg$e17 = peg$literalExpectation("...", false);
286
+ var peg$e18 = peg$literalExpectation("\u2026", false);
287
+ var peg$e19 = peg$literalExpectation("===", false);
288
+ var peg$e20 = peg$literalExpectation("!==", false);
289
+ var peg$e21 = peg$literalExpectation("==", false);
290
+ var peg$e22 = peg$literalExpectation("!=", false);
291
+ var peg$e23 = peg$otherExpectation("backslash-escaped character");
292
+ var peg$e24 = peg$literalExpectation("\\0", false);
293
+ var peg$e25 = peg$literalExpectation("\\b", false);
294
+ var peg$e26 = peg$literalExpectation("\\f", false);
295
+ var peg$e27 = peg$literalExpectation("\\n", false);
296
+ var peg$e28 = peg$literalExpectation("\\r", false);
297
+ var peg$e29 = peg$literalExpectation("\\t", false);
298
+ var peg$e30 = peg$literalExpectation("\\v", false);
299
+ var peg$e31 = peg$literalExpectation("\\", false);
300
+ var peg$e32 = peg$otherExpectation("floating-point number");
301
+ var peg$e33 = peg$literalExpectation(".", false);
302
+ var peg$e34 = peg$otherExpectation("parenthetical group");
303
+ var peg$e35 = peg$otherExpectation("guillemet string");
304
+ var peg$e36 = peg$literalExpectation("\xAB", false);
305
+ var peg$e37 = peg$literalExpectation("\xBB", false);
306
+ var peg$e38 = peg$literalExpectation("~", false);
307
+ var peg$e39 = peg$otherExpectation("HTTP/HTTPS host");
308
+ var peg$e40 = peg$otherExpectation("identifier");
309
+ var peg$e41 = peg$classExpectation(["(", ")", "{", "}", "[", "]", "<", ">", "?", "!", "&", "|", "-", "=", ",", "/", ":", "`", "\"", "'", "\xAB", "\xBB", "\\", " ", "\u2192", "\u21D2", "\t", "\n", "\r"], true, false);
310
+ var peg$e42 = peg$literalExpectation("-", false);
311
+ var peg$e43 = peg$literalExpectation(">", false);
312
+ var peg$e44 = peg$otherExpectation("function call with implicit parentheses");
313
+ var peg$e45 = peg$classExpectation([" ", "\t"], false, false);
314
+ var peg$e46 = peg$otherExpectation("integer");
315
+ var peg$e47 = peg$otherExpectation("list");
316
+ var peg$e48 = peg$literalExpectation("&&", false);
317
+ var peg$e49 = peg$literalExpectation("||", false);
304
318
  var peg$e50 = peg$literalExpectation("/*", false);
305
319
  var peg$e51 = peg$literalExpectation("*/", false);
306
- var peg$e52 = peg$literalExpectation("\n", false);
307
- var peg$e53 = peg$literalExpectation("\r\n", false);
308
- var peg$e54 = peg$literalExpectation("\r", false);
309
- var peg$e55 = peg$otherExpectation("number");
310
- var peg$e56 = peg$otherExpectation("object literal");
311
- var peg$e57 = peg$literalExpectation("{", false);
312
- var peg$e58 = peg$otherExpectation("object getter");
313
- var peg$e59 = peg$otherExpectation("object key");
314
- var peg$e60 = peg$otherExpectation("object property");
315
- var peg$e61 = peg$otherExpectation("object identifier");
316
- var peg$e62 = peg$otherExpectation("function arguments in parentheses");
317
- var peg$e63 = peg$otherExpectation("slash-separated path");
318
- var peg$e64 = peg$classExpectation(["(", ")", "{", "}", "[", "]", ",", ":", "/", "\\", " ", "\t", "\n", "\r"], true, false);
319
- var peg$e65 = peg$otherExpectation("function call using protocol: syntax");
320
- var peg$e66 = peg$otherExpectation("protocol");
321
- var peg$e67 = peg$otherExpectation("reserved protocol");
322
- var peg$e68 = peg$literalExpectation("explore", false);
323
- var peg$e69 = peg$literalExpectation("https", false);
324
- var peg$e70 = peg$literalExpectation("http", false);
325
- var peg$e71 = peg$literalExpectation("new", false);
326
- var peg$e72 = peg$literalExpectation("package", false);
327
- var peg$e73 = peg$literalExpectation("treehttps", false);
328
- var peg$e74 = peg$literalExpectation("treehttp", false);
329
- var peg$e75 = peg$literalExpectation("tree", false);
330
- var peg$e76 = peg$otherExpectation("scope reference");
331
- var peg$e77 = peg$literalExpectation(",", false);
332
- var peg$e78 = peg$literalExpectation("#!", false);
333
- var peg$e79 = peg$classExpectation(["\n", "\r"], true, false);
334
- var peg$e80 = peg$classExpectation(["+", "-"], false, false);
335
- var peg$e81 = peg$literalExpectation("\u2192", false);
336
- var peg$e82 = peg$literalExpectation("->", false);
337
- var peg$e83 = peg$otherExpectation("single quote string");
338
- var peg$e84 = peg$literalExpectation("'", false);
339
- var peg$e85 = peg$otherExpectation("string");
340
- var peg$e86 = peg$literalExpectation("`", false);
341
- var peg$e87 = peg$otherExpectation("template");
342
- var peg$e88 = peg$literalExpectation("${", false);
343
- var peg$e89 = peg$otherExpectation("template text");
344
- var peg$e90 = peg$otherExpectation("template literal");
345
- var peg$e91 = peg$otherExpectation("template substitution");
320
+ var peg$e52 = peg$literalExpectation("@", false);
321
+ var peg$e53 = peg$classExpectation([["A", "Z"], ["a", "z"]], false, false);
322
+ var peg$e54 = peg$literalExpectation("\n", false);
323
+ var peg$e55 = peg$literalExpectation("\r\n", false);
324
+ var peg$e56 = peg$literalExpectation("\r", false);
325
+ var peg$e57 = peg$otherExpectation("number");
326
+ var peg$e58 = peg$literalExpectation("??", false);
327
+ var peg$e59 = peg$otherExpectation("object literal");
328
+ var peg$e60 = peg$literalExpectation("{", false);
329
+ var peg$e61 = peg$otherExpectation("object getter");
330
+ var peg$e62 = peg$literalExpectation("=", false);
331
+ var peg$e63 = peg$otherExpectation("object key");
332
+ var peg$e64 = peg$otherExpectation("object property");
333
+ var peg$e65 = peg$otherExpectation("object identifier");
334
+ var peg$e66 = peg$literalExpectation("/", false);
335
+ var peg$e67 = peg$otherExpectation("function arguments in parentheses");
336
+ var peg$e68 = peg$otherExpectation("slash-separated path");
337
+ var peg$e69 = peg$classExpectation(["(", ")", "{", "}", "[", "]", ",", ":", "/", "\\", " ", "\t", "\n", "\r"], true, false);
338
+ var peg$e70 = peg$otherExpectation("Origami program");
339
+ var peg$e71 = peg$literalExpectation("//", false);
340
+ var peg$e72 = peg$otherExpectation("scope reference");
341
+ var peg$e73 = peg$literalExpectation(",", false);
342
+ var peg$e74 = peg$literalExpectation("#!", false);
343
+ var peg$e75 = peg$classExpectation(["\n", "\r"], true, false);
344
+ var peg$e76 = peg$otherExpectation("lambda function");
345
+ var peg$e77 = peg$classExpectation(["+", "-"], false, false);
346
+ var peg$e78 = peg$literalExpectation("\u2192", false);
347
+ var peg$e79 = peg$literalExpectation("->", false);
348
+ var peg$e80 = peg$otherExpectation("single quote string");
349
+ var peg$e81 = peg$literalExpectation("'", false);
350
+ var peg$e82 = peg$otherExpectation("string");
351
+ var peg$e83 = peg$otherExpectation("template");
352
+ var peg$e84 = peg$literalExpectation("${", false);
353
+ var peg$e85 = peg$otherExpectation("template text");
354
+ var peg$e86 = peg$otherExpectation("template literal");
355
+ var peg$e87 = peg$literalExpectation("`", false);
356
+ var peg$e88 = peg$otherExpectation("template substitution");
357
+ var peg$e89 = peg$literalExpectation("!", false);
346
358
 
347
359
  var peg$f0 = function() {
348
360
  return null;
349
361
  };
350
- var peg$f1 = function(path) {
351
- return annotate([[ops.filesRoot], ...path], location());
352
- };
353
- var peg$f2 = function(path) {
354
- return annotate([ops.traverse, ...path], location());
355
- };
356
- var peg$f3 = function(entries) {
362
+ var peg$f1 = function(entries) {
357
363
  return annotate(makeArray(entries ?? []), location());
358
364
  };
359
- var peg$f4 = function(entries) {
365
+ var peg$f2 = function(entries) {
360
366
  return annotate(entries, location());
361
367
  };
368
+ var peg$f3 = function(parameters, pipeline) {
369
+ return annotate([ops.lambda, parameters ?? [], pipeline], location());
370
+ };
371
+ var peg$f4 = function(head, tail) {
372
+ return tail.length === 0
373
+ ? head
374
+ : annotate(tail.reduce(makeCall, head), location());
375
+ };
362
376
  var peg$f5 = function() {
363
377
  error("Expected right curly brace");
364
378
  };
@@ -368,152 +382,189 @@ function peg$parse(input, options) {
368
382
  var peg$f7 = function() {
369
383
  error("Expected right parenthesis");
370
384
  };
371
- var peg$f8 = function(chars) {
385
+ var peg$f8 = function(condition, truthy, falsy) {
386
+ return annotate([
387
+ ops.conditional,
388
+ downgradeReference(condition),
389
+ [ops.lambda, [], downgradeReference(truthy)],
390
+ [ops.lambda, [], downgradeReference(falsy)]
391
+ ], location());
392
+ };
393
+ var peg$f9 = function(chars) {
372
394
  return annotate([ops.literal, chars.join("")], location());
373
395
  };
374
- var peg$f9 = function() { return "\0"; };
375
- var peg$f10 = function() { return "\b"; };
376
- var peg$f11 = function() { return "\f"; };
377
- var peg$f12 = function() { return "\n"; };
378
- var peg$f13 = function() { return "\r"; };
379
- var peg$f14 = function() { return "\t"; };
380
- var peg$f15 = function() { return "\v"; };
381
- var peg$f16 = function() {
382
- return annotate([ops.literal, parseFloat(text())], location());
383
- };
384
- var peg$f17 = function(target, chain, end) {
385
- if (end) {
386
- chain.push(end);
387
- }
388
- return annotate(makeFunctionCall(target, chain, location()), location());
396
+ var peg$f10 = function(head, tail) {
397
+ return tail.length === 0
398
+ ? head
399
+ : annotate(makeBinaryOperatorChain(head, tail), location());
389
400
  };
390
- var peg$f18 = function(target, chain, end) {
391
- if (end) {
392
- chain.push(end);
393
- }
394
- return annotate(makeFunctionCall(target, chain, location()), location());
401
+ var peg$f11 = function() { return "\0"; };
402
+ var peg$f12 = function() { return "\b"; };
403
+ var peg$f13 = function() { return "\f"; };
404
+ var peg$f14 = function() { return "\n"; };
405
+ var peg$f15 = function() { return "\r"; };
406
+ var peg$f16 = function() { return "\t"; };
407
+ var peg$f17 = function() { return "\v"; };
408
+ var peg$f18 = function() {
409
+ return annotate([ops.literal, parseFloat(text())], location());
395
410
  };
396
- var peg$f19 = function(expr) {
397
- return annotate(expr, location());
411
+ var peg$f19 = function(expression) {
412
+ return annotate(downgradeReference(expression), location());
398
413
  };
399
414
  var peg$f20 = function(chars) {
400
415
  return annotate([ops.literal, chars.join("")], location());
401
416
  };
402
- var peg$f21 = function(identifier, port) {
417
+ var peg$f21 = function() {
418
+ return annotate([ops.homeDirectory], location());
419
+ };
420
+ var peg$f22 = function(identifier, port, slashFollows) {
403
421
  const portText = port ? `:${port[1]}` : "";
404
- const hostText = identifier + portText;
422
+ const slashText = slashFollows ? "/" : "";
423
+ const hostText = identifier + portText + slashText;
405
424
  return annotate([ops.literal, hostText], location());
406
425
  };
407
- var peg$f22 = function(chars) { return chars.join(""); };
408
- var peg$f23 = function(list) {
426
+ var peg$f23 = function(chars) { return chars.join(""); };
427
+ var peg$f24 = function(list) {
409
428
  return annotate(list, location());
410
429
  };
411
- var peg$f24 = function(args) {
412
- /* Stuff */
413
- return annotate(args, location());
430
+ var peg$f25 = function(head, args) {
431
+ return args ? makeCall(head, args) : head;
414
432
  };
415
- var peg$f25 = function() {
433
+ var peg$f26 = function(values) {
434
+ return annotate(values, location());
435
+ };
436
+ var peg$f27 = function() {
416
437
  return annotate([ops.literal, parseInt(text())], location());
417
438
  };
418
- var peg$f26 = function(expr) {
419
- return annotate([ops.lambda, ["_"], expr], location());
439
+ var peg$f28 = function(values) {
440
+ return annotate(values, location());
420
441
  };
421
- var peg$f27 = function(path) {
422
- return annotate(path ?? [], location());
442
+ var peg$f29 = function(head, tail) {
443
+ return tail.length === 0
444
+ ? head
445
+ : annotate(
446
+ [ops.logicalAnd, downgradeReference(head), ...makeDeferredArguments(tail)],
447
+ location()
448
+ );
423
449
  };
424
- var peg$f28 = function(list) {
425
- return annotate(list, location());
450
+ var peg$f30 = function(head, tail) {
451
+ return tail.length === 0
452
+ ? head
453
+ : annotate(
454
+ [ops.logicalOr, downgradeReference(head), ...makeDeferredArguments(tail)],
455
+ location()
456
+ );
426
457
  };
427
- var peg$f29 = function() { return null; };
428
- var peg$f30 = function(entries) {
458
+ var peg$f31 = function() { return null; };
459
+ var peg$f32 = function(at, chars) {
460
+ return annotate([ops.builtin, (at ?? "") + chars.join("") + ":"], location());
461
+ };
462
+ var peg$f33 = function(head, tail) {
463
+ return tail.length === 0
464
+ ? head
465
+ : annotate(
466
+ [ops.nullishCoalescing, downgradeReference(head), ...makeDeferredArguments(tail)],
467
+ location()
468
+ );
469
+ };
470
+ var peg$f34 = function(entries) {
429
471
  return annotate(makeObject(entries ?? [], ops.object), location());
430
472
  };
431
- var peg$f31 = function(entries) {
473
+ var peg$f35 = function(entries) {
432
474
  return annotate(entries, location());
433
475
  };
434
- var peg$f32 = function(key, value) {
435
- return annotate(makeProperty(key, [ops.getter, value]), location());
476
+ var peg$f36 = function(key, pipeline) {
477
+ return annotate(
478
+ makeProperty(key, annotate([ops.getter, pipeline], location())),
479
+ location()
480
+ );
436
481
  };
437
- var peg$f33 = function(hiddenKey) { return hiddenKey.join(""); };
438
- var peg$f34 = function(key, value) {
439
- return annotate(makeProperty(key, value), location());
482
+ var peg$f37 = function(hiddenKey) { return hiddenKey.join(""); };
483
+ var peg$f38 = function(key, pipeline) {
484
+ return annotate(makeProperty(key, pipeline), location());
440
485
  };
441
- var peg$f35 = function(key) {
486
+ var peg$f39 = function(key) {
442
487
  return annotate([key, [ops.inherited, key]], location());
443
488
  };
444
- var peg$f36 = function(identifier, slash) {
489
+ var peg$f40 = function(identifier, slash) {
445
490
  return identifier + (slash ?? "");
446
491
  };
447
- var peg$f37 = function(string) {
492
+ var peg$f41 = function(string) {
448
493
  // Remove `ops.literal` from the string code
449
494
  return string[1];
450
495
  };
451
- var peg$f38 = function(parameters, expr) {
452
- return annotate([ops.lambda, parameters ?? [], expr], location());
453
- };
454
- var peg$f39 = function(list) {
496
+ var peg$f42 = function(list) {
455
497
  return annotate(list ?? [undefined], location());
456
498
  };
457
- var peg$f40 = function(steps) {
458
- return annotate(makePipeline(steps), location());
499
+ var peg$f43 = function(segments) {
500
+ // Drop empty segments that represent consecutive or final slashes
501
+ segments = segments.filter(segment => segment);
502
+ return annotate(segments, location());
459
503
  };
460
- var peg$f41 = function(head, tail) {
461
- let path = tail ? [...head, tail] : head;
462
- // Remove parts for consecutive slashes
463
- path = path.filter((part) => part[1] !== "/");
464
- return annotate(path, location());
504
+ var peg$f44 = function(path) {
505
+ return annotate([ops.traverse, ...path], location());
465
506
  };
466
- var peg$f42 = function(chars) {
467
- return annotate([ops.literal, chars.join("") + "/"], location());
507
+ var peg$f45 = function(chars, slashFollows) {
508
+ // Append a trailing slash if one follows (but don't consume it)
509
+ const key = chars.join("") + (slashFollows ? "/" : "");
510
+ return annotate([ops.literal, key], location());
468
511
  };
469
- var peg$f43 = function(chars) {
470
- return annotate([ops.literal, chars.join("")], location());
471
- };
472
- var peg$f44 = function(protocol, host, path) {
473
- return annotate([protocol, host, ...(path ?? [])], location());
512
+ var peg$f46 = function(head, tail) {
513
+ return tail.reduce(makePipeline, downgradeReference(head));
514
+ };
515
+ var peg$f47 = function(fn, host, path) {
516
+ const keys = annotate([host, ...(path ?? [])], location());
517
+ return annotate(makeCall(fn, keys), location());
518
+ };
519
+ var peg$f48 = function(fn, reference) {
520
+ const literal = annotate([ops.literal, reference[1]], reference.location);
521
+ return annotate(makeCall(fn, [literal]), location());
474
522
  };
475
- var peg$f45 = function() { return ops.explorableSite; };
476
- var peg$f46 = function() { return ops.https; };
477
- var peg$f47 = function() { return ops.http; };
478
- var peg$f48 = function() { return ops.constructor; };
479
- var peg$f49 = function() { return [ops.scope, "@package"] };
480
- var peg$f50 = function() { return ops.treeHttps; };
481
- var peg$f51 = function() { return ops.treeHttp; };
482
- var peg$f52 = function() { return ops.treeHttps; };
483
- var peg$f53 = function(key) {
484
- return annotate([ops.scope, key], location());
523
+ var peg$f49 = function(key) {
524
+ return annotate([ops.rootDirectory, key], location());
485
525
  };
486
- var peg$f54 = function(ref, path) {
487
- const head = [ops.scope, `${ ref[1] }/`];
488
- head.location = ref.location;
489
- return annotate([ops.traverse, head, ...path], location());
526
+ var peg$f50 = function() {
527
+ return annotate([ops.rootDirectory], location());
528
+ };
529
+ var peg$f51 = function(identifier, slashFollows) {
530
+ const id = identifier + (slashFollows ? "/" : "");
531
+ return annotate(makeReference(id), location());
532
+ };
533
+ var peg$f52 = function() {
534
+ return true;
535
+ };
536
+ var peg$f53 = function() { return null; };
537
+ var peg$f54 = function(definition) {
538
+ return annotate([ops.lambda, ["_"], definition], location());
490
539
  };
491
540
  var peg$f55 = function() { return null; };
492
- var peg$f56 = function() { return null; };
493
- var peg$f57 = function(chars) {
541
+ var peg$f56 = function(chars) {
494
542
  return annotate([ops.literal, chars.join("")], location());
495
543
  };
496
- var peg$f58 = function(expr) {
497
- return annotate([ops.spread, expr], location());
498
- };
499
- var peg$f59 = function(tag, contents) {
500
- return annotate(makeTemplate(tag, contents[0], contents[1]), location());
544
+ var peg$f57 = function(value) {
545
+ return annotate([ops.spread, value], location());
501
546
  };
502
- var peg$f60 = function(contents) {
547
+ var peg$f58 = function(contents) {
503
548
  return annotate([ops.lambda, ["_"], contents], location());
504
549
  };
505
- var peg$f61 = function(head, tail) {
550
+ var peg$f59 = function(head, tail) {
506
551
  return annotate(makeTemplate(ops.template, head, tail), location());
507
552
  };
508
- var peg$f62 = function(chars) {
553
+ var peg$f60 = function(chars) {
509
554
  return chars.join("");
510
555
  };
511
- var peg$f63 = function(contents) {
556
+ var peg$f61 = function(contents) {
512
557
  return annotate(makeTemplate(ops.template, contents[0], contents[1]), location());
513
558
  };
514
- var peg$f64 = function(chars) {
559
+ var peg$f62 = function(chars) {
515
560
  return chars.join("");
516
561
  };
562
+ var peg$f63 = function(expression) {
563
+ return annotate(expression, location());
564
+ };
565
+ var peg$f64 = function(operator, expression) {
566
+ return annotate(makeUnaryOperatorCall(operator, expression), location());
567
+ };
517
568
  var peg$currPos = options.peg$currPos | 0;
518
569
  var peg$savedPos = peg$currPos;
519
570
  var peg$posDetailsCache = [{ line: 1, column: 1 }];
@@ -705,83 +756,37 @@ function peg$parse(input, options) {
705
756
  return s0;
706
757
  }
707
758
 
708
- function peg$parseabsoluteFilePath() {
709
- var s0, s1, s2;
710
-
711
- peg$silentFails++;
712
- s0 = peg$currPos;
713
- s1 = peg$currPos;
714
- peg$silentFails++;
715
- if (input.substr(peg$currPos, 2) === peg$c0) {
716
- s2 = peg$c0;
717
- peg$currPos += 2;
718
- } else {
719
- s2 = peg$FAILED;
720
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
721
- }
722
- peg$silentFails--;
723
- if (s2 === peg$FAILED) {
724
- s1 = undefined;
725
- } else {
726
- peg$currPos = s1;
727
- s1 = peg$FAILED;
728
- }
729
- if (s1 !== peg$FAILED) {
730
- s2 = peg$parseleadingSlashPath();
731
- if (s2 !== peg$FAILED) {
732
- peg$savedPos = s0;
733
- s0 = peg$f1(s2);
734
- } else {
735
- peg$currPos = s0;
736
- s0 = peg$FAILED;
737
- }
738
- } else {
739
- peg$currPos = s0;
740
- s0 = peg$FAILED;
741
- }
742
- peg$silentFails--;
743
- if (s0 === peg$FAILED) {
744
- s1 = peg$FAILED;
745
- if (peg$silentFails === 0) { peg$fail(peg$e0); }
746
- }
747
-
748
- return s0;
749
- }
750
-
751
- function peg$parseargs() {
759
+ function peg$parsearguments() {
752
760
  var s0, s1;
753
761
 
754
762
  peg$silentFails++;
755
- s0 = peg$parseparensArgs();
763
+ s0 = peg$parseparenthesesArguments();
756
764
  if (s0 === peg$FAILED) {
757
- s0 = peg$currPos;
758
- s1 = peg$parseleadingSlashPath();
759
- if (s1 !== peg$FAILED) {
760
- peg$savedPos = s0;
761
- s1 = peg$f2(s1);
765
+ s0 = peg$parsepathArguments();
766
+ if (s0 === peg$FAILED) {
767
+ s0 = peg$parsetemplateLiteral();
762
768
  }
763
- s0 = s1;
764
769
  }
765
770
  peg$silentFails--;
766
771
  if (s0 === peg$FAILED) {
767
772
  s1 = peg$FAILED;
768
- if (peg$silentFails === 0) { peg$fail(peg$e2); }
773
+ if (peg$silentFails === 0) { peg$fail(peg$e0); }
769
774
  }
770
775
 
771
776
  return s0;
772
777
  }
773
778
 
774
- function peg$parsearray() {
779
+ function peg$parsearrayLiteral() {
775
780
  var s0, s1, s2, s3, s4, s5;
776
781
 
777
782
  peg$silentFails++;
778
783
  s0 = peg$currPos;
779
784
  if (input.charCodeAt(peg$currPos) === 91) {
780
- s1 = peg$c1;
785
+ s1 = peg$c0;
781
786
  peg$currPos++;
782
787
  } else {
783
788
  s1 = peg$FAILED;
784
- if (peg$silentFails === 0) { peg$fail(peg$e4); }
789
+ if (peg$silentFails === 0) { peg$fail(peg$e2); }
785
790
  }
786
791
  if (s1 !== peg$FAILED) {
787
792
  s2 = peg$parse__();
@@ -793,7 +798,7 @@ function peg$parse(input, options) {
793
798
  s5 = peg$parseclosingBracket();
794
799
  if (s5 !== peg$FAILED) {
795
800
  peg$savedPos = s0;
796
- s0 = peg$f3(s3);
801
+ s0 = peg$f1(s3);
797
802
  } else {
798
803
  peg$currPos = s0;
799
804
  s0 = peg$FAILED;
@@ -805,7 +810,7 @@ function peg$parse(input, options) {
805
810
  peg$silentFails--;
806
811
  if (s0 === peg$FAILED) {
807
812
  s1 = peg$FAILED;
808
- if (peg$silentFails === 0) { peg$fail(peg$e3); }
813
+ if (peg$silentFails === 0) { peg$fail(peg$e1); }
809
814
  }
810
815
 
811
816
  return s0;
@@ -846,7 +851,7 @@ function peg$parse(input, options) {
846
851
  s2 = null;
847
852
  }
848
853
  peg$savedPos = s0;
849
- s0 = peg$f4(s1);
854
+ s0 = peg$f2(s1);
850
855
  } else {
851
856
  peg$currPos = s0;
852
857
  s0 = peg$FAILED;
@@ -860,40 +865,87 @@ function peg$parse(input, options) {
860
865
 
861
866
  s0 = peg$parsespread();
862
867
  if (s0 === peg$FAILED) {
863
- s0 = peg$parsepipeline();
868
+ s0 = peg$parsepipelineExpression();
864
869
  }
865
870
 
866
871
  return s0;
867
872
  }
868
873
 
869
- function peg$parsecallTarget() {
870
- var s0, s1;
874
+ function peg$parsearrowFunction() {
875
+ var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
871
876
 
872
- peg$silentFails++;
873
- s0 = peg$parseabsoluteFilePath();
874
- if (s0 === peg$FAILED) {
875
- s0 = peg$parsearray();
876
- if (s0 === peg$FAILED) {
877
- s0 = peg$parseobject();
878
- if (s0 === peg$FAILED) {
879
- s0 = peg$parselambda();
880
- if (s0 === peg$FAILED) {
881
- s0 = peg$parseparameterizedLambda();
882
- if (s0 === peg$FAILED) {
883
- s0 = peg$parseprotocolCall();
884
- if (s0 === peg$FAILED) {
885
- s0 = peg$parsegroup();
886
- if (s0 === peg$FAILED) {
887
- s0 = peg$parsescopeTraverse();
888
- if (s0 === peg$FAILED) {
889
- s0 = peg$parsescopeReference();
890
- }
891
- }
892
- }
893
- }
877
+ s0 = peg$currPos;
878
+ if (input.charCodeAt(peg$currPos) === 40) {
879
+ s1 = peg$c1;
880
+ peg$currPos++;
881
+ } else {
882
+ s1 = peg$FAILED;
883
+ if (peg$silentFails === 0) { peg$fail(peg$e3); }
884
+ }
885
+ if (s1 !== peg$FAILED) {
886
+ s2 = peg$parse__();
887
+ s3 = peg$parseidentifierList();
888
+ if (s3 === peg$FAILED) {
889
+ s3 = null;
890
+ }
891
+ s4 = peg$parse__();
892
+ if (input.charCodeAt(peg$currPos) === 41) {
893
+ s5 = peg$c2;
894
+ peg$currPos++;
895
+ } else {
896
+ s5 = peg$FAILED;
897
+ if (peg$silentFails === 0) { peg$fail(peg$e4); }
898
+ }
899
+ if (s5 !== peg$FAILED) {
900
+ s6 = peg$parse__();
901
+ s7 = peg$parsedoubleArrow();
902
+ if (s7 !== peg$FAILED) {
903
+ s8 = peg$parse__();
904
+ s9 = peg$parsepipelineExpression();
905
+ if (s9 !== peg$FAILED) {
906
+ peg$savedPos = s0;
907
+ s0 = peg$f3(s3, s9);
908
+ } else {
909
+ peg$currPos = s0;
910
+ s0 = peg$FAILED;
894
911
  }
912
+ } else {
913
+ peg$currPos = s0;
914
+ s0 = peg$FAILED;
895
915
  }
916
+ } else {
917
+ peg$currPos = s0;
918
+ s0 = peg$FAILED;
919
+ }
920
+ } else {
921
+ peg$currPos = s0;
922
+ s0 = peg$FAILED;
923
+ }
924
+ if (s0 === peg$FAILED) {
925
+ s0 = peg$parseconditionalExpression();
926
+ }
927
+
928
+ return s0;
929
+ }
930
+
931
+ function peg$parsecallExpression() {
932
+ var s0, s1, s2, s3;
933
+
934
+ peg$silentFails++;
935
+ s0 = peg$currPos;
936
+ s1 = peg$parseprotocolExpression();
937
+ if (s1 !== peg$FAILED) {
938
+ s2 = [];
939
+ s3 = peg$parsearguments();
940
+ while (s3 !== peg$FAILED) {
941
+ s2.push(s3);
942
+ s3 = peg$parsearguments();
896
943
  }
944
+ peg$savedPos = s0;
945
+ s0 = peg$f4(s1, s2);
946
+ } else {
947
+ peg$currPos = s0;
948
+ s0 = peg$FAILED;
897
949
  }
898
950
  peg$silentFails--;
899
951
  if (s0 === peg$FAILED) {
@@ -908,7 +960,7 @@ function peg$parse(input, options) {
908
960
  var s0, s1;
909
961
 
910
962
  if (input.charCodeAt(peg$currPos) === 125) {
911
- s0 = peg$c2;
963
+ s0 = peg$c3;
912
964
  peg$currPos++;
913
965
  } else {
914
966
  s0 = peg$FAILED;
@@ -938,7 +990,7 @@ function peg$parse(input, options) {
938
990
  var s0, s1;
939
991
 
940
992
  if (input.charCodeAt(peg$currPos) === 93) {
941
- s0 = peg$c3;
993
+ s0 = peg$c4;
942
994
  peg$currPos++;
943
995
  } else {
944
996
  s0 = peg$FAILED;
@@ -964,15 +1016,15 @@ function peg$parse(input, options) {
964
1016
  return s0;
965
1017
  }
966
1018
 
967
- function peg$parseclosingParen() {
1019
+ function peg$parseclosingParenthesis() {
968
1020
  var s0, s1;
969
1021
 
970
1022
  if (input.charCodeAt(peg$currPos) === 41) {
971
- s0 = peg$c4;
1023
+ s0 = peg$c2;
972
1024
  peg$currPos++;
973
1025
  } else {
974
1026
  s0 = peg$FAILED;
975
- if (peg$silentFails === 0) { peg$fail(peg$e9); }
1027
+ if (peg$silentFails === 0) { peg$fail(peg$e4); }
976
1028
  }
977
1029
  if (s0 === peg$FAILED) {
978
1030
  s0 = peg$currPos;
@@ -1005,7 +1057,66 @@ function peg$parse(input, options) {
1005
1057
  peg$silentFails--;
1006
1058
  if (s0 === peg$FAILED) {
1007
1059
  s1 = peg$FAILED;
1008
- if (peg$silentFails === 0) { peg$fail(peg$e10); }
1060
+ if (peg$silentFails === 0) { peg$fail(peg$e9); }
1061
+ }
1062
+
1063
+ return s0;
1064
+ }
1065
+
1066
+ function peg$parseconditionalExpression() {
1067
+ var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
1068
+
1069
+ s0 = peg$currPos;
1070
+ s1 = peg$parselogicalOrExpression();
1071
+ if (s1 !== peg$FAILED) {
1072
+ s2 = peg$parse__();
1073
+ if (input.charCodeAt(peg$currPos) === 63) {
1074
+ s3 = peg$c5;
1075
+ peg$currPos++;
1076
+ } else {
1077
+ s3 = peg$FAILED;
1078
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
1079
+ }
1080
+ if (s3 !== peg$FAILED) {
1081
+ s4 = peg$parse__();
1082
+ s5 = peg$parsepipelineExpression();
1083
+ if (s5 !== peg$FAILED) {
1084
+ s6 = peg$parse__();
1085
+ if (input.charCodeAt(peg$currPos) === 58) {
1086
+ s7 = peg$c6;
1087
+ peg$currPos++;
1088
+ } else {
1089
+ s7 = peg$FAILED;
1090
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
1091
+ }
1092
+ if (s7 !== peg$FAILED) {
1093
+ s8 = peg$parse__();
1094
+ s9 = peg$parsepipelineExpression();
1095
+ if (s9 !== peg$FAILED) {
1096
+ peg$savedPos = s0;
1097
+ s0 = peg$f8(s1, s5, s9);
1098
+ } else {
1099
+ peg$currPos = s0;
1100
+ s0 = peg$FAILED;
1101
+ }
1102
+ } else {
1103
+ peg$currPos = s0;
1104
+ s0 = peg$FAILED;
1105
+ }
1106
+ } else {
1107
+ peg$currPos = s0;
1108
+ s0 = peg$FAILED;
1109
+ }
1110
+ } else {
1111
+ peg$currPos = s0;
1112
+ s0 = peg$FAILED;
1113
+ }
1114
+ } else {
1115
+ peg$currPos = s0;
1116
+ s0 = peg$FAILED;
1117
+ }
1118
+ if (s0 === peg$FAILED) {
1119
+ s0 = peg$parselogicalOrExpression();
1009
1120
  }
1010
1121
 
1011
1122
  return s0;
@@ -1021,7 +1132,7 @@ function peg$parse(input, options) {
1021
1132
  peg$currPos++;
1022
1133
  } else {
1023
1134
  s2 = peg$FAILED;
1024
- if (peg$silentFails === 0) { peg$fail(peg$e11); }
1135
+ if (peg$silentFails === 0) { peg$fail(peg$e12); }
1025
1136
  }
1026
1137
  if (s2 !== peg$FAILED) {
1027
1138
  while (s2 !== peg$FAILED) {
@@ -1031,7 +1142,7 @@ function peg$parse(input, options) {
1031
1142
  peg$currPos++;
1032
1143
  } else {
1033
1144
  s2 = peg$FAILED;
1034
- if (peg$silentFails === 0) { peg$fail(peg$e11); }
1145
+ if (peg$silentFails === 0) { peg$fail(peg$e12); }
1035
1146
  }
1036
1147
  }
1037
1148
  } else {
@@ -1051,19 +1162,19 @@ function peg$parse(input, options) {
1051
1162
  var s0;
1052
1163
 
1053
1164
  if (input.charCodeAt(peg$currPos) === 8658) {
1054
- s0 = peg$c5;
1165
+ s0 = peg$c7;
1055
1166
  peg$currPos++;
1056
1167
  } else {
1057
1168
  s0 = peg$FAILED;
1058
- if (peg$silentFails === 0) { peg$fail(peg$e12); }
1169
+ if (peg$silentFails === 0) { peg$fail(peg$e13); }
1059
1170
  }
1060
1171
  if (s0 === peg$FAILED) {
1061
- if (input.substr(peg$currPos, 2) === peg$c6) {
1062
- s0 = peg$c6;
1172
+ if (input.substr(peg$currPos, 2) === peg$c8) {
1173
+ s0 = peg$c8;
1063
1174
  peg$currPos += 2;
1064
1175
  } else {
1065
1176
  s0 = peg$FAILED;
1066
- if (peg$silentFails === 0) { peg$fail(peg$e13); }
1177
+ if (peg$silentFails === 0) { peg$fail(peg$e14); }
1067
1178
  }
1068
1179
  }
1069
1180
 
@@ -1076,11 +1187,11 @@ function peg$parse(input, options) {
1076
1187
  peg$silentFails++;
1077
1188
  s0 = peg$currPos;
1078
1189
  if (input.charCodeAt(peg$currPos) === 34) {
1079
- s1 = peg$c7;
1190
+ s1 = peg$c9;
1080
1191
  peg$currPos++;
1081
1192
  } else {
1082
1193
  s1 = peg$FAILED;
1083
- if (peg$silentFails === 0) { peg$fail(peg$e15); }
1194
+ if (peg$silentFails === 0) { peg$fail(peg$e16); }
1084
1195
  }
1085
1196
  if (s1 !== peg$FAILED) {
1086
1197
  s2 = [];
@@ -1090,15 +1201,15 @@ function peg$parse(input, options) {
1090
1201
  s3 = peg$parsedoubleQuoteStringChar();
1091
1202
  }
1092
1203
  if (input.charCodeAt(peg$currPos) === 34) {
1093
- s3 = peg$c7;
1204
+ s3 = peg$c9;
1094
1205
  peg$currPos++;
1095
1206
  } else {
1096
1207
  s3 = peg$FAILED;
1097
- if (peg$silentFails === 0) { peg$fail(peg$e15); }
1208
+ if (peg$silentFails === 0) { peg$fail(peg$e16); }
1098
1209
  }
1099
1210
  if (s3 !== peg$FAILED) {
1100
1211
  peg$savedPos = s0;
1101
- s0 = peg$f8(s2);
1212
+ s0 = peg$f9(s2);
1102
1213
  } else {
1103
1214
  peg$currPos = s0;
1104
1215
  s0 = peg$FAILED;
@@ -1110,7 +1221,7 @@ function peg$parse(input, options) {
1110
1221
  peg$silentFails--;
1111
1222
  if (s0 === peg$FAILED) {
1112
1223
  s1 = peg$FAILED;
1113
- if (peg$silentFails === 0) { peg$fail(peg$e14); }
1224
+ if (peg$silentFails === 0) { peg$fail(peg$e15); }
1114
1225
  }
1115
1226
 
1116
1227
  return s0;
@@ -1123,11 +1234,11 @@ function peg$parse(input, options) {
1123
1234
  s1 = peg$currPos;
1124
1235
  peg$silentFails++;
1125
1236
  if (input.charCodeAt(peg$currPos) === 34) {
1126
- s2 = peg$c7;
1237
+ s2 = peg$c9;
1127
1238
  peg$currPos++;
1128
1239
  } else {
1129
1240
  s2 = peg$FAILED;
1130
- if (peg$silentFails === 0) { peg$fail(peg$e15); }
1241
+ if (peg$silentFails === 0) { peg$fail(peg$e16); }
1131
1242
  }
1132
1243
  if (s2 === peg$FAILED) {
1133
1244
  s2 = peg$parsenewLine();
@@ -1158,135 +1269,228 @@ function peg$parse(input, options) {
1158
1269
  function peg$parseellipsis() {
1159
1270
  var s0;
1160
1271
 
1161
- if (input.substr(peg$currPos, 3) === peg$c8) {
1162
- s0 = peg$c8;
1272
+ if (input.substr(peg$currPos, 3) === peg$c10) {
1273
+ s0 = peg$c10;
1163
1274
  peg$currPos += 3;
1164
1275
  } else {
1165
1276
  s0 = peg$FAILED;
1166
- if (peg$silentFails === 0) { peg$fail(peg$e16); }
1277
+ if (peg$silentFails === 0) { peg$fail(peg$e17); }
1167
1278
  }
1168
1279
  if (s0 === peg$FAILED) {
1169
1280
  if (input.charCodeAt(peg$currPos) === 8230) {
1170
- s0 = peg$c9;
1281
+ s0 = peg$c11;
1171
1282
  peg$currPos++;
1172
1283
  } else {
1173
1284
  s0 = peg$FAILED;
1174
- if (peg$silentFails === 0) { peg$fail(peg$e17); }
1285
+ if (peg$silentFails === 0) { peg$fail(peg$e18); }
1175
1286
  }
1176
1287
  }
1177
1288
 
1178
1289
  return s0;
1179
1290
  }
1180
1291
 
1181
- function peg$parseescapedChar() {
1182
- var s0, s1, s2;
1292
+ function peg$parseequalityExpression() {
1293
+ var s0, s1, s2, s3, s4, s5, s6, s7;
1183
1294
 
1184
- peg$silentFails++;
1185
1295
  s0 = peg$currPos;
1186
- if (input.substr(peg$currPos, 2) === peg$c10) {
1187
- s1 = peg$c10;
1188
- peg$currPos += 2;
1189
- } else {
1190
- s1 = peg$FAILED;
1191
- if (peg$silentFails === 0) { peg$fail(peg$e19); }
1192
- }
1296
+ s1 = peg$parseunaryExpression();
1193
1297
  if (s1 !== peg$FAILED) {
1194
- peg$savedPos = s0;
1195
- s1 = peg$f9();
1196
- }
1197
- s0 = s1;
1198
- if (s0 === peg$FAILED) {
1199
- s0 = peg$currPos;
1200
- if (input.substr(peg$currPos, 2) === peg$c11) {
1201
- s1 = peg$c11;
1202
- peg$currPos += 2;
1298
+ s2 = [];
1299
+ s3 = peg$currPos;
1300
+ s4 = peg$parse__();
1301
+ s5 = peg$parseequalityOperator();
1302
+ if (s5 !== peg$FAILED) {
1303
+ s6 = peg$parse__();
1304
+ s7 = peg$parseunaryExpression();
1305
+ if (s7 !== peg$FAILED) {
1306
+ s3 = [ s5, s7 ];
1307
+ } else {
1308
+ peg$currPos = s3;
1309
+ s3 = peg$FAILED;
1310
+ }
1203
1311
  } else {
1204
- s1 = peg$FAILED;
1205
- if (peg$silentFails === 0) { peg$fail(peg$e20); }
1312
+ peg$currPos = s3;
1313
+ s3 = peg$FAILED;
1206
1314
  }
1207
- if (s1 !== peg$FAILED) {
1208
- peg$savedPos = s0;
1209
- s1 = peg$f10();
1315
+ while (s3 !== peg$FAILED) {
1316
+ s2.push(s3);
1317
+ s3 = peg$currPos;
1318
+ s4 = peg$parse__();
1319
+ s5 = peg$parseequalityOperator();
1320
+ if (s5 !== peg$FAILED) {
1321
+ s6 = peg$parse__();
1322
+ s7 = peg$parseunaryExpression();
1323
+ if (s7 !== peg$FAILED) {
1324
+ s3 = [ s5, s7 ];
1325
+ } else {
1326
+ peg$currPos = s3;
1327
+ s3 = peg$FAILED;
1328
+ }
1329
+ } else {
1330
+ peg$currPos = s3;
1331
+ s3 = peg$FAILED;
1332
+ }
1333
+ }
1334
+ peg$savedPos = s0;
1335
+ s0 = peg$f10(s1, s2);
1336
+ } else {
1337
+ peg$currPos = s0;
1338
+ s0 = peg$FAILED;
1339
+ }
1340
+
1341
+ return s0;
1342
+ }
1343
+
1344
+ function peg$parseequalityOperator() {
1345
+ var s0;
1346
+
1347
+ if (input.substr(peg$currPos, 3) === peg$c12) {
1348
+ s0 = peg$c12;
1349
+ peg$currPos += 3;
1350
+ } else {
1351
+ s0 = peg$FAILED;
1352
+ if (peg$silentFails === 0) { peg$fail(peg$e19); }
1353
+ }
1354
+ if (s0 === peg$FAILED) {
1355
+ if (input.substr(peg$currPos, 3) === peg$c13) {
1356
+ s0 = peg$c13;
1357
+ peg$currPos += 3;
1358
+ } else {
1359
+ s0 = peg$FAILED;
1360
+ if (peg$silentFails === 0) { peg$fail(peg$e20); }
1361
+ }
1362
+ if (s0 === peg$FAILED) {
1363
+ if (input.substr(peg$currPos, 2) === peg$c14) {
1364
+ s0 = peg$c14;
1365
+ peg$currPos += 2;
1366
+ } else {
1367
+ s0 = peg$FAILED;
1368
+ if (peg$silentFails === 0) { peg$fail(peg$e21); }
1369
+ }
1370
+ if (s0 === peg$FAILED) {
1371
+ if (input.substr(peg$currPos, 2) === peg$c15) {
1372
+ s0 = peg$c15;
1373
+ peg$currPos += 2;
1374
+ } else {
1375
+ s0 = peg$FAILED;
1376
+ if (peg$silentFails === 0) { peg$fail(peg$e22); }
1377
+ }
1378
+ }
1379
+ }
1380
+ }
1381
+
1382
+ return s0;
1383
+ }
1384
+
1385
+ function peg$parseescapedChar() {
1386
+ var s0, s1, s2;
1387
+
1388
+ peg$silentFails++;
1389
+ s0 = peg$currPos;
1390
+ if (input.substr(peg$currPos, 2) === peg$c16) {
1391
+ s1 = peg$c16;
1392
+ peg$currPos += 2;
1393
+ } else {
1394
+ s1 = peg$FAILED;
1395
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1396
+ }
1397
+ if (s1 !== peg$FAILED) {
1398
+ peg$savedPos = s0;
1399
+ s1 = peg$f11();
1400
+ }
1401
+ s0 = s1;
1402
+ if (s0 === peg$FAILED) {
1403
+ s0 = peg$currPos;
1404
+ if (input.substr(peg$currPos, 2) === peg$c17) {
1405
+ s1 = peg$c17;
1406
+ peg$currPos += 2;
1407
+ } else {
1408
+ s1 = peg$FAILED;
1409
+ if (peg$silentFails === 0) { peg$fail(peg$e25); }
1410
+ }
1411
+ if (s1 !== peg$FAILED) {
1412
+ peg$savedPos = s0;
1413
+ s1 = peg$f12();
1210
1414
  }
1211
1415
  s0 = s1;
1212
1416
  if (s0 === peg$FAILED) {
1213
1417
  s0 = peg$currPos;
1214
- if (input.substr(peg$currPos, 2) === peg$c12) {
1215
- s1 = peg$c12;
1418
+ if (input.substr(peg$currPos, 2) === peg$c18) {
1419
+ s1 = peg$c18;
1216
1420
  peg$currPos += 2;
1217
1421
  } else {
1218
1422
  s1 = peg$FAILED;
1219
- if (peg$silentFails === 0) { peg$fail(peg$e21); }
1423
+ if (peg$silentFails === 0) { peg$fail(peg$e26); }
1220
1424
  }
1221
1425
  if (s1 !== peg$FAILED) {
1222
1426
  peg$savedPos = s0;
1223
- s1 = peg$f11();
1427
+ s1 = peg$f13();
1224
1428
  }
1225
1429
  s0 = s1;
1226
1430
  if (s0 === peg$FAILED) {
1227
1431
  s0 = peg$currPos;
1228
- if (input.substr(peg$currPos, 2) === peg$c13) {
1229
- s1 = peg$c13;
1432
+ if (input.substr(peg$currPos, 2) === peg$c19) {
1433
+ s1 = peg$c19;
1230
1434
  peg$currPos += 2;
1231
1435
  } else {
1232
1436
  s1 = peg$FAILED;
1233
- if (peg$silentFails === 0) { peg$fail(peg$e22); }
1437
+ if (peg$silentFails === 0) { peg$fail(peg$e27); }
1234
1438
  }
1235
1439
  if (s1 !== peg$FAILED) {
1236
1440
  peg$savedPos = s0;
1237
- s1 = peg$f12();
1441
+ s1 = peg$f14();
1238
1442
  }
1239
1443
  s0 = s1;
1240
1444
  if (s0 === peg$FAILED) {
1241
1445
  s0 = peg$currPos;
1242
- if (input.substr(peg$currPos, 2) === peg$c14) {
1243
- s1 = peg$c14;
1446
+ if (input.substr(peg$currPos, 2) === peg$c20) {
1447
+ s1 = peg$c20;
1244
1448
  peg$currPos += 2;
1245
1449
  } else {
1246
1450
  s1 = peg$FAILED;
1247
- if (peg$silentFails === 0) { peg$fail(peg$e23); }
1451
+ if (peg$silentFails === 0) { peg$fail(peg$e28); }
1248
1452
  }
1249
1453
  if (s1 !== peg$FAILED) {
1250
1454
  peg$savedPos = s0;
1251
- s1 = peg$f13();
1455
+ s1 = peg$f15();
1252
1456
  }
1253
1457
  s0 = s1;
1254
1458
  if (s0 === peg$FAILED) {
1255
1459
  s0 = peg$currPos;
1256
- if (input.substr(peg$currPos, 2) === peg$c15) {
1257
- s1 = peg$c15;
1460
+ if (input.substr(peg$currPos, 2) === peg$c21) {
1461
+ s1 = peg$c21;
1258
1462
  peg$currPos += 2;
1259
1463
  } else {
1260
1464
  s1 = peg$FAILED;
1261
- if (peg$silentFails === 0) { peg$fail(peg$e24); }
1465
+ if (peg$silentFails === 0) { peg$fail(peg$e29); }
1262
1466
  }
1263
1467
  if (s1 !== peg$FAILED) {
1264
1468
  peg$savedPos = s0;
1265
- s1 = peg$f14();
1469
+ s1 = peg$f16();
1266
1470
  }
1267
1471
  s0 = s1;
1268
1472
  if (s0 === peg$FAILED) {
1269
1473
  s0 = peg$currPos;
1270
- if (input.substr(peg$currPos, 2) === peg$c16) {
1271
- s1 = peg$c16;
1474
+ if (input.substr(peg$currPos, 2) === peg$c22) {
1475
+ s1 = peg$c22;
1272
1476
  peg$currPos += 2;
1273
1477
  } else {
1274
1478
  s1 = peg$FAILED;
1275
- if (peg$silentFails === 0) { peg$fail(peg$e25); }
1479
+ if (peg$silentFails === 0) { peg$fail(peg$e30); }
1276
1480
  }
1277
1481
  if (s1 !== peg$FAILED) {
1278
1482
  peg$savedPos = s0;
1279
- s1 = peg$f15();
1483
+ s1 = peg$f17();
1280
1484
  }
1281
1485
  s0 = s1;
1282
1486
  if (s0 === peg$FAILED) {
1283
1487
  s0 = peg$currPos;
1284
1488
  if (input.charCodeAt(peg$currPos) === 92) {
1285
- s1 = peg$c17;
1489
+ s1 = peg$c23;
1286
1490
  peg$currPos++;
1287
1491
  } else {
1288
1492
  s1 = peg$FAILED;
1289
- if (peg$silentFails === 0) { peg$fail(peg$e26); }
1493
+ if (peg$silentFails === 0) { peg$fail(peg$e31); }
1290
1494
  }
1291
1495
  if (s1 !== peg$FAILED) {
1292
1496
  if (input.length > peg$currPos) {
@@ -1316,48 +1520,30 @@ function peg$parse(input, options) {
1316
1520
  peg$silentFails--;
1317
1521
  if (s0 === peg$FAILED) {
1318
1522
  s1 = peg$FAILED;
1319
- if (peg$silentFails === 0) { peg$fail(peg$e18); }
1523
+ if (peg$silentFails === 0) { peg$fail(peg$e23); }
1320
1524
  }
1321
1525
 
1322
1526
  return s0;
1323
1527
  }
1324
1528
 
1325
- function peg$parseexpr() {
1326
- var s0;
1327
-
1328
- s0 = peg$parsepipeline();
1329
-
1330
- return s0;
1331
- }
1332
-
1333
1529
  function peg$parseexpression() {
1334
- var s0, s1, s2, s3, s4;
1530
+ var s0, s1, s2, s3;
1335
1531
 
1336
- peg$silentFails++;
1337
1532
  s0 = peg$currPos;
1338
- s1 = peg$parseshebang();
1339
- if (s1 === peg$FAILED) {
1340
- s1 = null;
1341
- }
1342
- s2 = peg$parse__();
1343
- s3 = peg$parsepipeline();
1344
- if (s3 !== peg$FAILED) {
1345
- s4 = peg$parse__();
1346
- s0 = s3;
1533
+ s1 = peg$parse__();
1534
+ s2 = peg$parsepipelineExpression();
1535
+ if (s2 !== peg$FAILED) {
1536
+ s3 = peg$parse__();
1537
+ s0 = s2;
1347
1538
  } else {
1348
1539
  peg$currPos = s0;
1349
1540
  s0 = peg$FAILED;
1350
1541
  }
1351
- peg$silentFails--;
1352
- if (s0 === peg$FAILED) {
1353
- s1 = peg$FAILED;
1354
- if (peg$silentFails === 0) { peg$fail(peg$e27); }
1355
- }
1356
1542
 
1357
1543
  return s0;
1358
1544
  }
1359
1545
 
1360
- function peg$parsefloat() {
1546
+ function peg$parsefloatLiteral() {
1361
1547
  var s0, s1, s2, s3, s4;
1362
1548
 
1363
1549
  peg$silentFails++;
@@ -1371,58 +1557,17 @@ function peg$parse(input, options) {
1371
1557
  s2 = null;
1372
1558
  }
1373
1559
  if (input.charCodeAt(peg$currPos) === 46) {
1374
- s3 = peg$c18;
1560
+ s3 = peg$c24;
1375
1561
  peg$currPos++;
1376
1562
  } else {
1377
1563
  s3 = peg$FAILED;
1378
- if (peg$silentFails === 0) { peg$fail(peg$e29); }
1564
+ if (peg$silentFails === 0) { peg$fail(peg$e33); }
1379
1565
  }
1380
1566
  if (s3 !== peg$FAILED) {
1381
1567
  s4 = peg$parsedigits();
1382
1568
  if (s4 !== peg$FAILED) {
1383
1569
  peg$savedPos = s0;
1384
- s0 = peg$f16();
1385
- } else {
1386
- peg$currPos = s0;
1387
- s0 = peg$FAILED;
1388
- }
1389
- } else {
1390
- peg$currPos = s0;
1391
- s0 = peg$FAILED;
1392
- }
1393
- peg$silentFails--;
1394
- if (s0 === peg$FAILED) {
1395
- s1 = peg$FAILED;
1396
- if (peg$silentFails === 0) { peg$fail(peg$e28); }
1397
- }
1398
-
1399
- return s0;
1400
- }
1401
-
1402
- function peg$parsefunctionComposition() {
1403
- var s0, s1, s2, s3;
1404
-
1405
- peg$silentFails++;
1406
- s0 = peg$currPos;
1407
- s1 = peg$parsecallTarget();
1408
- if (s1 !== peg$FAILED) {
1409
- s2 = [];
1410
- s3 = peg$parseargs();
1411
- if (s3 !== peg$FAILED) {
1412
- while (s3 !== peg$FAILED) {
1413
- s2.push(s3);
1414
- s3 = peg$parseargs();
1415
- }
1416
- } else {
1417
- s2 = peg$FAILED;
1418
- }
1419
- if (s2 !== peg$FAILED) {
1420
- s3 = peg$parseimplicitParensArgs();
1421
- if (s3 === peg$FAILED) {
1422
- s3 = null;
1423
- }
1424
- peg$savedPos = s0;
1425
- s0 = peg$f17(s1, s2, s3);
1570
+ s0 = peg$f18();
1426
1571
  } else {
1427
1572
  peg$currPos = s0;
1428
1573
  s0 = peg$FAILED;
@@ -1431,59 +1576,34 @@ function peg$parse(input, options) {
1431
1576
  peg$currPos = s0;
1432
1577
  s0 = peg$FAILED;
1433
1578
  }
1434
- if (s0 === peg$FAILED) {
1435
- s0 = peg$currPos;
1436
- s1 = peg$parsecallTarget();
1437
- if (s1 !== peg$FAILED) {
1438
- s2 = [];
1439
- s3 = peg$parseargs();
1440
- while (s3 !== peg$FAILED) {
1441
- s2.push(s3);
1442
- s3 = peg$parseargs();
1443
- }
1444
- s3 = peg$parseimplicitParensArgs();
1445
- if (s3 !== peg$FAILED) {
1446
- peg$savedPos = s0;
1447
- s0 = peg$f18(s1, s2, s3);
1448
- } else {
1449
- peg$currPos = s0;
1450
- s0 = peg$FAILED;
1451
- }
1452
- } else {
1453
- peg$currPos = s0;
1454
- s0 = peg$FAILED;
1455
- }
1456
- }
1457
1579
  peg$silentFails--;
1458
1580
  if (s0 === peg$FAILED) {
1459
1581
  s1 = peg$FAILED;
1460
- if (peg$silentFails === 0) { peg$fail(peg$e30); }
1582
+ if (peg$silentFails === 0) { peg$fail(peg$e32); }
1461
1583
  }
1462
1584
 
1463
1585
  return s0;
1464
1586
  }
1465
1587
 
1466
1588
  function peg$parsegroup() {
1467
- var s0, s1, s2, s3, s4, s5;
1589
+ var s0, s1, s2, s3;
1468
1590
 
1469
1591
  peg$silentFails++;
1470
1592
  s0 = peg$currPos;
1471
1593
  if (input.charCodeAt(peg$currPos) === 40) {
1472
- s1 = peg$c19;
1594
+ s1 = peg$c1;
1473
1595
  peg$currPos++;
1474
1596
  } else {
1475
1597
  s1 = peg$FAILED;
1476
- if (peg$silentFails === 0) { peg$fail(peg$e32); }
1598
+ if (peg$silentFails === 0) { peg$fail(peg$e3); }
1477
1599
  }
1478
1600
  if (s1 !== peg$FAILED) {
1479
- s2 = peg$parse__();
1480
- s3 = peg$parsepipeline();
1481
- if (s3 !== peg$FAILED) {
1482
- s4 = peg$parse__();
1483
- s5 = peg$parseclosingParen();
1484
- if (s5 !== peg$FAILED) {
1601
+ s2 = peg$parseexpression();
1602
+ if (s2 !== peg$FAILED) {
1603
+ s3 = peg$parseclosingParenthesis();
1604
+ if (s3 !== peg$FAILED) {
1485
1605
  peg$savedPos = s0;
1486
- s0 = peg$f19(s3);
1606
+ s0 = peg$f19(s2);
1487
1607
  } else {
1488
1608
  peg$currPos = s0;
1489
1609
  s0 = peg$FAILED;
@@ -1499,7 +1619,7 @@ function peg$parse(input, options) {
1499
1619
  peg$silentFails--;
1500
1620
  if (s0 === peg$FAILED) {
1501
1621
  s1 = peg$FAILED;
1502
- if (peg$silentFails === 0) { peg$fail(peg$e31); }
1622
+ if (peg$silentFails === 0) { peg$fail(peg$e34); }
1503
1623
  }
1504
1624
 
1505
1625
  return s0;
@@ -1511,11 +1631,11 @@ function peg$parse(input, options) {
1511
1631
  peg$silentFails++;
1512
1632
  s0 = peg$currPos;
1513
1633
  if (input.charCodeAt(peg$currPos) === 171) {
1514
- s1 = peg$c20;
1634
+ s1 = peg$c25;
1515
1635
  peg$currPos++;
1516
1636
  } else {
1517
1637
  s1 = peg$FAILED;
1518
- if (peg$silentFails === 0) { peg$fail(peg$e34); }
1638
+ if (peg$silentFails === 0) { peg$fail(peg$e36); }
1519
1639
  }
1520
1640
  if (s1 !== peg$FAILED) {
1521
1641
  s2 = [];
@@ -1525,11 +1645,11 @@ function peg$parse(input, options) {
1525
1645
  s3 = peg$parseguillemetStringChar();
1526
1646
  }
1527
1647
  if (input.charCodeAt(peg$currPos) === 187) {
1528
- s3 = peg$c21;
1648
+ s3 = peg$c26;
1529
1649
  peg$currPos++;
1530
1650
  } else {
1531
1651
  s3 = peg$FAILED;
1532
- if (peg$silentFails === 0) { peg$fail(peg$e35); }
1652
+ if (peg$silentFails === 0) { peg$fail(peg$e37); }
1533
1653
  }
1534
1654
  if (s3 !== peg$FAILED) {
1535
1655
  peg$savedPos = s0;
@@ -1545,7 +1665,7 @@ function peg$parse(input, options) {
1545
1665
  peg$silentFails--;
1546
1666
  if (s0 === peg$FAILED) {
1547
1667
  s1 = peg$FAILED;
1548
- if (peg$silentFails === 0) { peg$fail(peg$e33); }
1668
+ if (peg$silentFails === 0) { peg$fail(peg$e35); }
1549
1669
  }
1550
1670
 
1551
1671
  return s0;
@@ -1558,11 +1678,11 @@ function peg$parse(input, options) {
1558
1678
  s1 = peg$currPos;
1559
1679
  peg$silentFails++;
1560
1680
  if (input.charCodeAt(peg$currPos) === 187) {
1561
- s2 = peg$c21;
1681
+ s2 = peg$c26;
1562
1682
  peg$currPos++;
1563
1683
  } else {
1564
1684
  s2 = peg$FAILED;
1565
- if (peg$silentFails === 0) { peg$fail(peg$e35); }
1685
+ if (peg$silentFails === 0) { peg$fail(peg$e37); }
1566
1686
  }
1567
1687
  if (s2 === peg$FAILED) {
1568
1688
  s2 = peg$parsenewLine();
@@ -1590,6 +1710,26 @@ function peg$parse(input, options) {
1590
1710
  return s0;
1591
1711
  }
1592
1712
 
1713
+ function peg$parsehomeDirectory() {
1714
+ var s0, s1;
1715
+
1716
+ s0 = peg$currPos;
1717
+ if (input.charCodeAt(peg$currPos) === 126) {
1718
+ s1 = peg$c27;
1719
+ peg$currPos++;
1720
+ } else {
1721
+ s1 = peg$FAILED;
1722
+ if (peg$silentFails === 0) { peg$fail(peg$e38); }
1723
+ }
1724
+ if (s1 !== peg$FAILED) {
1725
+ peg$savedPos = s0;
1726
+ s1 = peg$f21();
1727
+ }
1728
+ s0 = s1;
1729
+
1730
+ return s0;
1731
+ }
1732
+
1593
1733
  function peg$parsehost() {
1594
1734
  var s0, s1, s2, s3, s4;
1595
1735
 
@@ -1599,14 +1739,14 @@ function peg$parse(input, options) {
1599
1739
  if (s1 !== peg$FAILED) {
1600
1740
  s2 = peg$currPos;
1601
1741
  if (input.charCodeAt(peg$currPos) === 58) {
1602
- s3 = peg$c22;
1742
+ s3 = peg$c6;
1603
1743
  peg$currPos++;
1604
1744
  } else {
1605
1745
  s3 = peg$FAILED;
1606
- if (peg$silentFails === 0) { peg$fail(peg$e37); }
1746
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
1607
1747
  }
1608
1748
  if (s3 !== peg$FAILED) {
1609
- s4 = peg$parsenumber();
1749
+ s4 = peg$parseintegerLiteral();
1610
1750
  if (s4 !== peg$FAILED) {
1611
1751
  s2 = s4;
1612
1752
  } else {
@@ -1620,8 +1760,12 @@ function peg$parse(input, options) {
1620
1760
  if (s2 === peg$FAILED) {
1621
1761
  s2 = null;
1622
1762
  }
1763
+ s3 = peg$parseslashFollows();
1764
+ if (s3 === peg$FAILED) {
1765
+ s3 = null;
1766
+ }
1623
1767
  peg$savedPos = s0;
1624
- s0 = peg$f21(s1, s2);
1768
+ s0 = peg$f22(s1, s2, s3);
1625
1769
  } else {
1626
1770
  peg$currPos = s0;
1627
1771
  s0 = peg$FAILED;
@@ -1629,7 +1773,7 @@ function peg$parse(input, options) {
1629
1773
  peg$silentFails--;
1630
1774
  if (s0 === peg$FAILED) {
1631
1775
  s1 = peg$FAILED;
1632
- if (peg$silentFails === 0) { peg$fail(peg$e36); }
1776
+ if (peg$silentFails === 0) { peg$fail(peg$e39); }
1633
1777
  }
1634
1778
 
1635
1779
  return s0;
@@ -1652,13 +1796,13 @@ function peg$parse(input, options) {
1652
1796
  }
1653
1797
  if (s1 !== peg$FAILED) {
1654
1798
  peg$savedPos = s0;
1655
- s1 = peg$f22(s1);
1799
+ s1 = peg$f23(s1);
1656
1800
  }
1657
1801
  s0 = s1;
1658
1802
  peg$silentFails--;
1659
1803
  if (s0 === peg$FAILED) {
1660
1804
  s1 = peg$FAILED;
1661
- if (peg$silentFails === 0) { peg$fail(peg$e38); }
1805
+ if (peg$silentFails === 0) { peg$fail(peg$e40); }
1662
1806
  }
1663
1807
 
1664
1808
  return s0;
@@ -1672,26 +1816,26 @@ function peg$parse(input, options) {
1672
1816
  peg$currPos++;
1673
1817
  } else {
1674
1818
  s0 = peg$FAILED;
1675
- if (peg$silentFails === 0) { peg$fail(peg$e39); }
1819
+ if (peg$silentFails === 0) { peg$fail(peg$e41); }
1676
1820
  }
1677
1821
  if (s0 === peg$FAILED) {
1678
1822
  s0 = peg$currPos;
1679
1823
  if (input.charCodeAt(peg$currPos) === 45) {
1680
- s1 = peg$c23;
1824
+ s1 = peg$c28;
1681
1825
  peg$currPos++;
1682
1826
  } else {
1683
1827
  s1 = peg$FAILED;
1684
- if (peg$silentFails === 0) { peg$fail(peg$e40); }
1828
+ if (peg$silentFails === 0) { peg$fail(peg$e42); }
1685
1829
  }
1686
1830
  if (s1 !== peg$FAILED) {
1687
1831
  s2 = peg$currPos;
1688
1832
  peg$silentFails++;
1689
1833
  if (input.charCodeAt(peg$currPos) === 62) {
1690
- s3 = peg$c24;
1834
+ s3 = peg$c29;
1691
1835
  peg$currPos++;
1692
1836
  } else {
1693
1837
  s3 = peg$FAILED;
1694
- if (peg$silentFails === 0) { peg$fail(peg$e41); }
1838
+ if (peg$silentFails === 0) { peg$fail(peg$e43); }
1695
1839
  }
1696
1840
  peg$silentFails--;
1697
1841
  if (s3 === peg$FAILED) {
@@ -1753,7 +1897,7 @@ function peg$parse(input, options) {
1753
1897
  s2 = null;
1754
1898
  }
1755
1899
  peg$savedPos = s0;
1756
- s0 = peg$f23(s1);
1900
+ s0 = peg$f24(s1);
1757
1901
  } else {
1758
1902
  peg$currPos = s0;
1759
1903
  s0 = peg$FAILED;
@@ -1762,98 +1906,41 @@ function peg$parse(input, options) {
1762
1906
  return s0;
1763
1907
  }
1764
1908
 
1765
- function peg$parseimplicitParensArgs() {
1766
- var s0, s1, s2, s3, s4, s5;
1909
+ function peg$parseimplicitParenthesesCallExpression() {
1910
+ var s0, s1, s2, s3, s4;
1767
1911
 
1768
1912
  peg$silentFails++;
1769
1913
  s0 = peg$currPos;
1770
- s1 = [];
1771
- s2 = peg$parseinlineSpace();
1772
- if (s2 !== peg$FAILED) {
1773
- while (s2 !== peg$FAILED) {
1774
- s1.push(s2);
1775
- s2 = peg$parseinlineSpace();
1776
- }
1777
- } else {
1778
- s1 = peg$FAILED;
1779
- }
1914
+ s1 = peg$parsearrowFunction();
1780
1915
  if (s1 !== peg$FAILED) {
1781
1916
  s2 = peg$currPos;
1782
1917
  s3 = [];
1783
- s4 = peg$parsestep();
1784
- while (s4 !== peg$FAILED) {
1785
- s3.push(s4);
1786
- s4 = peg$currPos;
1787
- s5 = peg$parseseparator();
1788
- if (s5 !== peg$FAILED) {
1789
- s5 = peg$parsestep();
1790
- if (s5 === peg$FAILED) {
1791
- peg$currPos = s4;
1792
- s4 = peg$FAILED;
1793
- } else {
1794
- s4 = s5;
1795
- }
1796
- } else {
1797
- s4 = s5;
1918
+ s4 = peg$parseinlineSpace();
1919
+ if (s4 !== peg$FAILED) {
1920
+ while (s4 !== peg$FAILED) {
1921
+ s3.push(s4);
1922
+ s4 = peg$parseinlineSpace();
1798
1923
  }
1799
- }
1800
- if (s3.length < 1) {
1801
- peg$currPos = s2;
1802
- s2 = peg$FAILED;
1803
1924
  } else {
1804
- s2 = s3;
1925
+ s3 = peg$FAILED;
1805
1926
  }
1806
- if (s2 !== peg$FAILED) {
1807
- s3 = peg$parseseparator();
1808
- if (s3 === peg$FAILED) {
1809
- s3 = null;
1927
+ if (s3 !== peg$FAILED) {
1928
+ s4 = peg$parseimplicitParensthesesArguments();
1929
+ if (s4 !== peg$FAILED) {
1930
+ s2 = s4;
1931
+ } else {
1932
+ peg$currPos = s2;
1933
+ s2 = peg$FAILED;
1810
1934
  }
1811
- peg$savedPos = s0;
1812
- s0 = peg$f24(s2);
1813
1935
  } else {
1814
- peg$currPos = s0;
1815
- s0 = peg$FAILED;
1936
+ peg$currPos = s2;
1937
+ s2 = peg$FAILED;
1938
+ }
1939
+ if (s2 === peg$FAILED) {
1940
+ s2 = null;
1816
1941
  }
1817
- } else {
1818
- peg$currPos = s0;
1819
- s0 = peg$FAILED;
1820
- }
1821
- peg$silentFails--;
1822
- if (s0 === peg$FAILED) {
1823
- s1 = peg$FAILED;
1824
- if (peg$silentFails === 0) { peg$fail(peg$e42); }
1825
- }
1826
-
1827
- return s0;
1828
- }
1829
-
1830
- function peg$parseinlineSpace() {
1831
- var s0;
1832
-
1833
- s0 = input.charAt(peg$currPos);
1834
- if (peg$r2.test(s0)) {
1835
- peg$currPos++;
1836
- } else {
1837
- s0 = peg$FAILED;
1838
- if (peg$silentFails === 0) { peg$fail(peg$e43); }
1839
- }
1840
-
1841
- return s0;
1842
- }
1843
-
1844
- function peg$parseinteger() {
1845
- var s0, s1, s2;
1846
-
1847
- peg$silentFails++;
1848
- s0 = peg$currPos;
1849
- s1 = peg$parsesign();
1850
- if (s1 === peg$FAILED) {
1851
- s1 = null;
1852
- }
1853
- s2 = peg$parsedigits();
1854
- if (s2 !== peg$FAILED) {
1855
1942
  peg$savedPos = s0;
1856
- s0 = peg$f25();
1943
+ s0 = peg$f25(s1, s2);
1857
1944
  } else {
1858
1945
  peg$currPos = s0;
1859
1946
  s0 = peg$FAILED;
@@ -1867,57 +1954,77 @@ function peg$parse(input, options) {
1867
1954
  return s0;
1868
1955
  }
1869
1956
 
1870
- function peg$parselambda() {
1871
- var s0, s1, s2, s3;
1957
+ function peg$parseimplicitParensthesesArguments() {
1958
+ var s0, s1, s2, s3, s4;
1872
1959
 
1873
- peg$silentFails++;
1874
1960
  s0 = peg$currPos;
1875
- if (input.charCodeAt(peg$currPos) === 61) {
1876
- s1 = peg$c25;
1877
- peg$currPos++;
1878
- } else {
1961
+ s1 = peg$currPos;
1962
+ s2 = [];
1963
+ s3 = peg$parseshorthandFunction();
1964
+ while (s3 !== peg$FAILED) {
1965
+ s2.push(s3);
1966
+ s3 = peg$currPos;
1967
+ s4 = peg$parseseparator();
1968
+ if (s4 !== peg$FAILED) {
1969
+ s4 = peg$parseshorthandFunction();
1970
+ if (s4 === peg$FAILED) {
1971
+ peg$currPos = s3;
1972
+ s3 = peg$FAILED;
1973
+ } else {
1974
+ s3 = s4;
1975
+ }
1976
+ } else {
1977
+ s3 = s4;
1978
+ }
1979
+ }
1980
+ if (s2.length < 1) {
1981
+ peg$currPos = s1;
1879
1982
  s1 = peg$FAILED;
1880
- if (peg$silentFails === 0) { peg$fail(peg$e46); }
1983
+ } else {
1984
+ s1 = s2;
1881
1985
  }
1882
1986
  if (s1 !== peg$FAILED) {
1883
- s2 = peg$parse__();
1884
- s3 = peg$parsepipeline();
1885
- if (s3 !== peg$FAILED) {
1886
- peg$savedPos = s0;
1887
- s0 = peg$f26(s3);
1888
- } else {
1889
- peg$currPos = s0;
1890
- s0 = peg$FAILED;
1987
+ s2 = peg$parseseparator();
1988
+ if (s2 === peg$FAILED) {
1989
+ s2 = null;
1891
1990
  }
1991
+ peg$savedPos = s0;
1992
+ s0 = peg$f26(s1);
1892
1993
  } else {
1893
1994
  peg$currPos = s0;
1894
1995
  s0 = peg$FAILED;
1895
1996
  }
1896
- peg$silentFails--;
1897
- if (s0 === peg$FAILED) {
1898
- s1 = peg$FAILED;
1997
+
1998
+ return s0;
1999
+ }
2000
+
2001
+ function peg$parseinlineSpace() {
2002
+ var s0;
2003
+
2004
+ s0 = input.charAt(peg$currPos);
2005
+ if (peg$r2.test(s0)) {
2006
+ peg$currPos++;
2007
+ } else {
2008
+ s0 = peg$FAILED;
1899
2009
  if (peg$silentFails === 0) { peg$fail(peg$e45); }
1900
2010
  }
1901
2011
 
1902
2012
  return s0;
1903
2013
  }
1904
2014
 
1905
- function peg$parseleadingSlashPath() {
2015
+ function peg$parseintegerLiteral() {
1906
2016
  var s0, s1, s2;
1907
2017
 
1908
2018
  peg$silentFails++;
1909
2019
  s0 = peg$currPos;
1910
- if (input.charCodeAt(peg$currPos) === 47) {
1911
- s1 = peg$c26;
1912
- peg$currPos++;
1913
- } else {
1914
- s1 = peg$FAILED;
1915
- if (peg$silentFails === 0) { peg$fail(peg$e48); }
2020
+ s1 = peg$parsesign();
2021
+ if (s1 === peg$FAILED) {
2022
+ s1 = null;
1916
2023
  }
1917
- if (s1 !== peg$FAILED) {
1918
- s2 = peg$parsepath();
2024
+ s2 = peg$parsedigits();
2025
+ if (s2 !== peg$FAILED) {
1919
2026
  peg$savedPos = s0;
1920
- s0 = peg$f27(s2);
2027
+ s0 = peg$f27();
1921
2028
  } else {
1922
2029
  peg$currPos = s0;
1923
2030
  s0 = peg$FAILED;
@@ -1925,7 +2032,7 @@ function peg$parse(input, options) {
1925
2032
  peg$silentFails--;
1926
2033
  if (s0 === peg$FAILED) {
1927
2034
  s1 = peg$FAILED;
1928
- if (peg$silentFails === 0) { peg$fail(peg$e47); }
2035
+ if (peg$silentFails === 0) { peg$fail(peg$e46); }
1929
2036
  }
1930
2037
 
1931
2038
  return s0;
@@ -1938,13 +2045,13 @@ function peg$parse(input, options) {
1938
2045
  s0 = peg$currPos;
1939
2046
  s1 = peg$currPos;
1940
2047
  s2 = [];
1941
- s3 = peg$parsepipeline();
2048
+ s3 = peg$parsepipelineExpression();
1942
2049
  while (s3 !== peg$FAILED) {
1943
2050
  s2.push(s3);
1944
2051
  s3 = peg$currPos;
1945
2052
  s4 = peg$parseseparator();
1946
2053
  if (s4 !== peg$FAILED) {
1947
- s4 = peg$parsepipeline();
2054
+ s4 = peg$parsepipelineExpression();
1948
2055
  if (s4 === peg$FAILED) {
1949
2056
  peg$currPos = s3;
1950
2057
  s3 = peg$FAILED;
@@ -1975,7 +2082,146 @@ function peg$parse(input, options) {
1975
2082
  peg$silentFails--;
1976
2083
  if (s0 === peg$FAILED) {
1977
2084
  s1 = peg$FAILED;
1978
- if (peg$silentFails === 0) { peg$fail(peg$e49); }
2085
+ if (peg$silentFails === 0) { peg$fail(peg$e47); }
2086
+ }
2087
+
2088
+ return s0;
2089
+ }
2090
+
2091
+ function peg$parseliteral() {
2092
+ var s0;
2093
+
2094
+ s0 = peg$parsenumericLiteral();
2095
+ if (s0 === peg$FAILED) {
2096
+ s0 = peg$parsestringLiteral();
2097
+ }
2098
+
2099
+ return s0;
2100
+ }
2101
+
2102
+ function peg$parselogicalAndExpression() {
2103
+ var s0, s1, s2, s3, s4, s5, s6, s7;
2104
+
2105
+ s0 = peg$currPos;
2106
+ s1 = peg$parseequalityExpression();
2107
+ if (s1 !== peg$FAILED) {
2108
+ s2 = [];
2109
+ s3 = peg$currPos;
2110
+ s4 = peg$parse__();
2111
+ if (input.substr(peg$currPos, 2) === peg$c30) {
2112
+ s5 = peg$c30;
2113
+ peg$currPos += 2;
2114
+ } else {
2115
+ s5 = peg$FAILED;
2116
+ if (peg$silentFails === 0) { peg$fail(peg$e48); }
2117
+ }
2118
+ if (s5 !== peg$FAILED) {
2119
+ s6 = peg$parse__();
2120
+ s7 = peg$parseequalityExpression();
2121
+ if (s7 !== peg$FAILED) {
2122
+ s3 = s7;
2123
+ } else {
2124
+ peg$currPos = s3;
2125
+ s3 = peg$FAILED;
2126
+ }
2127
+ } else {
2128
+ peg$currPos = s3;
2129
+ s3 = peg$FAILED;
2130
+ }
2131
+ while (s3 !== peg$FAILED) {
2132
+ s2.push(s3);
2133
+ s3 = peg$currPos;
2134
+ s4 = peg$parse__();
2135
+ if (input.substr(peg$currPos, 2) === peg$c30) {
2136
+ s5 = peg$c30;
2137
+ peg$currPos += 2;
2138
+ } else {
2139
+ s5 = peg$FAILED;
2140
+ if (peg$silentFails === 0) { peg$fail(peg$e48); }
2141
+ }
2142
+ if (s5 !== peg$FAILED) {
2143
+ s6 = peg$parse__();
2144
+ s7 = peg$parseequalityExpression();
2145
+ if (s7 !== peg$FAILED) {
2146
+ s3 = s7;
2147
+ } else {
2148
+ peg$currPos = s3;
2149
+ s3 = peg$FAILED;
2150
+ }
2151
+ } else {
2152
+ peg$currPos = s3;
2153
+ s3 = peg$FAILED;
2154
+ }
2155
+ }
2156
+ peg$savedPos = s0;
2157
+ s0 = peg$f29(s1, s2);
2158
+ } else {
2159
+ peg$currPos = s0;
2160
+ s0 = peg$FAILED;
2161
+ }
2162
+
2163
+ return s0;
2164
+ }
2165
+
2166
+ function peg$parselogicalOrExpression() {
2167
+ var s0, s1, s2, s3, s4, s5, s6, s7;
2168
+
2169
+ s0 = peg$currPos;
2170
+ s1 = peg$parsenullishCoalescingExpression();
2171
+ if (s1 !== peg$FAILED) {
2172
+ s2 = [];
2173
+ s3 = peg$currPos;
2174
+ s4 = peg$parse__();
2175
+ if (input.substr(peg$currPos, 2) === peg$c31) {
2176
+ s5 = peg$c31;
2177
+ peg$currPos += 2;
2178
+ } else {
2179
+ s5 = peg$FAILED;
2180
+ if (peg$silentFails === 0) { peg$fail(peg$e49); }
2181
+ }
2182
+ if (s5 !== peg$FAILED) {
2183
+ s6 = peg$parse__();
2184
+ s7 = peg$parsenullishCoalescingExpression();
2185
+ if (s7 !== peg$FAILED) {
2186
+ s3 = s7;
2187
+ } else {
2188
+ peg$currPos = s3;
2189
+ s3 = peg$FAILED;
2190
+ }
2191
+ } else {
2192
+ peg$currPos = s3;
2193
+ s3 = peg$FAILED;
2194
+ }
2195
+ while (s3 !== peg$FAILED) {
2196
+ s2.push(s3);
2197
+ s3 = peg$currPos;
2198
+ s4 = peg$parse__();
2199
+ if (input.substr(peg$currPos, 2) === peg$c31) {
2200
+ s5 = peg$c31;
2201
+ peg$currPos += 2;
2202
+ } else {
2203
+ s5 = peg$FAILED;
2204
+ if (peg$silentFails === 0) { peg$fail(peg$e49); }
2205
+ }
2206
+ if (s5 !== peg$FAILED) {
2207
+ s6 = peg$parse__();
2208
+ s7 = peg$parsenullishCoalescingExpression();
2209
+ if (s7 !== peg$FAILED) {
2210
+ s3 = s7;
2211
+ } else {
2212
+ peg$currPos = s3;
2213
+ s3 = peg$FAILED;
2214
+ }
2215
+ } else {
2216
+ peg$currPos = s3;
2217
+ s3 = peg$FAILED;
2218
+ }
2219
+ }
2220
+ peg$savedPos = s0;
2221
+ s0 = peg$f30(s1, s2);
2222
+ } else {
2223
+ peg$currPos = s0;
2224
+ s0 = peg$FAILED;
1979
2225
  }
1980
2226
 
1981
2227
  return s0;
@@ -1985,8 +2231,8 @@ function peg$parse(input, options) {
1985
2231
  var s0, s1, s2, s3, s4, s5;
1986
2232
 
1987
2233
  s0 = peg$currPos;
1988
- if (input.substr(peg$currPos, 2) === peg$c27) {
1989
- s1 = peg$c27;
2234
+ if (input.substr(peg$currPos, 2) === peg$c32) {
2235
+ s1 = peg$c32;
1990
2236
  peg$currPos += 2;
1991
2237
  } else {
1992
2238
  s1 = peg$FAILED;
@@ -1997,8 +2243,8 @@ function peg$parse(input, options) {
1997
2243
  s3 = peg$currPos;
1998
2244
  s4 = peg$currPos;
1999
2245
  peg$silentFails++;
2000
- if (input.substr(peg$currPos, 2) === peg$c28) {
2001
- s5 = peg$c28;
2246
+ if (input.substr(peg$currPos, 2) === peg$c33) {
2247
+ s5 = peg$c33;
2002
2248
  peg$currPos += 2;
2003
2249
  } else {
2004
2250
  s5 = peg$FAILED;
@@ -2035,8 +2281,8 @@ function peg$parse(input, options) {
2035
2281
  s3 = peg$currPos;
2036
2282
  s4 = peg$currPos;
2037
2283
  peg$silentFails++;
2038
- if (input.substr(peg$currPos, 2) === peg$c28) {
2039
- s5 = peg$c28;
2284
+ if (input.substr(peg$currPos, 2) === peg$c33) {
2285
+ s5 = peg$c33;
2040
2286
  peg$currPos += 2;
2041
2287
  } else {
2042
2288
  s5 = peg$FAILED;
@@ -2069,8 +2315,8 @@ function peg$parse(input, options) {
2069
2315
  s3 = peg$FAILED;
2070
2316
  }
2071
2317
  }
2072
- if (input.substr(peg$currPos, 2) === peg$c28) {
2073
- s3 = peg$c28;
2318
+ if (input.substr(peg$currPos, 2) === peg$c33) {
2319
+ s3 = peg$c33;
2074
2320
  peg$currPos += 2;
2075
2321
  } else {
2076
2322
  s3 = peg$FAILED;
@@ -2078,7 +2324,66 @@ function peg$parse(input, options) {
2078
2324
  }
2079
2325
  if (s3 !== peg$FAILED) {
2080
2326
  peg$savedPos = s0;
2081
- s0 = peg$f29();
2327
+ s0 = peg$f31();
2328
+ } else {
2329
+ peg$currPos = s0;
2330
+ s0 = peg$FAILED;
2331
+ }
2332
+ } else {
2333
+ peg$currPos = s0;
2334
+ s0 = peg$FAILED;
2335
+ }
2336
+
2337
+ return s0;
2338
+ }
2339
+
2340
+ function peg$parsenamespace() {
2341
+ var s0, s1, s2, s3;
2342
+
2343
+ s0 = peg$currPos;
2344
+ if (input.charCodeAt(peg$currPos) === 64) {
2345
+ s1 = peg$c34;
2346
+ peg$currPos++;
2347
+ } else {
2348
+ s1 = peg$FAILED;
2349
+ if (peg$silentFails === 0) { peg$fail(peg$e52); }
2350
+ }
2351
+ if (s1 === peg$FAILED) {
2352
+ s1 = null;
2353
+ }
2354
+ s2 = [];
2355
+ s3 = input.charAt(peg$currPos);
2356
+ if (peg$r3.test(s3)) {
2357
+ peg$currPos++;
2358
+ } else {
2359
+ s3 = peg$FAILED;
2360
+ if (peg$silentFails === 0) { peg$fail(peg$e53); }
2361
+ }
2362
+ if (s3 !== peg$FAILED) {
2363
+ while (s3 !== peg$FAILED) {
2364
+ s2.push(s3);
2365
+ s3 = input.charAt(peg$currPos);
2366
+ if (peg$r3.test(s3)) {
2367
+ peg$currPos++;
2368
+ } else {
2369
+ s3 = peg$FAILED;
2370
+ if (peg$silentFails === 0) { peg$fail(peg$e53); }
2371
+ }
2372
+ }
2373
+ } else {
2374
+ s2 = peg$FAILED;
2375
+ }
2376
+ if (s2 !== peg$FAILED) {
2377
+ if (input.charCodeAt(peg$currPos) === 58) {
2378
+ s3 = peg$c6;
2379
+ peg$currPos++;
2380
+ } else {
2381
+ s3 = peg$FAILED;
2382
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
2383
+ }
2384
+ if (s3 !== peg$FAILED) {
2385
+ peg$savedPos = s0;
2386
+ s0 = peg$f32(s1, s2);
2082
2387
  } else {
2083
2388
  peg$currPos = s0;
2084
2389
  s0 = peg$FAILED;
@@ -2095,27 +2400,27 @@ function peg$parse(input, options) {
2095
2400
  var s0;
2096
2401
 
2097
2402
  if (input.charCodeAt(peg$currPos) === 10) {
2098
- s0 = peg$c29;
2403
+ s0 = peg$c35;
2099
2404
  peg$currPos++;
2100
2405
  } else {
2101
2406
  s0 = peg$FAILED;
2102
- if (peg$silentFails === 0) { peg$fail(peg$e52); }
2407
+ if (peg$silentFails === 0) { peg$fail(peg$e54); }
2103
2408
  }
2104
2409
  if (s0 === peg$FAILED) {
2105
- if (input.substr(peg$currPos, 2) === peg$c30) {
2106
- s0 = peg$c30;
2410
+ if (input.substr(peg$currPos, 2) === peg$c36) {
2411
+ s0 = peg$c36;
2107
2412
  peg$currPos += 2;
2108
2413
  } else {
2109
2414
  s0 = peg$FAILED;
2110
- if (peg$silentFails === 0) { peg$fail(peg$e53); }
2415
+ if (peg$silentFails === 0) { peg$fail(peg$e55); }
2111
2416
  }
2112
2417
  if (s0 === peg$FAILED) {
2113
2418
  if (input.charCodeAt(peg$currPos) === 13) {
2114
- s0 = peg$c31;
2419
+ s0 = peg$c37;
2115
2420
  peg$currPos++;
2116
2421
  } else {
2117
2422
  s0 = peg$FAILED;
2118
- if (peg$silentFails === 0) { peg$fail(peg$e54); }
2423
+ if (peg$silentFails === 0) { peg$fail(peg$e56); }
2119
2424
  }
2120
2425
  }
2121
2426
  }
@@ -2123,49 +2428,113 @@ function peg$parse(input, options) {
2123
2428
  return s0;
2124
2429
  }
2125
2430
 
2126
- function peg$parsenumber() {
2431
+ function peg$parsenumericLiteral() {
2127
2432
  var s0, s1;
2128
2433
 
2129
2434
  peg$silentFails++;
2130
- s0 = peg$parsefloat();
2435
+ s0 = peg$parsefloatLiteral();
2131
2436
  if (s0 === peg$FAILED) {
2132
- s0 = peg$parseinteger();
2437
+ s0 = peg$parseintegerLiteral();
2133
2438
  }
2134
2439
  peg$silentFails--;
2135
2440
  if (s0 === peg$FAILED) {
2136
2441
  s1 = peg$FAILED;
2137
- if (peg$silentFails === 0) { peg$fail(peg$e55); }
2442
+ if (peg$silentFails === 0) { peg$fail(peg$e57); }
2138
2443
  }
2139
2444
 
2140
2445
  return s0;
2141
2446
  }
2142
2447
 
2143
- function peg$parseobject() {
2144
- var s0, s1, s2, s3, s4, s5;
2448
+ function peg$parsenullishCoalescingExpression() {
2449
+ var s0, s1, s2, s3, s4, s5, s6, s7;
2145
2450
 
2146
- peg$silentFails++;
2147
2451
  s0 = peg$currPos;
2148
- if (input.charCodeAt(peg$currPos) === 123) {
2149
- s1 = peg$c32;
2150
- peg$currPos++;
2151
- } else {
2152
- s1 = peg$FAILED;
2153
- if (peg$silentFails === 0) { peg$fail(peg$e57); }
2154
- }
2452
+ s1 = peg$parselogicalAndExpression();
2155
2453
  if (s1 !== peg$FAILED) {
2156
- s2 = peg$parse__();
2157
- s3 = peg$parseobjectEntries();
2158
- if (s3 === peg$FAILED) {
2159
- s3 = null;
2160
- }
2454
+ s2 = [];
2455
+ s3 = peg$currPos;
2161
2456
  s4 = peg$parse__();
2162
- s5 = peg$parseclosingBrace();
2457
+ if (input.substr(peg$currPos, 2) === peg$c38) {
2458
+ s5 = peg$c38;
2459
+ peg$currPos += 2;
2460
+ } else {
2461
+ s5 = peg$FAILED;
2462
+ if (peg$silentFails === 0) { peg$fail(peg$e58); }
2463
+ }
2163
2464
  if (s5 !== peg$FAILED) {
2164
- peg$savedPos = s0;
2165
- s0 = peg$f30(s3);
2465
+ s6 = peg$parse__();
2466
+ s7 = peg$parselogicalAndExpression();
2467
+ if (s7 !== peg$FAILED) {
2468
+ s3 = s7;
2469
+ } else {
2470
+ peg$currPos = s3;
2471
+ s3 = peg$FAILED;
2472
+ }
2166
2473
  } else {
2167
- peg$currPos = s0;
2168
- s0 = peg$FAILED;
2474
+ peg$currPos = s3;
2475
+ s3 = peg$FAILED;
2476
+ }
2477
+ while (s3 !== peg$FAILED) {
2478
+ s2.push(s3);
2479
+ s3 = peg$currPos;
2480
+ s4 = peg$parse__();
2481
+ if (input.substr(peg$currPos, 2) === peg$c38) {
2482
+ s5 = peg$c38;
2483
+ peg$currPos += 2;
2484
+ } else {
2485
+ s5 = peg$FAILED;
2486
+ if (peg$silentFails === 0) { peg$fail(peg$e58); }
2487
+ }
2488
+ if (s5 !== peg$FAILED) {
2489
+ s6 = peg$parse__();
2490
+ s7 = peg$parselogicalAndExpression();
2491
+ if (s7 !== peg$FAILED) {
2492
+ s3 = s7;
2493
+ } else {
2494
+ peg$currPos = s3;
2495
+ s3 = peg$FAILED;
2496
+ }
2497
+ } else {
2498
+ peg$currPos = s3;
2499
+ s3 = peg$FAILED;
2500
+ }
2501
+ }
2502
+ peg$savedPos = s0;
2503
+ s0 = peg$f33(s1, s2);
2504
+ } else {
2505
+ peg$currPos = s0;
2506
+ s0 = peg$FAILED;
2507
+ }
2508
+
2509
+ return s0;
2510
+ }
2511
+
2512
+ function peg$parseobjectLiteral() {
2513
+ var s0, s1, s2, s3, s4, s5;
2514
+
2515
+ peg$silentFails++;
2516
+ s0 = peg$currPos;
2517
+ if (input.charCodeAt(peg$currPos) === 123) {
2518
+ s1 = peg$c39;
2519
+ peg$currPos++;
2520
+ } else {
2521
+ s1 = peg$FAILED;
2522
+ if (peg$silentFails === 0) { peg$fail(peg$e60); }
2523
+ }
2524
+ if (s1 !== peg$FAILED) {
2525
+ s2 = peg$parse__();
2526
+ s3 = peg$parseobjectEntries();
2527
+ if (s3 === peg$FAILED) {
2528
+ s3 = null;
2529
+ }
2530
+ s4 = peg$parse__();
2531
+ s5 = peg$parseclosingBrace();
2532
+ if (s5 !== peg$FAILED) {
2533
+ peg$savedPos = s0;
2534
+ s0 = peg$f34(s3);
2535
+ } else {
2536
+ peg$currPos = s0;
2537
+ s0 = peg$FAILED;
2169
2538
  }
2170
2539
  } else {
2171
2540
  peg$currPos = s0;
@@ -2174,7 +2543,7 @@ function peg$parse(input, options) {
2174
2543
  peg$silentFails--;
2175
2544
  if (s0 === peg$FAILED) {
2176
2545
  s1 = peg$FAILED;
2177
- if (peg$silentFails === 0) { peg$fail(peg$e56); }
2546
+ if (peg$silentFails === 0) { peg$fail(peg$e59); }
2178
2547
  }
2179
2548
 
2180
2549
  return s0;
@@ -2215,7 +2584,7 @@ function peg$parse(input, options) {
2215
2584
  s2 = null;
2216
2585
  }
2217
2586
  peg$savedPos = s0;
2218
- s0 = peg$f31(s1);
2587
+ s0 = peg$f35(s1);
2219
2588
  } else {
2220
2589
  peg$currPos = s0;
2221
2590
  s0 = peg$FAILED;
@@ -2250,18 +2619,18 @@ function peg$parse(input, options) {
2250
2619
  if (s1 !== peg$FAILED) {
2251
2620
  s2 = peg$parse__();
2252
2621
  if (input.charCodeAt(peg$currPos) === 61) {
2253
- s3 = peg$c25;
2622
+ s3 = peg$c40;
2254
2623
  peg$currPos++;
2255
2624
  } else {
2256
2625
  s3 = peg$FAILED;
2257
- if (peg$silentFails === 0) { peg$fail(peg$e46); }
2626
+ if (peg$silentFails === 0) { peg$fail(peg$e62); }
2258
2627
  }
2259
2628
  if (s3 !== peg$FAILED) {
2260
2629
  s4 = peg$parse__();
2261
- s5 = peg$parsepipeline();
2630
+ s5 = peg$parsepipelineExpression();
2262
2631
  if (s5 !== peg$FAILED) {
2263
2632
  peg$savedPos = s0;
2264
- s0 = peg$f32(s1, s5);
2633
+ s0 = peg$f36(s1, s5);
2265
2634
  } else {
2266
2635
  peg$currPos = s0;
2267
2636
  s0 = peg$FAILED;
@@ -2277,7 +2646,7 @@ function peg$parse(input, options) {
2277
2646
  peg$silentFails--;
2278
2647
  if (s0 === peg$FAILED) {
2279
2648
  s1 = peg$FAILED;
2280
- if (peg$silentFails === 0) { peg$fail(peg$e58); }
2649
+ if (peg$silentFails === 0) { peg$fail(peg$e61); }
2281
2650
  }
2282
2651
 
2283
2652
  return s0;
@@ -2289,21 +2658,21 @@ function peg$parse(input, options) {
2289
2658
  s0 = peg$currPos;
2290
2659
  s1 = peg$currPos;
2291
2660
  if (input.charCodeAt(peg$currPos) === 40) {
2292
- s2 = peg$c19;
2661
+ s2 = peg$c1;
2293
2662
  peg$currPos++;
2294
2663
  } else {
2295
2664
  s2 = peg$FAILED;
2296
- if (peg$silentFails === 0) { peg$fail(peg$e32); }
2665
+ if (peg$silentFails === 0) { peg$fail(peg$e3); }
2297
2666
  }
2298
2667
  if (s2 !== peg$FAILED) {
2299
2668
  s3 = peg$parseobjectPublicKey();
2300
2669
  if (s3 !== peg$FAILED) {
2301
2670
  if (input.charCodeAt(peg$currPos) === 41) {
2302
- s4 = peg$c4;
2671
+ s4 = peg$c2;
2303
2672
  peg$currPos++;
2304
2673
  } else {
2305
2674
  s4 = peg$FAILED;
2306
- if (peg$silentFails === 0) { peg$fail(peg$e9); }
2675
+ if (peg$silentFails === 0) { peg$fail(peg$e4); }
2307
2676
  }
2308
2677
  if (s4 !== peg$FAILED) {
2309
2678
  s2 = [s2, s3, s4];
@@ -2322,7 +2691,7 @@ function peg$parse(input, options) {
2322
2691
  }
2323
2692
  if (s1 !== peg$FAILED) {
2324
2693
  peg$savedPos = s0;
2325
- s1 = peg$f33(s1);
2694
+ s1 = peg$f37(s1);
2326
2695
  }
2327
2696
  s0 = s1;
2328
2697
 
@@ -2340,7 +2709,7 @@ function peg$parse(input, options) {
2340
2709
  peg$silentFails--;
2341
2710
  if (s0 === peg$FAILED) {
2342
2711
  s1 = peg$FAILED;
2343
- if (peg$silentFails === 0) { peg$fail(peg$e59); }
2712
+ if (peg$silentFails === 0) { peg$fail(peg$e63); }
2344
2713
  }
2345
2714
 
2346
2715
  return s0;
@@ -2355,18 +2724,18 @@ function peg$parse(input, options) {
2355
2724
  if (s1 !== peg$FAILED) {
2356
2725
  s2 = peg$parse__();
2357
2726
  if (input.charCodeAt(peg$currPos) === 58) {
2358
- s3 = peg$c22;
2727
+ s3 = peg$c6;
2359
2728
  peg$currPos++;
2360
2729
  } else {
2361
2730
  s3 = peg$FAILED;
2362
- if (peg$silentFails === 0) { peg$fail(peg$e37); }
2731
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
2363
2732
  }
2364
2733
  if (s3 !== peg$FAILED) {
2365
2734
  s4 = peg$parse__();
2366
- s5 = peg$parsepipeline();
2735
+ s5 = peg$parsepipelineExpression();
2367
2736
  if (s5 !== peg$FAILED) {
2368
2737
  peg$savedPos = s0;
2369
- s0 = peg$f34(s1, s5);
2738
+ s0 = peg$f38(s1, s5);
2370
2739
  } else {
2371
2740
  peg$currPos = s0;
2372
2741
  s0 = peg$FAILED;
@@ -2382,7 +2751,7 @@ function peg$parse(input, options) {
2382
2751
  peg$silentFails--;
2383
2752
  if (s0 === peg$FAILED) {
2384
2753
  s1 = peg$FAILED;
2385
- if (peg$silentFails === 0) { peg$fail(peg$e60); }
2754
+ if (peg$silentFails === 0) { peg$fail(peg$e64); }
2386
2755
  }
2387
2756
 
2388
2757
  return s0;
@@ -2396,13 +2765,13 @@ function peg$parse(input, options) {
2396
2765
  s1 = peg$parseobjectPublicKey();
2397
2766
  if (s1 !== peg$FAILED) {
2398
2767
  peg$savedPos = s0;
2399
- s1 = peg$f35(s1);
2768
+ s1 = peg$f39(s1);
2400
2769
  }
2401
2770
  s0 = s1;
2402
2771
  peg$silentFails--;
2403
2772
  if (s0 === peg$FAILED) {
2404
2773
  s1 = peg$FAILED;
2405
- if (peg$silentFails === 0) { peg$fail(peg$e61); }
2774
+ if (peg$silentFails === 0) { peg$fail(peg$e65); }
2406
2775
  }
2407
2776
 
2408
2777
  return s0;
@@ -2415,27 +2784,27 @@ function peg$parse(input, options) {
2415
2784
  s1 = peg$parseidentifier();
2416
2785
  if (s1 !== peg$FAILED) {
2417
2786
  if (input.charCodeAt(peg$currPos) === 47) {
2418
- s2 = peg$c26;
2787
+ s2 = peg$c41;
2419
2788
  peg$currPos++;
2420
2789
  } else {
2421
2790
  s2 = peg$FAILED;
2422
- if (peg$silentFails === 0) { peg$fail(peg$e48); }
2791
+ if (peg$silentFails === 0) { peg$fail(peg$e66); }
2423
2792
  }
2424
2793
  if (s2 === peg$FAILED) {
2425
2794
  s2 = null;
2426
2795
  }
2427
2796
  peg$savedPos = s0;
2428
- s0 = peg$f36(s1, s2);
2797
+ s0 = peg$f40(s1, s2);
2429
2798
  } else {
2430
2799
  peg$currPos = s0;
2431
2800
  s0 = peg$FAILED;
2432
2801
  }
2433
2802
  if (s0 === peg$FAILED) {
2434
2803
  s0 = peg$currPos;
2435
- s1 = peg$parsestring();
2804
+ s1 = peg$parsestringLiteral();
2436
2805
  if (s1 !== peg$FAILED) {
2437
2806
  peg$savedPos = s0;
2438
- s1 = peg$f37(s1);
2807
+ s1 = peg$f41(s1);
2439
2808
  }
2440
2809
  s0 = s1;
2441
2810
  }
@@ -2443,48 +2812,35 @@ function peg$parse(input, options) {
2443
2812
  return s0;
2444
2813
  }
2445
2814
 
2446
- function peg$parseparameterizedLambda() {
2447
- var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
2815
+ function peg$parseparenthesesArguments() {
2816
+ var s0, s1, s2, s3, s4, s5;
2448
2817
 
2818
+ peg$silentFails++;
2449
2819
  s0 = peg$currPos;
2450
2820
  if (input.charCodeAt(peg$currPos) === 40) {
2451
- s1 = peg$c19;
2821
+ s1 = peg$c1;
2452
2822
  peg$currPos++;
2453
2823
  } else {
2454
2824
  s1 = peg$FAILED;
2455
- if (peg$silentFails === 0) { peg$fail(peg$e32); }
2825
+ if (peg$silentFails === 0) { peg$fail(peg$e3); }
2456
2826
  }
2457
2827
  if (s1 !== peg$FAILED) {
2458
2828
  s2 = peg$parse__();
2459
- s3 = peg$parseidentifierList();
2829
+ s3 = peg$parselist();
2460
2830
  if (s3 === peg$FAILED) {
2461
2831
  s3 = null;
2462
2832
  }
2463
2833
  s4 = peg$parse__();
2464
2834
  if (input.charCodeAt(peg$currPos) === 41) {
2465
- s5 = peg$c4;
2835
+ s5 = peg$c2;
2466
2836
  peg$currPos++;
2467
2837
  } else {
2468
2838
  s5 = peg$FAILED;
2469
- if (peg$silentFails === 0) { peg$fail(peg$e9); }
2839
+ if (peg$silentFails === 0) { peg$fail(peg$e4); }
2470
2840
  }
2471
2841
  if (s5 !== peg$FAILED) {
2472
- s6 = peg$parse__();
2473
- s7 = peg$parsedoubleArrow();
2474
- if (s7 !== peg$FAILED) {
2475
- s8 = peg$parse__();
2476
- s9 = peg$parsepipeline();
2477
- if (s9 !== peg$FAILED) {
2478
- peg$savedPos = s0;
2479
- s0 = peg$f38(s3, s9);
2480
- } else {
2481
- peg$currPos = s0;
2482
- s0 = peg$FAILED;
2483
- }
2484
- } else {
2485
- peg$currPos = s0;
2486
- s0 = peg$FAILED;
2487
- }
2842
+ peg$savedPos = s0;
2843
+ s0 = peg$f42(s3);
2488
2844
  } else {
2489
2845
  peg$currPos = s0;
2490
2846
  s0 = peg$FAILED;
@@ -2493,155 +2849,107 @@ function peg$parse(input, options) {
2493
2849
  peg$currPos = s0;
2494
2850
  s0 = peg$FAILED;
2495
2851
  }
2852
+ peg$silentFails--;
2853
+ if (s0 === peg$FAILED) {
2854
+ s1 = peg$FAILED;
2855
+ if (peg$silentFails === 0) { peg$fail(peg$e67); }
2856
+ }
2496
2857
 
2497
2858
  return s0;
2498
2859
  }
2499
2860
 
2500
- function peg$parseparensArgs() {
2501
- var s0, s1, s2, s3, s4, s5;
2861
+ function peg$parsepath() {
2862
+ var s0, s1, s2, s3;
2502
2863
 
2503
2864
  peg$silentFails++;
2504
2865
  s0 = peg$currPos;
2505
- if (input.charCodeAt(peg$currPos) === 40) {
2506
- s1 = peg$c19;
2507
- peg$currPos++;
2508
- } else {
2866
+ s1 = peg$currPos;
2867
+ s2 = [];
2868
+ s3 = peg$parsepathSegment();
2869
+ while (s3 !== peg$FAILED) {
2870
+ s2.push(s3);
2871
+ s3 = peg$parsepathSegment();
2872
+ }
2873
+ if (s2.length < 1) {
2874
+ peg$currPos = s1;
2509
2875
  s1 = peg$FAILED;
2510
- if (peg$silentFails === 0) { peg$fail(peg$e32); }
2876
+ } else {
2877
+ s1 = s2;
2511
2878
  }
2512
2879
  if (s1 !== peg$FAILED) {
2513
- s2 = peg$parse__();
2514
- s3 = peg$parselist();
2515
- if (s3 === peg$FAILED) {
2516
- s3 = null;
2517
- }
2518
- s4 = peg$parse__();
2519
- if (input.charCodeAt(peg$currPos) === 41) {
2520
- s5 = peg$c4;
2521
- peg$currPos++;
2522
- } else {
2523
- s5 = peg$FAILED;
2524
- if (peg$silentFails === 0) { peg$fail(peg$e9); }
2525
- }
2526
- if (s5 !== peg$FAILED) {
2527
- peg$savedPos = s0;
2528
- s0 = peg$f39(s3);
2529
- } else {
2530
- peg$currPos = s0;
2531
- s0 = peg$FAILED;
2532
- }
2533
- } else {
2534
- peg$currPos = s0;
2535
- s0 = peg$FAILED;
2880
+ peg$savedPos = s0;
2881
+ s1 = peg$f43(s1);
2536
2882
  }
2883
+ s0 = s1;
2537
2884
  peg$silentFails--;
2538
2885
  if (s0 === peg$FAILED) {
2539
2886
  s1 = peg$FAILED;
2540
- if (peg$silentFails === 0) { peg$fail(peg$e62); }
2887
+ if (peg$silentFails === 0) { peg$fail(peg$e68); }
2541
2888
  }
2542
2889
 
2543
2890
  return s0;
2544
2891
  }
2545
2892
 
2546
- function peg$parsepipeline() {
2547
- var s0, s1, s2, s3, s4, s5, s6, s7, s8;
2893
+ function peg$parsepathArguments() {
2894
+ var s0, s1;
2548
2895
 
2549
2896
  s0 = peg$currPos;
2550
- s1 = peg$currPos;
2551
- s2 = peg$currPos;
2552
- s3 = [];
2553
- s4 = peg$parsestep();
2554
- while (s4 !== peg$FAILED) {
2555
- s3.push(s4);
2556
- s4 = peg$currPos;
2557
- s5 = peg$currPos;
2558
- s6 = peg$parse__();
2559
- s7 = peg$parsesingleArrow();
2560
- if (s7 !== peg$FAILED) {
2561
- s8 = peg$parse__();
2562
- s6 = [s6, s7, s8];
2563
- s5 = s6;
2564
- } else {
2565
- peg$currPos = s5;
2566
- s5 = peg$FAILED;
2567
- }
2568
- if (s5 !== peg$FAILED) {
2569
- s5 = peg$parsestep();
2570
- if (s5 === peg$FAILED) {
2571
- peg$currPos = s4;
2572
- s4 = peg$FAILED;
2573
- } else {
2574
- s4 = s5;
2575
- }
2576
- } else {
2577
- s4 = s5;
2578
- }
2579
- }
2580
- if (s3.length < 1) {
2581
- peg$currPos = s2;
2582
- s2 = peg$FAILED;
2583
- } else {
2584
- s2 = s3;
2585
- }
2586
- if (s2 !== peg$FAILED) {
2587
- s1 = s2;
2588
- } else {
2589
- peg$currPos = s1;
2590
- s1 = peg$FAILED;
2591
- }
2897
+ s1 = peg$parsepath();
2592
2898
  if (s1 !== peg$FAILED) {
2593
2899
  peg$savedPos = s0;
2594
- s1 = peg$f40(s1);
2900
+ s1 = peg$f44(s1);
2595
2901
  }
2596
2902
  s0 = s1;
2597
2903
 
2598
2904
  return s0;
2599
2905
  }
2600
2906
 
2601
- function peg$parsepath() {
2907
+ function peg$parsepathKey() {
2602
2908
  var s0, s1, s2;
2603
2909
 
2604
- peg$silentFails++;
2605
2910
  s0 = peg$currPos;
2606
2911
  s1 = [];
2607
- s2 = peg$parsepathElement();
2608
- while (s2 !== peg$FAILED) {
2609
- s1.push(s2);
2610
- s2 = peg$parsepathElement();
2912
+ s2 = peg$parsepathSegmentChar();
2913
+ if (s2 !== peg$FAILED) {
2914
+ while (s2 !== peg$FAILED) {
2915
+ s1.push(s2);
2916
+ s2 = peg$parsepathSegmentChar();
2917
+ }
2918
+ } else {
2919
+ s1 = peg$FAILED;
2611
2920
  }
2612
- s2 = peg$parsepathTail();
2613
- if (s2 === peg$FAILED) {
2614
- s2 = null;
2921
+ if (s1 !== peg$FAILED) {
2922
+ s2 = peg$parseslashFollows();
2923
+ if (s2 === peg$FAILED) {
2924
+ s2 = null;
2925
+ }
2926
+ peg$savedPos = s0;
2927
+ s0 = peg$f45(s1, s2);
2928
+ } else {
2929
+ peg$currPos = s0;
2930
+ s0 = peg$FAILED;
2615
2931
  }
2616
- peg$savedPos = s0;
2617
- s0 = peg$f41(s1, s2);
2618
- peg$silentFails--;
2619
- s1 = peg$FAILED;
2620
- if (peg$silentFails === 0) { peg$fail(peg$e63); }
2621
2932
 
2622
2933
  return s0;
2623
2934
  }
2624
2935
 
2625
- function peg$parsepathElement() {
2936
+ function peg$parsepathSegment() {
2626
2937
  var s0, s1, s2;
2627
2938
 
2628
2939
  s0 = peg$currPos;
2629
- s1 = [];
2630
- s2 = peg$parsepathKeyChar();
2631
- while (s2 !== peg$FAILED) {
2632
- s1.push(s2);
2633
- s2 = peg$parsepathKeyChar();
2634
- }
2635
2940
  if (input.charCodeAt(peg$currPos) === 47) {
2636
- s2 = peg$c26;
2941
+ s1 = peg$c41;
2637
2942
  peg$currPos++;
2638
2943
  } else {
2639
- s2 = peg$FAILED;
2640
- if (peg$silentFails === 0) { peg$fail(peg$e48); }
2944
+ s1 = peg$FAILED;
2945
+ if (peg$silentFails === 0) { peg$fail(peg$e66); }
2641
2946
  }
2642
- if (s2 !== peg$FAILED) {
2643
- peg$savedPos = s0;
2644
- s0 = peg$f42(s1);
2947
+ if (s1 !== peg$FAILED) {
2948
+ s2 = peg$parsepathKey();
2949
+ if (s2 === peg$FAILED) {
2950
+ s2 = null;
2951
+ }
2952
+ s0 = s2;
2645
2953
  } else {
2646
2954
  peg$currPos = s0;
2647
2955
  s0 = peg$FAILED;
@@ -2650,15 +2958,15 @@ function peg$parse(input, options) {
2650
2958
  return s0;
2651
2959
  }
2652
2960
 
2653
- function peg$parsepathKeyChar() {
2961
+ function peg$parsepathSegmentChar() {
2654
2962
  var s0;
2655
2963
 
2656
2964
  s0 = input.charAt(peg$currPos);
2657
- if (peg$r3.test(s0)) {
2965
+ if (peg$r4.test(s0)) {
2658
2966
  peg$currPos++;
2659
2967
  } else {
2660
2968
  s0 = peg$FAILED;
2661
- if (peg$silentFails === 0) { peg$fail(peg$e64); }
2969
+ if (peg$silentFails === 0) { peg$fail(peg$e69); }
2662
2970
  }
2663
2971
  if (s0 === peg$FAILED) {
2664
2972
  s0 = peg$parseescapedChar();
@@ -2667,74 +2975,128 @@ function peg$parse(input, options) {
2667
2975
  return s0;
2668
2976
  }
2669
2977
 
2670
- function peg$parsepathTail() {
2671
- var s0, s1, s2;
2978
+ function peg$parsepipelineExpression() {
2979
+ var s0, s1, s2, s3, s4, s5, s6, s7;
2672
2980
 
2673
2981
  s0 = peg$currPos;
2674
- s1 = [];
2675
- s2 = peg$parsepathKeyChar();
2676
- if (s2 !== peg$FAILED) {
2677
- while (s2 !== peg$FAILED) {
2678
- s1.push(s2);
2679
- s2 = peg$parsepathKeyChar();
2982
+ s1 = peg$parseshorthandFunction();
2983
+ if (s1 !== peg$FAILED) {
2984
+ s2 = [];
2985
+ s3 = peg$currPos;
2986
+ s4 = peg$parse__();
2987
+ s5 = peg$parsesingleArrow();
2988
+ if (s5 !== peg$FAILED) {
2989
+ s6 = peg$parse__();
2990
+ s7 = peg$parseshorthandFunction();
2991
+ if (s7 !== peg$FAILED) {
2992
+ s3 = s7;
2993
+ } else {
2994
+ peg$currPos = s3;
2995
+ s3 = peg$FAILED;
2996
+ }
2997
+ } else {
2998
+ peg$currPos = s3;
2999
+ s3 = peg$FAILED;
2680
3000
  }
3001
+ while (s3 !== peg$FAILED) {
3002
+ s2.push(s3);
3003
+ s3 = peg$currPos;
3004
+ s4 = peg$parse__();
3005
+ s5 = peg$parsesingleArrow();
3006
+ if (s5 !== peg$FAILED) {
3007
+ s6 = peg$parse__();
3008
+ s7 = peg$parseshorthandFunction();
3009
+ if (s7 !== peg$FAILED) {
3010
+ s3 = s7;
3011
+ } else {
3012
+ peg$currPos = s3;
3013
+ s3 = peg$FAILED;
3014
+ }
3015
+ } else {
3016
+ peg$currPos = s3;
3017
+ s3 = peg$FAILED;
3018
+ }
3019
+ }
3020
+ peg$savedPos = s0;
3021
+ s0 = peg$f46(s1, s2);
2681
3022
  } else {
2682
- s1 = peg$FAILED;
3023
+ peg$currPos = s0;
3024
+ s0 = peg$FAILED;
2683
3025
  }
2684
- if (s1 !== peg$FAILED) {
2685
- peg$savedPos = s0;
2686
- s1 = peg$f43(s1);
3026
+
3027
+ return s0;
3028
+ }
3029
+
3030
+ function peg$parseprimary() {
3031
+ var s0;
3032
+
3033
+ s0 = peg$parseliteral();
3034
+ if (s0 === peg$FAILED) {
3035
+ s0 = peg$parsearrayLiteral();
3036
+ if (s0 === peg$FAILED) {
3037
+ s0 = peg$parseobjectLiteral();
3038
+ if (s0 === peg$FAILED) {
3039
+ s0 = peg$parsegroup();
3040
+ if (s0 === peg$FAILED) {
3041
+ s0 = peg$parsetemplateLiteral();
3042
+ if (s0 === peg$FAILED) {
3043
+ s0 = peg$parsereference();
3044
+ }
3045
+ }
3046
+ }
3047
+ }
2687
3048
  }
2688
- s0 = s1;
2689
3049
 
2690
3050
  return s0;
2691
3051
  }
2692
3052
 
2693
- function peg$parseprotocolCall() {
2694
- var s0, s1, s2, s3, s4, s5;
3053
+ function peg$parseprogram() {
3054
+ var s0, s1, s2;
2695
3055
 
2696
3056
  peg$silentFails++;
2697
3057
  s0 = peg$currPos;
2698
- s1 = peg$parseprotocol();
3058
+ s1 = peg$parseshebang();
3059
+ if (s1 === peg$FAILED) {
3060
+ s1 = null;
3061
+ }
3062
+ s2 = peg$parseexpression();
3063
+ if (s2 !== peg$FAILED) {
3064
+ s0 = s2;
3065
+ } else {
3066
+ peg$currPos = s0;
3067
+ s0 = peg$FAILED;
3068
+ }
3069
+ peg$silentFails--;
3070
+ if (s0 === peg$FAILED) {
3071
+ s1 = peg$FAILED;
3072
+ if (peg$silentFails === 0) { peg$fail(peg$e70); }
3073
+ }
3074
+
3075
+ return s0;
3076
+ }
3077
+
3078
+ function peg$parseprotocolExpression() {
3079
+ var s0, s1, s2, s3, s4;
3080
+
3081
+ s0 = peg$currPos;
3082
+ s1 = peg$parsenamespace();
2699
3083
  if (s1 !== peg$FAILED) {
2700
- if (input.charCodeAt(peg$currPos) === 58) {
2701
- s2 = peg$c22;
2702
- peg$currPos++;
3084
+ if (input.substr(peg$currPos, 2) === peg$c42) {
3085
+ s2 = peg$c42;
3086
+ peg$currPos += 2;
2703
3087
  } else {
2704
3088
  s2 = peg$FAILED;
2705
- if (peg$silentFails === 0) { peg$fail(peg$e37); }
3089
+ if (peg$silentFails === 0) { peg$fail(peg$e71); }
2706
3090
  }
2707
3091
  if (s2 !== peg$FAILED) {
2708
- s3 = [];
2709
- if (input.charCodeAt(peg$currPos) === 47) {
2710
- s4 = peg$c26;
2711
- peg$currPos++;
2712
- } else {
2713
- s4 = peg$FAILED;
2714
- if (peg$silentFails === 0) { peg$fail(peg$e48); }
2715
- }
2716
- while (s4 !== peg$FAILED) {
2717
- s3.push(s4);
2718
- if (s3.length >= 2) {
2719
- s4 = peg$FAILED;
2720
- } else {
2721
- if (input.charCodeAt(peg$currPos) === 47) {
2722
- s4 = peg$c26;
2723
- peg$currPos++;
2724
- } else {
2725
- s4 = peg$FAILED;
2726
- if (peg$silentFails === 0) { peg$fail(peg$e48); }
2727
- }
2728
- }
2729
- }
2730
- s4 = peg$parsehost();
2731
- if (s4 !== peg$FAILED) {
2732
- s5 = peg$parseleadingSlashPath();
2733
- if (s5 === peg$FAILED) {
2734
- s5 = null;
3092
+ s3 = peg$parsehost();
3093
+ if (s3 !== peg$FAILED) {
3094
+ s4 = peg$parsepath();
3095
+ if (s4 === peg$FAILED) {
3096
+ s4 = null;
2735
3097
  }
2736
3098
  peg$savedPos = s0;
2737
- s0 = peg$f44(s1, s4, s5);
3099
+ s0 = peg$f47(s1, s3, s4);
2738
3100
  } else {
2739
3101
  peg$currPos = s0;
2740
3102
  s0 = peg$FAILED;
@@ -2747,208 +3109,143 @@ function peg$parse(input, options) {
2747
3109
  peg$currPos = s0;
2748
3110
  s0 = peg$FAILED;
2749
3111
  }
2750
- peg$silentFails--;
2751
3112
  if (s0 === peg$FAILED) {
2752
- s1 = peg$FAILED;
2753
- if (peg$silentFails === 0) { peg$fail(peg$e65); }
3113
+ s0 = peg$parseprimary();
2754
3114
  }
2755
3115
 
2756
3116
  return s0;
2757
3117
  }
2758
3118
 
2759
- function peg$parseprotocol() {
2760
- var s0, s1;
3119
+ function peg$parsequalifiedReference() {
3120
+ var s0, s1, s2;
2761
3121
 
2762
- peg$silentFails++;
2763
- s0 = peg$parsereservedProtocol();
2764
- if (s0 === peg$FAILED) {
2765
- s0 = peg$parsescopeReference();
2766
- }
2767
- peg$silentFails--;
2768
- if (s0 === peg$FAILED) {
2769
- s1 = peg$FAILED;
2770
- if (peg$silentFails === 0) { peg$fail(peg$e66); }
3122
+ s0 = peg$currPos;
3123
+ s1 = peg$parsenamespace();
3124
+ if (s1 !== peg$FAILED) {
3125
+ s2 = peg$parsescopeReference();
3126
+ if (s2 !== peg$FAILED) {
3127
+ peg$savedPos = s0;
3128
+ s0 = peg$f48(s1, s2);
3129
+ } else {
3130
+ peg$currPos = s0;
3131
+ s0 = peg$FAILED;
3132
+ }
3133
+ } else {
3134
+ peg$currPos = s0;
3135
+ s0 = peg$FAILED;
2771
3136
  }
2772
3137
 
2773
3138
  return s0;
2774
3139
  }
2775
3140
 
2776
- function peg$parsereservedProtocol() {
2777
- var s0, s1;
3141
+ function peg$parsereference() {
3142
+ var s0;
2778
3143
 
2779
- peg$silentFails++;
2780
- s0 = peg$currPos;
2781
- if (input.substr(peg$currPos, 7) === peg$c33) {
2782
- s1 = peg$c33;
2783
- peg$currPos += 7;
2784
- } else {
2785
- s1 = peg$FAILED;
2786
- if (peg$silentFails === 0) { peg$fail(peg$e68); }
2787
- }
2788
- if (s1 !== peg$FAILED) {
2789
- peg$savedPos = s0;
2790
- s1 = peg$f45();
2791
- }
2792
- s0 = s1;
3144
+ s0 = peg$parserootDirectory();
2793
3145
  if (s0 === peg$FAILED) {
2794
- s0 = peg$currPos;
2795
- if (input.substr(peg$currPos, 5) === peg$c34) {
2796
- s1 = peg$c34;
2797
- peg$currPos += 5;
2798
- } else {
2799
- s1 = peg$FAILED;
2800
- if (peg$silentFails === 0) { peg$fail(peg$e69); }
2801
- }
2802
- if (s1 !== peg$FAILED) {
2803
- peg$savedPos = s0;
2804
- s1 = peg$f46();
2805
- }
2806
- s0 = s1;
3146
+ s0 = peg$parsehomeDirectory();
2807
3147
  if (s0 === peg$FAILED) {
2808
- s0 = peg$currPos;
2809
- if (input.substr(peg$currPos, 4) === peg$c35) {
2810
- s1 = peg$c35;
2811
- peg$currPos += 4;
2812
- } else {
2813
- s1 = peg$FAILED;
2814
- if (peg$silentFails === 0) { peg$fail(peg$e70); }
2815
- }
2816
- if (s1 !== peg$FAILED) {
2817
- peg$savedPos = s0;
2818
- s1 = peg$f47();
2819
- }
2820
- s0 = s1;
3148
+ s0 = peg$parsequalifiedReference();
2821
3149
  if (s0 === peg$FAILED) {
2822
- s0 = peg$currPos;
2823
- if (input.substr(peg$currPos, 3) === peg$c36) {
2824
- s1 = peg$c36;
2825
- peg$currPos += 3;
2826
- } else {
2827
- s1 = peg$FAILED;
2828
- if (peg$silentFails === 0) { peg$fail(peg$e71); }
2829
- }
2830
- if (s1 !== peg$FAILED) {
2831
- peg$savedPos = s0;
2832
- s1 = peg$f48();
2833
- }
2834
- s0 = s1;
3150
+ s0 = peg$parsenamespace();
2835
3151
  if (s0 === peg$FAILED) {
2836
- s0 = peg$currPos;
2837
- if (input.substr(peg$currPos, 7) === peg$c37) {
2838
- s1 = peg$c37;
2839
- peg$currPos += 7;
2840
- } else {
2841
- s1 = peg$FAILED;
2842
- if (peg$silentFails === 0) { peg$fail(peg$e72); }
2843
- }
2844
- if (s1 !== peg$FAILED) {
2845
- peg$savedPos = s0;
2846
- s1 = peg$f49();
2847
- }
2848
- s0 = s1;
2849
- if (s0 === peg$FAILED) {
2850
- s0 = peg$currPos;
2851
- if (input.substr(peg$currPos, 9) === peg$c38) {
2852
- s1 = peg$c38;
2853
- peg$currPos += 9;
2854
- } else {
2855
- s1 = peg$FAILED;
2856
- if (peg$silentFails === 0) { peg$fail(peg$e73); }
2857
- }
2858
- if (s1 !== peg$FAILED) {
2859
- peg$savedPos = s0;
2860
- s1 = peg$f50();
2861
- }
2862
- s0 = s1;
2863
- if (s0 === peg$FAILED) {
2864
- s0 = peg$currPos;
2865
- if (input.substr(peg$currPos, 8) === peg$c39) {
2866
- s1 = peg$c39;
2867
- peg$currPos += 8;
2868
- } else {
2869
- s1 = peg$FAILED;
2870
- if (peg$silentFails === 0) { peg$fail(peg$e74); }
2871
- }
2872
- if (s1 !== peg$FAILED) {
2873
- peg$savedPos = s0;
2874
- s1 = peg$f51();
2875
- }
2876
- s0 = s1;
2877
- if (s0 === peg$FAILED) {
2878
- s0 = peg$currPos;
2879
- if (input.substr(peg$currPos, 4) === peg$c40) {
2880
- s1 = peg$c40;
2881
- peg$currPos += 4;
2882
- } else {
2883
- s1 = peg$FAILED;
2884
- if (peg$silentFails === 0) { peg$fail(peg$e75); }
2885
- }
2886
- if (s1 !== peg$FAILED) {
2887
- peg$savedPos = s0;
2888
- s1 = peg$f52();
2889
- }
2890
- s0 = s1;
2891
- }
2892
- }
2893
- }
3152
+ s0 = peg$parsescopeReference();
2894
3153
  }
2895
3154
  }
2896
3155
  }
2897
3156
  }
2898
- peg$silentFails--;
2899
- if (s0 === peg$FAILED) {
2900
- s1 = peg$FAILED;
2901
- if (peg$silentFails === 0) { peg$fail(peg$e67); }
2902
- }
2903
3157
 
2904
3158
  return s0;
2905
3159
  }
2906
3160
 
2907
- function peg$parsescopeReference() {
2908
- var s0, s1;
3161
+ function peg$parserootDirectory() {
3162
+ var s0, s1, s2, s3;
2909
3163
 
2910
- peg$silentFails++;
2911
3164
  s0 = peg$currPos;
2912
- s1 = peg$parseidentifier();
3165
+ if (input.charCodeAt(peg$currPos) === 47) {
3166
+ s1 = peg$c41;
3167
+ peg$currPos++;
3168
+ } else {
3169
+ s1 = peg$FAILED;
3170
+ if (peg$silentFails === 0) { peg$fail(peg$e66); }
3171
+ }
2913
3172
  if (s1 !== peg$FAILED) {
2914
- peg$savedPos = s0;
2915
- s1 = peg$f53(s1);
3173
+ s2 = peg$parsepathKey();
3174
+ if (s2 !== peg$FAILED) {
3175
+ peg$savedPos = s0;
3176
+ s0 = peg$f49(s2);
3177
+ } else {
3178
+ peg$currPos = s0;
3179
+ s0 = peg$FAILED;
3180
+ }
3181
+ } else {
3182
+ peg$currPos = s0;
3183
+ s0 = peg$FAILED;
2916
3184
  }
2917
- s0 = s1;
2918
- peg$silentFails--;
2919
3185
  if (s0 === peg$FAILED) {
2920
- s1 = peg$FAILED;
2921
- if (peg$silentFails === 0) { peg$fail(peg$e76); }
3186
+ s0 = peg$currPos;
3187
+ if (input.charCodeAt(peg$currPos) === 47) {
3188
+ s1 = peg$c41;
3189
+ peg$currPos++;
3190
+ } else {
3191
+ s1 = peg$FAILED;
3192
+ if (peg$silentFails === 0) { peg$fail(peg$e66); }
3193
+ }
3194
+ if (s1 !== peg$FAILED) {
3195
+ s2 = peg$currPos;
3196
+ peg$silentFails++;
3197
+ if (input.charCodeAt(peg$currPos) === 47) {
3198
+ s3 = peg$c41;
3199
+ peg$currPos++;
3200
+ } else {
3201
+ s3 = peg$FAILED;
3202
+ if (peg$silentFails === 0) { peg$fail(peg$e66); }
3203
+ }
3204
+ peg$silentFails--;
3205
+ if (s3 === peg$FAILED) {
3206
+ s2 = undefined;
3207
+ } else {
3208
+ peg$currPos = s2;
3209
+ s2 = peg$FAILED;
3210
+ }
3211
+ if (s2 !== peg$FAILED) {
3212
+ peg$savedPos = s0;
3213
+ s0 = peg$f50();
3214
+ } else {
3215
+ peg$currPos = s0;
3216
+ s0 = peg$FAILED;
3217
+ }
3218
+ } else {
3219
+ peg$currPos = s0;
3220
+ s0 = peg$FAILED;
3221
+ }
2922
3222
  }
2923
3223
 
2924
3224
  return s0;
2925
3225
  }
2926
3226
 
2927
- function peg$parsescopeTraverse() {
2928
- var s0, s1, s2, s3;
3227
+ function peg$parsescopeReference() {
3228
+ var s0, s1, s2;
2929
3229
 
3230
+ peg$silentFails++;
2930
3231
  s0 = peg$currPos;
2931
- s1 = peg$parsescopeReference();
3232
+ s1 = peg$parseidentifier();
2932
3233
  if (s1 !== peg$FAILED) {
2933
- if (input.charCodeAt(peg$currPos) === 47) {
2934
- s2 = peg$c26;
2935
- peg$currPos++;
2936
- } else {
2937
- s2 = peg$FAILED;
2938
- if (peg$silentFails === 0) { peg$fail(peg$e48); }
2939
- }
2940
- if (s2 !== peg$FAILED) {
2941
- s3 = peg$parsepath();
2942
- peg$savedPos = s0;
2943
- s0 = peg$f54(s1, s3);
2944
- } else {
2945
- peg$currPos = s0;
2946
- s0 = peg$FAILED;
3234
+ s2 = peg$parseslashFollows();
3235
+ if (s2 === peg$FAILED) {
3236
+ s2 = null;
2947
3237
  }
3238
+ peg$savedPos = s0;
3239
+ s0 = peg$f51(s1, s2);
2948
3240
  } else {
2949
3241
  peg$currPos = s0;
2950
3242
  s0 = peg$FAILED;
2951
3243
  }
3244
+ peg$silentFails--;
3245
+ if (s0 === peg$FAILED) {
3246
+ s1 = peg$FAILED;
3247
+ if (peg$silentFails === 0) { peg$fail(peg$e72); }
3248
+ }
2952
3249
 
2953
3250
  return s0;
2954
3251
  }
@@ -2959,11 +3256,11 @@ function peg$parse(input, options) {
2959
3256
  s0 = peg$currPos;
2960
3257
  s1 = peg$parse__();
2961
3258
  if (input.charCodeAt(peg$currPos) === 44) {
2962
- s2 = peg$c41;
3259
+ s2 = peg$c43;
2963
3260
  peg$currPos++;
2964
3261
  } else {
2965
3262
  s2 = peg$FAILED;
2966
- if (peg$silentFails === 0) { peg$fail(peg$e77); }
3263
+ if (peg$silentFails === 0) { peg$fail(peg$e73); }
2967
3264
  }
2968
3265
  if (s2 !== peg$FAILED) {
2969
3266
  s3 = peg$parse__();
@@ -2980,42 +3277,130 @@ function peg$parse(input, options) {
2980
3277
  return s0;
2981
3278
  }
2982
3279
 
3280
+ function peg$parseslashFollows() {
3281
+ var s0, s1, s2;
3282
+
3283
+ s0 = peg$currPos;
3284
+ s1 = peg$currPos;
3285
+ peg$silentFails++;
3286
+ if (input.charCodeAt(peg$currPos) === 47) {
3287
+ s2 = peg$c41;
3288
+ peg$currPos++;
3289
+ } else {
3290
+ s2 = peg$FAILED;
3291
+ if (peg$silentFails === 0) { peg$fail(peg$e66); }
3292
+ }
3293
+ peg$silentFails--;
3294
+ if (s2 !== peg$FAILED) {
3295
+ peg$currPos = s1;
3296
+ s1 = undefined;
3297
+ } else {
3298
+ s1 = peg$FAILED;
3299
+ }
3300
+ if (s1 !== peg$FAILED) {
3301
+ peg$savedPos = s0;
3302
+ s1 = peg$f52();
3303
+ }
3304
+ s0 = s1;
3305
+
3306
+ return s0;
3307
+ }
3308
+
2983
3309
  function peg$parseshebang() {
2984
3310
  var s0, s1, s2, s3;
2985
3311
 
2986
3312
  s0 = peg$currPos;
2987
- if (input.substr(peg$currPos, 2) === peg$c42) {
2988
- s1 = peg$c42;
3313
+ if (input.substr(peg$currPos, 2) === peg$c44) {
3314
+ s1 = peg$c44;
2989
3315
  peg$currPos += 2;
2990
3316
  } else {
2991
3317
  s1 = peg$FAILED;
2992
- if (peg$silentFails === 0) { peg$fail(peg$e78); }
3318
+ if (peg$silentFails === 0) { peg$fail(peg$e74); }
2993
3319
  }
2994
3320
  if (s1 !== peg$FAILED) {
2995
3321
  s2 = [];
2996
3322
  s3 = input.charAt(peg$currPos);
2997
- if (peg$r4.test(s3)) {
3323
+ if (peg$r5.test(s3)) {
2998
3324
  peg$currPos++;
2999
3325
  } else {
3000
3326
  s3 = peg$FAILED;
3001
- if (peg$silentFails === 0) { peg$fail(peg$e79); }
3327
+ if (peg$silentFails === 0) { peg$fail(peg$e75); }
3002
3328
  }
3003
3329
  while (s3 !== peg$FAILED) {
3004
3330
  s2.push(s3);
3005
3331
  s3 = input.charAt(peg$currPos);
3006
- if (peg$r4.test(s3)) {
3332
+ if (peg$r5.test(s3)) {
3007
3333
  peg$currPos++;
3008
3334
  } else {
3009
3335
  s3 = peg$FAILED;
3010
- if (peg$silentFails === 0) { peg$fail(peg$e79); }
3336
+ if (peg$silentFails === 0) { peg$fail(peg$e75); }
3011
3337
  }
3012
3338
  }
3013
3339
  peg$savedPos = s0;
3014
- s0 = peg$f55();
3340
+ s0 = peg$f53();
3341
+ } else {
3342
+ peg$currPos = s0;
3343
+ s0 = peg$FAILED;
3344
+ }
3345
+
3346
+ return s0;
3347
+ }
3348
+
3349
+ function peg$parseshorthandFunction() {
3350
+ var s0, s1, s2, s3, s4;
3351
+
3352
+ peg$silentFails++;
3353
+ s0 = peg$currPos;
3354
+ if (input.charCodeAt(peg$currPos) === 61) {
3355
+ s1 = peg$c40;
3356
+ peg$currPos++;
3357
+ } else {
3358
+ s1 = peg$FAILED;
3359
+ if (peg$silentFails === 0) { peg$fail(peg$e62); }
3360
+ }
3361
+ if (s1 !== peg$FAILED) {
3362
+ s2 = peg$currPos;
3363
+ peg$silentFails++;
3364
+ if (input.charCodeAt(peg$currPos) === 61) {
3365
+ s3 = peg$c40;
3366
+ peg$currPos++;
3367
+ } else {
3368
+ s3 = peg$FAILED;
3369
+ if (peg$silentFails === 0) { peg$fail(peg$e62); }
3370
+ }
3371
+ peg$silentFails--;
3372
+ if (s3 === peg$FAILED) {
3373
+ s2 = undefined;
3374
+ } else {
3375
+ peg$currPos = s2;
3376
+ s2 = peg$FAILED;
3377
+ }
3378
+ if (s2 !== peg$FAILED) {
3379
+ s3 = peg$parse__();
3380
+ s4 = peg$parseimplicitParenthesesCallExpression();
3381
+ if (s4 !== peg$FAILED) {
3382
+ peg$savedPos = s0;
3383
+ s0 = peg$f54(s4);
3384
+ } else {
3385
+ peg$currPos = s0;
3386
+ s0 = peg$FAILED;
3387
+ }
3388
+ } else {
3389
+ peg$currPos = s0;
3390
+ s0 = peg$FAILED;
3391
+ }
3015
3392
  } else {
3016
3393
  peg$currPos = s0;
3017
3394
  s0 = peg$FAILED;
3018
3395
  }
3396
+ if (s0 === peg$FAILED) {
3397
+ s0 = peg$parseimplicitParenthesesCallExpression();
3398
+ }
3399
+ peg$silentFails--;
3400
+ if (s0 === peg$FAILED) {
3401
+ s1 = peg$FAILED;
3402
+ if (peg$silentFails === 0) { peg$fail(peg$e76); }
3403
+ }
3019
3404
 
3020
3405
  return s0;
3021
3406
  }
@@ -3024,11 +3409,11 @@ function peg$parse(input, options) {
3024
3409
  var s0;
3025
3410
 
3026
3411
  s0 = input.charAt(peg$currPos);
3027
- if (peg$r5.test(s0)) {
3412
+ if (peg$r6.test(s0)) {
3028
3413
  peg$currPos++;
3029
3414
  } else {
3030
3415
  s0 = peg$FAILED;
3031
- if (peg$silentFails === 0) { peg$fail(peg$e80); }
3416
+ if (peg$silentFails === 0) { peg$fail(peg$e77); }
3032
3417
  }
3033
3418
 
3034
3419
  return s0;
@@ -3038,19 +3423,19 @@ function peg$parse(input, options) {
3038
3423
  var s0;
3039
3424
 
3040
3425
  if (input.charCodeAt(peg$currPos) === 8594) {
3041
- s0 = peg$c43;
3426
+ s0 = peg$c45;
3042
3427
  peg$currPos++;
3043
3428
  } else {
3044
3429
  s0 = peg$FAILED;
3045
- if (peg$silentFails === 0) { peg$fail(peg$e81); }
3430
+ if (peg$silentFails === 0) { peg$fail(peg$e78); }
3046
3431
  }
3047
3432
  if (s0 === peg$FAILED) {
3048
- if (input.substr(peg$currPos, 2) === peg$c44) {
3049
- s0 = peg$c44;
3433
+ if (input.substr(peg$currPos, 2) === peg$c46) {
3434
+ s0 = peg$c46;
3050
3435
  peg$currPos += 2;
3051
3436
  } else {
3052
3437
  s0 = peg$FAILED;
3053
- if (peg$silentFails === 0) { peg$fail(peg$e82); }
3438
+ if (peg$silentFails === 0) { peg$fail(peg$e79); }
3054
3439
  }
3055
3440
  }
3056
3441
 
@@ -3061,34 +3446,34 @@ function peg$parse(input, options) {
3061
3446
  var s0, s1, s2, s3;
3062
3447
 
3063
3448
  s0 = peg$currPos;
3064
- if (input.substr(peg$currPos, 2) === peg$c0) {
3065
- s1 = peg$c0;
3449
+ if (input.substr(peg$currPos, 2) === peg$c42) {
3450
+ s1 = peg$c42;
3066
3451
  peg$currPos += 2;
3067
3452
  } else {
3068
3453
  s1 = peg$FAILED;
3069
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
3454
+ if (peg$silentFails === 0) { peg$fail(peg$e71); }
3070
3455
  }
3071
3456
  if (s1 !== peg$FAILED) {
3072
3457
  s2 = [];
3073
3458
  s3 = input.charAt(peg$currPos);
3074
- if (peg$r4.test(s3)) {
3459
+ if (peg$r5.test(s3)) {
3075
3460
  peg$currPos++;
3076
3461
  } else {
3077
3462
  s3 = peg$FAILED;
3078
- if (peg$silentFails === 0) { peg$fail(peg$e79); }
3463
+ if (peg$silentFails === 0) { peg$fail(peg$e75); }
3079
3464
  }
3080
3465
  while (s3 !== peg$FAILED) {
3081
3466
  s2.push(s3);
3082
3467
  s3 = input.charAt(peg$currPos);
3083
- if (peg$r4.test(s3)) {
3468
+ if (peg$r5.test(s3)) {
3084
3469
  peg$currPos++;
3085
3470
  } else {
3086
3471
  s3 = peg$FAILED;
3087
- if (peg$silentFails === 0) { peg$fail(peg$e79); }
3472
+ if (peg$silentFails === 0) { peg$fail(peg$e75); }
3088
3473
  }
3089
3474
  }
3090
3475
  peg$savedPos = s0;
3091
- s0 = peg$f56();
3476
+ s0 = peg$f55();
3092
3477
  } else {
3093
3478
  peg$currPos = s0;
3094
3479
  s0 = peg$FAILED;
@@ -3103,11 +3488,11 @@ function peg$parse(input, options) {
3103
3488
  peg$silentFails++;
3104
3489
  s0 = peg$currPos;
3105
3490
  if (input.charCodeAt(peg$currPos) === 39) {
3106
- s1 = peg$c45;
3491
+ s1 = peg$c47;
3107
3492
  peg$currPos++;
3108
3493
  } else {
3109
3494
  s1 = peg$FAILED;
3110
- if (peg$silentFails === 0) { peg$fail(peg$e84); }
3495
+ if (peg$silentFails === 0) { peg$fail(peg$e81); }
3111
3496
  }
3112
3497
  if (s1 !== peg$FAILED) {
3113
3498
  s2 = [];
@@ -3117,15 +3502,15 @@ function peg$parse(input, options) {
3117
3502
  s3 = peg$parsesingleQuoteStringChar();
3118
3503
  }
3119
3504
  if (input.charCodeAt(peg$currPos) === 39) {
3120
- s3 = peg$c45;
3505
+ s3 = peg$c47;
3121
3506
  peg$currPos++;
3122
3507
  } else {
3123
3508
  s3 = peg$FAILED;
3124
- if (peg$silentFails === 0) { peg$fail(peg$e84); }
3509
+ if (peg$silentFails === 0) { peg$fail(peg$e81); }
3125
3510
  }
3126
3511
  if (s3 !== peg$FAILED) {
3127
3512
  peg$savedPos = s0;
3128
- s0 = peg$f57(s2);
3513
+ s0 = peg$f56(s2);
3129
3514
  } else {
3130
3515
  peg$currPos = s0;
3131
3516
  s0 = peg$FAILED;
@@ -3137,7 +3522,7 @@ function peg$parse(input, options) {
3137
3522
  peg$silentFails--;
3138
3523
  if (s0 === peg$FAILED) {
3139
3524
  s1 = peg$FAILED;
3140
- if (peg$silentFails === 0) { peg$fail(peg$e83); }
3525
+ if (peg$silentFails === 0) { peg$fail(peg$e80); }
3141
3526
  }
3142
3527
 
3143
3528
  return s0;
@@ -3150,11 +3535,11 @@ function peg$parse(input, options) {
3150
3535
  s1 = peg$currPos;
3151
3536
  peg$silentFails++;
3152
3537
  if (input.charCodeAt(peg$currPos) === 39) {
3153
- s2 = peg$c45;
3538
+ s2 = peg$c47;
3154
3539
  peg$currPos++;
3155
3540
  } else {
3156
3541
  s2 = peg$FAILED;
3157
- if (peg$silentFails === 0) { peg$fail(peg$e84); }
3542
+ if (peg$silentFails === 0) { peg$fail(peg$e81); }
3158
3543
  }
3159
3544
  if (s2 === peg$FAILED) {
3160
3545
  s2 = peg$parsenewLine();
@@ -3183,15 +3568,16 @@ function peg$parse(input, options) {
3183
3568
  }
3184
3569
 
3185
3570
  function peg$parsespread() {
3186
- var s0, s1, s2;
3571
+ var s0, s1, s2, s3;
3187
3572
 
3188
3573
  s0 = peg$currPos;
3189
3574
  s1 = peg$parseellipsis();
3190
3575
  if (s1 !== peg$FAILED) {
3191
- s2 = peg$parsepipeline();
3192
- if (s2 !== peg$FAILED) {
3576
+ s2 = peg$parse__();
3577
+ s3 = peg$parseconditionalExpression();
3578
+ if (s3 !== peg$FAILED) {
3193
3579
  peg$savedPos = s0;
3194
- s0 = peg$f58(s2);
3580
+ s0 = peg$f57(s3);
3195
3581
  } else {
3196
3582
  peg$currPos = s0;
3197
3583
  s0 = peg$FAILED;
@@ -3204,62 +3590,7 @@ function peg$parse(input, options) {
3204
3590
  return s0;
3205
3591
  }
3206
3592
 
3207
- function peg$parsestep() {
3208
- var s0;
3209
-
3210
- s0 = peg$parsenumber();
3211
- if (s0 === peg$FAILED) {
3212
- s0 = peg$parsefunctionComposition();
3213
- if (s0 === peg$FAILED) {
3214
- s0 = peg$parseabsoluteFilePath();
3215
- if (s0 === peg$FAILED) {
3216
- s0 = peg$parsearray();
3217
- if (s0 === peg$FAILED) {
3218
- s0 = peg$parseobject();
3219
- if (s0 === peg$FAILED) {
3220
- s0 = peg$parselambda();
3221
- if (s0 === peg$FAILED) {
3222
- s0 = peg$parseparameterizedLambda();
3223
- if (s0 === peg$FAILED) {
3224
- s0 = peg$parsetemplateLiteral();
3225
- if (s0 === peg$FAILED) {
3226
- s0 = peg$parsestring();
3227
- if (s0 === peg$FAILED) {
3228
- s0 = peg$parsegroup();
3229
- if (s0 === peg$FAILED) {
3230
- s0 = peg$parseprotocolCall();
3231
- if (s0 === peg$FAILED) {
3232
- s0 = peg$parsetaggedTemplate();
3233
- if (s0 === peg$FAILED) {
3234
- s0 = peg$parsescopeTraverse();
3235
- if (s0 === peg$FAILED) {
3236
- s0 = peg$parsescopeReference();
3237
- }
3238
- }
3239
- }
3240
- }
3241
- }
3242
- }
3243
- }
3244
- }
3245
- }
3246
- }
3247
- }
3248
- }
3249
- }
3250
-
3251
- return s0;
3252
- }
3253
-
3254
- function peg$parsestart() {
3255
- var s0;
3256
-
3257
- s0 = peg$parsenumber();
3258
-
3259
- return s0;
3260
- }
3261
-
3262
- function peg$parsestring() {
3593
+ function peg$parsestringLiteral() {
3263
3594
  var s0, s1;
3264
3595
 
3265
3596
  peg$silentFails++;
@@ -3273,48 +3604,7 @@ function peg$parse(input, options) {
3273
3604
  peg$silentFails--;
3274
3605
  if (s0 === peg$FAILED) {
3275
3606
  s1 = peg$FAILED;
3276
- if (peg$silentFails === 0) { peg$fail(peg$e85); }
3277
- }
3278
-
3279
- return s0;
3280
- }
3281
-
3282
- function peg$parsetaggedTemplate() {
3283
- var s0, s1, s2, s3, s4;
3284
-
3285
- s0 = peg$currPos;
3286
- s1 = peg$parsecallTarget();
3287
- if (s1 !== peg$FAILED) {
3288
- if (input.charCodeAt(peg$currPos) === 96) {
3289
- s2 = peg$c46;
3290
- peg$currPos++;
3291
- } else {
3292
- s2 = peg$FAILED;
3293
- if (peg$silentFails === 0) { peg$fail(peg$e86); }
3294
- }
3295
- if (s2 !== peg$FAILED) {
3296
- s3 = peg$parsetemplateLiteralContents();
3297
- if (input.charCodeAt(peg$currPos) === 96) {
3298
- s4 = peg$c46;
3299
- peg$currPos++;
3300
- } else {
3301
- s4 = peg$FAILED;
3302
- if (peg$silentFails === 0) { peg$fail(peg$e86); }
3303
- }
3304
- if (s4 !== peg$FAILED) {
3305
- peg$savedPos = s0;
3306
- s0 = peg$f59(s1, s3);
3307
- } else {
3308
- peg$currPos = s0;
3309
- s0 = peg$FAILED;
3310
- }
3311
- } else {
3312
- peg$currPos = s0;
3313
- s0 = peg$FAILED;
3314
- }
3315
- } else {
3316
- peg$currPos = s0;
3317
- s0 = peg$FAILED;
3607
+ if (peg$silentFails === 0) { peg$fail(peg$e82); }
3318
3608
  }
3319
3609
 
3320
3610
  return s0;
@@ -3327,11 +3617,11 @@ function peg$parse(input, options) {
3327
3617
  s0 = peg$currPos;
3328
3618
  s1 = peg$parsetemplateDocumentContents();
3329
3619
  peg$savedPos = s0;
3330
- s1 = peg$f60(s1);
3620
+ s1 = peg$f58(s1);
3331
3621
  s0 = s1;
3332
3622
  peg$silentFails--;
3333
3623
  s1 = peg$FAILED;
3334
- if (peg$silentFails === 0) { peg$fail(peg$e87); }
3624
+ if (peg$silentFails === 0) { peg$fail(peg$e83); }
3335
3625
 
3336
3626
  return s0;
3337
3627
  }
@@ -3342,12 +3632,12 @@ function peg$parse(input, options) {
3342
3632
  s0 = peg$currPos;
3343
3633
  s1 = peg$currPos;
3344
3634
  peg$silentFails++;
3345
- if (input.substr(peg$currPos, 2) === peg$c47) {
3346
- s2 = peg$c47;
3635
+ if (input.substr(peg$currPos, 2) === peg$c48) {
3636
+ s2 = peg$c48;
3347
3637
  peg$currPos += 2;
3348
3638
  } else {
3349
3639
  s2 = peg$FAILED;
3350
- if (peg$silentFails === 0) { peg$fail(peg$e88); }
3640
+ if (peg$silentFails === 0) { peg$fail(peg$e84); }
3351
3641
  }
3352
3642
  peg$silentFails--;
3353
3643
  if (s2 === peg$FAILED) {
@@ -3402,7 +3692,7 @@ function peg$parse(input, options) {
3402
3692
  }
3403
3693
  }
3404
3694
  peg$savedPos = s0;
3405
- s0 = peg$f61(s1, s2);
3695
+ s0 = peg$f59(s1, s2);
3406
3696
 
3407
3697
  return s0;
3408
3698
  }
@@ -3419,11 +3709,11 @@ function peg$parse(input, options) {
3419
3709
  s2 = peg$parsetemplateDocumentChar();
3420
3710
  }
3421
3711
  peg$savedPos = s0;
3422
- s1 = peg$f62(s1);
3712
+ s1 = peg$f60(s1);
3423
3713
  s0 = s1;
3424
3714
  peg$silentFails--;
3425
3715
  s1 = peg$FAILED;
3426
- if (peg$silentFails === 0) { peg$fail(peg$e89); }
3716
+ if (peg$silentFails === 0) { peg$fail(peg$e85); }
3427
3717
 
3428
3718
  return s0;
3429
3719
  }
@@ -3434,24 +3724,24 @@ function peg$parse(input, options) {
3434
3724
  peg$silentFails++;
3435
3725
  s0 = peg$currPos;
3436
3726
  if (input.charCodeAt(peg$currPos) === 96) {
3437
- s1 = peg$c46;
3727
+ s1 = peg$c49;
3438
3728
  peg$currPos++;
3439
3729
  } else {
3440
3730
  s1 = peg$FAILED;
3441
- if (peg$silentFails === 0) { peg$fail(peg$e86); }
3731
+ if (peg$silentFails === 0) { peg$fail(peg$e87); }
3442
3732
  }
3443
3733
  if (s1 !== peg$FAILED) {
3444
3734
  s2 = peg$parsetemplateLiteralContents();
3445
3735
  if (input.charCodeAt(peg$currPos) === 96) {
3446
- s3 = peg$c46;
3736
+ s3 = peg$c49;
3447
3737
  peg$currPos++;
3448
3738
  } else {
3449
3739
  s3 = peg$FAILED;
3450
- if (peg$silentFails === 0) { peg$fail(peg$e86); }
3740
+ if (peg$silentFails === 0) { peg$fail(peg$e87); }
3451
3741
  }
3452
3742
  if (s3 !== peg$FAILED) {
3453
3743
  peg$savedPos = s0;
3454
- s0 = peg$f63(s2);
3744
+ s0 = peg$f61(s2);
3455
3745
  } else {
3456
3746
  peg$currPos = s0;
3457
3747
  s0 = peg$FAILED;
@@ -3463,7 +3753,7 @@ function peg$parse(input, options) {
3463
3753
  peg$silentFails--;
3464
3754
  if (s0 === peg$FAILED) {
3465
3755
  s1 = peg$FAILED;
3466
- if (peg$silentFails === 0) { peg$fail(peg$e90); }
3756
+ if (peg$silentFails === 0) { peg$fail(peg$e86); }
3467
3757
  }
3468
3758
 
3469
3759
  return s0;
@@ -3476,19 +3766,19 @@ function peg$parse(input, options) {
3476
3766
  s1 = peg$currPos;
3477
3767
  peg$silentFails++;
3478
3768
  if (input.charCodeAt(peg$currPos) === 96) {
3479
- s2 = peg$c46;
3769
+ s2 = peg$c49;
3480
3770
  peg$currPos++;
3481
3771
  } else {
3482
3772
  s2 = peg$FAILED;
3483
- if (peg$silentFails === 0) { peg$fail(peg$e86); }
3773
+ if (peg$silentFails === 0) { peg$fail(peg$e87); }
3484
3774
  }
3485
3775
  if (s2 === peg$FAILED) {
3486
- if (input.substr(peg$currPos, 2) === peg$c47) {
3487
- s2 = peg$c47;
3776
+ if (input.substr(peg$currPos, 2) === peg$c48) {
3777
+ s2 = peg$c48;
3488
3778
  peg$currPos += 2;
3489
3779
  } else {
3490
3780
  s2 = peg$FAILED;
3491
- if (peg$silentFails === 0) { peg$fail(peg$e88); }
3781
+ if (peg$silentFails === 0) { peg$fail(peg$e84); }
3492
3782
  }
3493
3783
  }
3494
3784
  peg$silentFails--;
@@ -3560,38 +3850,37 @@ function peg$parse(input, options) {
3560
3850
  s2 = peg$parsetemplateLiteralChar();
3561
3851
  }
3562
3852
  peg$savedPos = s0;
3563
- s1 = peg$f64(s1);
3853
+ s1 = peg$f62(s1);
3564
3854
  s0 = s1;
3565
3855
 
3566
3856
  return s0;
3567
3857
  }
3568
3858
 
3569
3859
  function peg$parsetemplateSubstitution() {
3570
- var s0, s1, s2, s3, s4, s5;
3860
+ var s0, s1, s2, s3;
3571
3861
 
3572
3862
  peg$silentFails++;
3573
3863
  s0 = peg$currPos;
3574
- if (input.substr(peg$currPos, 2) === peg$c47) {
3575
- s1 = peg$c47;
3864
+ if (input.substr(peg$currPos, 2) === peg$c48) {
3865
+ s1 = peg$c48;
3576
3866
  peg$currPos += 2;
3577
3867
  } else {
3578
3868
  s1 = peg$FAILED;
3579
- if (peg$silentFails === 0) { peg$fail(peg$e88); }
3869
+ if (peg$silentFails === 0) { peg$fail(peg$e84); }
3580
3870
  }
3581
3871
  if (s1 !== peg$FAILED) {
3582
- s2 = peg$parse__();
3583
- s3 = peg$parsepipeline();
3584
- if (s3 !== peg$FAILED) {
3585
- s4 = peg$parse__();
3872
+ s2 = peg$parseexpression();
3873
+ if (s2 !== peg$FAILED) {
3586
3874
  if (input.charCodeAt(peg$currPos) === 125) {
3587
- s5 = peg$c2;
3875
+ s3 = peg$c3;
3588
3876
  peg$currPos++;
3589
3877
  } else {
3590
- s5 = peg$FAILED;
3878
+ s3 = peg$FAILED;
3591
3879
  if (peg$silentFails === 0) { peg$fail(peg$e6); }
3592
3880
  }
3593
- if (s5 !== peg$FAILED) {
3594
- s0 = s3;
3881
+ if (s3 !== peg$FAILED) {
3882
+ peg$savedPos = s0;
3883
+ s0 = peg$f63(s2);
3595
3884
  } else {
3596
3885
  peg$currPos = s0;
3597
3886
  s0 = peg$FAILED;
@@ -3607,7 +3896,7 @@ function peg$parse(input, options) {
3607
3896
  peg$silentFails--;
3608
3897
  if (s0 === peg$FAILED) {
3609
3898
  s1 = peg$FAILED;
3610
- if (peg$silentFails === 0) { peg$fail(peg$e91); }
3899
+ if (peg$silentFails === 0) { peg$fail(peg$e88); }
3611
3900
  }
3612
3901
 
3613
3902
  return s0;
@@ -3630,6 +3919,46 @@ function peg$parse(input, options) {
3630
3919
  return s0;
3631
3920
  }
3632
3921
 
3922
+ function peg$parseunaryExpression() {
3923
+ var s0, s1, s2, s3;
3924
+
3925
+ s0 = peg$currPos;
3926
+ s1 = peg$parseunaryOperator();
3927
+ if (s1 !== peg$FAILED) {
3928
+ s2 = peg$parse__();
3929
+ s3 = peg$parseunaryExpression();
3930
+ if (s3 !== peg$FAILED) {
3931
+ peg$savedPos = s0;
3932
+ s0 = peg$f64(s1, s3);
3933
+ } else {
3934
+ peg$currPos = s0;
3935
+ s0 = peg$FAILED;
3936
+ }
3937
+ } else {
3938
+ peg$currPos = s0;
3939
+ s0 = peg$FAILED;
3940
+ }
3941
+ if (s0 === peg$FAILED) {
3942
+ s0 = peg$parsecallExpression();
3943
+ }
3944
+
3945
+ return s0;
3946
+ }
3947
+
3948
+ function peg$parseunaryOperator() {
3949
+ var s0;
3950
+
3951
+ if (input.charCodeAt(peg$currPos) === 33) {
3952
+ s0 = peg$c50;
3953
+ peg$currPos++;
3954
+ } else {
3955
+ s0 = peg$FAILED;
3956
+ if (peg$silentFails === 0) { peg$fail(peg$e89); }
3957
+ }
3958
+
3959
+ return s0;
3960
+ }
3961
+
3633
3962
  function peg$parsewhitespaceWithNewLine() {
3634
3963
  var s0, s1, s2, s3, s4;
3635
3964
 
@@ -3687,43 +4016,49 @@ function peg$parse(input, options) {
3687
4016
 
3688
4017
  const peg$allowedStartRules = [
3689
4018
  "__",
3690
- "absoluteFilePath",
3691
- "args",
3692
- "array",
4019
+ "arguments",
4020
+ "arrayLiteral",
3693
4021
  "arrayEntries",
3694
4022
  "arrayEntry",
3695
- "callTarget",
4023
+ "arrowFunction",
4024
+ "callExpression",
3696
4025
  "closingBrace",
3697
4026
  "closingBracket",
3698
- "closingParen",
4027
+ "closingParenthesis",
3699
4028
  "comment",
4029
+ "conditionalExpression",
3700
4030
  "digits",
3701
4031
  "doubleArrow",
3702
4032
  "doubleQuoteString",
3703
4033
  "doubleQuoteStringChar",
3704
4034
  "ellipsis",
4035
+ "equalityExpression",
4036
+ "equalityOperator",
3705
4037
  "escapedChar",
3706
- "expr",
3707
4038
  "expression",
3708
- "float",
3709
- "functionComposition",
4039
+ "floatLiteral",
3710
4040
  "group",
3711
4041
  "guillemetString",
3712
4042
  "guillemetStringChar",
4043
+ "homeDirectory",
3713
4044
  "host",
3714
4045
  "identifier",
3715
4046
  "identifierChar",
3716
4047
  "identifierList",
3717
- "implicitParensArgs",
4048
+ "implicitParenthesesCallExpression",
4049
+ "implicitParensthesesArguments",
3718
4050
  "inlineSpace",
3719
- "integer",
3720
- "lambda",
3721
- "leadingSlashPath",
4051
+ "integerLiteral",
3722
4052
  "list",
4053
+ "literal",
4054
+ "logicalAndExpression",
4055
+ "logicalOrExpression",
3723
4056
  "multiLineComment",
4057
+ "namespace",
3724
4058
  "newLine",
3725
- "number",
3726
- "object",
4059
+ "numericLiteral",
4060
+ "nullishCoalescingExpression",
4061
+ "objectLiteral",
3727
4062
  "objectEntries",
3728
4063
  "objectEntry",
3729
4064
  "objectGetter",
@@ -3732,30 +4067,31 @@ const peg$allowedStartRules = [
3732
4067
  "objectProperty",
3733
4068
  "objectShorthandProperty",
3734
4069
  "objectPublicKey",
3735
- "parameterizedLambda",
3736
- "parensArgs",
3737
- "pipeline",
4070
+ "parenthesesArguments",
3738
4071
  "path",
3739
- "pathElement",
3740
- "pathKeyChar",
3741
- "pathTail",
3742
- "protocolCall",
3743
- "protocol",
3744
- "reservedProtocol",
4072
+ "pathArguments",
4073
+ "pathKey",
4074
+ "pathSegment",
4075
+ "pathSegmentChar",
4076
+ "pipelineExpression",
4077
+ "primary",
4078
+ "program",
4079
+ "protocolExpression",
4080
+ "qualifiedReference",
4081
+ "reference",
4082
+ "rootDirectory",
3745
4083
  "scopeReference",
3746
- "scopeTraverse",
3747
4084
  "separator",
4085
+ "slashFollows",
3748
4086
  "shebang",
4087
+ "shorthandFunction",
3749
4088
  "sign",
3750
4089
  "singleArrow",
3751
4090
  "singleLineComment",
3752
4091
  "singleQuoteString",
3753
4092
  "singleQuoteStringChar",
3754
4093
  "spread",
3755
- "step",
3756
- "start",
3757
- "string",
3758
- "taggedTemplate",
4094
+ "stringLiteral",
3759
4095
  "templateDocument",
3760
4096
  "templateDocumentChar",
3761
4097
  "templateDocumentContents",
@@ -3766,6 +4102,8 @@ const peg$allowedStartRules = [
3766
4102
  "templateLiteralText",
3767
4103
  "templateSubstitution",
3768
4104
  "textChar",
4105
+ "unaryExpression",
4106
+ "unaryOperator",
3769
4107
  "whitespaceWithNewLine"
3770
4108
  ];
3771
4109