UNPKG

greybel-languageserver

Version:
51 lines 1.26 MB
"use strict";var oy=Object.defineProperty;var bq=Object.getOwnPropertyDescriptor;var _q=Object.getOwnPropertyNames;var vq=Object.prototype.hasOwnProperty;var wq=(t,e)=>()=>(t&&(e=t(t=0)),e);var h=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Sq=(t,e)=>{for(var n in e)oy(t,n,{get:e[n],enumerable:!0})},Tq=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _q(e))!vq.call(t,i)&&i!==n&&oy(t,i,{get:()=>e[i],enumerable:!(r=bq(e,i))||r.enumerable});return t};var xq=t=>Tq(oy({},"__esModule",{value:!0}),t);var Fr=h(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.getAllDependencyLocationsFromGraph=gt.parseDependencyRawLocation=gt.parseDependencyLocation=gt.DependencyType=gt.TypeAnalyzerStrategy=gt.IndentationType=gt.DefaultFileExtensions=gt.ConfigurationNamespace=gt.LanguageId=void 0;gt.LanguageId="greyscript";gt.ConfigurationNamespace="greybel";gt.DefaultFileExtensions=["gs","ms","src"];var kq;(function(t){t.Tab="Tab",t.Whitespace="Whitespace"})(kq=gt.IndentationType||(gt.IndentationType={}));var Iq;(function(t){t.Dependency="Dependency",t.Workspace="Workspace"})(Iq=gt.TypeAnalyzerStrategy||(gt.TypeAnalyzerStrategy={}));var Eq;(function(t){t.Root="root",t.Include="include",t.Import="import",t.NativeImport="native-import"})(Eq=gt.DependencyType||(gt.DependencyType={}));function Rq(t){return t.args&&t.args.length>0?`${t.type}:${t.args.join(":")}!${t.location}`:`${t.type}!${t.location}`}gt.parseDependencyLocation=Rq;function Pq(t){let e=t.indexOf("!"),[n,...r]=t.substring(0,e).split(":"),i=t.substring(e+1);return{type:n,location:i,args:r}}gt.parseDependencyRawLocation=Pq;function Aq(t,e=new Set){let n=[],r=[...t.children];for(;r.length>0;){let i=r.pop();e.has(i.item.document.textDocument.uri)||(e.add(i.item.document.textDocument.uri),n.push(i.item.document),r.push(...i.children))}return n}gt.getAllDependencyLocationsFromGraph=Aq});var ia=h(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});wp.Position=void 0;var ay=class{constructor(e,n){this.line=e,this.character=n}toString(){return`${this.line}:${this.character}`}};wp.Position=ay});var us=h(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.LiteralToken=Xn.Token=Xn.BaseToken=Xn.BaseTokenOptions=Xn.TokenType=void 0;var l0=ia(),Cq;(function(t){t.EOF="EOF",t.StringLiteral="StringLiteral",t.Keyword="Keyword",t.Identifier="Identifier",t.NumericLiteral="NumericLiteral",t.Punctuator="Punctuator",t.BooleanLiteral="BooleanLiteral",t.NilLiteral="NilLiteral",t.EOL="EOL",t.SliceOperator="SliceOperator",t.Comment="Comment",t.Invalid="Invalid"})(Cq=Xn.TokenType||(Xn.TokenType={}));var ly=class{};Xn.BaseTokenOptions=ly;var Hl=class{constructor(e){this.type=e.type,this.value=e.value,this.line=e.line,this.lineStart=e.lineStart,this.range=e.range,this.lastLine=e.lastLine,this.lastLineStart=e.lastLineStart,this.afterSpace=e.afterSpace;let n=e.offsetRange,r=e.range;this.start=new l0.Position(this.line,r[0]-n[0]+1),this.end=new l0.Position(this.lastLine||this.line,r[1]-n[1]+1)}toString(){let e=this.line,n=this.lastLine!==void 0?this.lastLine:this.line,r=this.start.character,i=this.end.character,s=`${e}:${r} - ${n}:${i}`;return`${this.type}[${s}: value = '${this.value}']`}};Xn.BaseToken=Hl;var cy=class extends Hl{};Xn.Token=cy;var uy=class extends Hl{constructor(e){super(e),this.raw=e.raw}toString(){let e=this.line,n=this.lastLine!==void 0?this.lastLine:this.line,r=this.start.character,i=this.end.character,s=`${e}:${r} - ${n}:${i}`;return`${this.type}[${s}: value = ${this.raw}]`}};Xn.LiteralToken=uy});var Sp=h(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});zl.CharacterCode=void 0;var Oq;(function(t){t[t.WHITESPACE=32]="WHITESPACE",t[t.QUOTE=34]="QUOTE",t[t.NUMBER_0=48]="NUMBER_0",t[t.NUMBER_1=49]="NUMBER_1",t[t.NUMBER_2=50]="NUMBER_2",t[t.NUMBER_3=51]="NUMBER_3",t[t.NUMBER_4=52]="NUMBER_4",t[t.NUMBER_5=53]="NUMBER_5",t[t.NUMBER_6=54]="NUMBER_6",t[t.NUMBER_7=55]="NUMBER_7",t[t.NUMBER_8=56]="NUMBER_8",t[t.NUMBER_9=57]="NUMBER_9",t[t.TAB=9]="TAB",t[t.NEW_LINE=10]="NEW_LINE",t[t.RETURN_LINE=13]="RETURN_LINE",t[t.SLASH=47]="SLASH",t[t.DOT=46]="DOT",t[t.EQUAL=61]="EQUAL",t[t.ASTERISK=42]="ASTERISK",t[t.CARET=94]="CARET",t[t.PERCENT=37]="PERCENT",t[t.COMMA=44]="COMMA",t[t.CURLY_BRACKET_LEFT=123]="CURLY_BRACKET_LEFT",t[t.CURLY_BRACKET_RIGHT=125]="CURLY_BRACKET_RIGHT",t[t.SQUARE_BRACKETS_LEFT=91]="SQUARE_BRACKETS_LEFT",t[t.SQUARE_BRACKETS_RIGHT=93]="SQUARE_BRACKETS_RIGHT",t[t.PARENTHESIS_LEFT=40]="PARENTHESIS_LEFT",t[t.PARENTHESIS_RIGHT=41]="PARENTHESIS_RIGHT",t[t.SEMICOLON=59]="SEMICOLON",t[t.HASH=35]="HASH",t[t.MINUS=45]="MINUS",t[t.PLUS=43]="PLUS",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.AT_SIGN=64]="AT_SIGN",t[t.COLON=58]="COLON",t[t.ARROW_LEFT=60]="ARROW_LEFT",t[t.ARROW_RIGHT=62]="ARROW_RIGHT",t[t.LETTER_E=69]="LETTER_E",t[t.LETTER_e=101]="LETTER_e"})(Oq=zl.CharacterCode||(zl.CharacterCode={}))});var sa=h(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.Keyword=void 0;var Dq;(function(t){t.If="if",t.In="in",t.Or="or",t.And="and",t.Isa="isa",t.For="for",t.Not="not",t.New="new",t.End="end",t.EndFor="end for",t.EndWhile="end while",t.EndFunction="end function",t.EndIf="end if",t.Then="then",t.Else="else",t.Break="break",t.While="while",t.ElseIf="else if",t.Return="return",t.Function="function",t.Continue="continue",t.Repeat="repeat"})(Dq=Yl.Keyword||(Yl.Keyword={}))});var hy=h(dy=>{"use strict";Object.defineProperty(dy,"__esModule",{value:!0});var ur=Sp(),Mq=sa(),py=class{constructor(){this.isKeyword=Set.prototype.has.bind(new Set(Object.values(Mq.Keyword)))}isWhitespace(e){return ur.CharacterCode.WHITESPACE===e||ur.CharacterCode.TAB===e}isEndOfLine(e){return ur.CharacterCode.NEW_LINE===e||ur.CharacterCode.RETURN_LINE===e}isComment(e,n){return ur.CharacterCode.SLASH===e&&ur.CharacterCode.SLASH===n}isIdentifierStart(e){return(e|32)>=97&&(e|32)<=122||e>=128||e===95}isIdentifierPart(e){return(e|32)>=97&&(e|32)<=122||e>=48&&e<=57||e>=128||e===95}isDecDigit(e){return e>=ur.CharacterCode.NUMBER_0&&e<=ur.CharacterCode.NUMBER_9}isWinNewline(e,n){switch(e){case ur.CharacterCode.RETURN_LINE:return ur.CharacterCode.NEW_LINE===n;case ur.CharacterCode.NEW_LINE:return ur.CharacterCode.RETURN_LINE===n}return!1}};dy.default=py});var Tp=h(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.ParserException=oa.LexerException=void 0;var fy=class extends Error{constructor(e,n){super(e),this.range=n}};oa.LexerException=fy;var my=class extends Error{constructor(e,n){super(e),this.range=n}};oa.ParserException=my});var gy=h(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.Literal=void 0;var Lq;(function(t){t.True="true",t.False="false",t.Null="null"})(Lq=Xl.Literal||(Xl.Literal={}))});var aa=h(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});Jl.Operator=void 0;var Nq;(function(t){t.Plus="+",t.Asterik="*",t.Minus="-",t.Slash="/",t.Power="^",t.Modulo="%",t.LessThan="<",t.GreaterThan=">",t.LessThanOrEqual="<=",t.GreaterThanOrEqual=">=",t.NotEqual="!=",t.Equal="==",t.Or="or",t.And="and",t.Not="not",t.Isa="isa",t.AddShorthand="+=",t.SubtractShorthand="-=",t.MultiplyShorthand="*=",t.DivideShorthand="/=",t.PowerShorthand="^=",t.ModuloShorthand="%=",t.Member=".",t.Assign="=",t.EndOfLine=";",t.EndOfFile="<eof>",t.SliceSeperator=":",t.Comma=",",t.Escape='"',t.SLBracket="[",t.SRBracket="]",t.CLBracket="{",t.CRBracket="}",t.LParenthesis="(",t.RParenthesis=")",t.Reference="@",t.New="new"})(Nq=Jl.Operator||(Jl.Operator={}))});var la=h(xp=>{"use strict";Object.defineProperty(xp,"__esModule",{value:!0});xp.Range=void 0;var yy=class{constructor(e,n){this.start=e,this.end=n}toString(){return`${this.start} - ${this.end}`}};xp.Range=yy});var vy=h(_y=>{"use strict";Object.defineProperty(_y,"__esModule",{value:!0});var by=class{constructor(){this._head=null,this._tail=null,this._size=0}enqueue(e){let n={value:e};this._head?this._tail.next=n:this._head=n,this._tail=n,this._size++}dequeue(){let e=this._head.value;if(e)return this._head=this._head.next,this._size--,e}peek(){var e;return((e=this._head)===null||e===void 0?void 0:e.value)||null}clear(){this._head=null,this._tail=null,this._size=0}copyInto(e){this._head=e._head,this._tail=e._tail,this._size=e._size}get size(){return this._size}*[Symbol.iterator](){let e=this._head;for(;e;)yield e,e=e.next}};_y.default=by});var Ty=h(Zl=>{"use strict";var u0=Zl&&Zl.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zl,"__esModule",{value:!0});var ct=us(),qq=u0(hy()),ve=Sp(),jq=Tp(),wy=sa(),Ql=gy(),ut=aa(),ca=ia(),Sy=la(),c0=u0(vy());function ps(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var kp=class t{constructor(e,n={}){let r=this;r.content=e,r.length=e.length,r.index=0,r.tokenStart=null,r.tabWidth=n.tabWidth||1,r.line=1,r.lineStart=0,r.offset=0,r.validator=n.validator||new qq.default,r.unsafe=n.unsafe,r.errors=[],r.backlog=new c0.default,r.snapshot=new c0.default}scan(e,n){let r=t.scanHandlers[e];return r?r.call(this,n):this.validator.isDecDigit(e)?this.scanNumericLiteral(n):(this.index++,null)}isAtWhitespace(){return this.validator.isWhitespace(this.codeAt())}codeAt(e=0){let n=this.index+e;return n<this.length?this.content.charCodeAt(n):0}createEOL(e){let n=this,r=new ct.Token({type:ct.TokenType.EOL,value:ut.Operator.EndOfLine,line:n.line,lineStart:n.lineStart,range:[n.tokenStart,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(r),r}createIdentifier(e,n){let r=this,i=new ct.Token({type:ct.TokenType.Identifier,value:e,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset],afterSpace:n});return r.snapshot.enqueue(i),i}createEOF(e){let n=this,r=new ct.Token({type:ct.TokenType.EOF,value:ut.Operator.EndOfFile,line:n.line,lineStart:n.lineStart,range:[n.index,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(r),r}createBoolean(e,n){let r=this,i=new ct.LiteralToken({type:ct.TokenType.BooleanLiteral,value:e===Ql.Literal.True,raw:e,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset],afterSpace:n});return r.snapshot.enqueue(i),i}createNull(e){let n=this,r=new ct.LiteralToken({type:ct.TokenType.NilLiteral,value:null,raw:Ql.Literal.Null,line:n.line,lineStart:n.lineStart,range:[n.tokenStart,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(r),r}createSlice(e){let n=new ct.Token({type:ct.TokenType.SliceOperator,value:ut.Operator.SliceSeperator,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offsetRange:[this.offset,this.offset],afterSpace:e});return this.snapshot.enqueue(n),n}createPunctuator(e,n){let r=new ct.Token({type:ct.TokenType.Punctuator,value:e,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offsetRange:[this.offset,this.offset],afterSpace:n});return this.snapshot.enqueue(r),r}createNumericLiteral(e,n,r){let i=new ct.LiteralToken({type:ct.TokenType.NumericLiteral,value:e,raw:n,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offsetRange:[this.offset,this.offset],afterSpace:r});return this.snapshot.enqueue(i),i}scanStringLiteral(e){let n=this,r=n.validator,i=n.line,s=n.lineStart,o=n.index,a=n.offset,l=n.offset,c=!1;for(;n.index<n.length;){n.index++;let g=n.codeAt();if(n.validator.isEndOfLine(g))r.isWinNewline(g,n.codeAt(1))&&n.index++,n.line++,l=n.index+1;else if(ve.CharacterCode.QUOTE===g){if(ve.CharacterCode.QUOTE!==n.codeAt(1)){c=!0;break}n.index++}}if(!c)return n.raise("Unexpected string end of file.",new Sy.Range(new ca.Position(i,o-a+1),new ca.Position(n.line,n.index-l+2)));n.index++;let u=n.content.slice(n.tokenStart,n.index),p=u.slice(1,-1).replace(/""/g,ut.Operator.Escape),d=new ct.LiteralToken({type:ct.TokenType.StringLiteral,value:p,raw:u,line:i,lineStart:s,range:[n.tokenStart,n.index],offsetRange:[a,l],afterSpace:e,lastLine:n.line,lastLineStart:n.lineStart});return n.offset=l,n.snapshot.enqueue(d),d}scanComment(e){let n=this,r=n.validator,i=n.line,s=n.lineStart;for(;this.index<this.length&&!r.isEndOfLine(n.codeAt());n.index++);r.isWinNewline(n.codeAt(),n.codeAt(1))&&n.index++;let o=n.content.slice(n.tokenStart+2,n.index),a=new ct.Token({type:ct.TokenType.Comment,value:o,line:i,lineStart:s,range:[n.tokenStart,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(a),a}scanNumericLiteral(e){let n=this.validator,r,i;for(;this.index<this.length&&(r=i,i=this.codeAt(),n.isDecDigit(i)||ve.CharacterCode.DOT===i||ve.CharacterCode.LETTER_E===i||ve.CharacterCode.LETTER_e===i||(ve.CharacterCode.MINUS===i||ve.CharacterCode.PLUS===i)&&(ve.CharacterCode.LETTER_E===r||ve.CharacterCode.LETTER_e===r));)this.index++;let s=this.content.slice(this.tokenStart,this.index),o=Number(s);return isNaN(o)?this.raise(`Invalid numeric literal: ${s}`,new Sy.Range(new ca.Position(this.line,this.tokenStart-this.offset+1),new ca.Position(this.line,this.index-this.offset+1))):this.createNumericLiteral(o,s,e)}scanPunctuator(e,n){return this.index+=e.length,this.createPunctuator(e,n)}skipWhiteSpace(){let e=this;for(;e.index<e.length;e.index++){let n=e.content[e.index];if(n===" ")e.offset-=e.tabWidth-1;else if(n!==" ")return}}scanKeyword(e,n){let r=this,i=r.validator,s=e;switch(e){case wy.Keyword.End:{for(r.index++;i.isIdentifierPart(r.codeAt());r.index++);s=r.content.slice(r.tokenStart,r.index);break}case wy.Keyword.Else:{let a=r.content.slice(r.tokenStart,r.index+3);a===wy.Keyword.ElseIf&&(r.index+=3,s=a);break}}let o=new ct.Token({type:ct.TokenType.Keyword,value:s,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset],afterSpace:n});return r.snapshot.enqueue(o),o}scanIdentifierOrKeyword(e){let n=this,r=n.validator;for(n.index++;r.isIdentifierPart(n.codeAt());n.index++);let i=n.content.slice(n.tokenStart,n.index);if(r.isKeyword(i))return n.scanKeyword(i,e);switch(i){case Ql.Literal.True:case Ql.Literal.False:return n.createBoolean(i,e);case Ql.Literal.Null:return n.createNull(e)}return n.createIdentifier(i,e)}next(){let e=this;if(e.backlog.size)return e.backlog.dequeue();let n=e.index;e.skipWhiteSpace();let r=n<e.index,i=e.codeAt();if(e.validator.isComment(i,e.codeAt(1)))return e.tokenStart=e.index,e.scanComment(r);if(this.index>=this.length)return e.createEOF(r);if(e.tokenStart=e.index,e.validator.isEndOfLine(i)){e.validator.isWinNewline(i,e.codeAt(1))&&e.index++;let a=e.createEOL(r);return e.line++,e.offset=e.index+1,e.lineStart=++e.index,a}if(e.validator.isIdentifierStart(i))return e.scanIdentifierOrKeyword(r);let s=e.line,o=e.scan(i,r);return o||e.raise(`Invalid character ${i} (Code: ${String.fromCharCode(i)})`,new Sy.Range(new ca.Position(s,e.tokenStart-e.offset+1),new ca.Position(e.line,e.index-e.offset+1)))}recordSnapshot(){this.snapshot.clear()}recoverFromSnapshot(){this.backlog.copyInto(this.snapshot)}raise(e,n){let r=this,i=new jq.LexerException(e,n);if(r.errors.push(i),r.unsafe)return new ct.Token({type:ct.TokenType.Invalid,value:"",line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset]});throw i}};Zl.default=kp;kp.scanHandlers={[ve.CharacterCode.QUOTE]:function(e){return this.scanStringLiteral(e)},[ve.CharacterCode.DOT]:function(e){return this.validator.isDecDigit(this.codeAt(1))?this.scanNumericLiteral(e):(this.index++,this.createPunctuator(ut.Operator.Member,e))},[ve.CharacterCode.EQUAL]:function(e){return ve.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ut.Operator.Equal,e):this.scanPunctuator(ut.Operator.Assign,e)},[ve.CharacterCode.ARROW_LEFT]:function(e){return ve.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ut.Operator.LessThanOrEqual,e):this.scanPunctuator(ut.Operator.LessThan,e)},[ve.CharacterCode.ARROW_RIGHT]:function(e){return ve.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ut.Operator.GreaterThanOrEqual,e):this.scanPunctuator(ut.Operator.GreaterThan,e)},[ve.CharacterCode.EXCLAMATION_MARK]:function(e){return ve.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ut.Operator.NotEqual,e):(this.index++,null)},[ve.CharacterCode.MINUS]:function(e){return ve.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ut.Operator.SubtractShorthand,e):this.scanPunctuator(ut.Operator.Minus,e)},[ve.CharacterCode.PLUS]:function(e){return ve.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ut.Operator.AddShorthand,e):this.scanPunctuator(ut.Operator.Plus,e)},[ve.CharacterCode.ASTERISK]:function(e){return ve.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ut.Operator.MultiplyShorthand,e):this.scanPunctuator(ut.Operator.Asterik,e)},[ve.CharacterCode.SLASH]:function(e){return ve.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ut.Operator.DivideShorthand,e):this.scanPunctuator(ut.Operator.Slash,e)},[ve.CharacterCode.COLON]:function(e){return this.index++,this.createSlice(e)},[ve.CharacterCode.CARET]:function(e){return ve.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ut.Operator.PowerShorthand,e):this.scanPunctuator(ut.Operator.Power,e)},[ve.CharacterCode.PERCENT]:function(e){return ve.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(ut.Operator.ModuloShorthand,e):this.scanPunctuator(ut.Operator.Modulo,e)},[ve.CharacterCode.SEMICOLON]:function(e){return this.index++,this.createEOL(e)},[ve.CharacterCode.COMMA]:ps,[ve.CharacterCode.CURLY_BRACKET_LEFT]:ps,[ve.CharacterCode.CURLY_BRACKET_RIGHT]:ps,[ve.CharacterCode.SQUARE_BRACKETS_LEFT]:ps,[ve.CharacterCode.SQUARE_BRACKETS_RIGHT]:ps,[ve.CharacterCode.PARENTHESIS_LEFT]:ps,[ve.CharacterCode.PARENTHESIS_RIGHT]:ps,[ve.CharacterCode.AT_SIGN]:ps}});var pt=h(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.ASTComment=Jn.ASTBaseBlockWithScope=Jn.ASTBaseBlock=Jn.ASTBase=Jn.ASTType=void 0;var p0;(function(t){t.BreakStatement="BreakStatement",t.ContinueStatement="ContinueStatement",t.ReturnStatement="ReturnStatement",t.IfShortcutStatement="IfShortcutStatement",t.IfShortcutClause="IfShortcutClause",t.ElseifShortcutClause="ElseifShortcutClause",t.ElseShortcutClause="ElseShortcutClause",t.IfStatement="IfStatement",t.IfClause="IfClause",t.ElseifClause="ElseifClause",t.ElseClause="ElseClause",t.WhileStatement="WhileStatement",t.AssignmentStatement="AssignmentStatement",t.CallStatement="CallStatement",t.FunctionDeclaration="FunctionDeclaration",t.ForGenericStatement="ForGenericStatement",t.Chunk="Chunk",t.Identifier="Identifier",t.StringLiteral="StringLiteral",t.NumericLiteral="NumericLiteral",t.BooleanLiteral="BooleanLiteral",t.NilLiteral="NilLiteral",t.Unknown="Unknown",t.MemberExpression="MemberExpression",t.CallExpression="CallExpression",t.Comment="Comment",t.NegationExpression="NegationExpression",t.BinaryNegatedExpression="BinaryNegatedExpression",t.UnaryExpression="UnaryExpression",t.MapKeyString="MapKeyString",t.MapValue="MapValue",t.MapConstructorExpression="MapConstructorExpression",t.MapCallExpression="MapCallExpression",t.ListValue="ListValue",t.ListConstructorExpression="ListConstructorExpression",t.EmptyExpression="EmptyExpression",t.IndexExpression="IndexExpression",t.BinaryExpression="BinaryExpression",t.LogicalExpression="LogicalExpression",t.IsaExpression="IsaExpression",t.SliceExpression="SliceExpression",t.ImportCodeExpression="ImportCodeExpression",t.InvalidCodeExpression="InvalidCodeExpression",t.ParenthesisExpression="ParenthesisExpression",t.ComparisonGroupExpression="ComparisonGroupExpression"})(p0=Jn.ASTType||(Jn.ASTType={}));var ec=class t{constructor(e,n){this.type=e,this.start=n.start,this.end=n.end,this.range=n.range,this.scope=n.scope||null}toString(){return`${this.type}[${this.start}-${this.end}][]`}clone(){return new t(this.type,{start:this.start,end:this.end,range:this.range,scope:this.scope})}};Jn.ASTBase=ec;var Ip=class t extends ec{constructor(e,n){super(e,n),this.body=n.body||[]}toString(){let e=this.body.map(n=>`${n}`).join(` `).split(` `).map(n=>` ${n}`).join(` `);return`${this.type}[${this.start}-${this.end}][${e.length>0?` ${e} `:""}]`}clone(){return new t(this.type,{body:this.body.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Jn.ASTBaseBlock=Ip;var xy=class t extends Ip{constructor(e,n){super(e,n),this.namespaces=n.namespaces||[],this.definitions=n.definitions||[],this.returns=n.returns||[]}clone(){return new t(this.type,{namespaces:this.namespaces,definitions:this.definitions.map(e=>e.clone()),returns:this.returns.map(e=>e.clone()),body:this.body.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Jn.ASTBaseBlockWithScope=xy;var ky=class t extends ec{constructor(e){super(p0.Comment,e),this.value=e.value,this.isStatement=e.isStatement,this.isMultiline=e.isMultiline||!1}toString(){return`Comment[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value,isMultiline:this.isMultiline,isStatement:this.isStatement,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Jn.ASTComment=ky});var Ey=h(Ep=>{"use strict";Object.defineProperty(Ep,"__esModule",{value:!0});Ep.ASTAssignmentStatement=void 0;var d0=pt(),Iy=class t extends d0.ASTBase{constructor(e){super(d0.ASTType.AssignmentStatement,e),this.variable=e.variable,this.init=e.init}toString(){return`AssignmentStatement[${this.start}-${this.end}][${this.variable} = ${this.init}]`}clone(){return new t({variable:this.variable.clone(),init:this.init.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Ep.ASTAssignmentStatement=Iy});var Py=h(Rp=>{"use strict";Object.defineProperty(Rp,"__esModule",{value:!0});Rp.ASTBinaryExpression=void 0;var h0=pt(),Ry=class t extends h0.ASTBase{constructor(e){super(h0.ASTType.BinaryExpression,e),this.operator=e.operator,this.left=e.left,this.right=e.right}toString(){return`${this.type}[${this.start}-${this.end}][${this.left} ${this.operator} ${this.right}]`}clone(){return new t({operator:this.operator,left:this.left.clone(),right:this.right.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Rp.ASTBinaryExpression=Ry});var Oy=h(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.ASTCallExpression=ua.ASTCallStatement=void 0;var Pp=pt(),Ay=class t extends Pp.ASTBase{constructor(e){super(Pp.ASTType.CallStatement,e),this.expression=e.expression}toString(){return`CallStatment[${this.start}-${this.end}][${this.expression}]`}clone(){return new t({expression:this.expression,start:this.start,end:this.end,range:this.range,scope:this.scope})}};ua.ASTCallStatement=Ay;var Cy=class t extends Pp.ASTBase{constructor(e){super(Pp.ASTType.CallExpression,e),this.base=e.base,this.arguments=e.arguments||[]}toString(){return`CallExpression[${this.start}-${this.end}][${this.base}(${this.arguments.map(e=>e.toString()).join(", ")})]`}clone(){return new t({base:this.base.clone(),arguments:this.arguments.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};ua.ASTCallExpression=Cy});var My=h(Ap=>{"use strict";Object.defineProperty(Ap,"__esModule",{value:!0});Ap.ASTChunk=void 0;var f0=pt(),Dy=class t extends f0.ASTBaseBlockWithScope{constructor(e){super(f0.ASTType.Chunk,e),this.literals=e.literals||[],this.comments=e.comments||[],this.scopes=e.scopes||[],this.lines=e.lines||{}}toString(){if(this.body.length===0)return`Chunk[${this.start}-${this.end}][]`;let e=this.body.map(n=>`${n}`).join(` `).split(` `).map(n=>` ${n}`).join(` `);return`Chunk[${this.start}-${this.end}][ ${e} ]`}clone(){return new t({literals:this.literals.map(e=>e.clone()),comments:this.comments.map(e=>e.clone()),scopes:this.scopes.map(e=>e.clone()),lines:this.lines,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Ap.ASTChunk=Dy});var Ny=h(Cp=>{"use strict";Object.defineProperty(Cp,"__esModule",{value:!0});Cp.ASTComparisonGroupExpression=void 0;var m0=pt(),Ly=class t extends m0.ASTBase{constructor(e){super(m0.ASTType.ComparisonGroupExpression,e),this.operators=e.operators,this.expressions=e.expressions}toString(){let e=[this.expressions[0].toString()];for(let n=1;n<this.expressions.length;n++)e.push(this.operators[n-1],this.expressions[n].toString());return`${this.type}[${this.start}-${this.end}][${e.join(" ")}]`}clone(){return new t({operators:this.operators,expressions:this.expressions,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Cp.ASTComparisonGroupExpression=Ly});var jy=h(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});Op.ASTForGenericStatement=void 0;var g0=pt(),qy=class t extends g0.ASTBaseBlock{constructor(e){super(g0.ASTType.ForGenericStatement,e),this.variable=e.variable,this.iterator=e.iterator}toString(){if(this.body.length===0)return`${this.type}[${this.start}-${this.end}][${this.variable} in ${this.iterator}]`;let e=this.body.map(n=>`${n}`).join(` `).split(` `).map(n=>` ${n}`).join(` `);return`For[${this.start}-${this.end}][${this.variable} in ${this.iterator} ${e} ]`}clone(){return new t({variable:this.variable.clone(),iterator:this.iterator.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Op.ASTForGenericStatement=qy});var By=h(Dp=>{"use strict";Object.defineProperty(Dp,"__esModule",{value:!0});Dp.ASTFunctionStatement=void 0;var y0=pt(),Fy=class t extends y0.ASTBaseBlockWithScope{constructor(e){super(y0.ASTType.FunctionDeclaration,e),this.parameters=e.parameters||[],this.assignment=e.assignment}toString(){let e=this.parameters.map(r=>r).join(", ");if(this.body.length===0)return`${this.type}[${this.start}-${this.end}][${e}]`;let n=this.body.map(r=>`${r}`).join(` `).split(` `).map(r=>` ${r}`).join(` `);return`Function[${this.start}-${this.end}][${e} => ${n} ]`}clone(){return new t({parameters:this.parameters.map(e=>e.clone()),assignment:this.assignment.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Dp.ASTFunctionStatement=Fy});var Vy=h(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.ASTIndexExpression=Br.ASTMemberExpression=Br.ASTIdentifier=Br.ASTIdentifierKind=void 0;var pa=pt(),Fq;(function(t){t.Variable="variable",t.Argument="argument",t.ForInVariable="for-in-variable",t.Property="property"})(Fq=Br.ASTIdentifierKind||(Br.ASTIdentifierKind={}));var $y=class t extends pa.ASTBase{constructor(e){super(pa.ASTType.Identifier,e),this.name=e.name,this.kind=e.kind}toString(){return`Identifier[${this.start}-${this.end}][${this.name}]`}clone(){return new t({name:this.name,kind:this.kind,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Br.ASTIdentifier=$y;var Uy=class t extends pa.ASTBase{constructor(e){super(pa.ASTType.MemberExpression,e),this.indexer=e.indexer,this.identifier=e.identifier,this.base=e.base}toString(){return`MemberExpression[${this.start}-${this.end}][${this.base}.${this.identifier}]`}clone(){return new t({indexer:this.indexer,identifier:this.identifier.clone(),base:this.base,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Br.ASTMemberExpression=Uy;var Wy=class t extends pa.ASTBase{constructor(e){super(pa.ASTType.IndexExpression,e),this.base=e.base,this.index=e.index,this.isStatementStart=e.isStatementStart}toString(){return`IndexExpression[${this.start}-${this.end}]${this.isStatementStart?"[isStatementStart]":""}[${this.base}[${this.index}]]`}clone(){return new t({base:this.base.clone(),index:this.index.clone(),isStatementStart:this.isStatementStart,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Br.ASTIndexExpression=Wy});var zy=h(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.ASTElseClause=ai.ASTIfClause=ai.ASTIfStatement=ai.ASTClause=void 0;var b0=pt(),tc=class extends b0.ASTBaseBlock{};ai.ASTClause=tc;var Ky=class t extends b0.ASTBase{constructor(e,n){super(e,n),this.clauses=n.clauses||[]}toString(){if(this.clauses.length===0)return`IfStatement[${this.start}-${this.end}][]`;let e=this.clauses.map(n=>`${n}`).join(` `).split(` `).map(n=>` ${n}`).join(` `);return`IfStatement[${this.start}-${this.end}][ ${e} ]`}clone(){return new t(this.type,{clauses:this.clauses.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};ai.ASTIfStatement=Ky;var Gy=class t extends tc{constructor(e,n){super(e,n),this.condition=n.condition}toString(){if(this.body.length===0)return`${this.type}[${this.start}-${this.end}][${this.condition}]`;let e=this.body.map(n=>`${n}`).join(` `).split(` `).map(n=>` ${n}`).join(` `);return`${this.type}[${this.start}-${this.end}][${this.condition} ${e} ]`}clone(){return new t(this.type,{condition:this.condition.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};ai.ASTIfClause=Gy;var Hy=class t extends tc{constructor(e,n){super(e,n)}toString(){if(this.body.length===0)return`${this.type}[]`;let e=this.body.map(n=>`${n}`).join(` `).split(` `).map(n=>` ${n}`).join(` `);return`${this.type}[${this.start}-${this.end}][ ${e} }]`}clone(){return new t(this.type,{start:this.start,end:this.end,range:this.range,scope:this.scope})}};ai.ASTElseClause=Hy});var Xy=h(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});Mp.ASTIsaExpression=void 0;var _0=pt(),Yy=class t extends _0.ASTBase{constructor(e){super(_0.ASTType.IsaExpression,e),this.operator=e.operator,this.left=e.left,this.right=e.right}toString(){return`${this.type}[${this.start}-${this.end}][${this.left} ${this.operator} ${this.right}]`}clone(){return new t({operator:this.operator,left:this.left.clone(),right:this.right.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Mp.ASTIsaExpression=Yy});var Zy=h(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});da.ASTListConstructorExpression=da.ASTListValue=void 0;var Lp=pt(),Jy=class t extends Lp.ASTBase{constructor(e){super(Lp.ASTType.ListValue,e),this.value=e.value}toString(){return`ListValue[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};da.ASTListValue=Jy;var Qy=class t extends Lp.ASTBase{constructor(e){super(Lp.ASTType.ListConstructorExpression,e),this.fields=e.fields||[]}toString(){if(this.fields.length===0)return`ListConstructor[${this.start}-${this.end}][]`;let e=this.fields.map(n=>`${n}`).join(` `).split(` `).map(n=>` ${n}`).join(` `);return`ListConstructor[${this.start}-${this.end}][ ${e} ]`}clone(){return new t({fields:this.fields.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};da.ASTListConstructorExpression=Qy});var sb=h(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.ASTNilLiteral=pr.ASTStringLiteral=pr.ASTBooleanLiteral=pr.ASTNumericLiteral=pr.ASTLiteral=void 0;var v0=us(),ib=pt(),eo=class extends ib.ASTBase{};pr.ASTLiteral=eo;var eb=class t extends eo{constructor(e){super(v0.TokenType.NumericLiteral,e),this.value=e.value,this.raw=e.raw,this.negated=!1}toString(){return`Literal[${this.start}-${this.end}][${this.negated?"-":""}${this.value}]`}clone(){let e=new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope});return e.negated=this.negated,e}};pr.ASTNumericLiteral=eb;var tb=class t extends eo{constructor(e){super(v0.TokenType.BooleanLiteral,e),this.value=e.value,this.raw=e.raw,this.negated=!1}toString(){return`Literal[${this.start}-${this.end}][${this.negated?"-":""}${this.value}]`}clone(){let e=new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope});return e.negated=this.negated,e}};pr.ASTBooleanLiteral=tb;var nb=class t extends eo{constructor(e){super(ib.ASTType.StringLiteral,e),this.value=e.value,this.raw=e.raw}toString(){return`Literal[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope})}};pr.ASTStringLiteral=nb;var rb=class t extends eo{constructor(e){super(ib.ASTType.NilLiteral,e),this.value=e.value,this.raw=e.raw}toString(){return`Literal[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope})}};pr.ASTNilLiteral=rb});var ab=h(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});Np.ASTLogicalExpression=void 0;var w0=pt(),ob=class t extends w0.ASTBase{constructor(e){super(w0.ASTType.LogicalExpression,e),this.operator=e.operator,this.left=e.left,this.right=e.right}toString(){return`${this.type}[${this.start}-${this.end}][${this.left} ${this.operator} ${this.right}]`}clone(){return new t({operator:this.operator,left:this.left.clone(),right:this.right.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Np.ASTLogicalExpression=ob});var ub=h(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.ASTMapConstructorExpression=ha.ASTMapKeyString=void 0;var qp=pt(),lb=class t extends qp.ASTBase{constructor(e){super(qp.ASTType.MapKeyString,e),this.key=e.key,this.value=e.value}toString(){return`MapKeyString[${this.start}-${this.end}][${this.key}: ${this.value}]`}clone(){return new t({key:this.key.clone(),value:this.value.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};ha.ASTMapKeyString=lb;var cb=class t extends qp.ASTBase{constructor(e){super(qp.ASTType.MapConstructorExpression,e),this.fields=e.fields||[]}toString(){if(this.fields.length===0)return`MapConstructor[${this.start}-${this.end}][]`;let e=this.fields.map(n=>`${n}`).join(` `).split(` `).map(n=>` ${n}`).join(` `);return`MapConstructor[${this.start}-${this.end}][ ${e} ]`}clone(){return new t({fields:this.fields.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};ha.ASTMapConstructorExpression=cb});var db=h(jp=>{"use strict";Object.defineProperty(jp,"__esModule",{value:!0});jp.ASTParenthesisExpression=void 0;var S0=pt(),pb=class t extends S0.ASTBase{constructor(e){super(S0.ASTType.ParenthesisExpression,e),this.expression=e.expression}toString(){return this.expression.toString()}clone(){return new t({expression:this.expression.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};jp.ASTParenthesisExpression=pb});var fb=h(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});Fp.ASTReturnStatement=void 0;var T0=pt(),hb=class t extends T0.ASTBase{constructor(e){super(T0.ASTType.ReturnStatement,e),this.argument=e.argument}toString(){return`ReturnStatement[${this.start}-${this.end}][${this.argument}]`}clone(){return new t({argument:this.argument.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Fp.ASTReturnStatement=hb});var gb=h(Bp=>{"use strict";Object.defineProperty(Bp,"__esModule",{value:!0});Bp.ASTSliceExpression=void 0;var x0=pt(),mb=class t extends x0.ASTBase{constructor(e){super(x0.ASTType.SliceExpression,e),this.left=e.left,this.right=e.right,this.base=e.base}toString(){return`SliceExpression[${this.start}-${this.end}][${this.base}[${this.left}:${this.right}]]`}clone(){return new t({base:this.base.clone(),left:this.left.clone(),right:this.right.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Bp.ASTSliceExpression=mb});var _b=h(Up=>{"use strict";Object.defineProperty(Up,"__esModule",{value:!0});Up.ASTUnaryExpression=void 0;var yb=aa(),$p=pt(),bb=class t extends $p.ASTBase{constructor(e){super(t.getUnaryType(e.operator),e),this.argument=e.argument,this.operator=e.operator}static getUnaryType(e){switch(e){case yb.Operator.Not:return $p.ASTType.NegationExpression;case yb.Operator.Plus:case yb.Operator.Minus:return $p.ASTType.BinaryNegatedExpression;default:return $p.ASTType.UnaryExpression}}toString(){return`${this.type}[${this.start}-${this.end}][${this.operator} ${this.argument}]`}clone(){return new t({argument:this.argument.clone(),operator:this.operator,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Up.ASTUnaryExpression=bb});var wb=h(Wp=>{"use strict";Object.defineProperty(Wp,"__esModule",{value:!0});Wp.ASTWhileStatement=void 0;var k0=pt(),vb=class t extends k0.ASTBaseBlock{constructor(e){super(k0.ASTType.WhileStatement,e),this.condition=e.condition}toString(){if(this.body.length===0)return`WhileStatement[${this.start}-${this.end}][${this.condition}]`;let e=this.body.map(n=>`${n}`).join(` `).split(` `).map(n=>` ${n}`).join(` `);return`WhileStatement[${this.start}-${this.end}][${this.condition} ${e} ]`}clone(){return new t({condition:this.condition.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Wp.ASTWhileStatement=vb});var E0=h(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});Vp.ASTBreakStatement=void 0;var I0=pt(),Sb=class t extends I0.ASTBase{constructor(e){super(I0.ASTType.BreakStatement,e),this.iterator=e.iterator}toString(){return`BreakStatement[${this.start}-${this.end}]`}clone(){var e;return new t({iterator:(e=this.iterator)===null||e===void 0?void 0:e.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Vp.ASTBreakStatement=Sb});var P0=h(Kp=>{"use strict";Object.defineProperty(Kp,"__esModule",{value:!0});Kp.ASTContinueStatement=void 0;var R0=pt(),Tb=class t extends R0.ASTBase{constructor(e){super(R0.ASTType.ContinueStatement,e),this.iterator=e.iterator}toString(){return`ContinueStatement[${this.start}-${this.end}]`}clone(){var e;return new t({iterator:(e=this.iterator)===null||e===void 0?void 0:e.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Kp.ASTContinueStatement=Tb});var Xp=h(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.ASTWhileStatement=G.ASTUnaryExpression=G.ASTSliceExpression=G.ASTReturnStatement=G.ASTParenthesisExpression=G.ASTMapKeyString=G.ASTMapConstructorExpression=G.ASTLogicalExpression=G.ASTStringLiteral=G.ASTNumericLiteral=G.ASTNilLiteral=G.ASTLiteral=G.ASTBooleanLiteral=G.ASTListValue=G.ASTListConstructorExpression=G.ASTIsaExpression=G.ASTIfStatement=G.ASTIfClause=G.ASTElseClause=G.ASTClause=G.ASTMemberExpression=G.ASTIndexExpression=G.ASTIdentifierKind=G.ASTIdentifier=G.ASTFunctionStatement=G.ASTForGenericStatement=G.ASTContinueStatement=G.ASTComparisonGroupExpression=G.ASTChunk=G.ASTCallStatement=G.ASTCallExpression=G.ASTBreakStatement=G.ASTBinaryExpression=G.ASTType=G.ASTComment=G.ASTBaseBlockWithScope=G.ASTBaseBlock=G.ASTBase=G.ASTAssignmentStatement=G.ASTProvider=void 0;var Gp=us(),A0=Xp(),Bq=Ey(),Sn=pt(),$q=Py(),C0=Oy(),Uq=My(),Wq=Ny(),Vq=jy(),Kq=By(),xb=Vy(),ds=zy(),Gq=Xy(),O0=Zy(),Hp=sb(),Hq=ab(),D0=ub(),zq=db(),Yq=fb(),Xq=gb(),Jq=_b(),Qq=wb(),kb=class{returnStatement(e){return new Yq.ASTReturnStatement(e)}ifShortcutStatement(e){return new ds.ASTIfStatement(Sn.ASTType.IfShortcutStatement,e)}ifShortcutClause(e){return new ds.ASTIfClause(Sn.ASTType.IfShortcutClause,e)}elseifShortcutClause(e){return new ds.ASTIfClause(Sn.ASTType.ElseifShortcutClause,e)}elseShortcutClause(e){return new ds.ASTElseClause(Sn.ASTType.ElseShortcutClause,e)}ifStatement(e){return new ds.ASTIfStatement(Sn.ASTType.IfStatement,e)}ifClause(e){return new ds.ASTIfClause(Sn.ASTType.IfClause,e)}elseifClause(e){return new ds.ASTIfClause(Sn.ASTType.ElseifClause,e)}elseClause(e){return new ds.ASTElseClause(Sn.ASTType.ElseClause,e)}whileStatement(e){return new Qq.ASTWhileStatement(e)}assignmentStatement(e){return new Bq.ASTAssignmentStatement(e)}callStatement(e){return new C0.ASTCallStatement(e)}functionStatement(e){return new Kq.ASTFunctionStatement(e)}forGenericStatement(e){return new Vq.ASTForGenericStatement(e)}chunk(e){return new Uq.ASTChunk(e)}identifier(e){return new xb.ASTIdentifier(e)}literal(e,n){switch(e){case Gp.TokenType.StringLiteral:return new Hp.ASTStringLiteral(n);case Gp.TokenType.NumericLiteral:return new Hp.ASTNumericLiteral(n);case Gp.TokenType.BooleanLiteral:return new Hp.ASTBooleanLiteral(n);case Gp.TokenType.NilLiteral:return new Hp.ASTNilLiteral(n)}}memberExpression(e){return new xb.ASTMemberExpression(e)}callExpression(e){return new C0.ASTCallExpression(e)}comment(e){return new Sn.ASTComment(e)}unaryExpression(e){return new Jq.ASTUnaryExpression(e)}mapKeyString(e){return new D0.ASTMapKeyString(e)}mapConstructorExpression(e){return new D0.ASTMapConstructorExpression(e)}listValue(e){return new O0.ASTListValue(e)}listConstructorExpression(e){return new O0.ASTListConstructorExpression(e)}unknown(e){return new Sn.ASTBase(Sn.ASTType.Unknown,e)}emptyExpression(e){return new Sn.ASTBase(Sn.ASTType.EmptyExpression,e)}invalidCodeExpression(e){return new Sn.ASTBase(Sn.ASTType.InvalidCodeExpression,e)}indexExpression(e){return new xb.ASTIndexExpression(e)}logicalExpression(e){return new Hq.ASTLogicalExpression(e)}isaExpression(e){return new Gq.ASTIsaExpression(e)}binaryExpression(e){return new $q.ASTBinaryExpression(e)}sliceExpression(e){return new Xq.ASTSliceExpression(e)}parenthesisExpression(e){return new zq.ASTParenthesisExpression(e)}comparisonGroupExpression(e){return new Wq.ASTComparisonGroupExpression(e)}breakStatement(e){return new A0.ASTBreakStatement(e)}continueStatement(e){return new A0.ASTContinueStatement(e)}};G.ASTProvider=kb;var Zq=Ey();Object.defineProperty(G,"ASTAssignmentStatement",{enumerable:!0,get:function(){return Zq.ASTAssignmentStatement}});var nc=pt();Object.defineProperty(G,"ASTBase",{enumerable:!0,get:function(){return nc.ASTBase}});Object.defineProperty(G,"ASTBaseBlock",{enumerable:!0,get:function(){return nc.ASTBaseBlock}});Object.defineProperty(G,"ASTBaseBlockWithScope",{enumerable:!0,get:function(){return nc.ASTBaseBlockWithScope}});Object.defineProperty(G,"ASTComment",{enumerable:!0,get:function(){return nc.ASTComment}});Object.defineProperty(G,"ASTType",{enumerable:!0,get:function(){return nc.ASTType}});var ej=Py();Object.defineProperty(G,"ASTBinaryExpression",{enumerable:!0,get:function(){return ej.ASTBinaryExpression}});var tj=E0();Object.defineProperty(G,"ASTBreakStatement",{enumerable:!0,get:function(){return tj.ASTBreakStatement}});var M0=Oy();Object.defineProperty(G,"ASTCallExpression",{enumerable:!0,get:function(){return M0.ASTCallExpression}});Object.defineProperty(G,"ASTCallStatement",{enumerable:!0,get:function(){return M0.ASTCallStatement}});var nj=My();Object.defineProperty(G,"ASTChunk",{enumerable:!0,get:function(){return nj.ASTChunk}});var rj=Ny();Object.defineProperty(G,"ASTComparisonGroupExpression",{enumerable:!0,get:function(){return rj.ASTComparisonGroupExpression}});var ij=P0();Object.defineProperty(G,"ASTContinueStatement",{enumerable:!0,get:function(){return ij.ASTContinueStatement}});var sj=jy();Object.defineProperty(G,"ASTForGenericStatement",{enumerable:!0,get:function(){return sj.ASTForGenericStatement}});var oj=By();Object.defineProperty(G,"ASTFunctionStatement",{enumerable:!0,get:function(){return oj.ASTFunctionStatement}});var zp=Vy();Object.defineProperty(G,"ASTIdentifier",{enumerable:!0,get:function(){return zp.ASTIdentifier}});Object.defineProperty(G,"ASTIdentifierKind",{enumerable:!0,get:function(){return zp.ASTIdentifierKind}});Object.defineProperty(G,"ASTIndexExpression",{enumerable:!0,get:function(){return zp.ASTIndexExpression}});Object.defineProperty(G,"ASTMemberExpression",{enumerable:!0,get:function(){return zp.ASTMemberExpression}});var Yp=zy();Object.defineProperty(G,"ASTClause",{enumerable:!0,get:function(){return Yp.ASTClause}});Object.defineProperty(G,"ASTElseClause",{enumerable:!0,get:function(){return Yp.ASTElseClause}});Object.defineProperty(G,"ASTIfClause",{enumerable:!0,get:function(){return Yp.ASTIfClause}});Object.defineProperty(G,"ASTIfStatement",{enumerable:!0,get:function(){return Yp.ASTIfStatement}});var aj=Xy();Object.defineProperty(G,"ASTIsaExpression",{enumerable:!0,get:function(){return aj.ASTIsaExpression}});var L0=Zy();Object.defineProperty(G,"ASTListConstructorExpression",{enumerable:!0,get:function(){return L0.ASTListConstructorExpression}});Object.defineProperty(G,"ASTListValue",{enumerable:!0,get:function(){return L0.ASTListValue}});var rc=sb();Object.defineProperty(G,"ASTBooleanLiteral",{enumerable:!0,get:function(){return rc.ASTBooleanLiteral}});Object.defineProperty(G,"ASTLiteral",{enumerable:!0,get:function(){return rc.ASTLiteral}});Object.defineProperty(G,"ASTNilLiteral",{enumerable:!0,get:function(){return rc.ASTNilLiteral}});Object.defineProperty(G,"ASTNumericLiteral",{enumerable:!0,get:function(){return rc.ASTNumericLiteral}});Object.defineProperty(G,"ASTStringLiteral",{enumerable:!0,get:function(){return rc.ASTStringLiteral}});var lj=ab();Object.defineProperty(G,"ASTLogicalExpression",{enumerable:!0,get:function(){return lj.ASTLogicalExpression}});var N0=ub();Object.defineProperty(G,"ASTMapConstructorExpression",{enumerable:!0,get:function(){return N0.ASTMapConstructorExpression}});Object.defineProperty(G,"ASTMapKeyString",{enumerable:!0,get:function(){return N0.ASTMapKeyString}});var cj=db();Object.defineProperty(G,"ASTParenthesisExpression",{enumerable:!0,get:function(){return cj.ASTParenthesisExpression}});var uj=fb();Object.defineProperty(G,"ASTReturnStatement",{enumerable:!0,get:function(){return uj.ASTReturnStatement}});var pj=gb();Object.defineProperty(G,"ASTSliceExpression",{enumerable:!0,get:function(){return pj.ASTSliceExpression}});var dj=_b();Object.defineProperty(G,"ASTUnaryExpression",{enumerable:!0,get:function(){return dj.ASTUnaryExpression}});var hj=wb();Object.defineProperty(G,"ASTWhileStatement",{enumerable:!0,get:function(){return hj.ASTWhileStatement}})});var Rb=h(Eb=>{"use strict";Object.defineProperty(Eb,"__esModule",{value:!0});var hs=us(),Ib=class{constructor(){this.isNonNilLiteral=Set.prototype.has.bind(new Set([hs.TokenType.StringLiteral,hs.TokenType.NumericLiteral,hs.TokenType.BooleanLiteral])),this.isLiteral=Set.prototype.has.bind(new Set([hs.TokenType.StringLiteral,hs.TokenType.NumericLiteral,hs.TokenType.BooleanLiteral,hs.TokenType.NilLiteral]))}isComment(e){return e===hs.TokenType.Comment}};Eb.default=Ib});var Ab=h(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.SelectorGroups=se.SelectorGroupType=se.getSelectorsFromGroup=se.createSelectorGroup=se.Selectors=se.getSelectorValue=se.createSelector=se.createSelectorOptions=se.SelectorType=void 0;var oe=us(),$r=sa(),we=aa(),fj;(function(t){t.EndOfLine="EndOfLine",t.EndOfFile="EndOfFile",t.LParenthesis="LParenthesis",t.RParenthesis="RParenthesis",t.CLBracket="CLBracket",t.CRBracket="CRBracket",t.SLBracket="SLBracket",t.SRBracket="SRBracket",t.Assign="Assign",t.AddShorthand="AddShorthand",t.SubtractShorthand="SubtractShorthand",t.MultiplyShorthand="MultiplyShorthand",t.DivideShorthand="DivideShorthand",t.PowerShorthand="PowerShorthand",t.ModuloShorthand="ModuloShorthand",t.Seperator="Seperator",t.Function="Function",t.EndFunction="EndFunction",t.EndWhile="EndWhile",t.EndFor="EndFor",t.EndIf="EndIf",t.SliceSeperator="SliceSeperator",t.MapKeyValueSeperator="MapKeyValueSeperator",t.MapSeperator="MapSeperator",t.ListSeperator="ListSeperator",t.CallSeperator="CallSeperator",t.ArgumentSeperator="ArgumentSeperator",t.ImportCodeSeperator="ImportCodeSeperator",t.ElseIf="ElseIf",t.Then="Then",t.Else="Else",t.In="In",t.MemberSeperator="MemberSeperator",t.NumberSeperator="NumberSeperator",t.Reference="Reference",t.Isa="Isa",t.Or="Or",t.And="And",t.Minus="Minus",t.Plus="Plus",t.Times="Times",t.Divide="Divide",t.Power="Power",t.Mod="Mod",t.Equal="Equal",t.NotEqual="NotEqual",t.Greater="Greater",t.GreaterEqual="GreaterEqual",t.Lesser="Lesser",t.LessEqual="LessEqual",t.New="New",t.Not="Not",t.Comment="Comment"})(fj=se.SelectorType||(se.SelectorType={}));var Pb=class{};se.createSelectorOptions=Pb;function ie(t){let e;return t.value===void 0?(e=new Function("token",`if (token == null) return false;return token.type === '${t.type}';`),Object.defineProperty(e,"name",{value:`selector_${t.type}`,writable:!1})):(e=new Function("token",`if (token == null) return false;return token.value === '${t.value}' && token.type === '${t.type}';`),Object.defineProperty(e,"name",{value:`selector_${t.type}_${t.value}`,writable:!1})),e.data=t,e}se.createSelector=ie;function mj(t){return t.data.value}se.getSelectorValue=mj;se.Selectors={EndOfLine:ie({type:oe.TokenType.EOL,value:we.Operator.EndOfLine}),EndOfFile:ie({type:oe.TokenType.EOF,value:we.Operator.EndOfFile}),LParenthesis:ie({type:oe.TokenType.Punctuator,value:we.Operator.LParenthesis}),RParenthesis:ie({type:oe.TokenType.Punctuator,value:we.Operator.RParenthesis}),CLBracket:ie({type:oe.TokenType.Punctuator,value:we.Operator.CLBracket}),CRBracket:ie({type:oe.TokenType.Punctuator,value:we.Operator.CRBracket}),SLBracket:ie({type:oe.TokenType.Punctuator,value:we.Operator.SLBracket}),SRBracket:ie({type:oe.TokenType.Punctuator,value:we.Operator.SRBracket}),Assign:ie({type:oe.TokenType.Punctuator,value:we.Operator.Assign}),AddShorthand:ie({type:oe.TokenType.Punctuator,value:we.Operator.AddShorthand}),SubtractShorthand:ie({type:oe.TokenType.Punctuator,value:we.Operator.SubtractShorthand}),MultiplyShorthand:ie({type:oe.TokenType.Punctuator,value:we.Operator.MultiplyShorthand}),DivideShorthand:ie({type:oe.TokenType.Punctuator,value:we.Operator.DivideShorthand}),PowerShorthand:ie({type:oe.TokenType.Punctuator,value:we.Operator.PowerShorthand}),ModuloShorthand:ie({type:oe.TokenType.Punctuator,value:we.Operator.ModuloShorthand}),Seperator:ie({type:oe.TokenType.Punctuator,value:we.Operator.Comma}),Function:ie({type:oe.TokenType.Keyword,value:$r.Keyword.Function}),EndFunction:ie({type:oe.TokenType.Keyword,value:$r.Keyword.EndFunction}),EndWhile:ie({type:oe.TokenType.Keyword,value:$r.Keyword.EndWhile}),EndFor:ie({type:oe.TokenType.Keyword,value:$r.Keyword.EndFor}),EndIf:ie({type:oe.TokenType.Keyword,value:$r.Keyword.EndIf}),SliceSeperator:ie({type:oe.TokenType.SliceOperator,value:we.Operator.SliceSeperator}),MapKeyValueSeperator:ie({type:oe.TokenType.SliceOperator,value:we.Operator.SliceSeperator}),MapSeperator:ie({type:oe.TokenType.Punctuator,value:we.Operator.Comma}),L