Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gram-data/gram-parse

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gram-data/gram-parse - npm Package Compare versions

Comparing version 0.2.10 to 0.2.11

4

dist/gram-parse.cjs.development.js

@@ -488,4 +488,4 @@ 'use strict';

var id = _ref16[0],
labels = _ref16[2],
record = _ref16[4];
labels = _ref16[1],
record = _ref16[2];
return {

@@ -492,0 +492,0 @@ id: id,

@@ -1,2 +0,2 @@

"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("unified")),s=e(require("nearley")),r=e(require("moo")),n=require("@gram-data/gram-builder"),o=require("@gram-data/gram-ast");function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e}).apply(this,arguments)}function i(e){return e[0]}var l=r.compile({whitespace:{match:/\s+/,lineBreaks:!0},lineComment:{match:/\/\/.*?\n?$/},hexadecimal:o.tokens.hexadecimal,octal:o.tokens.octal,measurement:o.tokens.measurement,decimal:o.tokens.decimal,integer:o.tokens.integer,taggedString:{match:o.tokens.taggedString},boolean:["true","TRUE","True","false","FALSE","False"],symbol:o.tokens.symbol,identifier:o.tokens.identifier,doubleQuotedString:{match:o.tokens.doubleQuotedString,value:function(e){return e.slice(1,-1)}},singleQuotedString:{match:o.tokens.singleQuotedString,value:function(e){return e.slice(1,-1)}},tickedString:{match:o.tokens.tickedString,value:function(e){return e.slice(1,-1)}},"--\x3e":"--\x3e","--":"--","<--":"<--","-[]->":"-[]->","-[]-":"-[]-","<-[]-":"<-[]-","<-[":"<-[","]->":"]->","-[":"-[","]-":"]-","{":"{","}":"}","[":"[","]":"]","(":"(",")":")",",":",",":":":","`":"`","'":"'","ø":"ø"}),u=function(){return null},m=function(e){return e[0].text},c={Lexer:l,ParserRules:[{name:"GramSeq$ebnf$1$subexpression$1",symbols:["Path","_"],postprocess:function(e){return e[0]}},{name:"GramSeq$ebnf$1",symbols:["GramSeq$ebnf$1$subexpression$1"]},{name:"GramSeq$ebnf$1$subexpression$2",symbols:["Path","_"],postprocess:function(e){return e[0]}},{name:"GramSeq$ebnf$1",symbols:["GramSeq$ebnf$1","GramSeq$ebnf$1$subexpression$2"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"GramSeq$ebnf$2",symbols:["EOL"],postprocess:i},{name:"GramSeq$ebnf$2",symbols:[],postprocess:function(){return null}},{name:"GramSeq",symbols:["GramSeq$ebnf$1","GramSeq$ebnf$2"],postprocess:function(e){return n.builder.seq(n.builder.flatten(e[0]))}},{name:"Path",symbols:["NodePattern"],postprocess:i},{name:"Path",symbols:["PathComposition"],postprocess:i},{name:"Path",symbols:["PathPair"],postprocess:i},{name:"NodePattern",symbols:["Node","_","Edge","_","NodePattern"],postprocess:function(e){var t=e[2];return n.builder.cons([e[0],e[4]],{kind:t.kind,id:t.id,labels:t.labels,record:t.record})}},{name:"NodePattern",symbols:["Node"],postprocess:i},{name:"Node",symbols:[{literal:"("},"_","Attributes","_",{literal:")"}],postprocess:function(e){var t=e[2];return n.builder.node(t.id,t.labels,t.record)}},{name:"Edge",symbols:[{literal:"-["},"_","Attributes",{literal:"]->"}],postprocess:function(e){return a({kind:"right"},e[2])}},{name:"Edge",symbols:[{literal:"-["},"_","Attributes",{literal:"]-"}],postprocess:function(e){return a({kind:"either"},e[2])}},{name:"Edge",symbols:[{literal:"<-["},"_","Attributes",{literal:"]-"}],postprocess:function(e){return a({kind:"left"},e[2])}},{name:"Edge",symbols:[{literal:"-[]->"}],postprocess:function(){return{kind:"right"}}},{name:"Edge",symbols:[{literal:"-[]-"}],postprocess:function(){return{kind:"either"}}},{name:"Edge",symbols:[{literal:"<-[]-"}],postprocess:function(){return{kind:"left"}}},{name:"Edge",symbols:[{literal:"--\x3e"}],postprocess:function(){return{kind:"right"}}},{name:"Edge",symbols:[{literal:"--"}],postprocess:function(){return{kind:"either"}}},{name:"Edge",symbols:[{literal:"<--"}],postprocess:function(){return{kind:"left"}}},{name:"PathComposition",symbols:["PathPoint"],postprocess:i},{name:"PathComposition",symbols:["PathAnnotation"],postprocess:i},{name:"PathComposition",symbols:["PathExpression"],postprocess:i},{name:"PathPoint",symbols:[{literal:"["},"_","Attributes","_",{literal:"]"}],postprocess:function(e){var t=e[2];return(t.id||t.labels||t.record)&&"ø"!==t.id?n.builder.node(t.id,t.labels,t.record):n.builder.empty()}},{name:"PathAnnotation",symbols:[{literal:"["},"_","Attributes","_","Path",{literal:"]"}],postprocess:function(e){var t=e[2];return n.builder.cons([e[4]],{id:t.id,labels:t.labels,record:t.record})}},{name:"PathExpression$ebnf$1",symbols:["Kind"],postprocess:i},{name:"PathExpression$ebnf$1",symbols:[],postprocess:function(){return null}},{name:"PathExpression",symbols:[{literal:"["},"_","Attributes","_","PathExpression$ebnf$1","_","Path","_","Path","_",{literal:"]"}],postprocess:function(e){var t=e[2];return n.builder.cons([e[6],e[8]],{kind:e[4],id:t.id,labels:t.labels,record:t.record})}},{name:"PathPair$subexpression$1",symbols:["NodePattern"]},{name:"PathPair$subexpression$1",symbols:["PathComposition"]},{name:"PathPair",symbols:["PathPair$subexpression$1","_",{literal:","},"_","Path"],postprocess:function(e){return n.builder.pair([e[0][0],e[4]])}},{name:"Kind",symbols:[{literal:","}],postprocess:function(){return"pair"}},{name:"Kind",symbols:[{literal:"--\x3e"}],postprocess:function(){return"right"}},{name:"Kind",symbols:[{literal:"--"}],postprocess:function(){return"either"}},{name:"Kind",symbols:[{literal:"<--"}],postprocess:function(){return"left"}},{name:"Attributes$ebnf$1",symbols:["Identity"],postprocess:i},{name:"Attributes$ebnf$1",symbols:[],postprocess:function(){return null}},{name:"Attributes$ebnf$2$subexpression$1",symbols:["_","LabelList"],postprocess:function(e){return e[1]}},{name:"Attributes$ebnf$2",symbols:["Attributes$ebnf$2$subexpression$1"],postprocess:i},{name:"Attributes$ebnf$2",symbols:[],postprocess:function(){return null}},{name:"Attributes$ebnf$3$subexpression$1",symbols:["_","Record"],postprocess:function(e){return e[1]}},{name:"Attributes$ebnf$3",symbols:["Attributes$ebnf$3$subexpression$1"],postprocess:i},{name:"Attributes$ebnf$3",symbols:[],postprocess:function(){return null}},{name:"Attributes",symbols:["Attributes$ebnf$1","Attributes$ebnf$2","Attributes$ebnf$3"],postprocess:function(e){return{id:e[0],labels:e[2],record:e[4]}}},{name:"LabelList$ebnf$1",symbols:["Label"]},{name:"LabelList$ebnf$1",symbols:["LabelList$ebnf$1","Label"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"LabelList",symbols:["LabelList$ebnf$1"],postprocess:function(e){return e[0]}},{name:"Label",symbols:[{literal:":"},"Symbol"],postprocess:function(e){return e[1]}},{name:"Identity",symbols:[l.has("identifier")?{type:"identifier"}:identifier],postprocess:m},{name:"Identity",symbols:[{literal:"ø"}],postprocess:m},{name:"Identity",symbols:[l.has("symbol")?{type:"symbol"}:symbol],postprocess:m},{name:"Identity",symbols:[l.has("integer")?{type:"integer"}:integer],postprocess:m},{name:"Identity",symbols:[l.has("octal")?{type:"octal"}:octal],postprocess:m},{name:"Identity",symbols:[l.has("hexadecimal")?{type:"hexadecimal"}:hexadecimal],postprocess:m},{name:"Identity",symbols:[l.has("measurement")?{type:"measurement"}:measurement],postprocess:m},{name:"Identity",symbols:[l.has("tickedString")?{type:"tickedString"}:tickedString],postprocess:function(e){return e[0].text.slice(1,-1)}},{name:"Symbol",symbols:[l.has("symbol")?{type:"symbol"}:symbol],postprocess:m},{name:"Symbol",symbols:[l.has("tickedString")?{type:"tickedString"}:tickedString],postprocess:function(e){return e[0].text.slice(1,-1)}},{name:"Record",symbols:[{literal:"{"},"_",{literal:"}"}],postprocess:u},{name:"Record$ebnf$1",symbols:[]},{name:"Record$ebnf$1$subexpression$1",symbols:["_",{literal:","},"_","Property"]},{name:"Record$ebnf$1",symbols:["Record$ebnf$1","Record$ebnf$1$subexpression$1"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"Record",symbols:[{literal:"{"},"_","Property","Record$ebnf$1","_",{literal:"}"}],postprocess:function(e){return[e[2]].concat(e[3].map((function(e){return e[3]})))}},{name:"Property",symbols:["Symbol","_",{literal:":"},"_","Value"],postprocess:function(e){return n.builder.property(e[0],e[4])}},{name:"Value",symbols:["StringLiteral"],postprocess:i},{name:"Value",symbols:["NumericLiteral"],postprocess:i},{name:"Value",symbols:[l.has("boolean")?{type:"boolean"}:boolean],postprocess:function(e){return n.builder.boolean(JSON.parse(e[0].value.toLowerCase()))}},{name:"Value$ebnf$1",symbols:[]},{name:"Value$ebnf$1$subexpression$1",symbols:["_",{literal:","},"_","Value"]},{name:"Value$ebnf$1",symbols:["Value$ebnf$1","Value$ebnf$1$subexpression$1"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"Value",symbols:[{literal:"["},"_","Value","Value$ebnf$1",{literal:"]"}],postprocess:function(e){return[e[2]].concat(e[3].map((function(e){return e[3]})))}},{name:"StringLiteral",symbols:[l.has("singleQuotedString")?{type:"singleQuotedString"}:singleQuotedString],postprocess:function(e){return n.builder.string(e[0].value)}},{name:"StringLiteral",symbols:[l.has("doubleQuotedString")?{type:"doubleQuotedString"}:doubleQuotedString],postprocess:function(e){return n.builder.string(e[0].value)}},{name:"StringLiteral",symbols:[l.has("tickedString")?{type:"tickedString"}:tickedString],postprocess:function(e){return n.builder.string(e[0].value)}},{name:"StringLiteral",symbols:[l.has("taggedString")?{type:"taggedString"}:taggedString],postprocess:function(e){var t=function(e){var t=e.match(/([^`]+)`(.+)`$/);if(null==t)throw Error("Malformed tagged string: "+e);return{tag:t[1],value:t[2]}}(e[0].value);return n.builder.tagged(t.tag,t.value)}},{name:"NumericLiteral",symbols:[l.has("integer")?{type:"integer"}:integer],postprocess:function(e){return n.builder.integer(e[0].value)}},{name:"NumericLiteral",symbols:[l.has("decimal")?{type:"decimal"}:decimal],postprocess:function(e){return n.builder.decimal(e[0].value)}},{name:"NumericLiteral",symbols:[l.has("hexadecimal")?{type:"hexadecimal"}:hexadecimal],postprocess:function(e){return n.builder.hexadecimal(e[0].value)}},{name:"NumericLiteral",symbols:[l.has("octal")?{type:"octal"}:octal],postprocess:function(e){return n.builder.octal(e[0].value)}},{name:"NumericLiteral",symbols:[l.has("measurement")?{type:"measurement"}:measurement],postprocess:function(e){var t=function(e){var t=e.match(/(-?[0-9.]+)([a-zA-Z]+)/);if(null==t)throw Error("Malformed measurement : "+e);return{value:t[1],unit:t[2]}}(e[0].value);return n.builder.measurement(t.unit,t.value)}},{name:"_",symbols:[]},{name:"_",symbols:[l.has("whitespace")?{type:"whitespace"}:whitespace],postprocess:u},{name:"Comment",symbols:[l.has("lineComment")?{type:"lineComment"}:lineComment],postprocess:u},{name:"EOL",symbols:[{literal:"\n"}],postprocess:u}],ParserStart:"GramSeq"},p=function(e,t){var r,n,o=new s.Parser(s.Grammar.fromCompiled(c));try{var a=o.feed(e);if(void 0===a.results[0]&&a.lexerState){var i={line:(n=a.lexerState).line,column:n.col};t.fail("Incomplete parse.",i)}return a.results.length>1&&t.info("[WARN] parsing is ambiguous"),a.results[0]||{type:"error"}}catch(e){var l=e.token?{line:(r=e.token).line,column:r.col}:{line:0,column:0};t.fail(e.message,l)}},b=function(){this.Parser=p};exports.errors={__proto__:null,INCOMPLETE_PARSE:"Incomplete parse.",SYNTAX_ERROR:"Syntax error at"},exports.gramParserPlugin=b,exports.toAST=function(e){return t().use(b).freeze().parse(e)};
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("unified")),s=e(require("nearley")),r=e(require("moo")),n=require("@gram-data/gram-builder"),o=require("@gram-data/gram-ast");function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e}).apply(this,arguments)}function i(e){return e[0]}var l=r.compile({whitespace:{match:/\s+/,lineBreaks:!0},lineComment:{match:/\/\/.*?\n?$/},hexadecimal:o.tokens.hexadecimal,octal:o.tokens.octal,measurement:o.tokens.measurement,decimal:o.tokens.decimal,integer:o.tokens.integer,taggedString:{match:o.tokens.taggedString},boolean:["true","TRUE","True","false","FALSE","False"],symbol:o.tokens.symbol,identifier:o.tokens.identifier,doubleQuotedString:{match:o.tokens.doubleQuotedString,value:function(e){return e.slice(1,-1)}},singleQuotedString:{match:o.tokens.singleQuotedString,value:function(e){return e.slice(1,-1)}},tickedString:{match:o.tokens.tickedString,value:function(e){return e.slice(1,-1)}},"--\x3e":"--\x3e","--":"--","<--":"<--","-[]->":"-[]->","-[]-":"-[]-","<-[]-":"<-[]-","<-[":"<-[","]->":"]->","-[":"-[","]-":"]-","{":"{","}":"}","[":"[","]":"]","(":"(",")":")",",":",",":":":","`":"`","'":"'","ø":"ø"}),u=function(){return null},m=function(e){return e[0].text},c={Lexer:l,ParserRules:[{name:"GramSeq$ebnf$1$subexpression$1",symbols:["Path","_"],postprocess:function(e){return e[0]}},{name:"GramSeq$ebnf$1",symbols:["GramSeq$ebnf$1$subexpression$1"]},{name:"GramSeq$ebnf$1$subexpression$2",symbols:["Path","_"],postprocess:function(e){return e[0]}},{name:"GramSeq$ebnf$1",symbols:["GramSeq$ebnf$1","GramSeq$ebnf$1$subexpression$2"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"GramSeq$ebnf$2",symbols:["EOL"],postprocess:i},{name:"GramSeq$ebnf$2",symbols:[],postprocess:function(){return null}},{name:"GramSeq",symbols:["GramSeq$ebnf$1","GramSeq$ebnf$2"],postprocess:function(e){return n.builder.seq(n.builder.flatten(e[0]))}},{name:"Path",symbols:["NodePattern"],postprocess:i},{name:"Path",symbols:["PathComposition"],postprocess:i},{name:"Path",symbols:["PathPair"],postprocess:i},{name:"NodePattern",symbols:["Node","_","Edge","_","NodePattern"],postprocess:function(e){var t=e[2];return n.builder.cons([e[0],e[4]],{kind:t.kind,id:t.id,labels:t.labels,record:t.record})}},{name:"NodePattern",symbols:["Node"],postprocess:i},{name:"Node",symbols:[{literal:"("},"_","Attributes","_",{literal:")"}],postprocess:function(e){var t=e[2];return n.builder.node(t.id,t.labels,t.record)}},{name:"Edge",symbols:[{literal:"-["},"_","Attributes",{literal:"]->"}],postprocess:function(e){return a({kind:"right"},e[2])}},{name:"Edge",symbols:[{literal:"-["},"_","Attributes",{literal:"]-"}],postprocess:function(e){return a({kind:"either"},e[2])}},{name:"Edge",symbols:[{literal:"<-["},"_","Attributes",{literal:"]-"}],postprocess:function(e){return a({kind:"left"},e[2])}},{name:"Edge",symbols:[{literal:"-[]->"}],postprocess:function(){return{kind:"right"}}},{name:"Edge",symbols:[{literal:"-[]-"}],postprocess:function(){return{kind:"either"}}},{name:"Edge",symbols:[{literal:"<-[]-"}],postprocess:function(){return{kind:"left"}}},{name:"Edge",symbols:[{literal:"--\x3e"}],postprocess:function(){return{kind:"right"}}},{name:"Edge",symbols:[{literal:"--"}],postprocess:function(){return{kind:"either"}}},{name:"Edge",symbols:[{literal:"<--"}],postprocess:function(){return{kind:"left"}}},{name:"PathComposition",symbols:["PathPoint"],postprocess:i},{name:"PathComposition",symbols:["PathAnnotation"],postprocess:i},{name:"PathComposition",symbols:["PathExpression"],postprocess:i},{name:"PathPoint",symbols:[{literal:"["},"_","Attributes","_",{literal:"]"}],postprocess:function(e){var t=e[2];return(t.id||t.labels||t.record)&&"ø"!==t.id?n.builder.node(t.id,t.labels,t.record):n.builder.empty()}},{name:"PathAnnotation",symbols:[{literal:"["},"_","Attributes","_","Path",{literal:"]"}],postprocess:function(e){var t=e[2];return n.builder.cons([e[4]],{id:t.id,labels:t.labels,record:t.record})}},{name:"PathExpression$ebnf$1",symbols:["Kind"],postprocess:i},{name:"PathExpression$ebnf$1",symbols:[],postprocess:function(){return null}},{name:"PathExpression",symbols:[{literal:"["},"_","Attributes","_","PathExpression$ebnf$1","_","Path","_","Path","_",{literal:"]"}],postprocess:function(e){var t=e[2];return n.builder.cons([e[6],e[8]],{kind:e[4],id:t.id,labels:t.labels,record:t.record})}},{name:"PathPair$subexpression$1",symbols:["NodePattern"]},{name:"PathPair$subexpression$1",symbols:["PathComposition"]},{name:"PathPair",symbols:["PathPair$subexpression$1","_",{literal:","},"_","Path"],postprocess:function(e){return n.builder.pair([e[0][0],e[4]])}},{name:"Kind",symbols:[{literal:","}],postprocess:function(){return"pair"}},{name:"Kind",symbols:[{literal:"--\x3e"}],postprocess:function(){return"right"}},{name:"Kind",symbols:[{literal:"--"}],postprocess:function(){return"either"}},{name:"Kind",symbols:[{literal:"<--"}],postprocess:function(){return"left"}},{name:"Attributes$ebnf$1",symbols:["Identity"],postprocess:i},{name:"Attributes$ebnf$1",symbols:[],postprocess:function(){return null}},{name:"Attributes$ebnf$2$subexpression$1",symbols:["_","LabelList"],postprocess:function(e){return e[1]}},{name:"Attributes$ebnf$2",symbols:["Attributes$ebnf$2$subexpression$1"],postprocess:i},{name:"Attributes$ebnf$2",symbols:[],postprocess:function(){return null}},{name:"Attributes$ebnf$3$subexpression$1",symbols:["_","Record"],postprocess:function(e){return e[1]}},{name:"Attributes$ebnf$3",symbols:["Attributes$ebnf$3$subexpression$1"],postprocess:i},{name:"Attributes$ebnf$3",symbols:[],postprocess:function(){return null}},{name:"Attributes",symbols:["Attributes$ebnf$1","Attributes$ebnf$2","Attributes$ebnf$3"],postprocess:function(e){return{id:e[0],labels:e[1],record:e[2]}}},{name:"LabelList$ebnf$1",symbols:["Label"]},{name:"LabelList$ebnf$1",symbols:["LabelList$ebnf$1","Label"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"LabelList",symbols:["LabelList$ebnf$1"],postprocess:function(e){return e[0]}},{name:"Label",symbols:[{literal:":"},"Symbol"],postprocess:function(e){return e[1]}},{name:"Identity",symbols:[l.has("identifier")?{type:"identifier"}:identifier],postprocess:m},{name:"Identity",symbols:[{literal:"ø"}],postprocess:m},{name:"Identity",symbols:[l.has("symbol")?{type:"symbol"}:symbol],postprocess:m},{name:"Identity",symbols:[l.has("integer")?{type:"integer"}:integer],postprocess:m},{name:"Identity",symbols:[l.has("octal")?{type:"octal"}:octal],postprocess:m},{name:"Identity",symbols:[l.has("hexadecimal")?{type:"hexadecimal"}:hexadecimal],postprocess:m},{name:"Identity",symbols:[l.has("measurement")?{type:"measurement"}:measurement],postprocess:m},{name:"Identity",symbols:[l.has("tickedString")?{type:"tickedString"}:tickedString],postprocess:function(e){return e[0].text.slice(1,-1)}},{name:"Symbol",symbols:[l.has("symbol")?{type:"symbol"}:symbol],postprocess:m},{name:"Symbol",symbols:[l.has("tickedString")?{type:"tickedString"}:tickedString],postprocess:function(e){return e[0].text.slice(1,-1)}},{name:"Record",symbols:[{literal:"{"},"_",{literal:"}"}],postprocess:u},{name:"Record$ebnf$1",symbols:[]},{name:"Record$ebnf$1$subexpression$1",symbols:["_",{literal:","},"_","Property"]},{name:"Record$ebnf$1",symbols:["Record$ebnf$1","Record$ebnf$1$subexpression$1"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"Record",symbols:[{literal:"{"},"_","Property","Record$ebnf$1","_",{literal:"}"}],postprocess:function(e){return[e[2]].concat(e[3].map((function(e){return e[3]})))}},{name:"Property",symbols:["Symbol","_",{literal:":"},"_","Value"],postprocess:function(e){return n.builder.property(e[0],e[4])}},{name:"Value",symbols:["StringLiteral"],postprocess:i},{name:"Value",symbols:["NumericLiteral"],postprocess:i},{name:"Value",symbols:[l.has("boolean")?{type:"boolean"}:boolean],postprocess:function(e){return n.builder.boolean(JSON.parse(e[0].value.toLowerCase()))}},{name:"Value$ebnf$1",symbols:[]},{name:"Value$ebnf$1$subexpression$1",symbols:["_",{literal:","},"_","Value"]},{name:"Value$ebnf$1",symbols:["Value$ebnf$1","Value$ebnf$1$subexpression$1"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"Value",symbols:[{literal:"["},"_","Value","Value$ebnf$1",{literal:"]"}],postprocess:function(e){return[e[2]].concat(e[3].map((function(e){return e[3]})))}},{name:"StringLiteral",symbols:[l.has("singleQuotedString")?{type:"singleQuotedString"}:singleQuotedString],postprocess:function(e){return n.builder.string(e[0].value)}},{name:"StringLiteral",symbols:[l.has("doubleQuotedString")?{type:"doubleQuotedString"}:doubleQuotedString],postprocess:function(e){return n.builder.string(e[0].value)}},{name:"StringLiteral",symbols:[l.has("tickedString")?{type:"tickedString"}:tickedString],postprocess:function(e){return n.builder.string(e[0].value)}},{name:"StringLiteral",symbols:[l.has("taggedString")?{type:"taggedString"}:taggedString],postprocess:function(e){var t=function(e){var t=e.match(/([^`]+)`(.+)`$/);if(null==t)throw Error("Malformed tagged string: "+e);return{tag:t[1],value:t[2]}}(e[0].value);return n.builder.tagged(t.tag,t.value)}},{name:"NumericLiteral",symbols:[l.has("integer")?{type:"integer"}:integer],postprocess:function(e){return n.builder.integer(e[0].value)}},{name:"NumericLiteral",symbols:[l.has("decimal")?{type:"decimal"}:decimal],postprocess:function(e){return n.builder.decimal(e[0].value)}},{name:"NumericLiteral",symbols:[l.has("hexadecimal")?{type:"hexadecimal"}:hexadecimal],postprocess:function(e){return n.builder.hexadecimal(e[0].value)}},{name:"NumericLiteral",symbols:[l.has("octal")?{type:"octal"}:octal],postprocess:function(e){return n.builder.octal(e[0].value)}},{name:"NumericLiteral",symbols:[l.has("measurement")?{type:"measurement"}:measurement],postprocess:function(e){var t=function(e){var t=e.match(/(-?[0-9.]+)([a-zA-Z]+)/);if(null==t)throw Error("Malformed measurement : "+e);return{value:t[1],unit:t[2]}}(e[0].value);return n.builder.measurement(t.unit,t.value)}},{name:"_",symbols:[]},{name:"_",symbols:[l.has("whitespace")?{type:"whitespace"}:whitespace],postprocess:u},{name:"Comment",symbols:[l.has("lineComment")?{type:"lineComment"}:lineComment],postprocess:u},{name:"EOL",symbols:[{literal:"\n"}],postprocess:u}],ParserStart:"GramSeq"},p=function(e,t){var r,n,o=new s.Parser(s.Grammar.fromCompiled(c));try{var a=o.feed(e);if(void 0===a.results[0]&&a.lexerState){var i={line:(n=a.lexerState).line,column:n.col};t.fail("Incomplete parse.",i)}return a.results.length>1&&t.info("[WARN] parsing is ambiguous"),a.results[0]||{type:"error"}}catch(e){var l=e.token?{line:(r=e.token).line,column:r.col}:{line:0,column:0};t.fail(e.message,l)}},b=function(){this.Parser=p};exports.errors={__proto__:null,INCOMPLETE_PARSE:"Incomplete parse.",SYNTAX_ERROR:"Syntax error at"},exports.gramParserPlugin=b,exports.toAST=function(e){return t().use(b).freeze().parse(e)};
//# sourceMappingURL=gram-parse.cjs.production.min.js.map

@@ -482,4 +482,4 @@ import unified from 'unified';

var id = _ref16[0],
labels = _ref16[2],
record = _ref16[4];
labels = _ref16[1],
record = _ref16[2];
return {

@@ -486,0 +486,0 @@ id: id,

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((t=t||self).gram=t.gram||{},t.gram.parse={}))}(this,(function(t){"use strict";var e=function(t){if(t)throw t},n=function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},r=Object.prototype.hasOwnProperty,o=Object.prototype.toString,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===o.call(t)},l=function(t){if(!t||"[object Object]"!==o.call(t))return!1;var e,n=r.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&r.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;for(e in t);return void 0===e||r.call(t,e)},u=function(t,e){i&&"__proto__"===e.name?i(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},c=function(t,e){if("__proto__"===e){if(!r.call(t,e))return;if(s)return s(t,e).value}return t[e]},f=function t(){var e,n,r,o,i,s,f=arguments[0],p=1,h=arguments.length,m=!1;for("boolean"==typeof f&&(m=f,f=arguments[1]||{},p=2),(null==f||"object"!=typeof f&&"function"!=typeof f)&&(f={});p<h;++p)if(null!=(e=arguments[p]))for(n in e)r=c(f,n),f!==(o=c(e,n))&&(m&&o&&(l(o)||(i=a(o)))?(i?(i=!1,s=r&&a(r)?r:[]):s=r&&l(r)?r:{},u(f,{name:n,newValue:t(m,s,o)})):void 0!==o&&u(f,{name:n,newValue:o}));return f},p=t=>{if("[object Object]"!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype},h=[].slice,m=function(t,e){var n;return function(){var e,i=h.call(arguments,0),s=t.length>i.length;s&&i.push(r);try{e=t.apply(null,i)}catch(t){if(s&&n)throw t;return r(t)}s||(e&&"function"==typeof e.then?e.then(o,r):e instanceof Error?r(e):o(e))};function r(){n||(n=!0,e.apply(null,arguments))}function o(t){r(null,t)}},d=b;b.wrap=m;var y=[].slice;function b(){var t=[],e={run:function(){var e=-1,n=y.call(arguments,0,-1),r=arguments[arguments.length-1];if("function"!=typeof r)throw new Error("Expected function as last argument, not "+r);function o(i){var s=t[++e],a=y.call(arguments,0),l=a.slice(1),u=n.length,c=-1;if(i)r(i);else{for(;++c<u;)null==l[c]&&(l[c]=n[c]);n=l,s?m(s,o).apply(null,n):r.apply(null,[null].concat(n))}}o.apply(null,[null].concat(n))},use:function(n){if("function"!=typeof n)throw new Error("Expected `fn` to be a function, not "+n);return t.push(n),e}};return e}var g={}.hasOwnProperty,v=function(t){return t&&"object"==typeof t?g.call(t,"position")||g.call(t,"type")?x(t.position):g.call(t,"start")||g.call(t,"end")?x(t):g.call(t,"line")||g.call(t,"column")?w(t):"":""};function w(t){return t&&"object"==typeof t||(t={}),S(t.line)+":"+S(t.column)}function x(t){return t&&"object"==typeof t||(t={}),w(t.start)+"-"+w(t.end)}function S(t){return t&&"number"==typeof t?t:1}var k=P;function $(){}$.prototype=Error.prototype;var E=P.prototype=new $;function P(t,e,n){var r,o,i;"string"==typeof e&&(n=e,e=null),r=function(t){var e,n=[null,null];return"string"==typeof t&&(-1===(e=t.indexOf(":"))?n[1]=t:(n[0]=t.slice(0,e),n[1]=t.slice(e+1))),n}(n),o=v(e)||"1:1",i={start:{line:null,column:null},end:{line:null,column:null}},e&&e.position&&(e=e.position),e&&(e.start?(i=e,e=e.start):i.start=e),t.stack&&(this.stack=t.stack,t=t.message),this.message=t,this.name=o,this.reason=t,this.line=e?e.line:null,this.column=e?e.column:null,this.location=i,this.source=r[0],this.ruleId=r[1]}E.file="",E.name="",E.reason="",E.message="",E.stack="",E.fatal=null,E.column=null,E.line=null;var _="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function O(t,e){for(var n=0,r=t.length-1;r>=0;r--){var o=t[r];"."===o?t.splice(r,1):".."===o?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}"function"==typeof _.setTimeout&&setTimeout,"function"==typeof _.clearTimeout&&clearTimeout,new Date;var A=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,j=function(t){return A.exec(t).slice(1)};function T(){for(var t="",e=!1,n=arguments.length-1;n>=-1&&!e;n--){var r=n>=0?arguments[n]:"/";if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(t=r+"/"+t,e="/"===r.charAt(0))}return(e?"/":"")+(t=O(M(t.split("/"),(function(t){return!!t})),!e).join("/"))||"."}function C(t){var e=L(t),n="/"===V(t,-1);return(t=O(M(t.split("/"),(function(t){return!!t})),!e).join("/"))||e||(t="."),t&&n&&(t+="/"),(e?"/":"")+t}function L(t){return"/"===t.charAt(0)}function R(){var t=Array.prototype.slice.call(arguments,0);return C(M(t,(function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t})).join("/"))}function q(t,e){function n(t){for(var e=0;e<t.length&&""===t[e];e++);for(var n=t.length-1;n>=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=T(t).substr(1),e=T(e).substr(1);for(var r=n(t.split("/")),o=n(e.split("/")),i=Math.min(r.length,o.length),s=i,a=0;a<i;a++)if(r[a]!==o[a]){s=a;break}var l=[];for(a=s;a<r.length;a++)l.push("..");return(l=l.concat(o.slice(s))).join("/")}function N(t){var e=j(t),n=e[0],r=e[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."}function I(t,e){var n=j(t)[2];return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),n}function G(t){return j(t)[3]}var B={extname:G,basename:I,dirname:N,sep:"/",delimiter:":",relative:q,join:R,isAbsolute:L,normalize:C,resolve:T};function M(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r<t.length;r++)e(t[r],r,t)&&n.push(t[r]);return n}var V="b"==="ab".substr(-1)?function(t,e,n){return t.substr(e,n)}:function(t,e,n){return e<0&&(e=t.length+e),t.substr(e,n)},z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function F(t,e){return t(e={exports:{}},e.exports),e.exports}var U,Q=(U={__proto__:null,resolve:T,normalize:C,isAbsolute:L,join:R,relative:q,sep:"/",delimiter:":",dirname:N,basename:I,extname:G,default:B})&&U.default||U,D=K,H={}.hasOwnProperty,J=K.prototype,Z=["history","path","basename","stem","extname","dirname"];function K(t){var e,r,o;if(t){if("string"==typeof t||n(t))t={contents:t};else if("message"in t&&"messages"in t)return t}else t={};if(!(this instanceof K))return new K(t);for(this.data={},this.messages=[],this.history=[],this.cwd="/",r=-1,o=Z.length;++r<o;)H.call(t,e=Z[r])&&(this[e]=t[e]);for(e in t)-1===Z.indexOf(e)&&(this[e]=t[e])}function Y(t,e){if(-1!==t.indexOf(Q.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+Q.sep+"`")}function W(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function X(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}J.toString=function(t){var e=this.contents||"";return n(e)?e.toString(t):String(e)},Object.defineProperty(J,"path",{get:function(){return this.history[this.history.length-1]},set:function(t){W(t,"path"),t!==this.path&&this.history.push(t)}}),Object.defineProperty(J,"dirname",{get:function(){return"string"==typeof this.path?Q.dirname(this.path):void 0},set:function(t){X(this.path,"dirname"),this.path=Q.join(t||"",this.basename)}}),Object.defineProperty(J,"basename",{get:function(){return"string"==typeof this.path?Q.basename(this.path):void 0},set:function(t){W(t,"basename"),Y(t,"basename"),this.path=Q.join(this.dirname||"",t)}}),Object.defineProperty(J,"extname",{get:function(){return"string"==typeof this.path?Q.extname(this.path):void 0},set:function(t){var e=t||"";if(Y(e,"extname"),X(this.path,"extname"),e){if("."!==e.charAt(0))throw new Error("`extname` must start with `.`");if(-1!==e.indexOf(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=function(t,e){if("string"!=typeof t)return t;if(0===t.length)return t;var n=Q.basename(t,Q.extname(t))+e;return Q.join(Q.dirname(t),n)}(this.path,e)}}),Object.defineProperty(J,"stem",{get:function(){return"string"==typeof this.path?Q.basename(this.path,this.extname):void 0},set:function(t){W(t,"stem"),Y(t,"stem"),this.path=Q.join(this.dirname||"",t+(this.extname||""))}});var tt=D,et=D.prototype;et.message=function(t,e,n){var r=this.path,o=new k(t,e,n);return r&&(o.name=r+":"+o.name,o.file=r),o.fatal=!1,this.messages.push(o),o},et.info=function(){var t=this.message.apply(this,arguments);return t.fatal=null,t},et.fail=function(){var t=this.message.apply(this,arguments);throw t.fatal=!0,t};var nt=function t(){var n=[],r=d(),o={},i=!1,s=-1;return a.data=function(t,e){return"string"==typeof t?2===arguments.length?(ut("data",i),o[t]=e,a):ot.call(o,t)&&o[t]||null:t?(ut("data",i),o=t,a):o},a.freeze=l,a.attachers=n,a.use=function(t){var e;if(ut("use",i),null==t);else if("function"==typeof t)c.apply(null,arguments);else{if("object"!=typeof t)throw new Error("Expected usable value, not `"+t+"`");"length"in t?l(t):r(t)}return e&&(o.settings=f(o.settings||{},e)),a;function r(t){l(t.plugins),t.settings&&(e=f(e||{},t.settings))}function s(t){if("function"==typeof t)c(t);else{if("object"!=typeof t)throw new Error("Expected usable value, not `"+t+"`");"length"in t?c.apply(null,t):r(t)}}function l(t){var e,n;if(null==t);else{if("object"!=typeof t||!("length"in t))throw new Error("Expected a list of plugins, not `"+t+"`");for(e=t.length,n=-1;++n<e;)s(t[n])}}function c(t,e){var r=u(t);r?(p(r[1])&&p(e)&&(e=f(r[1],e)),r[1]=e):n.push(rt.call(arguments))}},a.parse=function(t){var e,n=tt(t);return l(),at("parse",e=a.Parser),st(e,"parse")?new e(String(n),n).parse():e(String(n),n)},a.stringify=function(t,e){var n,r=tt(e);return l(),lt("stringify",n=a.Compiler),ct(t),st(n,"compile")?new n(t,r).compile():n(t,r)},a.run=c,a.runSync=function(t,n){var r,o=!1;return c(t,n,(function(t,n){o=!0,e(t),r=n})),ft("runSync","run",o),r},a.process=h,a.processSync=function(t){var n,r=!1;return l(),at("processSync",a.Parser),lt("processSync",a.Compiler),h(n=tt(t),(function(t){r=!0,e(t)})),ft("processSync","process",r),n},a;function a(){for(var e=t(),r=n.length,i=-1;++i<r;)e.use.apply(null,n[i]);return e.data(f(!0,{},o)),e}function l(){var t,e,o,l;if(i)return a;for(;++s<n.length;)e=(t=n[s])[0],!1!==(o=t[1])&&(!0===o&&(t[1]=void 0),"function"==typeof(l=e.apply(a,t.slice(1)))&&r.use(l));return i=!0,s=Infinity,a}function u(t){for(var e,r=n.length,o=-1;++o<r;)if((e=n[o])[0]===t)return e}function c(t,e,n){if(ct(t),l(),n||"function"!=typeof e||(n=e,e=null),!n)return new Promise(o);function o(o,i){r.run(t,tt(e),(function(e,r,s){r=r||t,e?i(e):o?o(r):n(null,r,s)}))}o(null,n)}function h(t,e){if(l(),at("process",a.Parser),lt("process",a.Compiler),!e)return new Promise(n);function n(n,r){var o=tt(t);it.run(a,{file:o},(function(t){t?r(t):n?n(o):e(null,o)}))}n(null,e)}}().freeze(),rt=[].slice,ot={}.hasOwnProperty,it=d().use((function(t,e){e.tree=t.parse(e.file)})).use((function(t,e,n){t.run(e.tree,e.file,(function(t,r,o){t?n(t):(e.tree=r,e.file=o,n())}))})).use((function(t,e){var r=t.stringify(e.tree,e.file),o=e.file;null==r||("string"==typeof r||n(r)?o.contents=r:o.result=r)}));function st(t,e){return"function"==typeof t&&t.prototype&&(function(t){var e;for(e in t)return!0;return!1}(t.prototype)||e in t.prototype)}function at(t,e){if("function"!=typeof e)throw new Error("Cannot `"+t+"` without `Parser`")}function lt(t,e){if("function"!=typeof e)throw new Error("Cannot `"+t+"` without `Compiler`")}function ut(t,e){if(e)throw new Error("Cannot invoke `"+t+"` on a frozen processor.\nCreate a new processor first, by invoking it: use `processor()` instead of `processor`.")}function ct(t){if(!t||"string"!=typeof t.type)throw new Error("Expected node, got `"+t+"`")}function ft(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}var pt=F((function(t){var e,n;e=z,n=function(){function t(e,n,r){return this.id=++t.highestId,this.name=e,this.symbols=n,this.postprocess=r,this}function e(t,e,n,r){this.rule=t,this.dot=e,this.reference=n,this.data=[],this.wantedBy=r,this.isComplete=this.dot===t.symbols.length}function n(t,e){this.grammar=t,this.index=e,this.states=[],this.wants={},this.scannable=[],this.completed={}}function r(t,e){this.rules=t,this.start=e||this.rules[0].name;var n=this.byName={};this.rules.forEach((function(t){n.hasOwnProperty(t.name)||(n[t.name]=[]),n[t.name].push(t)}))}function o(){this.reset("")}function i(t,e,i){if(t instanceof r){var s=t;i=e}else s=r.fromCompiled(t,e);for(var a in this.grammar=s,this.options={keepHistory:!1,lexer:s.lexer||new o},i||{})this.options[a]=i[a];this.lexer=this.options.lexer,this.lexerState=void 0;var l=new n(s,0);this.table=[l],l.wants[s.start]=[],l.predict(s.start),l.process(),this.current=0}function s(t){var e=typeof t;if("string"===e)return t;if("object"===e){if(t.literal)return JSON.stringify(t.literal);if(t instanceof RegExp)return t.toString();if(t.type)return"%"+t.type;if(t.test)return"<"+String(t.test)+">";throw new Error("Unknown symbol type: "+t)}}return t.highestId=0,t.prototype.toString=function(t){var e=void 0===t?this.symbols.map(s).join(" "):this.symbols.slice(0,t).map(s).join(" ")+" ● "+this.symbols.slice(t).map(s).join(" ");return this.name+" → "+e},e.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},e.prototype.nextState=function(t){var n=new e(this.rule,this.dot+1,this.reference,this.wantedBy);return n.left=this,n.right=t,n.isComplete&&(n.data=n.build(),n.right=void 0),n},e.prototype.build=function(){var t=[],e=this;do{t.push(e.right.data),e=e.left}while(e.left);return t.reverse(),t},e.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,i.fail))},n.prototype.process=function(t){for(var e=this.states,n=this.wants,r=this.completed,o=0;o<e.length;o++){var s=e[o];if(s.isComplete){if(s.finish(),s.data!==i.fail){for(var a=s.wantedBy,l=a.length;l--;)this.complete(a[l],s);s.reference===this.index&&(this.completed[u=s.rule.name]=this.completed[u]||[]).push(s)}}else{var u;if("string"!=typeof(u=s.rule.symbols[s.dot])){this.scannable.push(s);continue}if(n[u]){if(n[u].push(s),r.hasOwnProperty(u)){var c=r[u];for(l=0;l<c.length;l++)this.complete(s,c[l])}}else n[u]=[s],this.predict(u)}}},n.prototype.predict=function(t){for(var n=this.grammar.byName[t]||[],r=0;r<n.length;r++){var o=new e(n[r],0,this.index,this.wants[t]);this.states.push(o)}},n.prototype.complete=function(t,e){var n=t.nextState(e);this.states.push(n)},r.fromCompiled=function(e,n){var o=e.Lexer;e.ParserStart&&(n=e.ParserStart,e=e.ParserRules);var i=new r(e=e.map((function(e){return new t(e.name,e.symbols,e.postprocess)})),n);return i.lexer=o,i},o.prototype.reset=function(t,e){this.buffer=t,this.index=0,this.line=e?e.line:1,this.lastLineBreak=e?-e.col:0},o.prototype.next=function(){if(this.index<this.buffer.length){var t=this.buffer[this.index++];return"\n"===t&&(this.line+=1,this.lastLineBreak=this.index),{value:t}}},o.prototype.save=function(){return{line:this.line,col:this.index-this.lastLineBreak}},o.prototype.formatError=function(t,e){var n=this.buffer;if("string"==typeof n){var r=n.split("\n").slice(Math.max(0,this.line-5),this.line),o=n.indexOf("\n",this.index);-1===o&&(o=n.length);var i=this.index-this.lastLineBreak,s=String(this.line).length;return e+=" at line "+this.line+" col "+i+":\n\n",(e+=r.map((function(t,e){return a(this.line-r.length+e+1,s)+" "+t}),this).join("\n"))+"\n"+a("",s+i)+"^\n"}return e+" at index "+(this.index-1);function a(t,e){var n=String(t);return Array(e-n.length+1).join(" ")+n}},i.fail={},i.prototype.feed=function(t){var e,r=this.lexer;for(r.reset(t,this.lexerState);;){try{if(!(e=r.next()))break}catch(t){var i=new n(this.grammar,this.current+1);throw this.table.push(i),(l=new Error(this.reportLexerError(t))).offset=this.current,l.token=t.token,l}var s=this.table[this.current];this.options.keepHistory||delete this.table[this.current-1];var a=this.current+1;i=new n(this.grammar,a),this.table.push(i);for(var l,u=void 0!==e.text?e.text:e.value,c=r.constructor===o?e.value:e,f=s.scannable,p=f.length;p--;){var h=f[p],m=h.rule.symbols[h.dot];if(m.test?m.test(c):m.type?m.type===e.type:m.literal===u){var d=h.nextState({data:c,token:e,isToken:!0,reference:a-1});i.states.push(d)}}if(i.process(),0===i.states.length)throw(l=new Error(this.reportError(e))).offset=this.current,l.token=e,l;this.options.keepHistory&&(s.lexerState=r.save()),this.current++}return s&&(this.lexerState=r.save()),this.results=this.finish(),this},i.prototype.reportLexerError=function(t){var e,n,r=t.token;return r?(e="input "+JSON.stringify(r.text[0])+" (lexer error)",n=this.lexer.formatError(r,"Syntax error")):(e="input (lexer error)",n=t.message),this.reportErrorCommon(n,e)},i.prototype.reportError=function(t){var e=(t.type?t.type+" token: ":"")+JSON.stringify(void 0!==t.value?t.value:t),n=this.lexer.formatError(t,"Syntax error");return this.reportErrorCommon(n,e)},i.prototype.reportErrorCommon=function(t,e){var n=[];n.push(t);var r=this.table[this.table.length-2],o=r.states.filter((function(t){var e=t.rule.symbols[t.dot];return e&&"string"!=typeof e}));return 0===o.length?(n.push("Unexpected "+e+". I did not expect any more input. Here is the state of my parse table:\n"),this.displayStateStack(r.states,n)):(n.push("Unexpected "+e+". Instead, I was expecting to see one of the following:\n"),o.map((function(t){return this.buildFirstStateStack(t,[])||[t]}),this).forEach((function(t){var e=t[0],r=this.getSymbolDisplay(e.rule.symbols[e.dot]);n.push("A "+r+" based on:"),this.displayStateStack(t,n)}),this)),n.push(""),n.join("\n")},i.prototype.displayStateStack=function(t,e){for(var n,r=0,o=0;o<t.length;o++){var i=t[o],s=i.rule.toString(i.dot);s===n?r++:(r>0&&e.push(" ^ "+r+" more lines identical to this"),r=0,e.push(" "+s)),n=s}},i.prototype.getSymbolDisplay=function(t){return function(t){var e=typeof t;if("string"===e)return t;if("object"===e){if(t.literal)return JSON.stringify(t.literal);if(t instanceof RegExp)return"character matching "+t;if(t.type)return t.type+" token";if(t.test)return"token matching "+String(t.test);throw new Error("Unknown symbol type: "+t)}}(t)},i.prototype.buildFirstStateStack=function(t,e){if(-1!==e.indexOf(t))return null;if(0===t.wantedBy.length)return[t];var n=t.wantedBy[0],r=[t].concat(e),o=this.buildFirstStateStack(n,r);return null===o?null:[t].concat(o)},i.prototype.save=function(){var t=this.table[this.current];return t.lexerState=this.lexerState,t},i.prototype.restore=function(t){var e=t.index;this.current=e,this.table[e]=t,this.table.splice(e+1),this.lexerState=t.lexerState,this.results=this.finish()},i.prototype.rewind=function(t){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[t])},i.prototype.finish=function(){var t=[],e=this.grammar.start;return this.table[this.table.length-1].states.forEach((function(n){n.rule.name===e&&n.dot===n.rule.symbols.length&&0===n.reference&&n.data!==i.fail&&t.push(n)})),t.map((function(t){return t.data}))},{Parser:i,Grammar:r,Rule:t}},t.exports?t.exports=n():e.nearley=n()}));function ht(){return(ht=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var mt=F((function(t){var e,n;e=z,n=function(){var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n="boolean"==typeof(new RegExp).sticky;function r(t){return t&&"[object RegExp]"===e.call(t)}function o(t){return t&&"object"==typeof t&&!r(t)&&!Array.isArray(t)}function i(t){return t.length?"(?:"+t.map((function(t){return"(?:"+t+")"})).join("|")+")":"(?!)"}function s(t){if("string"==typeof t)return"(?:"+t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+")";if(r(t)){if(t.ignoreCase)throw new Error("RegExp /i flag not allowed");if(t.global)throw new Error("RegExp /g flag is implied");if(t.sticky)throw new Error("RegExp /y flag is implied");if(t.multiline)throw new Error("RegExp /m flag is implied");return t.source}throw new Error("Not a pattern: "+t)}function a(e,n){if(o(n)||(n={match:n}),n.include)throw new Error("Matching rules cannot also include states");var i={defaultType:e,lineBreaks:!!n.error||!!n.fallback,pop:!1,next:null,push:null,error:!1,fallback:!1,value:null,type:null,shouldThrow:!1};for(var s in n)t.call(n,s)&&(i[s]=n[s]);if("string"==typeof i.type&&e!==i.type)throw new Error("Type transform cannot be a string (type '"+i.type+"' for token '"+e+"')");var a=i.match;return i.match=Array.isArray(a)?a:a?[a]:[],i.match.sort((function(t,e){return r(t)&&r(e)?0:r(e)?-1:r(t)?1:e.length-t.length})),i}function l(t){return Array.isArray(t)?function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(r.include)for(var o=[].concat(r.include),i=0;i<o.length;i++)e.push({include:o[i]});else{if(!r.type)throw new Error("Rule has no type: "+JSON.stringify(r));e.push(a(r.type,r))}}return e}(t):function(t){for(var e=Object.getOwnPropertyNames(t),n=[],r=0;r<e.length;r++){var i=e[r],s=[].concat(t[i]);if("include"!==i){var l=[];s.forEach((function(t){o(t)?(l.length&&n.push(a(i,l)),n.push(a(i,t)),l=[]):l.push(t)})),l.length&&n.push(a(i,l))}else for(var u=0;u<s.length;u++)n.push({include:s[u]})}return n}(t)}var u=a("error",{lineBreaks:!0,shouldThrow:!0});function c(t,e){for(var o=null,a=Object.create(null),l=!0,c=null,f=[],p=[],h=0;h<t.length;h++)t[h].fallback&&(l=!1);for(h=0;h<t.length;h++){var m=t[h];if(m.include)throw new Error("Inheritance is not allowed in stateless lexers");if(m.error||m.fallback){if(o)throw!m.fallback==!o.fallback?new Error("Multiple "+(m.fallback?"fallback":"error")+" rules not allowed (for token '"+m.defaultType+"')"):new Error("fallback and error are mutually exclusive (for token '"+m.defaultType+"')");o=m}var d=m.match.slice();if(l)for(;d.length&&"string"==typeof d[0]&&1===d[0].length;)a[d.shift().charCodeAt(0)]=m;if(m.pop||m.push||m.next){if(!e)throw new Error("State-switching options are not allowed in stateless lexers (for token '"+m.defaultType+"')");if(m.fallback)throw new Error("State-switching options are not allowed on fallback tokens (for token '"+m.defaultType+"')")}if(0!==d.length){l=!1,f.push(m);for(var y=0;y<d.length;y++){var b=d[y];if(r(b))if(null===c)c=b.unicode;else if(c!==b.unicode&&!1===m.fallback)throw new Error("If one rule is /u then all must be")}var g=i(d.map(s)),v=new RegExp(g);if(v.test(""))throw new Error("RegExp matches empty string: "+v);if(new RegExp("|"+g).exec("").length-1>0)throw new Error("RegExp has capture groups: "+v+"\nUse (?: … ) instead");if(!m.lineBreaks&&v.test("\n"))throw new Error("Rule should declare lineBreaks: "+v);p.push("("+g+")")}}var w=o&&o.fallback,x=n&&!w?"ym":"gm",S=n||w?"":"|";return!0===c&&(x+="u"),{regexp:new RegExp(i(p)+S,x),groups:f,fast:a,error:o||u}}function f(t,e,n){var r=t&&(t.push||t.next);if(r&&!n[r])throw new Error("Missing state '"+r+"' (in token '"+t.defaultType+"' of state '"+e+"')");if(t&&t.pop&&1!=+t.pop)throw new Error("pop must be 1 (in token '"+t.defaultType+"' of state '"+e+"')")}var p=function(t,e){this.startState=e,this.states=t,this.buffer="",this.stack=[],this.reset()};p.prototype.reset=function(t,e){return this.buffer=t||"",this.index=0,this.line=e?e.line:1,this.col=e?e.col:1,this.queuedToken=e?e.queuedToken:null,this.queuedThrow=e?e.queuedThrow:null,this.setState(e?e.state:this.startState),this.stack=e&&e.stack?e.stack.slice():[],this},p.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedThrow:this.queuedThrow}},p.prototype.setState=function(t){if(t&&this.state!==t){this.state=t;var e=this.states[t];this.groups=e.groups,this.error=e.error,this.re=e.regexp,this.fast=e.fast}},p.prototype.popState=function(){this.setState(this.stack.pop())},p.prototype.pushState=function(t){this.stack.push(this.state),this.setState(t)};var h=n?function(t,e){return t.exec(e)}:function(t,e){var n=t.exec(e);return 0===n[0].length?null:n};function m(){return this.value}if(p.prototype._getGroup=function(t){for(var e=this.groups.length,n=0;n<e;n++)if(void 0!==t[n+1])return this.groups[n];throw new Error("Cannot find token type for matched text")},p.prototype.next=function(){var t=this.index;if(this.queuedGroup){var e=this._token(this.queuedGroup,this.queuedText,t);return this.queuedGroup=null,this.queuedText="",e}var n=this.buffer;if(t!==n.length){if(s=this.fast[n.charCodeAt(t)])return this._token(s,n.charAt(t),t);var r=this.re;r.lastIndex=t;var o=h(r,n),i=this.error;if(null==o)return this._token(i,n.slice(t,n.length),t);var s=this._getGroup(o),a=o[0];return i.fallback&&o.index!==t?(this.queuedGroup=s,this.queuedText=a,this._token(i,n.slice(t,o.index),t)):this._token(s,a,t)}},p.prototype._token=function(t,e,n){var r=0;if(t.lineBreaks){var o=/\n/g,i=1;if("\n"===e)r=1;else for(;o.exec(e);)r++,i=o.lastIndex}var s={type:"function"==typeof t.type&&t.type(e)||t.defaultType,value:"function"==typeof t.value?t.value(e):e,text:e,toString:m,offset:n,lineBreaks:r,line:this.line,col:this.col},a=e.length;if(this.index+=a,this.line+=r,0!==r?this.col=a-i+1:this.col+=a,t.shouldThrow)throw new Error(this.formatError(s,"invalid syntax"));return t.pop?this.popState():t.push?this.pushState(t.push):t.next&&this.setState(t.next),s},"undefined"!=typeof Symbol&&Symbol.iterator){var d=function(t){this.lexer=t};d.prototype.next=function(){var t=this.lexer.next();return{value:t,done:!t}},d.prototype[Symbol.iterator]=function(){return this},p.prototype[Symbol.iterator]=function(){return new d(this)}}return p.prototype.formatError=function(t,e){if(null==t){var n=this.buffer.slice(this.index);t={text:n,offset:this.index,lineBreaks:-1===n.indexOf("\n")?0:1,line:this.line,col:this.col}}var r=Math.max(0,t.offset-t.col+1),o=t.lineBreaks?t.text.indexOf("\n"):t.text.length,i=this.buffer.substring(r,t.offset+o);return e+=" at line "+t.line+" col "+t.col+":\n\n",(e+=" "+i+"\n")+" "+Array(t.col).join(" ")+"^"},p.prototype.clone=function(){return new p(this.states,this.state)},p.prototype.has=function(t){return!0},{compile:function(t){var e=c(l(t));return new p({start:e},"start")},states:function(t,e){var n=t.$all?l(t.$all):[];delete t.$all;var r=Object.getOwnPropertyNames(t);e||(e=r[0]);for(var o=Object.create(null),i=0;i<r.length;i++)o[v=r[i]]=l(t[v]).concat(n);for(i=0;i<r.length;i++)for(var s=o[v=r[i]],a=Object.create(null),u=0;u<s.length;u++){var h=s[u];if(h.include){var m=[u,1];if(h.include!==v&&!a[h.include]){a[h.include]=!0;var d=o[h.include];if(!d)throw new Error("Cannot include nonexistent state '"+h.include+"' (in state '"+v+"')");for(var y=0;y<d.length;y++){var b=d[y];-1===s.indexOf(b)&&m.push(b)}}s.splice.apply(s,m),u--}}var g=Object.create(null);for(i=0;i<r.length;i++){var v;g[v=r[i]]=c(o[v],!0)}for(i=0;i<r.length;i++){var w=r[i],x=g[w],S=x.groups;for(u=0;u<S.length;u++)f(S[u],w,g);var k=Object.getOwnPropertyNames(x.fast);for(u=0;u<k.length;u++)f(x.fast[k[u]],w,g)}return new p(g,e)},error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:function(t){for(var e=Object.create(null),n=Object.create(null),r=Object.getOwnPropertyNames(t),o=0;o<r.length;o++){var i=r[o],s=t[i];(Array.isArray(s)?s:[s]).forEach((function(t){if((n[t.length]=n[t.length]||[]).push(t),"string"!=typeof t)throw new Error("keyword must be string (in keyword '"+i+"')");e[t]=i}))}function a(t){return JSON.stringify(t)}var l="";for(var u in l+="switch (value.length) {\n",n)l+="case "+u+":\n",l+="switch (value) {\n",n[u].forEach((function(t){var n=e[t];l+="case "+a(t)+": return "+a(n)+"\n"})),l+="}\n";return l+="}\n",Function("value",l)}}},t.exports?t.exports=n():e.moo=n()})),dt=/[0-9a-zA-Z_@]+\b@*/,yt=new RegExp("^"+dt.source+"$"),bt={__proto__:null,boolean:/true|false|TRUE|FALSE\b(?!@)/,hexadecimal:/-?0x(?:[0-9a-fA-F]+)\b(?!@)/,octal:/-?0(?:[0-7]+)\b(?!@)/,measurement:/-?(?:[0-9]|[1-9][0-9]+)(?:\.[0-9]+)?[a-zA-Z]+\b(?!@)/,decimal:/-?(?:[0-9]|[1-9][0-9]+)\.[0-9]+(?:[eE][-+]?[0-9]+)?\b(?!@)/,integer:/-?(?:[0-9]|[1-9][0-9]+)(?:[eE][-+]?[0-9]+)?\b(?!@)/,taggedString:/[a-zA-Z][0-9a-zA-Z_@]*`(?:\\[`bfnrt/\\]|\\u[a-fA-F0-9]{4}|[^`\\])*`/,doubleQuotedString:/"(?:\\["bfnrt/\\]|\\u[a-fA-F0-9]{4}|[^"\\])*"/,singleQuotedString:/'(?:\\['bfnrt/\\]|\\u[a-fA-F0-9]{4}|[^'\\])*'/,tickedString:/`(?:\\[`bfnrt/\\]|\\u[a-fA-F0-9]{4}|[^`\\])*`/,symbol:/[a-zA-Z_][0-9a-zA-Z_]*\b(?!@)/,identifier:dt,isValidIdentifier:function(t){return t&&yt.test(t)}},gt=function(t){return!!t.type&&"path"===t.type},vt=function(t){return gt(t)&&"ø"===t.id},wt=function(t){return gt(t)&&t.children&&0===t.children.length&&"ø"!==t.id};function xt(){return(xt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function St(t){return Array.isArray(t)?t:t instanceof Function?St(t()):void 0===t?[]:[t]}var kt=function(t,e,n,r){return xt({type:"seq",id:e},n&&{labels:n},r&&{record:r},{children:St(t)})},$t=function(t,e){return void 0===t&&(t="pair"),e.length>1?e.slice(0,e.length-1).reduceRight((function(e,n){return Et([n,e],{kind:t})}),e[e.length-1]):e[0]},Et=function(t,e){void 0===e&&(e={});var n=xt({type:"path"},e.id&&{id:e.id},e.labels&&{labels:e.labels},e.record&&{record:e.record});if(void 0===t)return n.id&&"ø"!==n.id?(n.children=[],n):(n.children=void 0,Pt);if(0===t.length)return"ø"===n.id?Pt:(n.children=[],n);if(1===t.length){var r=t[0];return vt(r)?(n.children=[],n):(n.children=[r],n)}if(2===t.length){if(e.kind&&"pair"!==e.kind&&wt(t[0])&&wt(t[1]))return n.kind=e.kind,n.children=[t[0],t[1]],n;if(vt(t[0])&&vt(t[1]))return n.kind=e.kind,n.children=[],n;n.children=[t[0],t[1]]}return n.kind=e.kind||"pair",n},Pt={type:"path",id:"ø",labels:void 0,record:void 0,children:[]},_t=function(){return Pt},Ot=function(t,e,n){return xt({type:"path"},t&&{id:t},e&&{labels:e},n&&{record:n},{children:[]})},At=function(t,e,n,r,o){return xt({type:"path",id:n},r&&{labels:r},o&&{record:o},{kind:e,children:t})},jt=function(t,e,n,r){return xt({type:"path",kind:"pair",id:e},n&&{labels:n},r&&{record:r},{children:t})},Tt=function(t){return t.reduce((function(t,e){return t[e.name]=e.value,t}),{})},Ct=function(t){return Object.entries(t).reduce((function(t,e){return t.push(Lt(e[0],e[1])),t}),[])},Lt=function(t,e){return{type:"property",name:t,value:e}},Rt=function(t){return{type:"boolean",value:t?"true":"false"}},qt=function(t){return{type:"string",value:t}},Nt=function(t,e){return{type:"tagged",value:e,tag:t}},It=function(t){return{type:"integer",value:String(t)}},Gt=function(t){return{type:"decimal",value:String(t)}},Bt=function(t){return{type:"hexadecimal",value:"number"==typeof t?t.toString(16):t}},Mt=function(t){return{type:"octal",value:"number"==typeof t?t.toString(8):t}},Vt=function(t,e){return{type:"measurement",value:String(e),unit:t}},zt=function(t){return Nt("date",t instanceof Date?t.toISOString().slice(0,10):t)},Ft=function(t){return Nt("time",t instanceof Date?t.toTimeString():t)},Ut=function(t){return Nt("duration",t instanceof Date?"P"+(t.getUTCFullYear()-1970)+"Y"+t.getUTCMonth()+"M"+t.getUTCDate()+"DT"+t.getUTCHours()+"H"+t.getUTCMinutes()+"M"+t.getUTCMilliseconds()/1e3+"S":t)},Qt=function(t,e){return void 0===e&&(e=1),t.flat(e).filter((function(t){return null!==t}))},Dt={__proto__:null,seq:kt,listToPath:$t,cons:Et,empty:_t,node:Ot,edge:At,pair:jt,recordToMap:Tt,mapToRecord:Ct,pluck:function(t,e){return t.reduce((function(t,n){return n.name===e?n:t}))},property:Lt,boolean:Rt,string:qt,tagged:Nt,integer:It,decimal:Gt,hexadecimal:Bt,octal:Mt,measurement:Vt,year:function(t){return Nt("date",t instanceof Date?t.getFullYear().toString():t)},date:zt,dayOfMonth:function(t){return Nt("date",t instanceof Date?"--"+t.toISOString().slice(5,10):t)},time:Ft,duration:Ut,flatten:Qt,default:{seq:kt,empty:_t,cons:Et,pair:jt,listToPath:$t,node:Ot,edge:At,property:Lt,boolean:Rt,string:qt,tagged:Nt,integer:It,decimal:Gt,hexadecimal:Bt,octal:Mt,measurement:Vt,date:zt,time:Ft,duration:Ut,flatten:Qt,recordToMap:Tt,mapToRecord:Ct}};function Ht(t){return t[0]}var Jt=mt.compile({whitespace:{match:/\s+/,lineBreaks:!0},lineComment:{match:/\/\/.*?\n?$/},hexadecimal:bt.hexadecimal,octal:bt.octal,measurement:bt.measurement,decimal:bt.decimal,integer:bt.integer,taggedString:{match:bt.taggedString},boolean:["true","TRUE","True","false","FALSE","False"],symbol:bt.symbol,identifier:bt.identifier,doubleQuotedString:{match:bt.doubleQuotedString,value:function(t){return t.slice(1,-1)}},singleQuotedString:{match:bt.singleQuotedString,value:function(t){return t.slice(1,-1)}},tickedString:{match:bt.tickedString,value:function(t){return t.slice(1,-1)}},"--\x3e":"--\x3e","--":"--","<--":"<--","-[]->":"-[]->","-[]-":"-[]-","<-[]-":"<-[]-","<-[":"<-[","]->":"]->","-[":"-[","]-":"]-","{":"{","}":"}","[":"[","]":"]","(":"(",")":")",",":",",":":":","`":"`","'":"'","ø":"ø"}),Zt=function(){return null},Kt=function(t){return t[0].text},Yt={Lexer:Jt,ParserRules:[{name:"GramSeq$ebnf$1$subexpression$1",symbols:["Path","_"],postprocess:function(t){return t[0]}},{name:"GramSeq$ebnf$1",symbols:["GramSeq$ebnf$1$subexpression$1"]},{name:"GramSeq$ebnf$1$subexpression$2",symbols:["Path","_"],postprocess:function(t){return t[0]}},{name:"GramSeq$ebnf$1",symbols:["GramSeq$ebnf$1","GramSeq$ebnf$1$subexpression$2"],postprocess:function(t){return t[0].concat([t[1]])}},{name:"GramSeq$ebnf$2",symbols:["EOL"],postprocess:Ht},{name:"GramSeq$ebnf$2",symbols:[],postprocess:function(){return null}},{name:"GramSeq",symbols:["GramSeq$ebnf$1","GramSeq$ebnf$2"],postprocess:function(t){return Dt.seq(Dt.flatten(t[0]))}},{name:"Path",symbols:["NodePattern"],postprocess:Ht},{name:"Path",symbols:["PathComposition"],postprocess:Ht},{name:"Path",symbols:["PathPair"],postprocess:Ht},{name:"NodePattern",symbols:["Node","_","Edge","_","NodePattern"],postprocess:function(t){var e=t[2];return Dt.cons([t[0],t[4]],{kind:e.kind,id:e.id,labels:e.labels,record:e.record})}},{name:"NodePattern",symbols:["Node"],postprocess:Ht},{name:"Node",symbols:[{literal:"("},"_","Attributes","_",{literal:")"}],postprocess:function(t){var e=t[2];return Dt.node(e.id,e.labels,e.record)}},{name:"Edge",symbols:[{literal:"-["},"_","Attributes",{literal:"]->"}],postprocess:function(t){return ht({kind:"right"},t[2])}},{name:"Edge",symbols:[{literal:"-["},"_","Attributes",{literal:"]-"}],postprocess:function(t){return ht({kind:"either"},t[2])}},{name:"Edge",symbols:[{literal:"<-["},"_","Attributes",{literal:"]-"}],postprocess:function(t){return ht({kind:"left"},t[2])}},{name:"Edge",symbols:[{literal:"-[]->"}],postprocess:function(){return{kind:"right"}}},{name:"Edge",symbols:[{literal:"-[]-"}],postprocess:function(){return{kind:"either"}}},{name:"Edge",symbols:[{literal:"<-[]-"}],postprocess:function(){return{kind:"left"}}},{name:"Edge",symbols:[{literal:"--\x3e"}],postprocess:function(){return{kind:"right"}}},{name:"Edge",symbols:[{literal:"--"}],postprocess:function(){return{kind:"either"}}},{name:"Edge",symbols:[{literal:"<--"}],postprocess:function(){return{kind:"left"}}},{name:"PathComposition",symbols:["PathPoint"],postprocess:Ht},{name:"PathComposition",symbols:["PathAnnotation"],postprocess:Ht},{name:"PathComposition",symbols:["PathExpression"],postprocess:Ht},{name:"PathPoint",symbols:[{literal:"["},"_","Attributes","_",{literal:"]"}],postprocess:function(t){var e=t[2];return(e.id||e.labels||e.record)&&"ø"!==e.id?Dt.node(e.id,e.labels,e.record):Dt.empty()}},{name:"PathAnnotation",symbols:[{literal:"["},"_","Attributes","_","Path",{literal:"]"}],postprocess:function(t){var e=t[2];return Dt.cons([t[4]],{id:e.id,labels:e.labels,record:e.record})}},{name:"PathExpression$ebnf$1",symbols:["Kind"],postprocess:Ht},{name:"PathExpression$ebnf$1",symbols:[],postprocess:function(){return null}},{name:"PathExpression",symbols:[{literal:"["},"_","Attributes","_","PathExpression$ebnf$1","_","Path","_","Path","_",{literal:"]"}],postprocess:function(t){var e=t[2];return Dt.cons([t[6],t[8]],{kind:t[4],id:e.id,labels:e.labels,record:e.record})}},{name:"PathPair$subexpression$1",symbols:["NodePattern"]},{name:"PathPair$subexpression$1",symbols:["PathComposition"]},{name:"PathPair",symbols:["PathPair$subexpression$1","_",{literal:","},"_","Path"],postprocess:function(t){return Dt.pair([t[0][0],t[4]])}},{name:"Kind",symbols:[{literal:","}],postprocess:function(){return"pair"}},{name:"Kind",symbols:[{literal:"--\x3e"}],postprocess:function(){return"right"}},{name:"Kind",symbols:[{literal:"--"}],postprocess:function(){return"either"}},{name:"Kind",symbols:[{literal:"<--"}],postprocess:function(){return"left"}},{name:"Attributes$ebnf$1",symbols:["Identity"],postprocess:Ht},{name:"Attributes$ebnf$1",symbols:[],postprocess:function(){return null}},{name:"Attributes$ebnf$2$subexpression$1",symbols:["_","LabelList"],postprocess:function(t){return t[1]}},{name:"Attributes$ebnf$2",symbols:["Attributes$ebnf$2$subexpression$1"],postprocess:Ht},{name:"Attributes$ebnf$2",symbols:[],postprocess:function(){return null}},{name:"Attributes$ebnf$3$subexpression$1",symbols:["_","Record"],postprocess:function(t){return t[1]}},{name:"Attributes$ebnf$3",symbols:["Attributes$ebnf$3$subexpression$1"],postprocess:Ht},{name:"Attributes$ebnf$3",symbols:[],postprocess:function(){return null}},{name:"Attributes",symbols:["Attributes$ebnf$1","Attributes$ebnf$2","Attributes$ebnf$3"],postprocess:function(t){return{id:t[0],labels:t[2],record:t[4]}}},{name:"LabelList$ebnf$1",symbols:["Label"]},{name:"LabelList$ebnf$1",symbols:["LabelList$ebnf$1","Label"],postprocess:function(t){return t[0].concat([t[1]])}},{name:"LabelList",symbols:["LabelList$ebnf$1"],postprocess:function(t){return t[0]}},{name:"Label",symbols:[{literal:":"},"Symbol"],postprocess:function(t){return t[1]}},{name:"Identity",symbols:[Jt.has("identifier")?{type:"identifier"}:identifier],postprocess:Kt},{name:"Identity",symbols:[{literal:"ø"}],postprocess:Kt},{name:"Identity",symbols:[Jt.has("symbol")?{type:"symbol"}:symbol],postprocess:Kt},{name:"Identity",symbols:[Jt.has("integer")?{type:"integer"}:integer],postprocess:Kt},{name:"Identity",symbols:[Jt.has("octal")?{type:"octal"}:octal],postprocess:Kt},{name:"Identity",symbols:[Jt.has("hexadecimal")?{type:"hexadecimal"}:hexadecimal],postprocess:Kt},{name:"Identity",symbols:[Jt.has("measurement")?{type:"measurement"}:measurement],postprocess:Kt},{name:"Identity",symbols:[Jt.has("tickedString")?{type:"tickedString"}:tickedString],postprocess:function(t){return t[0].text.slice(1,-1)}},{name:"Symbol",symbols:[Jt.has("symbol")?{type:"symbol"}:symbol],postprocess:Kt},{name:"Symbol",symbols:[Jt.has("tickedString")?{type:"tickedString"}:tickedString],postprocess:function(t){return t[0].text.slice(1,-1)}},{name:"Record",symbols:[{literal:"{"},"_",{literal:"}"}],postprocess:Zt},{name:"Record$ebnf$1",symbols:[]},{name:"Record$ebnf$1$subexpression$1",symbols:["_",{literal:","},"_","Property"]},{name:"Record$ebnf$1",symbols:["Record$ebnf$1","Record$ebnf$1$subexpression$1"],postprocess:function(t){return t[0].concat([t[1]])}},{name:"Record",symbols:[{literal:"{"},"_","Property","Record$ebnf$1","_",{literal:"}"}],postprocess:function(t){return[t[2]].concat(t[3].map((function(t){return t[3]})))}},{name:"Property",symbols:["Symbol","_",{literal:":"},"_","Value"],postprocess:function(t){return Dt.property(t[0],t[4])}},{name:"Value",symbols:["StringLiteral"],postprocess:Ht},{name:"Value",symbols:["NumericLiteral"],postprocess:Ht},{name:"Value",symbols:[Jt.has("boolean")?{type:"boolean"}:boolean],postprocess:function(t){return Dt.boolean(JSON.parse(t[0].value.toLowerCase()))}},{name:"Value$ebnf$1",symbols:[]},{name:"Value$ebnf$1$subexpression$1",symbols:["_",{literal:","},"_","Value"]},{name:"Value$ebnf$1",symbols:["Value$ebnf$1","Value$ebnf$1$subexpression$1"],postprocess:function(t){return t[0].concat([t[1]])}},{name:"Value",symbols:[{literal:"["},"_","Value","Value$ebnf$1",{literal:"]"}],postprocess:function(t){return[t[2]].concat(t[3].map((function(t){return t[3]})))}},{name:"StringLiteral",symbols:[Jt.has("singleQuotedString")?{type:"singleQuotedString"}:singleQuotedString],postprocess:function(t){return Dt.string(t[0].value)}},{name:"StringLiteral",symbols:[Jt.has("doubleQuotedString")?{type:"doubleQuotedString"}:doubleQuotedString],postprocess:function(t){return Dt.string(t[0].value)}},{name:"StringLiteral",symbols:[Jt.has("tickedString")?{type:"tickedString"}:tickedString],postprocess:function(t){return Dt.string(t[0].value)}},{name:"StringLiteral",symbols:[Jt.has("taggedString")?{type:"taggedString"}:taggedString],postprocess:function(t){var e=function(t){var e=t.match(/([^`]+)`(.+)`$/);if(null==e)throw Error("Malformed tagged string: "+t);return{tag:e[1],value:e[2]}}(t[0].value);return Dt.tagged(e.tag,e.value)}},{name:"NumericLiteral",symbols:[Jt.has("integer")?{type:"integer"}:integer],postprocess:function(t){return Dt.integer(t[0].value)}},{name:"NumericLiteral",symbols:[Jt.has("decimal")?{type:"decimal"}:decimal],postprocess:function(t){return Dt.decimal(t[0].value)}},{name:"NumericLiteral",symbols:[Jt.has("hexadecimal")?{type:"hexadecimal"}:hexadecimal],postprocess:function(t){return Dt.hexadecimal(t[0].value)}},{name:"NumericLiteral",symbols:[Jt.has("octal")?{type:"octal"}:octal],postprocess:function(t){return Dt.octal(t[0].value)}},{name:"NumericLiteral",symbols:[Jt.has("measurement")?{type:"measurement"}:measurement],postprocess:function(t){var e=function(t){var e=t.match(/(-?[0-9.]+)([a-zA-Z]+)/);if(null==e)throw Error("Malformed measurement : "+t);return{value:e[1],unit:e[2]}}(t[0].value);return Dt.measurement(e.unit,e.value)}},{name:"_",symbols:[]},{name:"_",symbols:[Jt.has("whitespace")?{type:"whitespace"}:whitespace],postprocess:Zt},{name:"Comment",symbols:[Jt.has("lineComment")?{type:"lineComment"}:lineComment],postprocess:Zt},{name:"EOL",symbols:[{literal:"\n"}],postprocess:Zt}],ParserStart:"GramSeq"},Wt=function(t,e){var n,r,o=new pt.Parser(pt.Grammar.fromCompiled(Yt));try{var i=o.feed(t);if(void 0===i.results[0]&&i.lexerState){var s={line:(r=i.lexerState).line,column:r.col};e.fail("Incomplete parse.",s)}return i.results.length>1&&e.info("[WARN] parsing is ambiguous"),i.results[0]||{type:"error"}}catch(t){var a=t.token?{line:(n=t.token).line,column:n.col}:{line:0,column:0};e.fail(t.message,a)}},Xt=function(){this.Parser=Wt};t.errors={__proto__:null,INCOMPLETE_PARSE:"Incomplete parse.",SYNTAX_ERROR:"Syntax error at"},t.gramParserPlugin=Xt,t.toAST=function(t){return nt().use(Xt).freeze().parse(t)},Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((t=t||self).gram=t.gram||{},t.gram.parse={}))}(this,(function(t){"use strict";var e=function(t){if(t)throw t},n=function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},r=Object.prototype.hasOwnProperty,o=Object.prototype.toString,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===o.call(t)},l=function(t){if(!t||"[object Object]"!==o.call(t))return!1;var e,n=r.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&r.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;for(e in t);return void 0===e||r.call(t,e)},u=function(t,e){i&&"__proto__"===e.name?i(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},c=function(t,e){if("__proto__"===e){if(!r.call(t,e))return;if(s)return s(t,e).value}return t[e]},f=function t(){var e,n,r,o,i,s,f=arguments[0],p=1,h=arguments.length,m=!1;for("boolean"==typeof f&&(m=f,f=arguments[1]||{},p=2),(null==f||"object"!=typeof f&&"function"!=typeof f)&&(f={});p<h;++p)if(null!=(e=arguments[p]))for(n in e)r=c(f,n),f!==(o=c(e,n))&&(m&&o&&(l(o)||(i=a(o)))?(i?(i=!1,s=r&&a(r)?r:[]):s=r&&l(r)?r:{},u(f,{name:n,newValue:t(m,s,o)})):void 0!==o&&u(f,{name:n,newValue:o}));return f},p=t=>{if("[object Object]"!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype},h=[].slice,m=function(t,e){var n;return function(){var e,i=h.call(arguments,0),s=t.length>i.length;s&&i.push(r);try{e=t.apply(null,i)}catch(t){if(s&&n)throw t;return r(t)}s||(e&&"function"==typeof e.then?e.then(o,r):e instanceof Error?r(e):o(e))};function r(){n||(n=!0,e.apply(null,arguments))}function o(t){r(null,t)}},d=b;b.wrap=m;var y=[].slice;function b(){var t=[],e={run:function(){var e=-1,n=y.call(arguments,0,-1),r=arguments[arguments.length-1];if("function"!=typeof r)throw new Error("Expected function as last argument, not "+r);function o(i){var s=t[++e],a=y.call(arguments,0),l=a.slice(1),u=n.length,c=-1;if(i)r(i);else{for(;++c<u;)null==l[c]&&(l[c]=n[c]);n=l,s?m(s,o).apply(null,n):r.apply(null,[null].concat(n))}}o.apply(null,[null].concat(n))},use:function(n){if("function"!=typeof n)throw new Error("Expected `fn` to be a function, not "+n);return t.push(n),e}};return e}var g={}.hasOwnProperty,v=function(t){return t&&"object"==typeof t?g.call(t,"position")||g.call(t,"type")?x(t.position):g.call(t,"start")||g.call(t,"end")?x(t):g.call(t,"line")||g.call(t,"column")?w(t):"":""};function w(t){return t&&"object"==typeof t||(t={}),S(t.line)+":"+S(t.column)}function x(t){return t&&"object"==typeof t||(t={}),w(t.start)+"-"+w(t.end)}function S(t){return t&&"number"==typeof t?t:1}var k=P;function $(){}$.prototype=Error.prototype;var E=P.prototype=new $;function P(t,e,n){var r,o,i;"string"==typeof e&&(n=e,e=null),r=function(t){var e,n=[null,null];return"string"==typeof t&&(-1===(e=t.indexOf(":"))?n[1]=t:(n[0]=t.slice(0,e),n[1]=t.slice(e+1))),n}(n),o=v(e)||"1:1",i={start:{line:null,column:null},end:{line:null,column:null}},e&&e.position&&(e=e.position),e&&(e.start?(i=e,e=e.start):i.start=e),t.stack&&(this.stack=t.stack,t=t.message),this.message=t,this.name=o,this.reason=t,this.line=e?e.line:null,this.column=e?e.column:null,this.location=i,this.source=r[0],this.ruleId=r[1]}E.file="",E.name="",E.reason="",E.message="",E.stack="",E.fatal=null,E.column=null,E.line=null;var _="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function O(t,e){for(var n=0,r=t.length-1;r>=0;r--){var o=t[r];"."===o?t.splice(r,1):".."===o?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}"function"==typeof _.setTimeout&&setTimeout,"function"==typeof _.clearTimeout&&clearTimeout,new Date;var A=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,j=function(t){return A.exec(t).slice(1)};function T(){for(var t="",e=!1,n=arguments.length-1;n>=-1&&!e;n--){var r=n>=0?arguments[n]:"/";if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(t=r+"/"+t,e="/"===r.charAt(0))}return(e?"/":"")+(t=O(M(t.split("/"),(function(t){return!!t})),!e).join("/"))||"."}function C(t){var e=L(t),n="/"===V(t,-1);return(t=O(M(t.split("/"),(function(t){return!!t})),!e).join("/"))||e||(t="."),t&&n&&(t+="/"),(e?"/":"")+t}function L(t){return"/"===t.charAt(0)}function R(){var t=Array.prototype.slice.call(arguments,0);return C(M(t,(function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t})).join("/"))}function q(t,e){function n(t){for(var e=0;e<t.length&&""===t[e];e++);for(var n=t.length-1;n>=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=T(t).substr(1),e=T(e).substr(1);for(var r=n(t.split("/")),o=n(e.split("/")),i=Math.min(r.length,o.length),s=i,a=0;a<i;a++)if(r[a]!==o[a]){s=a;break}var l=[];for(a=s;a<r.length;a++)l.push("..");return(l=l.concat(o.slice(s))).join("/")}function N(t){var e=j(t),n=e[0],r=e[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."}function I(t,e){var n=j(t)[2];return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),n}function G(t){return j(t)[3]}var B={extname:G,basename:I,dirname:N,sep:"/",delimiter:":",relative:q,join:R,isAbsolute:L,normalize:C,resolve:T};function M(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r<t.length;r++)e(t[r],r,t)&&n.push(t[r]);return n}var V="b"==="ab".substr(-1)?function(t,e,n){return t.substr(e,n)}:function(t,e,n){return e<0&&(e=t.length+e),t.substr(e,n)},z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function F(t,e){return t(e={exports:{}},e.exports),e.exports}var U,Q=(U={__proto__:null,resolve:T,normalize:C,isAbsolute:L,join:R,relative:q,sep:"/",delimiter:":",dirname:N,basename:I,extname:G,default:B})&&U.default||U,D=K,H={}.hasOwnProperty,J=K.prototype,Z=["history","path","basename","stem","extname","dirname"];function K(t){var e,r,o;if(t){if("string"==typeof t||n(t))t={contents:t};else if("message"in t&&"messages"in t)return t}else t={};if(!(this instanceof K))return new K(t);for(this.data={},this.messages=[],this.history=[],this.cwd="/",r=-1,o=Z.length;++r<o;)H.call(t,e=Z[r])&&(this[e]=t[e]);for(e in t)-1===Z.indexOf(e)&&(this[e]=t[e])}function Y(t,e){if(-1!==t.indexOf(Q.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+Q.sep+"`")}function W(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function X(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}J.toString=function(t){var e=this.contents||"";return n(e)?e.toString(t):String(e)},Object.defineProperty(J,"path",{get:function(){return this.history[this.history.length-1]},set:function(t){W(t,"path"),t!==this.path&&this.history.push(t)}}),Object.defineProperty(J,"dirname",{get:function(){return"string"==typeof this.path?Q.dirname(this.path):void 0},set:function(t){X(this.path,"dirname"),this.path=Q.join(t||"",this.basename)}}),Object.defineProperty(J,"basename",{get:function(){return"string"==typeof this.path?Q.basename(this.path):void 0},set:function(t){W(t,"basename"),Y(t,"basename"),this.path=Q.join(this.dirname||"",t)}}),Object.defineProperty(J,"extname",{get:function(){return"string"==typeof this.path?Q.extname(this.path):void 0},set:function(t){var e=t||"";if(Y(e,"extname"),X(this.path,"extname"),e){if("."!==e.charAt(0))throw new Error("`extname` must start with `.`");if(-1!==e.indexOf(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=function(t,e){if("string"!=typeof t)return t;if(0===t.length)return t;var n=Q.basename(t,Q.extname(t))+e;return Q.join(Q.dirname(t),n)}(this.path,e)}}),Object.defineProperty(J,"stem",{get:function(){return"string"==typeof this.path?Q.basename(this.path,this.extname):void 0},set:function(t){W(t,"stem"),Y(t,"stem"),this.path=Q.join(this.dirname||"",t+(this.extname||""))}});var tt=D,et=D.prototype;et.message=function(t,e,n){var r=this.path,o=new k(t,e,n);return r&&(o.name=r+":"+o.name,o.file=r),o.fatal=!1,this.messages.push(o),o},et.info=function(){var t=this.message.apply(this,arguments);return t.fatal=null,t},et.fail=function(){var t=this.message.apply(this,arguments);throw t.fatal=!0,t};var nt=function t(){var n=[],r=d(),o={},i=!1,s=-1;return a.data=function(t,e){return"string"==typeof t?2===arguments.length?(ut("data",i),o[t]=e,a):ot.call(o,t)&&o[t]||null:t?(ut("data",i),o=t,a):o},a.freeze=l,a.attachers=n,a.use=function(t){var e;if(ut("use",i),null==t);else if("function"==typeof t)c.apply(null,arguments);else{if("object"!=typeof t)throw new Error("Expected usable value, not `"+t+"`");"length"in t?l(t):r(t)}return e&&(o.settings=f(o.settings||{},e)),a;function r(t){l(t.plugins),t.settings&&(e=f(e||{},t.settings))}function s(t){if("function"==typeof t)c(t);else{if("object"!=typeof t)throw new Error("Expected usable value, not `"+t+"`");"length"in t?c.apply(null,t):r(t)}}function l(t){var e,n;if(null==t);else{if("object"!=typeof t||!("length"in t))throw new Error("Expected a list of plugins, not `"+t+"`");for(e=t.length,n=-1;++n<e;)s(t[n])}}function c(t,e){var r=u(t);r?(p(r[1])&&p(e)&&(e=f(r[1],e)),r[1]=e):n.push(rt.call(arguments))}},a.parse=function(t){var e,n=tt(t);return l(),at("parse",e=a.Parser),st(e,"parse")?new e(String(n),n).parse():e(String(n),n)},a.stringify=function(t,e){var n,r=tt(e);return l(),lt("stringify",n=a.Compiler),ct(t),st(n,"compile")?new n(t,r).compile():n(t,r)},a.run=c,a.runSync=function(t,n){var r,o=!1;return c(t,n,(function(t,n){o=!0,e(t),r=n})),ft("runSync","run",o),r},a.process=h,a.processSync=function(t){var n,r=!1;return l(),at("processSync",a.Parser),lt("processSync",a.Compiler),h(n=tt(t),(function(t){r=!0,e(t)})),ft("processSync","process",r),n},a;function a(){for(var e=t(),r=n.length,i=-1;++i<r;)e.use.apply(null,n[i]);return e.data(f(!0,{},o)),e}function l(){var t,e,o,l;if(i)return a;for(;++s<n.length;)e=(t=n[s])[0],!1!==(o=t[1])&&(!0===o&&(t[1]=void 0),"function"==typeof(l=e.apply(a,t.slice(1)))&&r.use(l));return i=!0,s=Infinity,a}function u(t){for(var e,r=n.length,o=-1;++o<r;)if((e=n[o])[0]===t)return e}function c(t,e,n){if(ct(t),l(),n||"function"!=typeof e||(n=e,e=null),!n)return new Promise(o);function o(o,i){r.run(t,tt(e),(function(e,r,s){r=r||t,e?i(e):o?o(r):n(null,r,s)}))}o(null,n)}function h(t,e){if(l(),at("process",a.Parser),lt("process",a.Compiler),!e)return new Promise(n);function n(n,r){var o=tt(t);it.run(a,{file:o},(function(t){t?r(t):n?n(o):e(null,o)}))}n(null,e)}}().freeze(),rt=[].slice,ot={}.hasOwnProperty,it=d().use((function(t,e){e.tree=t.parse(e.file)})).use((function(t,e,n){t.run(e.tree,e.file,(function(t,r,o){t?n(t):(e.tree=r,e.file=o,n())}))})).use((function(t,e){var r=t.stringify(e.tree,e.file),o=e.file;null==r||("string"==typeof r||n(r)?o.contents=r:o.result=r)}));function st(t,e){return"function"==typeof t&&t.prototype&&(function(t){var e;for(e in t)return!0;return!1}(t.prototype)||e in t.prototype)}function at(t,e){if("function"!=typeof e)throw new Error("Cannot `"+t+"` without `Parser`")}function lt(t,e){if("function"!=typeof e)throw new Error("Cannot `"+t+"` without `Compiler`")}function ut(t,e){if(e)throw new Error("Cannot invoke `"+t+"` on a frozen processor.\nCreate a new processor first, by invoking it: use `processor()` instead of `processor`.")}function ct(t){if(!t||"string"!=typeof t.type)throw new Error("Expected node, got `"+t+"`")}function ft(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}var pt=F((function(t){var e,n;e=z,n=function(){function t(e,n,r){return this.id=++t.highestId,this.name=e,this.symbols=n,this.postprocess=r,this}function e(t,e,n,r){this.rule=t,this.dot=e,this.reference=n,this.data=[],this.wantedBy=r,this.isComplete=this.dot===t.symbols.length}function n(t,e){this.grammar=t,this.index=e,this.states=[],this.wants={},this.scannable=[],this.completed={}}function r(t,e){this.rules=t,this.start=e||this.rules[0].name;var n=this.byName={};this.rules.forEach((function(t){n.hasOwnProperty(t.name)||(n[t.name]=[]),n[t.name].push(t)}))}function o(){this.reset("")}function i(t,e,i){if(t instanceof r){var s=t;i=e}else s=r.fromCompiled(t,e);for(var a in this.grammar=s,this.options={keepHistory:!1,lexer:s.lexer||new o},i||{})this.options[a]=i[a];this.lexer=this.options.lexer,this.lexerState=void 0;var l=new n(s,0);this.table=[l],l.wants[s.start]=[],l.predict(s.start),l.process(),this.current=0}function s(t){var e=typeof t;if("string"===e)return t;if("object"===e){if(t.literal)return JSON.stringify(t.literal);if(t instanceof RegExp)return t.toString();if(t.type)return"%"+t.type;if(t.test)return"<"+String(t.test)+">";throw new Error("Unknown symbol type: "+t)}}return t.highestId=0,t.prototype.toString=function(t){var e=void 0===t?this.symbols.map(s).join(" "):this.symbols.slice(0,t).map(s).join(" ")+" ● "+this.symbols.slice(t).map(s).join(" ");return this.name+" → "+e},e.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},e.prototype.nextState=function(t){var n=new e(this.rule,this.dot+1,this.reference,this.wantedBy);return n.left=this,n.right=t,n.isComplete&&(n.data=n.build(),n.right=void 0),n},e.prototype.build=function(){var t=[],e=this;do{t.push(e.right.data),e=e.left}while(e.left);return t.reverse(),t},e.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,i.fail))},n.prototype.process=function(t){for(var e=this.states,n=this.wants,r=this.completed,o=0;o<e.length;o++){var s=e[o];if(s.isComplete){if(s.finish(),s.data!==i.fail){for(var a=s.wantedBy,l=a.length;l--;)this.complete(a[l],s);s.reference===this.index&&(this.completed[u=s.rule.name]=this.completed[u]||[]).push(s)}}else{var u;if("string"!=typeof(u=s.rule.symbols[s.dot])){this.scannable.push(s);continue}if(n[u]){if(n[u].push(s),r.hasOwnProperty(u)){var c=r[u];for(l=0;l<c.length;l++)this.complete(s,c[l])}}else n[u]=[s],this.predict(u)}}},n.prototype.predict=function(t){for(var n=this.grammar.byName[t]||[],r=0;r<n.length;r++){var o=new e(n[r],0,this.index,this.wants[t]);this.states.push(o)}},n.prototype.complete=function(t,e){var n=t.nextState(e);this.states.push(n)},r.fromCompiled=function(e,n){var o=e.Lexer;e.ParserStart&&(n=e.ParserStart,e=e.ParserRules);var i=new r(e=e.map((function(e){return new t(e.name,e.symbols,e.postprocess)})),n);return i.lexer=o,i},o.prototype.reset=function(t,e){this.buffer=t,this.index=0,this.line=e?e.line:1,this.lastLineBreak=e?-e.col:0},o.prototype.next=function(){if(this.index<this.buffer.length){var t=this.buffer[this.index++];return"\n"===t&&(this.line+=1,this.lastLineBreak=this.index),{value:t}}},o.prototype.save=function(){return{line:this.line,col:this.index-this.lastLineBreak}},o.prototype.formatError=function(t,e){var n=this.buffer;if("string"==typeof n){var r=n.split("\n").slice(Math.max(0,this.line-5),this.line),o=n.indexOf("\n",this.index);-1===o&&(o=n.length);var i=this.index-this.lastLineBreak,s=String(this.line).length;return e+=" at line "+this.line+" col "+i+":\n\n",(e+=r.map((function(t,e){return a(this.line-r.length+e+1,s)+" "+t}),this).join("\n"))+"\n"+a("",s+i)+"^\n"}return e+" at index "+(this.index-1);function a(t,e){var n=String(t);return Array(e-n.length+1).join(" ")+n}},i.fail={},i.prototype.feed=function(t){var e,r=this.lexer;for(r.reset(t,this.lexerState);;){try{if(!(e=r.next()))break}catch(t){var i=new n(this.grammar,this.current+1);throw this.table.push(i),(l=new Error(this.reportLexerError(t))).offset=this.current,l.token=t.token,l}var s=this.table[this.current];this.options.keepHistory||delete this.table[this.current-1];var a=this.current+1;i=new n(this.grammar,a),this.table.push(i);for(var l,u=void 0!==e.text?e.text:e.value,c=r.constructor===o?e.value:e,f=s.scannable,p=f.length;p--;){var h=f[p],m=h.rule.symbols[h.dot];if(m.test?m.test(c):m.type?m.type===e.type:m.literal===u){var d=h.nextState({data:c,token:e,isToken:!0,reference:a-1});i.states.push(d)}}if(i.process(),0===i.states.length)throw(l=new Error(this.reportError(e))).offset=this.current,l.token=e,l;this.options.keepHistory&&(s.lexerState=r.save()),this.current++}return s&&(this.lexerState=r.save()),this.results=this.finish(),this},i.prototype.reportLexerError=function(t){var e,n,r=t.token;return r?(e="input "+JSON.stringify(r.text[0])+" (lexer error)",n=this.lexer.formatError(r,"Syntax error")):(e="input (lexer error)",n=t.message),this.reportErrorCommon(n,e)},i.prototype.reportError=function(t){var e=(t.type?t.type+" token: ":"")+JSON.stringify(void 0!==t.value?t.value:t),n=this.lexer.formatError(t,"Syntax error");return this.reportErrorCommon(n,e)},i.prototype.reportErrorCommon=function(t,e){var n=[];n.push(t);var r=this.table[this.table.length-2],o=r.states.filter((function(t){var e=t.rule.symbols[t.dot];return e&&"string"!=typeof e}));return 0===o.length?(n.push("Unexpected "+e+". I did not expect any more input. Here is the state of my parse table:\n"),this.displayStateStack(r.states,n)):(n.push("Unexpected "+e+". Instead, I was expecting to see one of the following:\n"),o.map((function(t){return this.buildFirstStateStack(t,[])||[t]}),this).forEach((function(t){var e=t[0],r=this.getSymbolDisplay(e.rule.symbols[e.dot]);n.push("A "+r+" based on:"),this.displayStateStack(t,n)}),this)),n.push(""),n.join("\n")},i.prototype.displayStateStack=function(t,e){for(var n,r=0,o=0;o<t.length;o++){var i=t[o],s=i.rule.toString(i.dot);s===n?r++:(r>0&&e.push(" ^ "+r+" more lines identical to this"),r=0,e.push(" "+s)),n=s}},i.prototype.getSymbolDisplay=function(t){return function(t){var e=typeof t;if("string"===e)return t;if("object"===e){if(t.literal)return JSON.stringify(t.literal);if(t instanceof RegExp)return"character matching "+t;if(t.type)return t.type+" token";if(t.test)return"token matching "+String(t.test);throw new Error("Unknown symbol type: "+t)}}(t)},i.prototype.buildFirstStateStack=function(t,e){if(-1!==e.indexOf(t))return null;if(0===t.wantedBy.length)return[t];var n=t.wantedBy[0],r=[t].concat(e),o=this.buildFirstStateStack(n,r);return null===o?null:[t].concat(o)},i.prototype.save=function(){var t=this.table[this.current];return t.lexerState=this.lexerState,t},i.prototype.restore=function(t){var e=t.index;this.current=e,this.table[e]=t,this.table.splice(e+1),this.lexerState=t.lexerState,this.results=this.finish()},i.prototype.rewind=function(t){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[t])},i.prototype.finish=function(){var t=[],e=this.grammar.start;return this.table[this.table.length-1].states.forEach((function(n){n.rule.name===e&&n.dot===n.rule.symbols.length&&0===n.reference&&n.data!==i.fail&&t.push(n)})),t.map((function(t){return t.data}))},{Parser:i,Grammar:r,Rule:t}},t.exports?t.exports=n():e.nearley=n()}));function ht(){return(ht=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var mt=F((function(t){var e,n;e=z,n=function(){var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n="boolean"==typeof(new RegExp).sticky;function r(t){return t&&"[object RegExp]"===e.call(t)}function o(t){return t&&"object"==typeof t&&!r(t)&&!Array.isArray(t)}function i(t){return t.length?"(?:"+t.map((function(t){return"(?:"+t+")"})).join("|")+")":"(?!)"}function s(t){if("string"==typeof t)return"(?:"+t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+")";if(r(t)){if(t.ignoreCase)throw new Error("RegExp /i flag not allowed");if(t.global)throw new Error("RegExp /g flag is implied");if(t.sticky)throw new Error("RegExp /y flag is implied");if(t.multiline)throw new Error("RegExp /m flag is implied");return t.source}throw new Error("Not a pattern: "+t)}function a(e,n){if(o(n)||(n={match:n}),n.include)throw new Error("Matching rules cannot also include states");var i={defaultType:e,lineBreaks:!!n.error||!!n.fallback,pop:!1,next:null,push:null,error:!1,fallback:!1,value:null,type:null,shouldThrow:!1};for(var s in n)t.call(n,s)&&(i[s]=n[s]);if("string"==typeof i.type&&e!==i.type)throw new Error("Type transform cannot be a string (type '"+i.type+"' for token '"+e+"')");var a=i.match;return i.match=Array.isArray(a)?a:a?[a]:[],i.match.sort((function(t,e){return r(t)&&r(e)?0:r(e)?-1:r(t)?1:e.length-t.length})),i}function l(t){return Array.isArray(t)?function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(r.include)for(var o=[].concat(r.include),i=0;i<o.length;i++)e.push({include:o[i]});else{if(!r.type)throw new Error("Rule has no type: "+JSON.stringify(r));e.push(a(r.type,r))}}return e}(t):function(t){for(var e=Object.getOwnPropertyNames(t),n=[],r=0;r<e.length;r++){var i=e[r],s=[].concat(t[i]);if("include"!==i){var l=[];s.forEach((function(t){o(t)?(l.length&&n.push(a(i,l)),n.push(a(i,t)),l=[]):l.push(t)})),l.length&&n.push(a(i,l))}else for(var u=0;u<s.length;u++)n.push({include:s[u]})}return n}(t)}var u=a("error",{lineBreaks:!0,shouldThrow:!0});function c(t,e){for(var o=null,a=Object.create(null),l=!0,c=null,f=[],p=[],h=0;h<t.length;h++)t[h].fallback&&(l=!1);for(h=0;h<t.length;h++){var m=t[h];if(m.include)throw new Error("Inheritance is not allowed in stateless lexers");if(m.error||m.fallback){if(o)throw!m.fallback==!o.fallback?new Error("Multiple "+(m.fallback?"fallback":"error")+" rules not allowed (for token '"+m.defaultType+"')"):new Error("fallback and error are mutually exclusive (for token '"+m.defaultType+"')");o=m}var d=m.match.slice();if(l)for(;d.length&&"string"==typeof d[0]&&1===d[0].length;)a[d.shift().charCodeAt(0)]=m;if(m.pop||m.push||m.next){if(!e)throw new Error("State-switching options are not allowed in stateless lexers (for token '"+m.defaultType+"')");if(m.fallback)throw new Error("State-switching options are not allowed on fallback tokens (for token '"+m.defaultType+"')")}if(0!==d.length){l=!1,f.push(m);for(var y=0;y<d.length;y++){var b=d[y];if(r(b))if(null===c)c=b.unicode;else if(c!==b.unicode&&!1===m.fallback)throw new Error("If one rule is /u then all must be")}var g=i(d.map(s)),v=new RegExp(g);if(v.test(""))throw new Error("RegExp matches empty string: "+v);if(new RegExp("|"+g).exec("").length-1>0)throw new Error("RegExp has capture groups: "+v+"\nUse (?: … ) instead");if(!m.lineBreaks&&v.test("\n"))throw new Error("Rule should declare lineBreaks: "+v);p.push("("+g+")")}}var w=o&&o.fallback,x=n&&!w?"ym":"gm",S=n||w?"":"|";return!0===c&&(x+="u"),{regexp:new RegExp(i(p)+S,x),groups:f,fast:a,error:o||u}}function f(t,e,n){var r=t&&(t.push||t.next);if(r&&!n[r])throw new Error("Missing state '"+r+"' (in token '"+t.defaultType+"' of state '"+e+"')");if(t&&t.pop&&1!=+t.pop)throw new Error("pop must be 1 (in token '"+t.defaultType+"' of state '"+e+"')")}var p=function(t,e){this.startState=e,this.states=t,this.buffer="",this.stack=[],this.reset()};p.prototype.reset=function(t,e){return this.buffer=t||"",this.index=0,this.line=e?e.line:1,this.col=e?e.col:1,this.queuedToken=e?e.queuedToken:null,this.queuedThrow=e?e.queuedThrow:null,this.setState(e?e.state:this.startState),this.stack=e&&e.stack?e.stack.slice():[],this},p.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedThrow:this.queuedThrow}},p.prototype.setState=function(t){if(t&&this.state!==t){this.state=t;var e=this.states[t];this.groups=e.groups,this.error=e.error,this.re=e.regexp,this.fast=e.fast}},p.prototype.popState=function(){this.setState(this.stack.pop())},p.prototype.pushState=function(t){this.stack.push(this.state),this.setState(t)};var h=n?function(t,e){return t.exec(e)}:function(t,e){var n=t.exec(e);return 0===n[0].length?null:n};function m(){return this.value}if(p.prototype._getGroup=function(t){for(var e=this.groups.length,n=0;n<e;n++)if(void 0!==t[n+1])return this.groups[n];throw new Error("Cannot find token type for matched text")},p.prototype.next=function(){var t=this.index;if(this.queuedGroup){var e=this._token(this.queuedGroup,this.queuedText,t);return this.queuedGroup=null,this.queuedText="",e}var n=this.buffer;if(t!==n.length){if(s=this.fast[n.charCodeAt(t)])return this._token(s,n.charAt(t),t);var r=this.re;r.lastIndex=t;var o=h(r,n),i=this.error;if(null==o)return this._token(i,n.slice(t,n.length),t);var s=this._getGroup(o),a=o[0];return i.fallback&&o.index!==t?(this.queuedGroup=s,this.queuedText=a,this._token(i,n.slice(t,o.index),t)):this._token(s,a,t)}},p.prototype._token=function(t,e,n){var r=0;if(t.lineBreaks){var o=/\n/g,i=1;if("\n"===e)r=1;else for(;o.exec(e);)r++,i=o.lastIndex}var s={type:"function"==typeof t.type&&t.type(e)||t.defaultType,value:"function"==typeof t.value?t.value(e):e,text:e,toString:m,offset:n,lineBreaks:r,line:this.line,col:this.col},a=e.length;if(this.index+=a,this.line+=r,0!==r?this.col=a-i+1:this.col+=a,t.shouldThrow)throw new Error(this.formatError(s,"invalid syntax"));return t.pop?this.popState():t.push?this.pushState(t.push):t.next&&this.setState(t.next),s},"undefined"!=typeof Symbol&&Symbol.iterator){var d=function(t){this.lexer=t};d.prototype.next=function(){var t=this.lexer.next();return{value:t,done:!t}},d.prototype[Symbol.iterator]=function(){return this},p.prototype[Symbol.iterator]=function(){return new d(this)}}return p.prototype.formatError=function(t,e){if(null==t){var n=this.buffer.slice(this.index);t={text:n,offset:this.index,lineBreaks:-1===n.indexOf("\n")?0:1,line:this.line,col:this.col}}var r=Math.max(0,t.offset-t.col+1),o=t.lineBreaks?t.text.indexOf("\n"):t.text.length,i=this.buffer.substring(r,t.offset+o);return e+=" at line "+t.line+" col "+t.col+":\n\n",(e+=" "+i+"\n")+" "+Array(t.col).join(" ")+"^"},p.prototype.clone=function(){return new p(this.states,this.state)},p.prototype.has=function(t){return!0},{compile:function(t){var e=c(l(t));return new p({start:e},"start")},states:function(t,e){var n=t.$all?l(t.$all):[];delete t.$all;var r=Object.getOwnPropertyNames(t);e||(e=r[0]);for(var o=Object.create(null),i=0;i<r.length;i++)o[v=r[i]]=l(t[v]).concat(n);for(i=0;i<r.length;i++)for(var s=o[v=r[i]],a=Object.create(null),u=0;u<s.length;u++){var h=s[u];if(h.include){var m=[u,1];if(h.include!==v&&!a[h.include]){a[h.include]=!0;var d=o[h.include];if(!d)throw new Error("Cannot include nonexistent state '"+h.include+"' (in state '"+v+"')");for(var y=0;y<d.length;y++){var b=d[y];-1===s.indexOf(b)&&m.push(b)}}s.splice.apply(s,m),u--}}var g=Object.create(null);for(i=0;i<r.length;i++){var v;g[v=r[i]]=c(o[v],!0)}for(i=0;i<r.length;i++){var w=r[i],x=g[w],S=x.groups;for(u=0;u<S.length;u++)f(S[u],w,g);var k=Object.getOwnPropertyNames(x.fast);for(u=0;u<k.length;u++)f(x.fast[k[u]],w,g)}return new p(g,e)},error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:function(t){for(var e=Object.create(null),n=Object.create(null),r=Object.getOwnPropertyNames(t),o=0;o<r.length;o++){var i=r[o],s=t[i];(Array.isArray(s)?s:[s]).forEach((function(t){if((n[t.length]=n[t.length]||[]).push(t),"string"!=typeof t)throw new Error("keyword must be string (in keyword '"+i+"')");e[t]=i}))}function a(t){return JSON.stringify(t)}var l="";for(var u in l+="switch (value.length) {\n",n)l+="case "+u+":\n",l+="switch (value) {\n",n[u].forEach((function(t){var n=e[t];l+="case "+a(t)+": return "+a(n)+"\n"})),l+="}\n";return l+="}\n",Function("value",l)}}},t.exports?t.exports=n():e.moo=n()})),dt=/[0-9a-zA-Z_@]+\b@*/,yt=new RegExp("^"+dt.source+"$"),bt={__proto__:null,boolean:/true|false|TRUE|FALSE\b(?!@)/,hexadecimal:/-?0x(?:[0-9a-fA-F]+)\b(?!@)/,octal:/-?0(?:[0-7]+)\b(?!@)/,measurement:/-?(?:[0-9]|[1-9][0-9]+)(?:\.[0-9]+)?[a-zA-Z]+\b(?!@)/,decimal:/-?(?:[0-9]|[1-9][0-9]+)\.[0-9]+(?:[eE][-+]?[0-9]+)?\b(?!@)/,integer:/-?(?:[0-9]|[1-9][0-9]+)(?:[eE][-+]?[0-9]+)?\b(?!@)/,taggedString:/[a-zA-Z][0-9a-zA-Z_@]*`(?:\\[`bfnrt/\\]|\\u[a-fA-F0-9]{4}|[^`\\])*`/,doubleQuotedString:/"(?:\\["bfnrt/\\]|\\u[a-fA-F0-9]{4}|[^"\\])*"/,singleQuotedString:/'(?:\\['bfnrt/\\]|\\u[a-fA-F0-9]{4}|[^'\\])*'/,tickedString:/`(?:\\[`bfnrt/\\]|\\u[a-fA-F0-9]{4}|[^`\\])*`/,symbol:/[a-zA-Z_][0-9a-zA-Z_]*\b(?!@)/,identifier:dt,isValidIdentifier:function(t){return t&&yt.test(t)}},gt=function(t){return!!t.type&&"path"===t.type},vt=function(t){return gt(t)&&"ø"===t.id},wt=function(t){return gt(t)&&t.children&&0===t.children.length&&"ø"!==t.id};function xt(){return(xt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function St(t){return Array.isArray(t)?t:t instanceof Function?St(t()):void 0===t?[]:[t]}var kt=function(t,e,n,r){return xt({type:"seq",id:e},n&&{labels:n},r&&{record:r},{children:St(t)})},$t=function(t,e){return void 0===t&&(t="pair"),e.length>1?e.slice(0,e.length-1).reduceRight((function(e,n){return Et([n,e],{kind:t})}),e[e.length-1]):e[0]},Et=function(t,e){void 0===e&&(e={});var n=xt({type:"path"},e.id&&{id:e.id},e.labels&&{labels:e.labels},e.record&&{record:e.record});if(void 0===t)return n.id&&"ø"!==n.id?(n.children=[],n):(n.children=void 0,Pt);if(0===t.length)return"ø"===n.id?Pt:(n.children=[],n);if(1===t.length){var r=t[0];return vt(r)?(n.children=[],n):(n.children=[r],n)}if(2===t.length){if(e.kind&&"pair"!==e.kind&&wt(t[0])&&wt(t[1]))return n.kind=e.kind,n.children=[t[0],t[1]],n;if(vt(t[0])&&vt(t[1]))return n.kind=e.kind,n.children=[],n;n.children=[t[0],t[1]]}return n.kind=e.kind||"pair",n},Pt={type:"path",id:"ø",labels:void 0,record:void 0,children:[]},_t=function(){return Pt},Ot=function(t,e,n){return xt({type:"path"},t&&{id:t},e&&{labels:e},n&&{record:n},{children:[]})},At=function(t,e,n,r,o){return xt({type:"path",id:n},r&&{labels:r},o&&{record:o},{kind:e,children:t})},jt=function(t,e,n,r){return xt({type:"path",kind:"pair",id:e},n&&{labels:n},r&&{record:r},{children:t})},Tt=function(t){return t.reduce((function(t,e){return t[e.name]=e.value,t}),{})},Ct=function(t){return Object.entries(t).reduce((function(t,e){return t.push(Lt(e[0],e[1])),t}),[])},Lt=function(t,e){return{type:"property",name:t,value:e}},Rt=function(t){return{type:"boolean",value:t?"true":"false"}},qt=function(t){return{type:"string",value:t}},Nt=function(t,e){return{type:"tagged",value:e,tag:t}},It=function(t){return{type:"integer",value:String(t)}},Gt=function(t){return{type:"decimal",value:String(t)}},Bt=function(t){return{type:"hexadecimal",value:"number"==typeof t?t.toString(16):t}},Mt=function(t){return{type:"octal",value:"number"==typeof t?t.toString(8):t}},Vt=function(t,e){return{type:"measurement",value:String(e),unit:t}},zt=function(t){return Nt("date",t instanceof Date?t.toISOString().slice(0,10):t)},Ft=function(t){return Nt("time",t instanceof Date?t.toTimeString():t)},Ut=function(t){return Nt("duration",t instanceof Date?"P"+(t.getUTCFullYear()-1970)+"Y"+t.getUTCMonth()+"M"+t.getUTCDate()+"DT"+t.getUTCHours()+"H"+t.getUTCMinutes()+"M"+t.getUTCMilliseconds()/1e3+"S":t)},Qt=function(t,e){return void 0===e&&(e=1),t.flat(e).filter((function(t){return null!==t}))},Dt={__proto__:null,seq:kt,listToPath:$t,cons:Et,empty:_t,node:Ot,edge:At,pair:jt,recordToMap:Tt,mapToRecord:Ct,pluck:function(t,e){return t.reduce((function(t,n){return n.name===e?n:t}))},property:Lt,boolean:Rt,string:qt,tagged:Nt,integer:It,decimal:Gt,hexadecimal:Bt,octal:Mt,measurement:Vt,year:function(t){return Nt("date",t instanceof Date?t.getFullYear().toString():t)},date:zt,dayOfMonth:function(t){return Nt("date",t instanceof Date?"--"+t.toISOString().slice(5,10):t)},time:Ft,duration:Ut,flatten:Qt,default:{seq:kt,empty:_t,cons:Et,pair:jt,listToPath:$t,node:Ot,edge:At,property:Lt,boolean:Rt,string:qt,tagged:Nt,integer:It,decimal:Gt,hexadecimal:Bt,octal:Mt,measurement:Vt,date:zt,time:Ft,duration:Ut,flatten:Qt,recordToMap:Tt,mapToRecord:Ct}};function Ht(t){return t[0]}var Jt=mt.compile({whitespace:{match:/\s+/,lineBreaks:!0},lineComment:{match:/\/\/.*?\n?$/},hexadecimal:bt.hexadecimal,octal:bt.octal,measurement:bt.measurement,decimal:bt.decimal,integer:bt.integer,taggedString:{match:bt.taggedString},boolean:["true","TRUE","True","false","FALSE","False"],symbol:bt.symbol,identifier:bt.identifier,doubleQuotedString:{match:bt.doubleQuotedString,value:function(t){return t.slice(1,-1)}},singleQuotedString:{match:bt.singleQuotedString,value:function(t){return t.slice(1,-1)}},tickedString:{match:bt.tickedString,value:function(t){return t.slice(1,-1)}},"--\x3e":"--\x3e","--":"--","<--":"<--","-[]->":"-[]->","-[]-":"-[]-","<-[]-":"<-[]-","<-[":"<-[","]->":"]->","-[":"-[","]-":"]-","{":"{","}":"}","[":"[","]":"]","(":"(",")":")",",":",",":":":","`":"`","'":"'","ø":"ø"}),Zt=function(){return null},Kt=function(t){return t[0].text},Yt={Lexer:Jt,ParserRules:[{name:"GramSeq$ebnf$1$subexpression$1",symbols:["Path","_"],postprocess:function(t){return t[0]}},{name:"GramSeq$ebnf$1",symbols:["GramSeq$ebnf$1$subexpression$1"]},{name:"GramSeq$ebnf$1$subexpression$2",symbols:["Path","_"],postprocess:function(t){return t[0]}},{name:"GramSeq$ebnf$1",symbols:["GramSeq$ebnf$1","GramSeq$ebnf$1$subexpression$2"],postprocess:function(t){return t[0].concat([t[1]])}},{name:"GramSeq$ebnf$2",symbols:["EOL"],postprocess:Ht},{name:"GramSeq$ebnf$2",symbols:[],postprocess:function(){return null}},{name:"GramSeq",symbols:["GramSeq$ebnf$1","GramSeq$ebnf$2"],postprocess:function(t){return Dt.seq(Dt.flatten(t[0]))}},{name:"Path",symbols:["NodePattern"],postprocess:Ht},{name:"Path",symbols:["PathComposition"],postprocess:Ht},{name:"Path",symbols:["PathPair"],postprocess:Ht},{name:"NodePattern",symbols:["Node","_","Edge","_","NodePattern"],postprocess:function(t){var e=t[2];return Dt.cons([t[0],t[4]],{kind:e.kind,id:e.id,labels:e.labels,record:e.record})}},{name:"NodePattern",symbols:["Node"],postprocess:Ht},{name:"Node",symbols:[{literal:"("},"_","Attributes","_",{literal:")"}],postprocess:function(t){var e=t[2];return Dt.node(e.id,e.labels,e.record)}},{name:"Edge",symbols:[{literal:"-["},"_","Attributes",{literal:"]->"}],postprocess:function(t){return ht({kind:"right"},t[2])}},{name:"Edge",symbols:[{literal:"-["},"_","Attributes",{literal:"]-"}],postprocess:function(t){return ht({kind:"either"},t[2])}},{name:"Edge",symbols:[{literal:"<-["},"_","Attributes",{literal:"]-"}],postprocess:function(t){return ht({kind:"left"},t[2])}},{name:"Edge",symbols:[{literal:"-[]->"}],postprocess:function(){return{kind:"right"}}},{name:"Edge",symbols:[{literal:"-[]-"}],postprocess:function(){return{kind:"either"}}},{name:"Edge",symbols:[{literal:"<-[]-"}],postprocess:function(){return{kind:"left"}}},{name:"Edge",symbols:[{literal:"--\x3e"}],postprocess:function(){return{kind:"right"}}},{name:"Edge",symbols:[{literal:"--"}],postprocess:function(){return{kind:"either"}}},{name:"Edge",symbols:[{literal:"<--"}],postprocess:function(){return{kind:"left"}}},{name:"PathComposition",symbols:["PathPoint"],postprocess:Ht},{name:"PathComposition",symbols:["PathAnnotation"],postprocess:Ht},{name:"PathComposition",symbols:["PathExpression"],postprocess:Ht},{name:"PathPoint",symbols:[{literal:"["},"_","Attributes","_",{literal:"]"}],postprocess:function(t){var e=t[2];return(e.id||e.labels||e.record)&&"ø"!==e.id?Dt.node(e.id,e.labels,e.record):Dt.empty()}},{name:"PathAnnotation",symbols:[{literal:"["},"_","Attributes","_","Path",{literal:"]"}],postprocess:function(t){var e=t[2];return Dt.cons([t[4]],{id:e.id,labels:e.labels,record:e.record})}},{name:"PathExpression$ebnf$1",symbols:["Kind"],postprocess:Ht},{name:"PathExpression$ebnf$1",symbols:[],postprocess:function(){return null}},{name:"PathExpression",symbols:[{literal:"["},"_","Attributes","_","PathExpression$ebnf$1","_","Path","_","Path","_",{literal:"]"}],postprocess:function(t){var e=t[2];return Dt.cons([t[6],t[8]],{kind:t[4],id:e.id,labels:e.labels,record:e.record})}},{name:"PathPair$subexpression$1",symbols:["NodePattern"]},{name:"PathPair$subexpression$1",symbols:["PathComposition"]},{name:"PathPair",symbols:["PathPair$subexpression$1","_",{literal:","},"_","Path"],postprocess:function(t){return Dt.pair([t[0][0],t[4]])}},{name:"Kind",symbols:[{literal:","}],postprocess:function(){return"pair"}},{name:"Kind",symbols:[{literal:"--\x3e"}],postprocess:function(){return"right"}},{name:"Kind",symbols:[{literal:"--"}],postprocess:function(){return"either"}},{name:"Kind",symbols:[{literal:"<--"}],postprocess:function(){return"left"}},{name:"Attributes$ebnf$1",symbols:["Identity"],postprocess:Ht},{name:"Attributes$ebnf$1",symbols:[],postprocess:function(){return null}},{name:"Attributes$ebnf$2$subexpression$1",symbols:["_","LabelList"],postprocess:function(t){return t[1]}},{name:"Attributes$ebnf$2",symbols:["Attributes$ebnf$2$subexpression$1"],postprocess:Ht},{name:"Attributes$ebnf$2",symbols:[],postprocess:function(){return null}},{name:"Attributes$ebnf$3$subexpression$1",symbols:["_","Record"],postprocess:function(t){return t[1]}},{name:"Attributes$ebnf$3",symbols:["Attributes$ebnf$3$subexpression$1"],postprocess:Ht},{name:"Attributes$ebnf$3",symbols:[],postprocess:function(){return null}},{name:"Attributes",symbols:["Attributes$ebnf$1","Attributes$ebnf$2","Attributes$ebnf$3"],postprocess:function(t){return{id:t[0],labels:t[1],record:t[2]}}},{name:"LabelList$ebnf$1",symbols:["Label"]},{name:"LabelList$ebnf$1",symbols:["LabelList$ebnf$1","Label"],postprocess:function(t){return t[0].concat([t[1]])}},{name:"LabelList",symbols:["LabelList$ebnf$1"],postprocess:function(t){return t[0]}},{name:"Label",symbols:[{literal:":"},"Symbol"],postprocess:function(t){return t[1]}},{name:"Identity",symbols:[Jt.has("identifier")?{type:"identifier"}:identifier],postprocess:Kt},{name:"Identity",symbols:[{literal:"ø"}],postprocess:Kt},{name:"Identity",symbols:[Jt.has("symbol")?{type:"symbol"}:symbol],postprocess:Kt},{name:"Identity",symbols:[Jt.has("integer")?{type:"integer"}:integer],postprocess:Kt},{name:"Identity",symbols:[Jt.has("octal")?{type:"octal"}:octal],postprocess:Kt},{name:"Identity",symbols:[Jt.has("hexadecimal")?{type:"hexadecimal"}:hexadecimal],postprocess:Kt},{name:"Identity",symbols:[Jt.has("measurement")?{type:"measurement"}:measurement],postprocess:Kt},{name:"Identity",symbols:[Jt.has("tickedString")?{type:"tickedString"}:tickedString],postprocess:function(t){return t[0].text.slice(1,-1)}},{name:"Symbol",symbols:[Jt.has("symbol")?{type:"symbol"}:symbol],postprocess:Kt},{name:"Symbol",symbols:[Jt.has("tickedString")?{type:"tickedString"}:tickedString],postprocess:function(t){return t[0].text.slice(1,-1)}},{name:"Record",symbols:[{literal:"{"},"_",{literal:"}"}],postprocess:Zt},{name:"Record$ebnf$1",symbols:[]},{name:"Record$ebnf$1$subexpression$1",symbols:["_",{literal:","},"_","Property"]},{name:"Record$ebnf$1",symbols:["Record$ebnf$1","Record$ebnf$1$subexpression$1"],postprocess:function(t){return t[0].concat([t[1]])}},{name:"Record",symbols:[{literal:"{"},"_","Property","Record$ebnf$1","_",{literal:"}"}],postprocess:function(t){return[t[2]].concat(t[3].map((function(t){return t[3]})))}},{name:"Property",symbols:["Symbol","_",{literal:":"},"_","Value"],postprocess:function(t){return Dt.property(t[0],t[4])}},{name:"Value",symbols:["StringLiteral"],postprocess:Ht},{name:"Value",symbols:["NumericLiteral"],postprocess:Ht},{name:"Value",symbols:[Jt.has("boolean")?{type:"boolean"}:boolean],postprocess:function(t){return Dt.boolean(JSON.parse(t[0].value.toLowerCase()))}},{name:"Value$ebnf$1",symbols:[]},{name:"Value$ebnf$1$subexpression$1",symbols:["_",{literal:","},"_","Value"]},{name:"Value$ebnf$1",symbols:["Value$ebnf$1","Value$ebnf$1$subexpression$1"],postprocess:function(t){return t[0].concat([t[1]])}},{name:"Value",symbols:[{literal:"["},"_","Value","Value$ebnf$1",{literal:"]"}],postprocess:function(t){return[t[2]].concat(t[3].map((function(t){return t[3]})))}},{name:"StringLiteral",symbols:[Jt.has("singleQuotedString")?{type:"singleQuotedString"}:singleQuotedString],postprocess:function(t){return Dt.string(t[0].value)}},{name:"StringLiteral",symbols:[Jt.has("doubleQuotedString")?{type:"doubleQuotedString"}:doubleQuotedString],postprocess:function(t){return Dt.string(t[0].value)}},{name:"StringLiteral",symbols:[Jt.has("tickedString")?{type:"tickedString"}:tickedString],postprocess:function(t){return Dt.string(t[0].value)}},{name:"StringLiteral",symbols:[Jt.has("taggedString")?{type:"taggedString"}:taggedString],postprocess:function(t){var e=function(t){var e=t.match(/([^`]+)`(.+)`$/);if(null==e)throw Error("Malformed tagged string: "+t);return{tag:e[1],value:e[2]}}(t[0].value);return Dt.tagged(e.tag,e.value)}},{name:"NumericLiteral",symbols:[Jt.has("integer")?{type:"integer"}:integer],postprocess:function(t){return Dt.integer(t[0].value)}},{name:"NumericLiteral",symbols:[Jt.has("decimal")?{type:"decimal"}:decimal],postprocess:function(t){return Dt.decimal(t[0].value)}},{name:"NumericLiteral",symbols:[Jt.has("hexadecimal")?{type:"hexadecimal"}:hexadecimal],postprocess:function(t){return Dt.hexadecimal(t[0].value)}},{name:"NumericLiteral",symbols:[Jt.has("octal")?{type:"octal"}:octal],postprocess:function(t){return Dt.octal(t[0].value)}},{name:"NumericLiteral",symbols:[Jt.has("measurement")?{type:"measurement"}:measurement],postprocess:function(t){var e=function(t){var e=t.match(/(-?[0-9.]+)([a-zA-Z]+)/);if(null==e)throw Error("Malformed measurement : "+t);return{value:e[1],unit:e[2]}}(t[0].value);return Dt.measurement(e.unit,e.value)}},{name:"_",symbols:[]},{name:"_",symbols:[Jt.has("whitespace")?{type:"whitespace"}:whitespace],postprocess:Zt},{name:"Comment",symbols:[Jt.has("lineComment")?{type:"lineComment"}:lineComment],postprocess:Zt},{name:"EOL",symbols:[{literal:"\n"}],postprocess:Zt}],ParserStart:"GramSeq"},Wt=function(t,e){var n,r,o=new pt.Parser(pt.Grammar.fromCompiled(Yt));try{var i=o.feed(t);if(void 0===i.results[0]&&i.lexerState){var s={line:(r=i.lexerState).line,column:r.col};e.fail("Incomplete parse.",s)}return i.results.length>1&&e.info("[WARN] parsing is ambiguous"),i.results[0]||{type:"error"}}catch(t){var a=t.token?{line:(n=t.token).line,column:n.col}:{line:0,column:0};e.fail(t.message,a)}},Xt=function(){this.Parser=Wt};t.errors={__proto__:null,INCOMPLETE_PARSE:"Incomplete parse.",SYNTAX_ERROR:"Syntax error at"},t.gramParserPlugin=Xt,t.toAST=function(t){return nt().use(Xt).freeze().parse(t)},Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=gram-parse.umd.production.min.js.map

@@ -8,3 +8,3 @@ {

],
"version": "0.2.10",
"version": "0.2.11",
"license": "MIT",

@@ -56,2 +56,3 @@ "author": "Andreas Kollegger",

"devDependencies": {
"@gram-data/gram-stringify": "^0.2.11",
"@types/jest": "^26.0.15",

@@ -76,4 +77,4 @@ "@types/moo": "^0.5.3",

"dependencies": {
"@gram-data/gram-ast": "^0.2.10",
"@gram-data/gram-builder": "^0.2.10",
"@gram-data/gram-ast": "^0.2.11",
"@gram-data/gram-builder": "^0.2.11",
"moo": "^0.5.1",

@@ -84,3 +85,3 @@ "nearley": "^2.19.7",

},
"gitHead": "5ab0f6f900db922abaf69906f62d6cf23e12215e",
"gitHead": "23013fdd8af755746f936dd4c01b165b90c477d7",
"publishConfig": {

@@ -87,0 +88,0 @@ "access": "public"

@@ -328,3 +328,3 @@ // Generated automatically by nearley, version 2.19.7

symbols: ['Attributes$ebnf$1', 'Attributes$ebnf$2', 'Attributes$ebnf$3'],
postprocess: ([id, , labels, , record]) => ({ id, labels, record }),
postprocess: ([id, labels, record]) => ({ id, labels, record }),
},

@@ -331,0 +331,0 @@ { name: 'LabelList$ebnf$1', symbols: ['Label'] },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc