diff --git a/.yarn/releases/yarn-3.8.7.cjs b/.yarn/releases/yarn-3.8.7.cjs index acd72385b..559d324ed 100755 --- a/.yarn/releases/yarn-3.8.7.cjs +++ b/.yarn/releases/yarn-3.8.7.cjs @@ -78,7 +78,7 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e. `),type:tr.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),i}We.performRuntimeChecks=JEe;function WEe(r,e,t){var i=[],n=!1,s=(0,Se.compact)((0,Se.flatten)((0,Se.mapValues)(r.modes,function(l){return l}))),o=(0,Se.reject)(s,function(l){return l[ko]===tr.Lexer.NA}),a=uY(t);return e&&(0,Se.forEach)(o,function(l){var c=lY(l,a);if(c!==!1){var u=cY(l,c),g={message:u,type:c.issue,tokenType:l};i.push(g)}else(0,Se.has)(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(n=!0):(0,Zg.canMatchCharCode)(a,l.PATTERN)&&(n=!0)}),e&&!n&&i.push({message:`Warning: No LINE_BREAKS Found. This Lexer has been defined to track line and column information, But none of the Token Types can be identified as matching a line terminator. - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS for details.`,type:tr.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),i}We.performWarningRuntimeChecks=WEe;function zEe(r){var e={},t=(0,Se.keys)(r);return(0,Se.forEach)(t,function(i){var n=r[i];if((0,Se.isArray)(n))e[i]=[];else throw Error("non exhaustive match")}),e}We.cloneEmptyGroups=zEe;function Ov(r){var e=r.PATTERN;if((0,Se.isRegExp)(e))return!1;if((0,Se.isFunction)(e))return!0;if((0,Se.has)(e,"exec"))return!0;if((0,Se.isString)(e))return!1;throw Error("non exhaustive match")}We.isCustomPattern=Ov;function AY(r){return(0,Se.isString)(r)&&r.length===1?r.charCodeAt(0):!1}We.isShortPattern=AY;We.LineTerminatorOptimizedTester={test:function(r){for(var e=r.length,t=this.lastIndex;t Token Type `)+(" Root cause: "+e.errMsg+`. @@ -101,8 +101,8 @@ but found: '`+a+"'";if(n)return o+n+l;var c=(0,$s.reduce)(e,function(p,d){return but found: '`+o+"'";if(i)return s+i+a;var l=(0,$s.map)(e,function(u){return"["+(0,$s.map)(u,function(g){return(0,ef.tokenLabel)(g)}).join(",")+"]"}),c=`expecting at least one iteration which starts with one of these possible Token sequences:: `+("<"+l.join(" ,")+">");return s+c+a}};Object.freeze(Da.defaultParserErrorProvider);Da.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(r,e){var t="Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- inside top level rule: ->`+r.name+"<-";return t}};Da.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(r,e){function t(u){return u instanceof Wv.Terminal?u.terminalType.name:u instanceof Wv.NonTerminal?u.nonTerminalName:""}var i=r.name,n=(0,$s.first)(e),s=n.idx,o=(0,VY.getProductionDslName)(n),a=t(n),l=s>0,c="->"+o+(l?s:"")+"<- "+(a?"with argument: ->"+a+"<-":"")+` - appears more than once (`+e.length+" times) in the top level rule: ->"+i+`<-. - For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES + appears more than once (`+e.length+" times) in the top level rule: ->"+i+`<-. + For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,` `),c},buildNamespaceConflictError:function(r){var e=`Namespace conflict found in grammar. `+("The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+r.name+`>. @@ -121,7 +121,7 @@ This could lead to an infinite loop.`;return t},buildTokenNameError:function(r){ `+(" inside <"+r.topLevelRule.name+`> Rule. has `+(r.alternation.definition.length+1)+" alternatives.");return e},buildLeftRecursionError:function(r){var e=r.topLevelRule.name,t=xIe.map(r.leftRecursionPath,function(s){return s.name}),i=e+" --> "+t.concat([e]).join(" --> "),n=`Left Recursion found in grammar. `+("rule: <"+e+`> can be invoked from itself (directly or indirectly) -`)+(`without consuming any Tokens. The grammar path that causes this is: +`)+(`without consuming any Tokens. The grammar path that causes this is: `+i+` `)+` To fix this refactor your grammar to remove the left recursion. see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return n},buildInvalidRuleNameError:function(r){return"deprecated"},buildDuplicateRuleNameError:function(r){var e;r.topLevelRule instanceof Wv.Rule?e=r.topLevelRule.name:e=r.topLevelRule;var t="Duplicate definition, rule: ->"+e+"<- is already defined in the grammar: ->"+r.grammarName+"<-";return t}}});var _Y=I(TA=>{"use strict";var PIe=TA&&TA.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(TA,"__esModule",{value:!0});TA.GastRefResolverVisitor=TA.resolveGrammar=void 0;var kIe=Yn(),XY=Kt(),DIe=$g();function RIe(r,e){var t=new ZY(r,e);return t.resolveRefs(),t.errors}TA.resolveGrammar=RIe;var ZY=function(r){PIe(e,r);function e(t,i){var n=r.call(this)||this;return n.nameToTopRule=t,n.errMsgProvider=i,n.errors=[],n}return e.prototype.resolveRefs=function(){var t=this;(0,XY.forEach)((0,XY.values)(this.nameToTopRule),function(i){t.currTopLevel=i,i.accept(t)})},e.prototype.visitNonTerminal=function(t){var i=this.nameToTopRule[t.nonTerminalName];if(i)t.referencedRule=i;else{var n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,t);this.errors.push({message:n,type:kIe.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}},e}(DIe.GAstVisitor);TA.GastRefResolverVisitor=ZY});var Dd=I(Fr=>{"use strict";var Ic=Fr&&Fr.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Fr,"__esModule",{value:!0});Fr.nextPossibleTokensAfter=Fr.possiblePathsFrom=Fr.NextTerminalAfterAtLeastOneSepWalker=Fr.NextTerminalAfterAtLeastOneWalker=Fr.NextTerminalAfterManySepWalker=Fr.NextTerminalAfterManyWalker=Fr.AbstractNextTerminalAfterProductionWalker=Fr.NextAfterTokenWalker=Fr.AbstractNextPossibleTokensWalker=void 0;var $Y=ay(),Lt=Kt(),FIe=qv(),kt=En(),eq=function(r){Ic(e,r);function e(t,i){var n=r.call(this)||this;return n.topProd=t,n.path=i,n.possibleTokTypes=[],n.nextProductionName="",n.nextProductionOccurrence=0,n.found=!1,n.isAtEndOfPath=!1,n}return e.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=(0,Lt.cloneArr)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,Lt.cloneArr)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},e.prototype.walk=function(t,i){i===void 0&&(i=[]),this.found||r.prototype.walk.call(this,t,i)},e.prototype.walkProdRef=function(t,i,n){if(t.referencedRule.name===this.nextProductionName&&t.idx===this.nextProductionOccurrence){var s=i.concat(n);this.updateExpectedNext(),this.walk(t.referencedRule,s)}},e.prototype.updateExpectedNext=function(){(0,Lt.isEmpty)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},e}($Y.RestWalker);Fr.AbstractNextPossibleTokensWalker=eq;var NIe=function(r){Ic(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.path=i,n.nextTerminalName="",n.nextTerminalOccurrence=0,n.nextTerminalName=n.path.lastTok.name,n.nextTerminalOccurrence=n.path.lastTokOccurrence,n}return e.prototype.walkTerminal=function(t,i,n){if(this.isAtEndOfPath&&t.terminalType.name===this.nextTerminalName&&t.idx===this.nextTerminalOccurrence&&!this.found){var s=i.concat(n),o=new kt.Alternative({definition:s});this.possibleTokTypes=(0,FIe.first)(o),this.found=!0}},e}(eq);Fr.NextAfterTokenWalker=NIe;var kd=function(r){Ic(e,r);function e(t,i){var n=r.call(this)||this;return n.topRule=t,n.occurrence=i,n.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},n}return e.prototype.startWalking=function(){return this.walk(this.topRule),this.result},e}($Y.RestWalker);Fr.AbstractNextTerminalAfterProductionWalker=kd;var TIe=function(r){Ic(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkMany=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Lt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof kt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkMany.call(this,t,i,n)},e}(kd);Fr.NextTerminalAfterManyWalker=TIe;var LIe=function(r){Ic(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkManySep=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Lt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof kt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkManySep.call(this,t,i,n)},e}(kd);Fr.NextTerminalAfterManySepWalker=LIe;var OIe=function(r){Ic(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkAtLeastOne=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Lt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof kt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkAtLeastOne.call(this,t,i,n)},e}(kd);Fr.NextTerminalAfterAtLeastOneWalker=OIe;var MIe=function(r){Ic(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkAtLeastOneSep=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Lt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof kt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkAtLeastOneSep.call(this,t,i,n)},e}(kd);Fr.NextTerminalAfterAtLeastOneSepWalker=MIe;function tq(r,e,t){t===void 0&&(t=[]),t=(0,Lt.cloneArr)(t);var i=[],n=0;function s(c){return c.concat((0,Lt.drop)(r,n+1))}function o(c){var u=tq(s(c),e,t);return i.concat(u)}for(;t.length=0;ue--){var te=B.definition[ue],O={idx:d,def:te.definition.concat((0,Lt.drop)(p)),ruleStack:m,occurrenceStack:y};g.push(O),g.push(o)}else if(B instanceof kt.Alternative)g.push({idx:d,def:B.definition.concat((0,Lt.drop)(p)),ruleStack:m,occurrenceStack:y});else if(B instanceof kt.Rule)g.push(UIe(B,d,m,y));else throw Error("non exhaustive match")}}return u}Fr.nextPossibleTokensAfter=KIe;function UIe(r,e,t,i){var n=(0,Lt.cloneArr)(t);n.push(r.name);var s=(0,Lt.cloneArr)(i);return s.push(1),{idx:e,def:r.definition,ruleStack:n,occurrenceStack:s}}});var Rd=I(Wt=>{"use strict";var nq=Wt&&Wt.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Wt,"__esModule",{value:!0});Wt.areTokenCategoriesNotUsed=Wt.isStrictPrefixOfPath=Wt.containsPath=Wt.getLookaheadPathsForOptionalProd=Wt.getLookaheadPathsForOr=Wt.lookAheadSequenceFromAlternatives=Wt.buildSingleAlternativeLookaheadFunction=Wt.buildAlternativesLookAheadFunc=Wt.buildLookaheadFuncForOptionalProd=Wt.buildLookaheadFuncForOr=Wt.getProdType=Wt.PROD_TYPE=void 0;var ir=Kt(),rq=Dd(),HIe=ay(),fy=_g(),LA=En(),jIe=$g(),si;(function(r){r[r.OPTION=0]="OPTION",r[r.REPETITION=1]="REPETITION",r[r.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",r[r.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",r[r.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",r[r.ALTERNATION=5]="ALTERNATION"})(si=Wt.PROD_TYPE||(Wt.PROD_TYPE={}));function GIe(r){if(r instanceof LA.Option)return si.OPTION;if(r instanceof LA.Repetition)return si.REPETITION;if(r instanceof LA.RepetitionMandatory)return si.REPETITION_MANDATORY;if(r instanceof LA.RepetitionMandatoryWithSeparator)return si.REPETITION_MANDATORY_WITH_SEPARATOR;if(r instanceof LA.RepetitionWithSeparator)return si.REPETITION_WITH_SEPARATOR;if(r instanceof LA.Alternation)return si.ALTERNATION;throw Error("non exhaustive match")}Wt.getProdType=GIe;function YIe(r,e,t,i,n,s){var o=oq(r,e,t),a=Xv(o)?fy.tokenStructuredMatcherNoCategories:fy.tokenStructuredMatcher;return s(o,i,a,n)}Wt.buildLookaheadFuncForOr=YIe;function qIe(r,e,t,i,n,s){var o=aq(r,e,n,t),a=Xv(o)?fy.tokenStructuredMatcherNoCategories:fy.tokenStructuredMatcher;return s(o[0],a,i)}Wt.buildLookaheadFuncForOptionalProd=qIe;function JIe(r,e,t,i){var n=r.length,s=(0,ir.every)(r,function(l){return(0,ir.every)(l,function(c){return c.length===1})});if(e)return function(l){for(var c=(0,ir.map)(l,function(P){return P.GATE}),u=0;u{"use strict";var Zv=Jt&&Jt.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Jt,"__esModule",{value:!0});Jt.checkPrefixAlternativesAmbiguities=Jt.validateSomeNonEmptyLookaheadPath=Jt.validateTooManyAlts=Jt.RepetionCollector=Jt.validateAmbiguousAlternationAlternatives=Jt.validateEmptyOrAlternative=Jt.getFirstNoneTerminal=Jt.validateNoLeftRecursion=Jt.validateRuleIsOverridden=Jt.validateRuleDoesNotAlreadyExist=Jt.OccurrenceValidationCollector=Jt.identifyProductionForDuplicates=Jt.validateGrammar=void 0;var _t=Kt(),Qr=Kt(),No=Yn(),_v=xd(),tf=Rd(),ZIe=Dd(),eo=En(),$v=$g();function _Ie(r,e,t,i,n){var s=_t.map(r,function(p){return $Ie(p,i)}),o=_t.map(r,function(p){return ex(p,p,i)}),a=[],l=[],c=[];(0,Qr.every)(o,Qr.isEmpty)&&(a=(0,Qr.map)(r,function(p){return fq(p,i)}),l=(0,Qr.map)(r,function(p){return hq(p,e,i)}),c=Cq(r,e,i));var u=rye(r,t,i),g=(0,Qr.map)(r,function(p){return dq(p,i)}),h=(0,Qr.map)(r,function(p){return gq(p,r,n,i)});return _t.flatten(s.concat(c,o,a,l,u,g,h))}Jt.validateGrammar=_Ie;function $Ie(r,e){var t=new uq;r.accept(t);var i=t.allProductions,n=_t.groupBy(i,lq),s=_t.pick(n,function(a){return a.length>1}),o=_t.map(_t.values(s),function(a){var l=_t.first(a),c=e.buildDuplicateFoundError(r,a),u=(0,_v.getProductionDslName)(l),g={message:c,type:No.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:r.name,dslName:u,occurrence:l.idx},h=cq(l);return h&&(g.parameter=h),g});return o}function lq(r){return(0,_v.getProductionDslName)(r)+"_#_"+r.idx+"_#_"+cq(r)}Jt.identifyProductionForDuplicates=lq;function cq(r){return r instanceof eo.Terminal?r.terminalType.name:r instanceof eo.NonTerminal?r.nonTerminalName:""}var uq=function(r){Zv(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.allProductions=[],t}return e.prototype.visitNonTerminal=function(t){this.allProductions.push(t)},e.prototype.visitOption=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetition=function(t){this.allProductions.push(t)},e.prototype.visitAlternation=function(t){this.allProductions.push(t)},e.prototype.visitTerminal=function(t){this.allProductions.push(t)},e}($v.GAstVisitor);Jt.OccurrenceValidationCollector=uq;function gq(r,e,t,i){var n=[],s=(0,Qr.reduce)(e,function(a,l){return l.name===r.name?a+1:a},0);if(s>1){var o=i.buildDuplicateRuleNameError({topLevelRule:r,grammarName:t});n.push({message:o,type:No.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:r.name})}return n}Jt.validateRuleDoesNotAlreadyExist=gq;function eye(r,e,t){var i=[],n;return _t.contains(e,r)||(n="Invalid rule override, rule: ->"+r+"<- cannot be overridden in the grammar: ->"+t+"<-as it is not defined in any of the super grammars ",i.push({message:n,type:No.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:r})),i}Jt.validateRuleIsOverridden=eye;function ex(r,e,t,i){i===void 0&&(i=[]);var n=[],s=Fd(e.definition);if(_t.isEmpty(s))return[];var o=r.name,a=_t.contains(s,r);a&&n.push({message:t.buildLeftRecursionError({topLevelRule:r,leftRecursionPath:i}),type:No.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:o});var l=_t.difference(s,i.concat([r])),c=_t.map(l,function(u){var g=_t.cloneArr(i);return g.push(u),ex(r,u,t,g)});return n.concat(_t.flatten(c))}Jt.validateNoLeftRecursion=ex;function Fd(r){var e=[];if(_t.isEmpty(r))return e;var t=_t.first(r);if(t instanceof eo.NonTerminal)e.push(t.referencedRule);else if(t instanceof eo.Alternative||t instanceof eo.Option||t instanceof eo.RepetitionMandatory||t instanceof eo.RepetitionMandatoryWithSeparator||t instanceof eo.RepetitionWithSeparator||t instanceof eo.Repetition)e=e.concat(Fd(t.definition));else if(t instanceof eo.Alternation)e=_t.flatten(_t.map(t.definition,function(o){return Fd(o.definition)}));else if(!(t instanceof eo.Terminal))throw Error("non exhaustive match");var i=(0,_v.isOptionalProd)(t),n=r.length>1;if(i&&n){var s=_t.drop(r);return e.concat(Fd(s))}else return e}Jt.getFirstNoneTerminal=Fd;var tx=function(r){Zv(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.alternations=[],t}return e.prototype.visitAlternation=function(t){this.alternations.push(t)},e}($v.GAstVisitor);function fq(r,e){var t=new tx;r.accept(t);var i=t.alternations,n=_t.reduce(i,function(s,o){var a=_t.dropRight(o.definition),l=_t.map(a,function(c,u){var g=(0,ZIe.nextPossibleTokensAfter)([c],[],null,1);return _t.isEmpty(g)?{message:e.buildEmptyAlternationError({topLevelRule:r,alternation:o,emptyChoiceIdx:u}),type:No.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:r.name,occurrence:o.idx,alternative:u+1}:null});return s.concat(_t.compact(l))},[]);return n}Jt.validateEmptyOrAlternative=fq;function hq(r,e,t){var i=new tx;r.accept(i);var n=i.alternations;n=(0,Qr.reject)(n,function(o){return o.ignoreAmbiguities===!0});var s=_t.reduce(n,function(o,a){var l=a.idx,c=a.maxLookahead||e,u=(0,tf.getLookaheadPathsForOr)(l,r,c,a),g=tye(u,a,r,t),h=mq(u,a,r,t);return o.concat(g,h)},[]);return s}Jt.validateAmbiguousAlternationAlternatives=hq;var pq=function(r){Zv(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.allProductions=[],t}return e.prototype.visitRepetitionWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetition=function(t){this.allProductions.push(t)},e}($v.GAstVisitor);Jt.RepetionCollector=pq;function dq(r,e){var t=new tx;r.accept(t);var i=t.alternations,n=_t.reduce(i,function(s,o){return o.definition.length>255&&s.push({message:e.buildTooManyAlternativesError({topLevelRule:r,alternation:o}),type:No.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:r.name,occurrence:o.idx}),s},[]);return n}Jt.validateTooManyAlts=dq;function Cq(r,e,t){var i=[];return(0,Qr.forEach)(r,function(n){var s=new pq;n.accept(s);var o=s.allProductions;(0,Qr.forEach)(o,function(a){var l=(0,tf.getProdType)(a),c=a.maxLookahead||e,u=a.idx,g=(0,tf.getLookaheadPathsForOptionalProd)(u,n,l,c),h=g[0];if((0,Qr.isEmpty)((0,Qr.flatten)(h))){var p=t.buildEmptyRepetitionError({topLevelRule:n,repetition:a});i.push({message:p,type:No.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:n.name})}})}),i}Jt.validateSomeNonEmptyLookaheadPath=Cq;function tye(r,e,t,i){var n=[],s=(0,Qr.reduce)(r,function(a,l,c){return e.definition[c].ignoreAmbiguities===!0||(0,Qr.forEach)(l,function(u){var g=[c];(0,Qr.forEach)(r,function(h,p){c!==p&&(0,tf.containsPath)(h,u)&&e.definition[p].ignoreAmbiguities!==!0&&g.push(p)}),g.length>1&&!(0,tf.containsPath)(n,u)&&(n.push(u),a.push({alts:g,path:u}))}),a},[]),o=_t.map(s,function(a){var l=(0,Qr.map)(a.alts,function(u){return u+1}),c=i.buildAlternationAmbiguityError({topLevelRule:t,alternation:e,ambiguityIndices:l,prefixPath:a.path});return{message:c,type:No.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:t.name,occurrence:e.idx,alternatives:[a.alts]}});return o}function mq(r,e,t,i){var n=[],s=(0,Qr.reduce)(r,function(o,a,l){var c=(0,Qr.map)(a,function(u){return{idx:l,path:u}});return o.concat(c)},[]);return(0,Qr.forEach)(s,function(o){var a=e.definition[o.idx];if(a.ignoreAmbiguities!==!0){var l=o.idx,c=o.path,u=(0,Qr.findAll)(s,function(h){return e.definition[h.idx].ignoreAmbiguities!==!0&&h.idx{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.validateGrammar=rf.resolveGrammar=void 0;var ix=Kt(),iye=_Y(),nye=rx(),Eq=Pd();function sye(r){r=(0,ix.defaults)(r,{errMsgProvider:Eq.defaultGrammarResolverErrorProvider});var e={};return(0,ix.forEach)(r.rules,function(t){e[t.name]=t}),(0,iye.resolveGrammar)(e,r.errMsgProvider)}rf.resolveGrammar=sye;function oye(r){return r=(0,ix.defaults)(r,{errMsgProvider:Eq.defaultGrammarValidatorErrorProvider}),(0,nye.validateGrammar)(r.rules,r.maxLookahead,r.tokenTypes,r.errMsgProvider,r.grammarName)}rf.validateGrammar=oye});var nf=I(yn=>{"use strict";var Nd=yn&&yn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(yn,"__esModule",{value:!0});yn.EarlyExitException=yn.NotAllInputParsedException=yn.NoViableAltException=yn.MismatchedTokenException=yn.isRecognitionException=void 0;var aye=Kt(),yq="MismatchedTokenException",wq="NoViableAltException",Bq="EarlyExitException",Qq="NotAllInputParsedException",bq=[yq,wq,Bq,Qq];Object.freeze(bq);function Aye(r){return(0,aye.contains)(bq,r.name)}yn.isRecognitionException=Aye;var hy=function(r){Nd(e,r);function e(t,i){var n=this.constructor,s=r.call(this,t)||this;return s.token=i,s.resyncedTokens=[],Object.setPrototypeOf(s,n.prototype),Error.captureStackTrace&&Error.captureStackTrace(s,s.constructor),s}return e}(Error),lye=function(r){Nd(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=yq,s}return e}(hy);yn.MismatchedTokenException=lye;var cye=function(r){Nd(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=wq,s}return e}(hy);yn.NoViableAltException=cye;var uye=function(r){Nd(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.name=Qq,n}return e}(hy);yn.NotAllInputParsedException=uye;var gye=function(r){Nd(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=Bq,s}return e}(hy);yn.EarlyExitException=gye});var sx=I(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.attemptInRepetitionRecovery=Ki.Recoverable=Ki.InRuleRecoveryException=Ki.IN_RULE_RECOVERY_EXCEPTION=Ki.EOF_FOLLOW_KEY=void 0;var py=NA(),fs=Kt(),fye=nf(),hye=Jv(),pye=Yn();Ki.EOF_FOLLOW_KEY={};Ki.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";function nx(r){this.name=Ki.IN_RULE_RECOVERY_EXCEPTION,this.message=r}Ki.InRuleRecoveryException=nx;nx.prototype=Error.prototype;var dye=function(){function r(){}return r.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,fs.has)(e,"recoveryEnabled")?e.recoveryEnabled:pye.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Sq)},r.prototype.getTokenToInsert=function(e){var t=(0,py.createTokenInstance)(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t},r.prototype.canTokenTypeBeInsertedInRecovery=function(e){return!0},r.prototype.tryInRepetitionRecovery=function(e,t,i,n){for(var s=this,o=this.findReSyncTokenType(),a=this.exportLexerState(),l=[],c=!1,u=this.LA(1),g=this.LA(1),h=function(){var p=s.LA(0),d=s.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:u,previous:p,ruleName:s.getCurrRuleFullName()}),m=new fye.MismatchedTokenException(d,u,s.LA(0));m.resyncedTokens=(0,fs.dropRight)(l),s.SAVE_ERROR(m)};!c;)if(this.tokenMatcher(g,n)){h();return}else if(i.call(this)){h(),e.apply(this,t);return}else this.tokenMatcher(g,o)?c=!0:(g=this.SKIP_TOKEN(),this.addToResyncTokens(g,l));this.importLexerState(a)},r.prototype.shouldInRepetitionRecoveryBeTried=function(e,t,i){return!(i===!1||e===void 0||t===void 0||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))},r.prototype.getFollowsForInRuleRecovery=function(e,t){var i=this.getCurrentGrammarPath(e,t),n=this.getNextPossibleTokenTypes(i);return n},r.prototype.tryInRuleRecovery=function(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t)){var i=this.getTokenToInsert(e);return i}if(this.canRecoverWithSingleTokenDeletion(e)){var n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new nx("sad sad panda")},r.prototype.canPerformInRuleRecovery=function(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)},r.prototype.canRecoverWithSingleTokenInsertion=function(e,t){var i=this;if(!this.canTokenTypeBeInsertedInRecovery(e)||(0,fs.isEmpty)(t))return!1;var n=this.LA(1),s=(0,fs.find)(t,function(o){return i.tokenMatcher(n,o)})!==void 0;return s},r.prototype.canRecoverWithSingleTokenDeletion=function(e){var t=this.tokenMatcher(this.LA(2),e);return t},r.prototype.isInCurrentRuleReSyncSet=function(e){var t=this.getCurrFollowKey(),i=this.getFollowSetFromFollowKey(t);return(0,fs.contains)(i,e)},r.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),t=this.LA(1),i=2;;){var n=t.tokenType;if((0,fs.contains)(e,n))return n;t=this.LA(i),i++}},r.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return Ki.EOF_FOLLOW_KEY;var e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),i=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(i)}},r.prototype.buildFullFollowKeyStack=function(){var e=this,t=this.RULE_STACK,i=this.RULE_OCCURRENCE_STACK;return(0,fs.map)(t,function(n,s){return s===0?Ki.EOF_FOLLOW_KEY:{ruleName:e.shortRuleNameToFullName(n),idxInCallingRule:i[s],inRule:e.shortRuleNameToFullName(t[s-1])}})},r.prototype.flattenFollowSet=function(){var e=this,t=(0,fs.map)(this.buildFullFollowKeyStack(),function(i){return e.getFollowSetFromFollowKey(i)});return(0,fs.flatten)(t)},r.prototype.getFollowSetFromFollowKey=function(e){if(e===Ki.EOF_FOLLOW_KEY)return[py.EOF];var t=e.ruleName+e.idxInCallingRule+hye.IN+e.inRule;return this.resyncFollows[t]},r.prototype.addToResyncTokens=function(e,t){return this.tokenMatcher(e,py.EOF)||t.push(e),t},r.prototype.reSyncTo=function(e){for(var t=[],i=this.LA(1);this.tokenMatcher(i,e)===!1;)i=this.SKIP_TOKEN(),this.addToResyncTokens(i,t);return(0,fs.dropRight)(t)},r.prototype.attemptInRepetitionRecovery=function(e,t,i,n,s,o,a){},r.prototype.getCurrentGrammarPath=function(e,t){var i=this.getHumanReadableRuleStack(),n=(0,fs.cloneArr)(this.RULE_OCCURRENCE_STACK),s={ruleStack:i,occurrenceStack:n,lastTok:e,lastTokOccurrence:t};return s},r.prototype.getHumanReadableRuleStack=function(){var e=this;return(0,fs.map)(this.RULE_STACK,function(t){return e.shortRuleNameToFullName(t)})},r}();Ki.Recoverable=dye;function Sq(r,e,t,i,n,s,o){var a=this.getKeyForAutomaticLookahead(i,n),l=this.firstAfterRepMap[a];if(l===void 0){var c=this.getCurrRuleFullName(),u=this.getGAstProductions()[c],g=new s(u,n);l=g.startWalking(),this.firstAfterRepMap[a]=l}var h=l.token,p=l.occurrence,d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&h===void 0&&(h=py.EOF,p=1),this.shouldInRepetitionRecoveryBeTried(h,p,o)&&this.tryInRepetitionRecovery(r,e,t,h)}Ki.attemptInRepetitionRecovery=Sq});var dy=I(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.getKeyForAutomaticLookahead=Gt.AT_LEAST_ONE_SEP_IDX=Gt.MANY_SEP_IDX=Gt.AT_LEAST_ONE_IDX=Gt.MANY_IDX=Gt.OPTION_IDX=Gt.OR_IDX=Gt.BITS_FOR_ALT_IDX=Gt.BITS_FOR_RULE_IDX=Gt.BITS_FOR_OCCURRENCE_IDX=Gt.BITS_FOR_METHOD_TYPE=void 0;Gt.BITS_FOR_METHOD_TYPE=4;Gt.BITS_FOR_OCCURRENCE_IDX=8;Gt.BITS_FOR_RULE_IDX=12;Gt.BITS_FOR_ALT_IDX=8;Gt.OR_IDX=1<{"use strict";Object.defineProperty(Cy,"__esModule",{value:!0});Cy.LooksAhead=void 0;var Ra=Rd(),to=Kt(),vq=Yn(),Fa=dy(),yc=xd(),mye=function(){function r(){}return r.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=(0,to.has)(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:vq.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=(0,to.has)(e,"maxLookahead")?e.maxLookahead:vq.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookAheadFuncsCache=(0,to.isES2015MapSupported)()?new Map:[],(0,to.isES2015MapSupported)()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},r.prototype.preComputeLookaheadFunctions=function(e){var t=this;(0,to.forEach)(e,function(i){t.TRACE_INIT(i.name+" Rule Lookahead",function(){var n=(0,yc.collectMethods)(i),s=n.alternation,o=n.repetition,a=n.option,l=n.repetitionMandatory,c=n.repetitionMandatoryWithSeparator,u=n.repetitionWithSeparator;(0,to.forEach)(s,function(g){var h=g.idx===0?"":g.idx;t.TRACE_INIT(""+(0,yc.getProductionDslName)(g)+h,function(){var p=(0,Ra.buildLookaheadFuncForOr)(g.idx,i,g.maxLookahead||t.maxLookahead,g.hasPredicates,t.dynamicTokensEnabled,t.lookAheadBuilderForAlternatives),d=(0,Fa.getKeyForAutomaticLookahead)(t.fullRuleNameToShort[i.name],Fa.OR_IDX,g.idx);t.setLaFuncCache(d,p)})}),(0,to.forEach)(o,function(g){t.computeLookaheadFunc(i,g.idx,Fa.MANY_IDX,Ra.PROD_TYPE.REPETITION,g.maxLookahead,(0,yc.getProductionDslName)(g))}),(0,to.forEach)(a,function(g){t.computeLookaheadFunc(i,g.idx,Fa.OPTION_IDX,Ra.PROD_TYPE.OPTION,g.maxLookahead,(0,yc.getProductionDslName)(g))}),(0,to.forEach)(l,function(g){t.computeLookaheadFunc(i,g.idx,Fa.AT_LEAST_ONE_IDX,Ra.PROD_TYPE.REPETITION_MANDATORY,g.maxLookahead,(0,yc.getProductionDslName)(g))}),(0,to.forEach)(c,function(g){t.computeLookaheadFunc(i,g.idx,Fa.AT_LEAST_ONE_SEP_IDX,Ra.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,g.maxLookahead,(0,yc.getProductionDslName)(g))}),(0,to.forEach)(u,function(g){t.computeLookaheadFunc(i,g.idx,Fa.MANY_SEP_IDX,Ra.PROD_TYPE.REPETITION_WITH_SEPARATOR,g.maxLookahead,(0,yc.getProductionDslName)(g))})})})},r.prototype.computeLookaheadFunc=function(e,t,i,n,s,o){var a=this;this.TRACE_INIT(""+o+(t===0?"":t),function(){var l=(0,Ra.buildLookaheadFuncForOptionalProd)(t,e,s||a.maxLookahead,a.dynamicTokensEnabled,n,a.lookAheadBuilderForOptional),c=(0,Fa.getKeyForAutomaticLookahead)(a.fullRuleNameToShort[e.name],i,t);a.setLaFuncCache(c,l)})},r.prototype.lookAheadBuilderForOptional=function(e,t,i){return(0,Ra.buildSingleAlternativeLookaheadFunction)(e,t,i)},r.prototype.lookAheadBuilderForAlternatives=function(e,t,i,n){return(0,Ra.buildAlternativesLookAheadFunc)(e,t,i,n)},r.prototype.getKeyForAutomaticLookahead=function(e,t){var i=this.getLastExplicitRuleShortName();return(0,Fa.getKeyForAutomaticLookahead)(i,e,t)},r.prototype.getLaFuncFromCache=function(e){},r.prototype.getLaFuncFromMap=function(e){return this.lookAheadFuncsCache.get(e)},r.prototype.getLaFuncFromObj=function(e){return this.lookAheadFuncsCache[e]},r.prototype.setLaFuncCache=function(e,t){},r.prototype.setLaFuncCacheUsingMap=function(e,t){this.lookAheadFuncsCache.set(e,t)},r.prototype.setLaFuncUsingObj=function(e,t){this.lookAheadFuncsCache[e]=t},r}();Cy.LooksAhead=mye});var Pq=I(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.addNoneTerminalToCst=To.addTerminalToCst=To.setNodeLocationFull=To.setNodeLocationOnlyOffset=void 0;function Eye(r,e){isNaN(r.startOffset)===!0?(r.startOffset=e.startOffset,r.endOffset=e.endOffset):r.endOffset{"use strict";Object.defineProperty(OA,"__esModule",{value:!0});OA.defineNameProp=OA.functionName=OA.classNameFromInstance=void 0;var Bye=Kt();function Qye(r){return Dq(r.constructor)}OA.classNameFromInstance=Qye;var kq="name";function Dq(r){var e=r.name;return e||"anonymous"}OA.functionName=Dq;function bye(r,e){var t=Object.getOwnPropertyDescriptor(r,kq);return(0,Bye.isUndefined)(t)||t.configurable?(Object.defineProperty(r,kq,{enumerable:!1,configurable:!0,writable:!1,value:e}),!0):!1}OA.defineNameProp=bye});var Lq=I(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.validateRedundantMethods=vi.validateMissingCstMethods=vi.validateVisitor=vi.CstVisitorDefinitionError=vi.createBaseVisitorConstructorWithDefaults=vi.createBaseSemanticVisitorConstructor=vi.defaultVisit=void 0;var hs=Kt(),Td=ox();function Rq(r,e){for(var t=(0,hs.keys)(r),i=t.length,n=0;n: @@ -168,7 +168,7 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis