From 8db8a3d6099ced38c24b828c56a6cf92c7db6b80 Mon Sep 17 00:00:00 2001 From: Gusarich Date: Wed, 27 Mar 2024 11:39:16 +0300 Subject: [PATCH] implement local type inference --- src/generator/writers/writeFunction.ts | 19 ++ src/grammar/ast.ts | 15 +- src/grammar/clone.ts | 5 + src/grammar/grammar.ohm | 3 +- src/grammar/grammar.ohm-bundle.d.ts | 4 +- src/grammar/grammar.ohm-bundle.js | 2 +- src/grammar/grammar.ts | 15 +- .../feature-local-type-inference.spec.ts.snap | 318 ++++++++++++++++++ src/test/feature-local-type-inference.spec.ts | 27 ++ src/test/features/local-type-inference.tact | 31 ++ src/types/resolveStatements.ts | 14 + tact.config.json | 8 + 12 files changed, 454 insertions(+), 7 deletions(-) create mode 100644 src/test/__snapshots__/feature-local-type-inference.spec.ts.snap create mode 100644 src/test/feature-local-type-inference.spec.ts create mode 100644 src/test/features/local-type-inference.tact diff --git a/src/generator/writers/writeFunction.ts b/src/generator/writers/writeFunction.ts index 7bcfdc4ff..fc0d59121 100644 --- a/src/generator/writers/writeFunction.ts +++ b/src/generator/writers/writeFunction.ts @@ -80,6 +80,25 @@ export function writeStatement(f: ASTStatement, self: string | null, returns: Ty ctx.append(`${resolveFuncType(t, ctx)} ${id(f.name)} = ${writeCastedExpression(f.expression, t, ctx)};`); return; + } else if (f.kind === 'statement_let_no_type') { + + const varType = getExpType(ctx.ctx, f.expression); + + // Contract/struct case + if (varType.kind === 'ref') { + const tt = getType(ctx.ctx, varType.name); + if (tt.kind === 'contract' || tt.kind === 'struct') { + if (varType.optional) { + ctx.append(`tuple ${id(f.name)} = ${writeCastedExpression(f.expression, varType, ctx)};`); + } else { + ctx.append(`var ${resolveFuncTypeUnpack(varType, id(f.name), ctx)} = ${writeCastedExpression(f.expression, varType, ctx)};`); + } + return; + } + } + + ctx.append(`${resolveFuncType(varType, ctx)} ${id(f.name)} = ${writeCastedExpression(f.expression, varType, ctx)};`); + return; } else if (f.kind === 'statement_assign') { // Prepare lvalue diff --git a/src/grammar/ast.ts b/src/grammar/ast.ts index ad3e278bc..43b023ddd 100644 --- a/src/grammar/ast.ts +++ b/src/grammar/ast.ts @@ -361,6 +361,14 @@ export type ASTStatementLet = { ref: ASTRef } +export type ASTStatementLetNoType = { + kind: 'statement_let_no_type', + id: number, + name: string, + expression: ASTExpression, + ref: ASTRef +} + export type ASTStatementReturn = { kind: 'statement_return', id: number, @@ -431,8 +439,8 @@ export type ASTStatementRepeat = { // Unions // -export type ASTStatement = ASTStatementLet | ASTStatementReturn | ASTStatementExpression | ASTSTatementAssign | ASTSTatementAugmentedAssign | ASTCondition | ASTStatementWhile | ASTStatementUntil | ASTStatementRepeat; -export type ASTNode = ASTExpression | ASTProgram | ASTStruct | ASTField | ASTContract | ASTArgument | ASTFunction | ASTOpCall | ASTStatementLet | ASTStatementReturn | ASTProgram | ASTPrimitive | ASTOpCallStatic | ASTStatementExpression | ASTNativeFunction | ASTSTatementAssign | ASTSTatementAugmentedAssign | ASTOpNew | ASTNewParameter | ASTTypeRef | ASTNull | ASTCondition | ASTInitFunction | ASTStatementWhile | ASTStatementUntil | ASTStatementRepeat | ASTReceive | ASTLvalueRef | ASTString | ASTTrait | ASTProgramImport | ASTFunction | ASTNativeFunction | ASTInitOf | ASTString | ASTConstant; +export type ASTStatement = ASTStatementLet | ASTStatementLetNoType | ASTStatementReturn | ASTStatementExpression | ASTSTatementAssign | ASTSTatementAugmentedAssign | ASTCondition | ASTStatementWhile | ASTStatementUntil | ASTStatementRepeat; +export type ASTNode = ASTExpression | ASTProgram | ASTStruct | ASTField | ASTContract | ASTArgument | ASTFunction | ASTOpCall | ASTStatementLet | ASTStatementLetNoType | ASTStatementReturn | ASTProgram | ASTPrimitive | ASTOpCallStatic | ASTStatementExpression | ASTNativeFunction | ASTSTatementAssign | ASTSTatementAugmentedAssign | ASTOpNew | ASTNewParameter | ASTTypeRef | ASTNull | ASTCondition | ASTInitFunction | ASTStatementWhile | ASTStatementUntil | ASTStatementRepeat | ASTReceive | ASTLvalueRef | ASTString | ASTTrait | ASTProgramImport | ASTFunction | ASTNativeFunction | ASTInitOf | ASTString | ASTConstant; export type ASTExpression = ASTOpBinary | ASTOpUnary | ASTOpField | ASTNumber | ASTID | ASTBoolean | ASTOpCall | ASTOpCallStatic | ASTOpNew | ASTNull | ASTLvalueRef | ASTInitOf | ASTString | ASTConditional; export type ASTType = ASTPrimitive | ASTStruct | ASTContract | ASTTrait; @@ -557,6 +565,9 @@ export function traverse(node: ASTNode, callback: (node: ASTNode) => void) { traverse(node.type, callback); traverse(node.expression, callback); } + if (node.kind === 'statement_let_no_type') { + traverse(node.expression, callback); + } if (node.kind === 'statement_return') { if (node.expression) { traverse(node.expression, callback); diff --git a/src/grammar/clone.ts b/src/grammar/clone.ts index a8a452cf2..47e6617e6 100644 --- a/src/grammar/clone.ts +++ b/src/grammar/clone.ts @@ -31,6 +31,11 @@ export function cloneNode(src: T): T { type: cloneASTNode(src.type), expression: cloneNode(src.expression), }); + } else if (src.kind === 'statement_let_no_type') { + return cloneASTNode({ + ...src, + expression: cloneNode(src.expression), + }); } else if (src.kind === 'statement_condition') { return cloneASTNode({ ...src, diff --git a/src/grammar/grammar.ohm b/src/grammar/grammar.ohm index 1daf08d45..2627264b5 100644 --- a/src/grammar/grammar.ohm +++ b/src/grammar/grammar.ohm @@ -98,7 +98,8 @@ Tact { | StatementRepeat | StatementUntil StatementBlock = "{" Statement* "}" - StatementLet = let id ":" Type "=" Expression ";" + StatementLet = let id ":" Type "=" Expression ";" --withType + | let id "=" Expression ";" --withoutType StatementReturn = return Expression ";" --withExpression | return ";" --withoutExpression StatementExpression = Expression ";" diff --git a/src/grammar/grammar.ohm-bundle.d.ts b/src/grammar/grammar.ohm-bundle.d.ts index 9c26303a7..b1034378f 100644 --- a/src/grammar/grammar.ohm-bundle.d.ts +++ b/src/grammar/grammar.ohm-bundle.d.ts @@ -77,7 +77,9 @@ export interface TactActionDict extends ActionDict { ReceiveFunction?: (this: NonterminalNode, arg0: NonterminalNode) => T; Statement?: (this: NonterminalNode, arg0: NonterminalNode) => T; StatementBlock?: (this: NonterminalNode, arg0: TerminalNode, arg1: IterationNode, arg2: TerminalNode) => T; - StatementLet?: (this: NonterminalNode, arg0: NonterminalNode, arg1: NonterminalNode, arg2: TerminalNode, arg3: NonterminalNode, arg4: TerminalNode, arg5: NonterminalNode, arg6: TerminalNode) => T; + StatementLet_withType?: (this: NonterminalNode, arg0: NonterminalNode, arg1: NonterminalNode, arg2: TerminalNode, arg3: NonterminalNode, arg4: TerminalNode, arg5: NonterminalNode, arg6: TerminalNode) => T; + StatementLet_withoutType?: (this: NonterminalNode, arg0: NonterminalNode, arg1: NonterminalNode, arg2: TerminalNode, arg3: NonterminalNode, arg4: TerminalNode) => T; + StatementLet?: (this: NonterminalNode, arg0: NonterminalNode) => T; StatementReturn_withExpression?: (this: NonterminalNode, arg0: NonterminalNode, arg1: NonterminalNode, arg2: TerminalNode) => T; StatementReturn_withoutExpression?: (this: NonterminalNode, arg0: NonterminalNode, arg1: TerminalNode) => T; StatementReturn?: (this: NonterminalNode, arg0: NonterminalNode) => T; diff --git a/src/grammar/grammar.ohm-bundle.js b/src/grammar/grammar.ohm-bundle.js index ef536397a..bd3312542 100644 --- a/src/grammar/grammar.ohm-bundle.js +++ b/src/grammar/grammar.ohm-bundle.js @@ -1 +1 @@ -'use strict';const ohm=(require('ohm-js').default || require('ohm-js'));const result=ohm.makeRecipe(["grammar",{"source":"Tact {\n\n // Starting point of the program\n Program = ProgramItem*\n ProgramItem = Struct\n | Contract\n | Primitive\n | StaticFunction\n | NativeFunction\n | ProgramImport\n | Trait\n | Constant\n ProgramImport = import stringLiteral \";\"\n\n // Built-in declarations\n Primitive = \"primitive\" Type \";\"\n\n // Static function\n StaticFunction = Function\n NativeFunction = nameAttribute \"(\" funcId \")\" FunctionAttribute* native id \"(\" ListOf \")\" \";\" --withVoid\n | nameAttribute \"(\" funcId \")\" FunctionAttribute* native id \"(\" ListOf \")\" \":\" Type \";\" --withType\n \n // Field declarations\n Type = typeLiteral \"?\" --optional\n | typeLiteral --required\n | \"map\" \"<\" typeLiteral (as id)? \",\" typeLiteral (as id)? \">\" --map\n | \"bounced\" \"<\" typeLiteral \">\" --bounced\n Field = id \":\" Type \";\" --default\n | id \":\" Type \"=\" Expression \";\" --defaultWithInit\n | id \":\" Type as id \";\" --withSerialization\n | id \":\" Type as id \"=\" Expression \";\" --withSerializationAndInit\n \n // Constant\n ConstantAttribute = virtual --virtual\n | override --override\n | abstract --abstract\n Constant = ConstantAttribute* ~fun const id \":\" Type \"=\" Expression \";\" --withValue\n | ConstantAttribute* ~fun const id \":\" Type \";\" --withEmpty\n\n // Struct\n Struct = \"struct\" typeLiteral \"{\" StructBody* \"}\" --originary\n | \"message\" typeLiteral \"{\" StructBody* \"}\" --message\n | \"message\" \"(\" integerLiteral \")\" typeLiteral \"{\" StructBody* \"}\" --messageWithId\n StructBody = Field\n\n // Contract\n Contract = ContractAttribute* contract id \"{\" ContractBody* \"}\" --simple\n | ContractAttribute* contract id with ListOf \"{\" ContractBody* \"}\" --withTraits\n ContractInit = \"init\" \"(\" ListOf \")\" \"{\" Statement* \"}\"\n ContractBody = Field\n | ContractInit\n | ReceiveFunction\n | Function\n | Constant\n \n // Trait\n Trait = ContractAttribute* trait id \"{\" TraitBody* \"}\" --originary\n | ContractAttribute* trait id with ListOf \"{\" TraitBody* \"}\" --withTraits\n TraitBody = Field\n | ReceiveFunction\n | Function\n | Constant\n\n // Contract attributes\n ContractAttribute = \"@interface\" \"(\" stringLiteral \")\" --interface\n\n // Function\n FunctionAttribute = \"get\" --getter\n | mutates --mutates\n | extends --extends\n | virtual --virtual\n | override --override\n | inline --inline\n | abstract --abstract\n Function = FunctionAttribute* fun id \"(\" ListOf \")\" \"{\" Statement* \"}\" --withVoid\n | FunctionAttribute* fun id \"(\" ListOf \")\" \":\" Type \"{\" Statement* \"}\" --withType\n | FunctionAttribute* fun id \"(\" ListOf \")\" \";\" --abstractVoid\n | FunctionAttribute* fun id \"(\" ListOf \")\" \":\" Type \";\" --abstractType\n FunctionArg = id \":\" Type\n \n ReceiveFunction = \"receive\" \"(\" FunctionArg \")\" \"{\" Statement* \"}\" --simple\n | \"receive\" \"(\" \")\" \"{\" Statement* \"}\" --empty\n | \"receive\" \"(\" stringLiteral \")\" \"{\" Statement* \"}\" --comment\n | \"bounced\" \"(\" FunctionArg \")\" \"{\" Statement* \"}\" --bounced\n | \"external\" \"(\" FunctionArg \")\" \"{\" Statement* \"}\" --externalSimple\n | \"external\" \"(\" stringLiteral \")\" \"{\" Statement* \"}\" --externalComment\n | \"external\" \"(\" \")\" \"{\" Statement* \"}\" --externalEmpty\n\n // Statements\n Statement = StatementLet\n | StatementBlock\n | StatementReturn\n | StatementExpression\n | StatementAssign\n | StatementAugmentedAssign\n | StatementCondition\n | StatementWhile\n | StatementRepeat\n | StatementUntil\n StatementBlock = \"{\" Statement* \"}\"\n StatementLet = let id \":\" Type \"=\" Expression \";\"\n StatementReturn = return Expression \";\" --withExpression\n | return \";\" --withoutExpression \n StatementExpression = Expression \";\"\n StatementAssign = LValue \"=\" Expression \";\"\n StatementAugmentedAssign = StatementAugmentedAssignAdd\n | StatementAugmentedAssignSub\n | StatementAugmentedAssignMul\n | StatementAugmentedAssignDiv\n | StatementAugmentedAssignRem\n StatementAugmentedAssignAdd = LValue \"+=\" Expression \";\"\n StatementAugmentedAssignSub = LValue \"-=\" Expression \";\"\n StatementAugmentedAssignMul = LValue \"*=\" Expression \";\"\n StatementAugmentedAssignDiv = LValue \"/=\" Expression \";\"\n StatementAugmentedAssignRem = LValue \"%=\" Expression \";\"\n StatementCondition = if Expression \"{\" Statement* \"}\" ~else --simple\n | if Expression \"{\" Statement* \"}\" else \"{\" Statement* \"}\" --withElse\n | if Expression \"{\" Statement* \"}\" else StatementCondition --withElseIf\n StatementWhile = while \"(\" Expression \")\" \"{\" Statement* \"}\"\n StatementRepeat = repeat \"(\" Expression \")\" \"{\" Statement* \"}\"\n StatementUntil = do \"{\" Statement* \"}\" until \"(\" Expression \")\" \";\"\n\n // L-value\n LValue = id \".\" LValue --more\n | id --single\n\n // Expressions\n Expression = ExpressionConditional\n ExpressionConditional = ExpressionOr \"?\" ExpressionOr \":\" ExpressionConditional --ternary\n | ExpressionOr\n ExpressionOr = ExpressionOr \"||\" ExpressionAnd --or\n | ExpressionAnd\n ExpressionAnd = ExpressionAnd \"&&\" ExpressionCompare --and\n | ExpressionCompare\n ExpressionCompare = ExpressionCompare \"!=\" ExpressionBinary --not\n | ExpressionCompare \"==\" ExpressionBinary --eq\n | ExpressionCompare \">\" ExpressionBinary --gt\n | ExpressionCompare \">=\" ExpressionBinary --gte\n | ExpressionCompare \"<\" ExpressionBinary --lt\n | ExpressionCompare \"<=\" ExpressionBinary --lte\n | ExpressionBinary\n ExpressionBinary = ExpressionBinary \">>\" ExpressionAdd --shr\n | ExpressionBinary \"<<\" ExpressionAdd --shl\n | ExpressionBinary \"&\" ExpressionAdd --bin_and\n | ExpressionBinary \"|\" ExpressionAdd --bin_or\n | ExpressionAdd\n ExpressionAdd = ExpressionAdd \"+\" ~\"+\" ExpressionMul --add\n | ExpressionAdd \"-\" ~\"-\" ExpressionMul --sub\n | ExpressionMul\n ExpressionMul = ExpressionMul \"*\" ExpressionUnary --mul\n | ExpressionMul \"/\" ExpressionUnary --div\n | ExpressionMul \"%\" ExpressionUnary --rem\n | ExpressionUnary\n ExpressionUnary = \"-\" ExpressionUnarySuffix --neg\n | \"+\" ExpressionUnarySuffix --add\n | \"!\" ExpressionUnarySuffix --not\n | ExpressionUnarySuffix\n ExpressionUnarySuffix = ExpressionValue \"!!\" --notNull\n | ExpressionValue\n ExpressionBracket = \"(\" Expression \")\"\n\n // Order is important\n ExpressionValue = ExpressionCall\n | ExpressionField\n | ExpressionStaticCall\n | ExpressionBracket\n | ExpressionNew\n | integerLiteral\n | boolLiteral\n | id\n | null\n | ExpressionInitOf\n | ExpressionString\n ExpressionString = stringLiteral\n ExpressionField = ExpressionValue \".\" id ~\"(\"\n ExpressionCall = ExpressionValue \".\" id \"(\" ListOf \")\"\n ExpressionNew = id \"{\" ListOf \"}\"\n NewParameter = id \":\" Expression\n ExpressionStaticCall = id \"(\" ListOf \")\"\n ExpressionInitOf = initOf id \"(\" ListOf \")\"\n\n // Type Literal\n typeLiteral = letterAsciiUC typeLiteralPart*\n typeLiteralPart = letterAscii | digit | \"_\"\n\n // Integer Literal\n // hexDigit defined in Ohm's built-in rules (otherwise: hexDigit = \"0\"..\"9\" | \"a\"..\"f\" | \"A\"..\"F\")\n // digit defined in Ohm's built-in rules (otherwise: digit = \"0\"..\"9\")\n integerLiteral = integerLiteralHex | integerLiteralBin | integerLiteralOct | integerLiteralDec // Order is important\n integerLiteralDec = nonZeroDigit (\"_\"? digit)* --nonZeroIntegerLiteralDec\n | \"0\" digit* --integerLiteralWithLeadingZero\n integerLiteralHex = (\"0x\" | \"0X\") hexDigit (\"_\"? hexDigit)*\n integerLiteralBin = (\"0b\" | \"0B\") binDigit (\"_\"? binDigit)*\n integerLiteralOct = (\"0o\" | \"0O\") octDigit (\"_\"? octDigit)*\n binDigit = \"0\" | \"1\"\n octDigit = \"0\"..\"7\"\n nonZeroDigit = \"1\"..\"9\"\n\n // Letters\n letterAsciiLC = \"a\"..\"z\"\n letterAsciiUC = \"A\"..\"Z\"\n letterAscii = letterAsciiLC | letterAsciiUC\n letterComment = letterAsciiLC | letterAsciiUC | digit | \"_\"\n\n // ID Literal\n idStart = letterAscii | \"_\"\n idPart = letterAscii | digit | \"_\"\n id = ~reservedWord #idStart #(idPart*)\n\n // FunC id\n funcLetter = letterAscii | \"_\" | \"'\" | \"?\" | \"!\" | \"::\" | \"&\"\n funcId = funcLetter #(funcLetter | digit)*\n\n // Bool Literal\n boolLiteral = (\"true\" | \"false\") ~idPart\n\n // String literal\n stringLiteralCharacter = ~(\"\\\"\" | \"\\\\\" | lineTerminator) any\n stringLiteral = \"\\\"\" stringLiteralCharacter* \"\\\"\"\n\n // Keywords\n // NOTE Order is important\n keyword = fun \n | let\n | return \n | extend \n | native \n | public \n | null \n | if \n | else \n | while \n | repeat \n | do \n | until \n | as \n | mutates\n | extends\n | import\n | with\n | trait\n | initOf\n | override\n | abstract\n | virtual\n | inline\n | const\n contract = \"contract\" ~idPart\n let = \"let\" ~idPart\n fun = \"fun\" ~idPart\n return = \"return\" ~idPart\n extend = \"extend\" ~idPart\n native = \"native\" ~idPart\n public = \"public\" ~idPart\n null = \"null\" ~idPart\n if = \"if\" ~idPart\n else = \"else\" ~idPart\n while = \"while\" ~idPart\n repeat = \"repeat\" ~idPart\n do = \"do\" ~idPart\n until = \"until\" ~idPart\n as = \"as\" ~idPart\n mutates = \"mutates\" ~idPart\n extends = \"extends\" ~idPart\n import = \"import\" ~idPart\n with = \"with\" ~idPart\n trait = \"trait\" ~idPart\n initOf = \"initOf\" ~idPart\n virtual = \"virtual\" ~idPart\n override = \"override\" ~idPart\n inline = \"inline\" ~idPart\n const = \"const\" ~idPart\n abstract = \"abstract\" ~idPart\n\n // Attributes\n nameAttribute = \"@name\"\n\n // Reserved\n reservedWord = keyword\n\n // Comments\n space += comment | lineTerminator\n comment = multiLineComment | singleLineComment\n lineTerminator = \"\\n\" | \"\\r\" | \"\\u2028\" | \"\\u2029\"\n multiLineComment = \"/*\" (~\"*/\" any)* \"*/\"\n singleLineComment = \"//\" (~lineTerminator any)*\n}"},"Tact",null,"Program",{"Program":["define",{"sourceInterval":[49,71]},null,[],["star",{"sourceInterval":[59,71]},["app",{"sourceInterval":[59,70]},"ProgramItem",[]]]],"ProgramItem":["define",{"sourceInterval":[76,300]},null,[],["alt",{"sourceInterval":[90,300]},["app",{"sourceInterval":[90,96]},"Struct",[]],["app",{"sourceInterval":[115,123]},"Contract",[]],["app",{"sourceInterval":[142,151]},"Primitive",[]],["app",{"sourceInterval":[170,184]},"StaticFunction",[]],["app",{"sourceInterval":[203,217]},"NativeFunction",[]],["app",{"sourceInterval":[236,249]},"ProgramImport",[]],["app",{"sourceInterval":[268,273]},"Trait",[]],["app",{"sourceInterval":[292,300]},"Constant",[]]]],"ProgramImport":["define",{"sourceInterval":[305,345]},null,[],["seq",{"sourceInterval":[321,345]},["app",{"sourceInterval":[321,327]},"import",[]],["app",{"sourceInterval":[328,341]},"stringLiteral",[]],["terminal",{"sourceInterval":[342,345]},";"]]],"Primitive":["define",{"sourceInterval":[380,412]},null,[],["seq",{"sourceInterval":[392,412]},["terminal",{"sourceInterval":[392,403]},"primitive"],["app",{"sourceInterval":[404,408]},"Type",[]],["terminal",{"sourceInterval":[409,412]},";"]]],"StaticFunction":["define",{"sourceInterval":[441,466]},null,[],["app",{"sourceInterval":[458,466]},"Function",[]]],"NativeFunction_withVoid":["define",{"sourceInterval":[488,592]},null,[],["seq",{"sourceInterval":[488,581]},["app",{"sourceInterval":[488,501]},"nameAttribute",[]],["terminal",{"sourceInterval":[502,505]},"("],["app",{"sourceInterval":[506,512]},"funcId",[]],["terminal",{"sourceInterval":[513,516]},")"],["star",{"sourceInterval":[517,535]},["app",{"sourceInterval":[517,534]},"FunctionAttribute",[]]],["app",{"sourceInterval":[536,542]},"native",[]],["app",{"sourceInterval":[543,545]},"id",[]],["terminal",{"sourceInterval":[546,549]},"("],["app",{"sourceInterval":[550,573]},"ListOf",[["app",{"sourceInterval":[557,568]},"FunctionArg",[]],["terminal",{"sourceInterval":[569,572]},","]]],["terminal",{"sourceInterval":[574,577]},")"],["terminal",{"sourceInterval":[578,581]},";"]]],"NativeFunction_withType":["define",{"sourceInterval":[614,727]},null,[],["seq",{"sourceInterval":[614,716]},["app",{"sourceInterval":[614,627]},"nameAttribute",[]],["terminal",{"sourceInterval":[628,631]},"("],["app",{"sourceInterval":[632,638]},"funcId",[]],["terminal",{"sourceInterval":[639,642]},")"],["star",{"sourceInterval":[643,661]},["app",{"sourceInterval":[643,660]},"FunctionAttribute",[]]],["app",{"sourceInterval":[662,668]},"native",[]],["app",{"sourceInterval":[669,671]},"id",[]],["terminal",{"sourceInterval":[672,675]},"("],["app",{"sourceInterval":[676,699]},"ListOf",[["app",{"sourceInterval":[683,694]},"FunctionArg",[]],["terminal",{"sourceInterval":[695,698]},","]]],["terminal",{"sourceInterval":[700,703]},")"],["terminal",{"sourceInterval":[704,707]},":"],["app",{"sourceInterval":[708,712]},"Type",[]],["terminal",{"sourceInterval":[713,716]},";"]]],"NativeFunction":["define",{"sourceInterval":[471,727]},null,[],["alt",{"sourceInterval":[488,727]},["app",{"sourceInterval":[488,581]},"NativeFunction_withVoid",[]],["app",{"sourceInterval":[614,716]},"NativeFunction_withType",[]]]],"Type_optional":["define",{"sourceInterval":[770,796]},null,[],["seq",{"sourceInterval":[770,785]},["app",{"sourceInterval":[770,781]},"typeLiteral",[]],["terminal",{"sourceInterval":[782,785]},"?"]]],"Type_required":["define",{"sourceInterval":[808,830]},null,[],["app",{"sourceInterval":[808,819]},"typeLiteral",[]]],"Type_map":["define",{"sourceInterval":[842,907]},null,[],["seq",{"sourceInterval":[842,901]},["terminal",{"sourceInterval":[842,847]},"map"],["terminal",{"sourceInterval":[848,851]},"<"],["app",{"sourceInterval":[852,863]},"typeLiteral",[]],["opt",{"sourceInterval":[864,872]},["seq",{"sourceInterval":[865,870]},["app",{"sourceInterval":[865,867]},"as",[]],["app",{"sourceInterval":[868,870]},"id",[]]]],["terminal",{"sourceInterval":[873,876]},","],["app",{"sourceInterval":[877,888]},"typeLiteral",[]],["opt",{"sourceInterval":[889,897]},["seq",{"sourceInterval":[890,895]},["app",{"sourceInterval":[890,892]},"as",[]],["app",{"sourceInterval":[893,895]},"id",[]]]],["terminal",{"sourceInterval":[898,901]},">"]]],"Type_bounced":["define",{"sourceInterval":[919,958]},null,[],["seq",{"sourceInterval":[919,948]},["terminal",{"sourceInterval":[919,928]},"bounced"],["terminal",{"sourceInterval":[929,932]},"<"],["app",{"sourceInterval":[933,944]},"typeLiteral",[]],["terminal",{"sourceInterval":[945,948]},">"]]],"Type":["define",{"sourceInterval":[763,958]},null,[],["alt",{"sourceInterval":[770,958]},["app",{"sourceInterval":[770,785]},"Type_optional",[]],["app",{"sourceInterval":[808,819]},"Type_required",[]],["app",{"sourceInterval":[842,901]},"Type_map",[]],["app",{"sourceInterval":[919,948]},"Type_bounced",[]]]],"Field_default":["define",{"sourceInterval":[971,996]},null,[],["seq",{"sourceInterval":[971,986]},["app",{"sourceInterval":[971,973]},"id",[]],["terminal",{"sourceInterval":[974,977]},":"],["app",{"sourceInterval":[978,982]},"Type",[]],["terminal",{"sourceInterval":[983,986]},";"]]],"Field_defaultWithInit":["define",{"sourceInterval":[1009,1057]},null,[],["seq",{"sourceInterval":[1009,1039]},["app",{"sourceInterval":[1009,1011]},"id",[]],["terminal",{"sourceInterval":[1012,1015]},":"],["app",{"sourceInterval":[1016,1020]},"Type",[]],["terminal",{"sourceInterval":[1021,1024]},"="],["app",{"sourceInterval":[1025,1035]},"Expression",[]],["terminal",{"sourceInterval":[1036,1039]},";"]]],"Field_withSerialization":["define",{"sourceInterval":[1070,1111]},null,[],["seq",{"sourceInterval":[1070,1091]},["app",{"sourceInterval":[1070,1072]},"id",[]],["terminal",{"sourceInterval":[1073,1076]},":"],["app",{"sourceInterval":[1077,1081]},"Type",[]],["app",{"sourceInterval":[1082,1084]},"as",[]],["app",{"sourceInterval":[1085,1087]},"id",[]],["terminal",{"sourceInterval":[1088,1091]},";"]]],"Field_withSerializationAndInit":["define",{"sourceInterval":[1124,1187]},null,[],["seq",{"sourceInterval":[1124,1160]},["app",{"sourceInterval":[1124,1126]},"id",[]],["terminal",{"sourceInterval":[1127,1130]},":"],["app",{"sourceInterval":[1131,1135]},"Type",[]],["app",{"sourceInterval":[1136,1138]},"as",[]],["app",{"sourceInterval":[1139,1141]},"id",[]],["terminal",{"sourceInterval":[1142,1145]},"="],["app",{"sourceInterval":[1146,1156]},"Expression",[]],["terminal",{"sourceInterval":[1157,1160]},";"]]],"Field":["define",{"sourceInterval":[963,1187]},null,[],["alt",{"sourceInterval":[971,1187]},["app",{"sourceInterval":[971,986]},"Field_default",[]],["app",{"sourceInterval":[1009,1039]},"Field_defaultWithInit",[]],["app",{"sourceInterval":[1070,1091]},"Field_withSerialization",[]],["app",{"sourceInterval":[1124,1160]},"Field_withSerializationAndInit",[]]]],"ConstantAttribute_virtual":["define",{"sourceInterval":[1233,1253]},null,[],["app",{"sourceInterval":[1233,1240]},"virtual",[]]],"ConstantAttribute_override":["define",{"sourceInterval":[1278,1299]},null,[],["app",{"sourceInterval":[1278,1286]},"override",[]]],"ConstantAttribute_abstract":["define",{"sourceInterval":[1324,1345]},null,[],["app",{"sourceInterval":[1324,1332]},"abstract",[]]],"ConstantAttribute":["define",{"sourceInterval":[1213,1345]},null,[],["alt",{"sourceInterval":[1233,1345]},["app",{"sourceInterval":[1233,1240]},"ConstantAttribute_virtual",[]],["app",{"sourceInterval":[1278,1286]},"ConstantAttribute_override",[]],["app",{"sourceInterval":[1324,1332]},"ConstantAttribute_abstract",[]]]],"Constant_withValue":["define",{"sourceInterval":[1361,1433]},null,[],["seq",{"sourceInterval":[1361,1421]},["star",{"sourceInterval":[1361,1379]},["app",{"sourceInterval":[1361,1378]},"ConstantAttribute",[]]],["not",{"sourceInterval":[1380,1384]},["app",{"sourceInterval":[1381,1384]},"fun",[]]],["app",{"sourceInterval":[1385,1390]},"const",[]],["app",{"sourceInterval":[1391,1393]},"id",[]],["terminal",{"sourceInterval":[1394,1397]},":"],["app",{"sourceInterval":[1398,1402]},"Type",[]],["terminal",{"sourceInterval":[1403,1406]},"="],["app",{"sourceInterval":[1407,1417]},"Expression",[]],["terminal",{"sourceInterval":[1418,1421]},";"]]],"Constant_withEmpty":["define",{"sourceInterval":[1449,1521]},null,[],["seq",{"sourceInterval":[1449,1494]},["star",{"sourceInterval":[1449,1467]},["app",{"sourceInterval":[1449,1466]},"ConstantAttribute",[]]],["not",{"sourceInterval":[1468,1472]},["app",{"sourceInterval":[1469,1472]},"fun",[]]],["app",{"sourceInterval":[1473,1478]},"const",[]],["app",{"sourceInterval":[1479,1481]},"id",[]],["terminal",{"sourceInterval":[1482,1485]},":"],["app",{"sourceInterval":[1486,1490]},"Type",[]],["terminal",{"sourceInterval":[1491,1494]},";"]]],"Constant":["define",{"sourceInterval":[1350,1521]},null,[],["alt",{"sourceInterval":[1361,1521]},["app",{"sourceInterval":[1361,1421]},"Constant_withValue",[]],["app",{"sourceInterval":[1449,1494]},"Constant_withEmpty",[]]]],"Struct_originary":["define",{"sourceInterval":[1550,1602]},null,[],["seq",{"sourceInterval":[1550,1590]},["terminal",{"sourceInterval":[1550,1558]},"struct"],["app",{"sourceInterval":[1559,1570]},"typeLiteral",[]],["terminal",{"sourceInterval":[1571,1574]},"{"],["star",{"sourceInterval":[1575,1586]},["app",{"sourceInterval":[1575,1585]},"StructBody",[]]],["terminal",{"sourceInterval":[1587,1590]},"}"]]],"Struct_message":["define",{"sourceInterval":[1616,1667]},null,[],["seq",{"sourceInterval":[1616,1657]},["terminal",{"sourceInterval":[1616,1625]},"message"],["app",{"sourceInterval":[1626,1637]},"typeLiteral",[]],["terminal",{"sourceInterval":[1638,1641]},"{"],["star",{"sourceInterval":[1642,1653]},["app",{"sourceInterval":[1642,1652]},"StructBody",[]]],["terminal",{"sourceInterval":[1654,1657]},"}"]]],"Struct_messageWithId":["define",{"sourceInterval":[1681,1761]},null,[],["seq",{"sourceInterval":[1681,1745]},["terminal",{"sourceInterval":[1681,1690]},"message"],["terminal",{"sourceInterval":[1691,1694]},"("],["app",{"sourceInterval":[1695,1709]},"integerLiteral",[]],["terminal",{"sourceInterval":[1710,1713]},")"],["app",{"sourceInterval":[1714,1725]},"typeLiteral",[]],["terminal",{"sourceInterval":[1726,1729]},"{"],["star",{"sourceInterval":[1730,1741]},["app",{"sourceInterval":[1730,1740]},"StructBody",[]]],["terminal",{"sourceInterval":[1742,1745]},"}"]]],"Struct":["define",{"sourceInterval":[1541,1761]},null,[],["alt",{"sourceInterval":[1550,1761]},["app",{"sourceInterval":[1550,1590]},"Struct_originary",[]],["app",{"sourceInterval":[1616,1657]},"Struct_message",[]],["app",{"sourceInterval":[1681,1745]},"Struct_messageWithId",[]]]],"StructBody":["define",{"sourceInterval":[1766,1784]},null,[],["app",{"sourceInterval":[1779,1784]},"Field",[]]],"Contract_simple":["define",{"sourceInterval":[1817,1878]},null,[],["seq",{"sourceInterval":[1817,1869]},["star",{"sourceInterval":[1817,1835]},["app",{"sourceInterval":[1817,1834]},"ContractAttribute",[]]],["app",{"sourceInterval":[1836,1844]},"contract",[]],["app",{"sourceInterval":[1845,1847]},"id",[]],["terminal",{"sourceInterval":[1848,1851]},"{"],["star",{"sourceInterval":[1852,1865]},["app",{"sourceInterval":[1852,1864]},"ContractBody",[]]],["terminal",{"sourceInterval":[1866,1869]},"}"]]],"Contract_withTraits":["define",{"sourceInterval":[1894,1979]},null,[],["seq",{"sourceInterval":[1894,1966]},["star",{"sourceInterval":[1894,1912]},["app",{"sourceInterval":[1894,1911]},"ContractAttribute",[]]],["app",{"sourceInterval":[1913,1921]},"contract",[]],["app",{"sourceInterval":[1922,1924]},"id",[]],["app",{"sourceInterval":[1925,1929]},"with",[]],["app",{"sourceInterval":[1930,1944]},"ListOf",[["app",{"sourceInterval":[1937,1939]},"id",[]],["terminal",{"sourceInterval":[1940,1943]},","]]],["terminal",{"sourceInterval":[1945,1948]},"{"],["star",{"sourceInterval":[1949,1962]},["app",{"sourceInterval":[1949,1961]},"ContractBody",[]]],["terminal",{"sourceInterval":[1963,1966]},"}"]]],"Contract":["define",{"sourceInterval":[1806,1979]},null,[],["alt",{"sourceInterval":[1817,1979]},["app",{"sourceInterval":[1817,1869]},"Contract_simple",[]],["app",{"sourceInterval":[1894,1966]},"Contract_withTraits",[]]]],"ContractInit":["define",{"sourceInterval":[1984,2056]},null,[],["seq",{"sourceInterval":[1999,2056]},["terminal",{"sourceInterval":[1999,2005]},"init"],["terminal",{"sourceInterval":[2006,2009]},"("],["app",{"sourceInterval":[2010,2033]},"ListOf",[["app",{"sourceInterval":[2017,2028]},"FunctionArg",[]],["terminal",{"sourceInterval":[2029,2032]},","]]],["terminal",{"sourceInterval":[2034,2037]},")"],["terminal",{"sourceInterval":[2038,2041]},"{"],["star",{"sourceInterval":[2042,2052]},["app",{"sourceInterval":[2042,2051]},"Statement",[]]],["terminal",{"sourceInterval":[2053,2056]},"}"]]],"ContractBody":["define",{"sourceInterval":[2061,2204]},null,[],["alt",{"sourceInterval":[2076,2204]},["app",{"sourceInterval":[2076,2081]},"Field",[]],["app",{"sourceInterval":[2101,2113]},"ContractInit",[]],["app",{"sourceInterval":[2133,2148]},"ReceiveFunction",[]],["app",{"sourceInterval":[2168,2176]},"Function",[]],["app",{"sourceInterval":[2196,2204]},"Constant",[]]]],"Trait_originary":["define",{"sourceInterval":[2235,2293]},null,[],["seq",{"sourceInterval":[2235,2281]},["star",{"sourceInterval":[2235,2253]},["app",{"sourceInterval":[2235,2252]},"ContractAttribute",[]]],["app",{"sourceInterval":[2254,2259]},"trait",[]],["app",{"sourceInterval":[2260,2262]},"id",[]],["terminal",{"sourceInterval":[2263,2266]},"{"],["star",{"sourceInterval":[2267,2277]},["app",{"sourceInterval":[2267,2276]},"TraitBody",[]]],["terminal",{"sourceInterval":[2278,2281]},"}"]]],"Trait_withTraits":["define",{"sourceInterval":[2306,2385]},null,[],["seq",{"sourceInterval":[2306,2372]},["star",{"sourceInterval":[2306,2324]},["app",{"sourceInterval":[2306,2323]},"ContractAttribute",[]]],["app",{"sourceInterval":[2325,2330]},"trait",[]],["app",{"sourceInterval":[2331,2333]},"id",[]],["app",{"sourceInterval":[2334,2338]},"with",[]],["app",{"sourceInterval":[2339,2353]},"ListOf",[["app",{"sourceInterval":[2346,2348]},"id",[]],["terminal",{"sourceInterval":[2349,2352]},","]]],["terminal",{"sourceInterval":[2354,2357]},"{"],["star",{"sourceInterval":[2358,2368]},["app",{"sourceInterval":[2358,2367]},"TraitBody",[]]],["terminal",{"sourceInterval":[2369,2372]},"}"]]],"Trait":["define",{"sourceInterval":[2227,2385]},null,[],["alt",{"sourceInterval":[2235,2385]},["app",{"sourceInterval":[2235,2281]},"Trait_originary",[]],["app",{"sourceInterval":[2306,2372]},"Trait_withTraits",[]]]],"TraitBody":["define",{"sourceInterval":[2390,2489]},null,[],["alt",{"sourceInterval":[2402,2489]},["app",{"sourceInterval":[2402,2407]},"Field",[]],["app",{"sourceInterval":[2424,2439]},"ReceiveFunction",[]],["app",{"sourceInterval":[2456,2464]},"Function",[]],["app",{"sourceInterval":[2481,2489]},"Constant",[]]]],"ContractAttribute_interface":["define",{"sourceInterval":[2542,2588]},null,[],["seq",{"sourceInterval":[2542,2576]},["terminal",{"sourceInterval":[2542,2554]},"@interface"],["terminal",{"sourceInterval":[2555,2558]},"("],["app",{"sourceInterval":[2559,2572]},"stringLiteral",[]],["terminal",{"sourceInterval":[2573,2576]},")"]]],"ContractAttribute":["define",{"sourceInterval":[2522,2588]},null,[],["app",{"sourceInterval":[2542,2588]},"ContractAttribute_interface",[]]],"FunctionAttribute_getter":["define",{"sourceInterval":[2630,2648]},null,[],["terminal",{"sourceInterval":[2630,2635]},"get"]],"FunctionAttribute_mutates":["define",{"sourceInterval":[2673,2692]},null,[],["app",{"sourceInterval":[2673,2680]},"mutates",[]]],"FunctionAttribute_extends":["define",{"sourceInterval":[2717,2736]},null,[],["app",{"sourceInterval":[2717,2724]},"extends",[]]],"FunctionAttribute_virtual":["define",{"sourceInterval":[2761,2780]},null,[],["app",{"sourceInterval":[2761,2768]},"virtual",[]]],"FunctionAttribute_override":["define",{"sourceInterval":[2805,2825]},null,[],["app",{"sourceInterval":[2805,2813]},"override",[]]],"FunctionAttribute_inline":["define",{"sourceInterval":[2850,2868]},null,[],["app",{"sourceInterval":[2850,2856]},"inline",[]]],"FunctionAttribute_abstract":["define",{"sourceInterval":[2893,2913]},null,[],["app",{"sourceInterval":[2893,2901]},"abstract",[]]],"FunctionAttribute":["define",{"sourceInterval":[2610,2913]},null,[],["alt",{"sourceInterval":[2630,2913]},["app",{"sourceInterval":[2630,2635]},"FunctionAttribute_getter",[]],["app",{"sourceInterval":[2673,2680]},"FunctionAttribute_mutates",[]],["app",{"sourceInterval":[2717,2724]},"FunctionAttribute_extends",[]],["app",{"sourceInterval":[2761,2768]},"FunctionAttribute_virtual",[]],["app",{"sourceInterval":[2805,2813]},"FunctionAttribute_override",[]],["app",{"sourceInterval":[2850,2856]},"FunctionAttribute_inline",[]],["app",{"sourceInterval":[2893,2901]},"FunctionAttribute_abstract",[]]]],"Function_withVoid":["define",{"sourceInterval":[2929,3016]},null,[],["seq",{"sourceInterval":[2929,3005]},["star",{"sourceInterval":[2929,2947]},["app",{"sourceInterval":[2929,2946]},"FunctionAttribute",[]]],["app",{"sourceInterval":[2948,2951]},"fun",[]],["app",{"sourceInterval":[2952,2954]},"id",[]],["terminal",{"sourceInterval":[2955,2958]},"("],["app",{"sourceInterval":[2959,2982]},"ListOf",[["app",{"sourceInterval":[2966,2977]},"FunctionArg",[]],["terminal",{"sourceInterval":[2978,2981]},","]]],["terminal",{"sourceInterval":[2983,2986]},")"],["terminal",{"sourceInterval":[2987,2990]},"{"],["star",{"sourceInterval":[2991,3001]},["app",{"sourceInterval":[2991,3000]},"Statement",[]]],["terminal",{"sourceInterval":[3002,3005]},"}"]]],"Function_withType":["define",{"sourceInterval":[3032,3128]},null,[],["seq",{"sourceInterval":[3032,3117]},["star",{"sourceInterval":[3032,3050]},["app",{"sourceInterval":[3032,3049]},"FunctionAttribute",[]]],["app",{"sourceInterval":[3051,3054]},"fun",[]],["app",{"sourceInterval":[3055,3057]},"id",[]],["terminal",{"sourceInterval":[3058,3061]},"("],["app",{"sourceInterval":[3062,3085]},"ListOf",[["app",{"sourceInterval":[3069,3080]},"FunctionArg",[]],["terminal",{"sourceInterval":[3081,3084]},","]]],["terminal",{"sourceInterval":[3086,3089]},")"],["terminal",{"sourceInterval":[3090,3093]},":"],["app",{"sourceInterval":[3094,3098]},"Type",[]],["terminal",{"sourceInterval":[3099,3102]},"{"],["star",{"sourceInterval":[3103,3113]},["app",{"sourceInterval":[3103,3112]},"Statement",[]]],["terminal",{"sourceInterval":[3114,3117]},"}"]]],"Function_abstractVoid":["define",{"sourceInterval":[3144,3220]},null,[],["seq",{"sourceInterval":[3144,3205]},["star",{"sourceInterval":[3144,3162]},["app",{"sourceInterval":[3144,3161]},"FunctionAttribute",[]]],["app",{"sourceInterval":[3163,3166]},"fun",[]],["app",{"sourceInterval":[3167,3169]},"id",[]],["terminal",{"sourceInterval":[3170,3173]},"("],["app",{"sourceInterval":[3174,3197]},"ListOf",[["app",{"sourceInterval":[3181,3192]},"FunctionArg",[]],["terminal",{"sourceInterval":[3193,3196]},","]]],["terminal",{"sourceInterval":[3198,3201]},")"],["terminal",{"sourceInterval":[3202,3205]},";"]]],"Function_abstractType":["define",{"sourceInterval":[3236,3321]},null,[],["seq",{"sourceInterval":[3236,3306]},["star",{"sourceInterval":[3236,3254]},["app",{"sourceInterval":[3236,3253]},"FunctionAttribute",[]]],["app",{"sourceInterval":[3255,3258]},"fun",[]],["app",{"sourceInterval":[3259,3261]},"id",[]],["terminal",{"sourceInterval":[3262,3265]},"("],["app",{"sourceInterval":[3266,3289]},"ListOf",[["app",{"sourceInterval":[3273,3284]},"FunctionArg",[]],["terminal",{"sourceInterval":[3285,3288]},","]]],["terminal",{"sourceInterval":[3290,3293]},")"],["terminal",{"sourceInterval":[3294,3297]},":"],["app",{"sourceInterval":[3298,3302]},"Type",[]],["terminal",{"sourceInterval":[3303,3306]},";"]]],"Function":["define",{"sourceInterval":[2918,3321]},null,[],["alt",{"sourceInterval":[2929,3321]},["app",{"sourceInterval":[2929,3005]},"Function_withVoid",[]],["app",{"sourceInterval":[3032,3117]},"Function_withType",[]],["app",{"sourceInterval":[3144,3205]},"Function_abstractVoid",[]],["app",{"sourceInterval":[3236,3306]},"Function_abstractType",[]]]],"FunctionArg":["define",{"sourceInterval":[3326,3351]},null,[],["seq",{"sourceInterval":[3340,3351]},["app",{"sourceInterval":[3340,3342]},"id",[]],["terminal",{"sourceInterval":[3343,3346]},":"],["app",{"sourceInterval":[3347,3351]},"Type",[]]]],"ReceiveFunction_simple":["define",{"sourceInterval":[3379,3436]},null,[],["seq",{"sourceInterval":[3379,3427]},["terminal",{"sourceInterval":[3379,3388]},"receive"],["terminal",{"sourceInterval":[3389,3392]},"("],["app",{"sourceInterval":[3393,3404]},"FunctionArg",[]],["terminal",{"sourceInterval":[3405,3408]},")"],["terminal",{"sourceInterval":[3409,3412]},"{"],["star",{"sourceInterval":[3413,3423]},["app",{"sourceInterval":[3413,3422]},"Statement",[]]],["terminal",{"sourceInterval":[3424,3427]},"}"]]],"ReceiveFunction_empty":["define",{"sourceInterval":[3459,3503]},null,[],["seq",{"sourceInterval":[3459,3495]},["terminal",{"sourceInterval":[3459,3468]},"receive"],["terminal",{"sourceInterval":[3469,3472]},"("],["terminal",{"sourceInterval":[3473,3476]},")"],["terminal",{"sourceInterval":[3477,3480]},"{"],["star",{"sourceInterval":[3481,3491]},["app",{"sourceInterval":[3481,3490]},"Statement",[]]],["terminal",{"sourceInterval":[3492,3495]},"}"]]],"ReceiveFunction_comment":["define",{"sourceInterval":[3526,3586]},null,[],["seq",{"sourceInterval":[3526,3576]},["terminal",{"sourceInterval":[3526,3535]},"receive"],["terminal",{"sourceInterval":[3536,3539]},"("],["app",{"sourceInterval":[3540,3553]},"stringLiteral",[]],["terminal",{"sourceInterval":[3554,3557]},")"],["terminal",{"sourceInterval":[3558,3561]},"{"],["star",{"sourceInterval":[3562,3572]},["app",{"sourceInterval":[3562,3571]},"Statement",[]]],["terminal",{"sourceInterval":[3573,3576]},"}"]]],"ReceiveFunction_bounced":["define",{"sourceInterval":[3609,3667]},null,[],["seq",{"sourceInterval":[3609,3657]},["terminal",{"sourceInterval":[3609,3618]},"bounced"],["terminal",{"sourceInterval":[3619,3622]},"("],["app",{"sourceInterval":[3623,3634]},"FunctionArg",[]],["terminal",{"sourceInterval":[3635,3638]},")"],["terminal",{"sourceInterval":[3639,3642]},"{"],["star",{"sourceInterval":[3643,3653]},["app",{"sourceInterval":[3643,3652]},"Statement",[]]],["terminal",{"sourceInterval":[3654,3657]},"}"]]],"ReceiveFunction_externalSimple":["define",{"sourceInterval":[3690,3756]},null,[],["seq",{"sourceInterval":[3690,3739]},["terminal",{"sourceInterval":[3690,3700]},"external"],["terminal",{"sourceInterval":[3701,3704]},"("],["app",{"sourceInterval":[3705,3716]},"FunctionArg",[]],["terminal",{"sourceInterval":[3717,3720]},")"],["terminal",{"sourceInterval":[3721,3724]},"{"],["star",{"sourceInterval":[3725,3735]},["app",{"sourceInterval":[3725,3734]},"Statement",[]]],["terminal",{"sourceInterval":[3736,3739]},"}"]]],"ReceiveFunction_externalComment":["define",{"sourceInterval":[3779,3848]},null,[],["seq",{"sourceInterval":[3779,3830]},["terminal",{"sourceInterval":[3779,3789]},"external"],["terminal",{"sourceInterval":[3790,3793]},"("],["app",{"sourceInterval":[3794,3807]},"stringLiteral",[]],["terminal",{"sourceInterval":[3808,3811]},")"],["terminal",{"sourceInterval":[3812,3815]},"{"],["star",{"sourceInterval":[3816,3826]},["app",{"sourceInterval":[3816,3825]},"Statement",[]]],["terminal",{"sourceInterval":[3827,3830]},"}"]]],"ReceiveFunction_externalEmpty":["define",{"sourceInterval":[3871,3924]},null,[],["seq",{"sourceInterval":[3871,3908]},["terminal",{"sourceInterval":[3871,3881]},"external"],["terminal",{"sourceInterval":[3882,3885]},"("],["terminal",{"sourceInterval":[3886,3889]},")"],["terminal",{"sourceInterval":[3890,3893]},"{"],["star",{"sourceInterval":[3894,3904]},["app",{"sourceInterval":[3894,3903]},"Statement",[]]],["terminal",{"sourceInterval":[3905,3908]},"}"]]],"ReceiveFunction":["define",{"sourceInterval":[3361,3924]},null,[],["alt",{"sourceInterval":[3379,3924]},["app",{"sourceInterval":[3379,3427]},"ReceiveFunction_simple",[]],["app",{"sourceInterval":[3459,3495]},"ReceiveFunction_empty",[]],["app",{"sourceInterval":[3526,3576]},"ReceiveFunction_comment",[]],["app",{"sourceInterval":[3609,3657]},"ReceiveFunction_bounced",[]],["app",{"sourceInterval":[3690,3739]},"ReceiveFunction_externalSimple",[]],["app",{"sourceInterval":[3779,3830]},"ReceiveFunction_externalComment",[]],["app",{"sourceInterval":[3871,3908]},"ReceiveFunction_externalEmpty",[]]]],"Statement":["define",{"sourceInterval":[3948,4273]},null,[],["alt",{"sourceInterval":[3960,4273]},["app",{"sourceInterval":[3960,3972]},"StatementLet",[]],["app",{"sourceInterval":[3989,4003]},"StatementBlock",[]],["app",{"sourceInterval":[4020,4035]},"StatementReturn",[]],["app",{"sourceInterval":[4052,4071]},"StatementExpression",[]],["app",{"sourceInterval":[4088,4103]},"StatementAssign",[]],["app",{"sourceInterval":[4120,4144]},"StatementAugmentedAssign",[]],["app",{"sourceInterval":[4161,4179]},"StatementCondition",[]],["app",{"sourceInterval":[4196,4210]},"StatementWhile",[]],["app",{"sourceInterval":[4227,4242]},"StatementRepeat",[]],["app",{"sourceInterval":[4259,4273]},"StatementUntil",[]]]],"StatementBlock":["define",{"sourceInterval":[4278,4313]},null,[],["seq",{"sourceInterval":[4295,4313]},["terminal",{"sourceInterval":[4295,4298]},"{"],["star",{"sourceInterval":[4299,4309]},["app",{"sourceInterval":[4299,4308]},"Statement",[]]],["terminal",{"sourceInterval":[4310,4313]},"}"]]],"StatementLet":["define",{"sourceInterval":[4318,4367]},null,[],["seq",{"sourceInterval":[4333,4367]},["app",{"sourceInterval":[4333,4336]},"let",[]],["app",{"sourceInterval":[4337,4339]},"id",[]],["terminal",{"sourceInterval":[4340,4343]},":"],["app",{"sourceInterval":[4344,4348]},"Type",[]],["terminal",{"sourceInterval":[4349,4352]},"="],["app",{"sourceInterval":[4353,4363]},"Expression",[]],["terminal",{"sourceInterval":[4364,4367]},";"]]],"StatementReturn_withExpression":["define",{"sourceInterval":[4390,4428]},null,[],["seq",{"sourceInterval":[4390,4411]},["app",{"sourceInterval":[4390,4396]},"return",[]],["app",{"sourceInterval":[4397,4407]},"Expression",[]],["terminal",{"sourceInterval":[4408,4411]},";"]]],"StatementReturn_withoutExpression":["define",{"sourceInterval":[4451,4481]},null,[],["seq",{"sourceInterval":[4451,4461]},["app",{"sourceInterval":[4451,4457]},"return",[]],["terminal",{"sourceInterval":[4458,4461]},";"]]],"StatementReturn":["define",{"sourceInterval":[4372,4481]},null,[],["alt",{"sourceInterval":[4390,4481]},["app",{"sourceInterval":[4390,4411]},"StatementReturn_withExpression",[]],["app",{"sourceInterval":[4451,4461]},"StatementReturn_withoutExpression",[]]]],"StatementExpression":["define",{"sourceInterval":[4490,4526]},null,[],["seq",{"sourceInterval":[4512,4526]},["app",{"sourceInterval":[4512,4522]},"Expression",[]],["terminal",{"sourceInterval":[4523,4526]},";"]]],"StatementAssign":["define",{"sourceInterval":[4531,4574]},null,[],["seq",{"sourceInterval":[4549,4574]},["app",{"sourceInterval":[4549,4555]},"LValue",[]],["terminal",{"sourceInterval":[4556,4559]},"="],["app",{"sourceInterval":[4560,4570]},"Expression",[]],["terminal",{"sourceInterval":[4571,4574]},";"]]],"StatementAugmentedAssign":["define",{"sourceInterval":[4579,4869]},null,[],["alt",{"sourceInterval":[4606,4869]},["app",{"sourceInterval":[4606,4633]},"StatementAugmentedAssignAdd",[]],["app",{"sourceInterval":[4665,4692]},"StatementAugmentedAssignSub",[]],["app",{"sourceInterval":[4724,4751]},"StatementAugmentedAssignMul",[]],["app",{"sourceInterval":[4783,4810]},"StatementAugmentedAssignDiv",[]],["app",{"sourceInterval":[4842,4869]},"StatementAugmentedAssignRem",[]]]],"StatementAugmentedAssignAdd":["define",{"sourceInterval":[4874,4930]},null,[],["seq",{"sourceInterval":[4904,4930]},["app",{"sourceInterval":[4904,4910]},"LValue",[]],["terminal",{"sourceInterval":[4911,4915]},"+="],["app",{"sourceInterval":[4916,4926]},"Expression",[]],["terminal",{"sourceInterval":[4927,4930]},";"]]],"StatementAugmentedAssignSub":["define",{"sourceInterval":[4935,4991]},null,[],["seq",{"sourceInterval":[4965,4991]},["app",{"sourceInterval":[4965,4971]},"LValue",[]],["terminal",{"sourceInterval":[4972,4976]},"-="],["app",{"sourceInterval":[4977,4987]},"Expression",[]],["terminal",{"sourceInterval":[4988,4991]},";"]]],"StatementAugmentedAssignMul":["define",{"sourceInterval":[4996,5052]},null,[],["seq",{"sourceInterval":[5026,5052]},["app",{"sourceInterval":[5026,5032]},"LValue",[]],["terminal",{"sourceInterval":[5033,5037]},"*="],["app",{"sourceInterval":[5038,5048]},"Expression",[]],["terminal",{"sourceInterval":[5049,5052]},";"]]],"StatementAugmentedAssignDiv":["define",{"sourceInterval":[5057,5113]},null,[],["seq",{"sourceInterval":[5087,5113]},["app",{"sourceInterval":[5087,5093]},"LValue",[]],["terminal",{"sourceInterval":[5094,5098]},"/="],["app",{"sourceInterval":[5099,5109]},"Expression",[]],["terminal",{"sourceInterval":[5110,5113]},";"]]],"StatementAugmentedAssignRem":["define",{"sourceInterval":[5118,5174]},null,[],["seq",{"sourceInterval":[5148,5174]},["app",{"sourceInterval":[5148,5154]},"LValue",[]],["terminal",{"sourceInterval":[5155,5159]},"%="],["app",{"sourceInterval":[5160,5170]},"Expression",[]],["terminal",{"sourceInterval":[5171,5174]},";"]]],"StatementCondition_simple":["define",{"sourceInterval":[5200,5247]},null,[],["seq",{"sourceInterval":[5200,5238]},["app",{"sourceInterval":[5200,5202]},"if",[]],["app",{"sourceInterval":[5203,5213]},"Expression",[]],["terminal",{"sourceInterval":[5214,5217]},"{"],["star",{"sourceInterval":[5218,5228]},["app",{"sourceInterval":[5218,5227]},"Statement",[]]],["terminal",{"sourceInterval":[5229,5232]},"}"],["not",{"sourceInterval":[5233,5238]},["app",{"sourceInterval":[5234,5238]},"else",[]]]]],"StatementCondition_withElse":["define",{"sourceInterval":[5273,5340]},null,[],["seq",{"sourceInterval":[5273,5329]},["app",{"sourceInterval":[5273,5275]},"if",[]],["app",{"sourceInterval":[5276,5286]},"Expression",[]],["terminal",{"sourceInterval":[5287,5290]},"{"],["star",{"sourceInterval":[5291,5301]},["app",{"sourceInterval":[5291,5300]},"Statement",[]]],["terminal",{"sourceInterval":[5302,5305]},"}"],["app",{"sourceInterval":[5306,5310]},"else",[]],["terminal",{"sourceInterval":[5311,5314]},"{"],["star",{"sourceInterval":[5315,5325]},["app",{"sourceInterval":[5315,5324]},"Statement",[]]],["terminal",{"sourceInterval":[5326,5329]},"}"]]],"StatementCondition_withElseIf":["define",{"sourceInterval":[5366,5435]},null,[],["seq",{"sourceInterval":[5366,5422]},["app",{"sourceInterval":[5366,5368]},"if",[]],["app",{"sourceInterval":[5369,5379]},"Expression",[]],["terminal",{"sourceInterval":[5380,5383]},"{"],["star",{"sourceInterval":[5384,5394]},["app",{"sourceInterval":[5384,5393]},"Statement",[]]],["terminal",{"sourceInterval":[5395,5398]},"}"],["app",{"sourceInterval":[5399,5403]},"else",[]],["app",{"sourceInterval":[5404,5422]},"StatementCondition",[]]]],"StatementCondition":["define",{"sourceInterval":[5179,5435]},null,[],["alt",{"sourceInterval":[5200,5435]},["app",{"sourceInterval":[5200,5238]},"StatementCondition_simple",[]],["app",{"sourceInterval":[5273,5329]},"StatementCondition_withElse",[]],["app",{"sourceInterval":[5366,5422]},"StatementCondition_withElseIf",[]]]],"StatementWhile":["define",{"sourceInterval":[5440,5500]},null,[],["seq",{"sourceInterval":[5457,5500]},["app",{"sourceInterval":[5457,5462]},"while",[]],["terminal",{"sourceInterval":[5463,5466]},"("],["app",{"sourceInterval":[5467,5477]},"Expression",[]],["terminal",{"sourceInterval":[5478,5481]},")"],["terminal",{"sourceInterval":[5482,5485]},"{"],["star",{"sourceInterval":[5486,5496]},["app",{"sourceInterval":[5486,5495]},"Statement",[]]],["terminal",{"sourceInterval":[5497,5500]},"}"]]],"StatementRepeat":["define",{"sourceInterval":[5505,5567]},null,[],["seq",{"sourceInterval":[5523,5567]},["app",{"sourceInterval":[5523,5529]},"repeat",[]],["terminal",{"sourceInterval":[5530,5533]},"("],["app",{"sourceInterval":[5534,5544]},"Expression",[]],["terminal",{"sourceInterval":[5545,5548]},")"],["terminal",{"sourceInterval":[5549,5552]},"{"],["star",{"sourceInterval":[5553,5563]},["app",{"sourceInterval":[5553,5562]},"Statement",[]]],["terminal",{"sourceInterval":[5564,5567]},"}"]]],"StatementUntil":["define",{"sourceInterval":[5572,5639]},null,[],["seq",{"sourceInterval":[5589,5639]},["app",{"sourceInterval":[5589,5591]},"do",[]],["terminal",{"sourceInterval":[5592,5595]},"{"],["star",{"sourceInterval":[5596,5606]},["app",{"sourceInterval":[5596,5605]},"Statement",[]]],["terminal",{"sourceInterval":[5607,5610]},"}"],["app",{"sourceInterval":[5611,5616]},"until",[]],["terminal",{"sourceInterval":[5617,5620]},"("],["app",{"sourceInterval":[5621,5631]},"Expression",[]],["terminal",{"sourceInterval":[5632,5635]},")"],["terminal",{"sourceInterval":[5636,5639]},";"]]],"LValue_more":["define",{"sourceInterval":[5669,5689]},null,[],["seq",{"sourceInterval":[5669,5682]},["app",{"sourceInterval":[5669,5671]},"id",[]],["terminal",{"sourceInterval":[5672,5675]},"."],["app",{"sourceInterval":[5676,5682]},"LValue",[]]]],"LValue_single":["define",{"sourceInterval":[5703,5714]},null,[],["app",{"sourceInterval":[5703,5705]},"id",[]]],"LValue":["define",{"sourceInterval":[5660,5714]},null,[],["alt",{"sourceInterval":[5669,5714]},["app",{"sourceInterval":[5669,5682]},"LValue_more",[]],["app",{"sourceInterval":[5703,5705]},"LValue_single",[]]]],"Expression":["define",{"sourceInterval":[5739,5773]},null,[],["app",{"sourceInterval":[5752,5773]},"ExpressionConditional",[]]],"ExpressionConditional_ternary":["define",{"sourceInterval":[5802,5867]},null,[],["seq",{"sourceInterval":[5802,5857]},["app",{"sourceInterval":[5802,5814]},"ExpressionOr",[]],["terminal",{"sourceInterval":[5815,5818]},"?"],["app",{"sourceInterval":[5819,5831]},"ExpressionOr",[]],["terminal",{"sourceInterval":[5832,5835]},":"],["app",{"sourceInterval":[5836,5857]},"ExpressionConditional",[]]]],"ExpressionConditional":["define",{"sourceInterval":[5778,5908]},null,[],["alt",{"sourceInterval":[5802,5908]},["app",{"sourceInterval":[5802,5857]},"ExpressionConditional_ternary",[]],["app",{"sourceInterval":[5896,5908]},"ExpressionOr",[]]]],"ExpressionOr_or":["define",{"sourceInterval":[5928,5964]},null,[],["seq",{"sourceInterval":[5928,5959]},["app",{"sourceInterval":[5928,5940]},"ExpressionOr",[]],["terminal",{"sourceInterval":[5941,5945]},"||"],["app",{"sourceInterval":[5946,5959]},"ExpressionAnd",[]]]],"ExpressionOr":["define",{"sourceInterval":[5913,5997]},null,[],["alt",{"sourceInterval":[5928,5997]},["app",{"sourceInterval":[5928,5959]},"ExpressionOr_or",[]],["app",{"sourceInterval":[5984,5997]},"ExpressionAnd",[]]]],"ExpressionAnd_and":["define",{"sourceInterval":[6018,6060]},null,[],["seq",{"sourceInterval":[6018,6054]},["app",{"sourceInterval":[6018,6031]},"ExpressionAnd",[]],["terminal",{"sourceInterval":[6032,6036]},"&&"],["app",{"sourceInterval":[6037,6054]},"ExpressionCompare",[]]]],"ExpressionAnd":["define",{"sourceInterval":[6002,6098]},null,[],["alt",{"sourceInterval":[6018,6098]},["app",{"sourceInterval":[6018,6054]},"ExpressionAnd_and",[]],["app",{"sourceInterval":[6081,6098]},"ExpressionCompare",[]]]],"ExpressionCompare_not":["define",{"sourceInterval":[6123,6168]},null,[],["seq",{"sourceInterval":[6123,6162]},["app",{"sourceInterval":[6123,6140]},"ExpressionCompare",[]],["terminal",{"sourceInterval":[6141,6145]},"!="],["app",{"sourceInterval":[6146,6162]},"ExpressionBinary",[]]]],"ExpressionCompare_eq":["define",{"sourceInterval":[6193,6237]},null,[],["seq",{"sourceInterval":[6193,6232]},["app",{"sourceInterval":[6193,6210]},"ExpressionCompare",[]],["terminal",{"sourceInterval":[6211,6215]},"=="],["app",{"sourceInterval":[6216,6232]},"ExpressionBinary",[]]]],"ExpressionCompare_gt":["define",{"sourceInterval":[6262,6305]},null,[],["seq",{"sourceInterval":[6262,6300]},["app",{"sourceInterval":[6262,6279]},"ExpressionCompare",[]],["terminal",{"sourceInterval":[6280,6283]},">"],["app",{"sourceInterval":[6284,6300]},"ExpressionBinary",[]]]],"ExpressionCompare_gte":["define",{"sourceInterval":[6330,6375]},null,[],["seq",{"sourceInterval":[6330,6369]},["app",{"sourceInterval":[6330,6347]},"ExpressionCompare",[]],["terminal",{"sourceInterval":[6348,6352]},">="],["app",{"sourceInterval":[6353,6369]},"ExpressionBinary",[]]]],"ExpressionCompare_lt":["define",{"sourceInterval":[6400,6443]},null,[],["seq",{"sourceInterval":[6400,6438]},["app",{"sourceInterval":[6400,6417]},"ExpressionCompare",[]],["terminal",{"sourceInterval":[6418,6421]},"<"],["app",{"sourceInterval":[6422,6438]},"ExpressionBinary",[]]]],"ExpressionCompare_lte":["define",{"sourceInterval":[6468,6513]},null,[],["seq",{"sourceInterval":[6468,6507]},["app",{"sourceInterval":[6468,6485]},"ExpressionCompare",[]],["terminal",{"sourceInterval":[6486,6490]},"<="],["app",{"sourceInterval":[6491,6507]},"ExpressionBinary",[]]]],"ExpressionCompare":["define",{"sourceInterval":[6103,6554]},null,[],["alt",{"sourceInterval":[6123,6554]},["app",{"sourceInterval":[6123,6162]},"ExpressionCompare_not",[]],["app",{"sourceInterval":[6193,6232]},"ExpressionCompare_eq",[]],["app",{"sourceInterval":[6262,6300]},"ExpressionCompare_gt",[]],["app",{"sourceInterval":[6330,6369]},"ExpressionCompare_gte",[]],["app",{"sourceInterval":[6400,6438]},"ExpressionCompare_lt",[]],["app",{"sourceInterval":[6468,6507]},"ExpressionCompare_lte",[]],["app",{"sourceInterval":[6538,6554]},"ExpressionBinary",[]]]],"ExpressionBinary_shr":["define",{"sourceInterval":[6578,6619]},null,[],["seq",{"sourceInterval":[6578,6613]},["app",{"sourceInterval":[6578,6594]},"ExpressionBinary",[]],["terminal",{"sourceInterval":[6595,6599]},">>"],["app",{"sourceInterval":[6600,6613]},"ExpressionAdd",[]]]],"ExpressionBinary_shl":["define",{"sourceInterval":[6642,6683]},null,[],["seq",{"sourceInterval":[6642,6677]},["app",{"sourceInterval":[6642,6658]},"ExpressionBinary",[]],["terminal",{"sourceInterval":[6659,6663]},"<<"],["app",{"sourceInterval":[6664,6677]},"ExpressionAdd",[]]]],"ExpressionBinary_bin_and":["define",{"sourceInterval":[6706,6750]},null,[],["seq",{"sourceInterval":[6706,6740]},["app",{"sourceInterval":[6706,6722]},"ExpressionBinary",[]],["terminal",{"sourceInterval":[6723,6726]},"&"],["app",{"sourceInterval":[6727,6740]},"ExpressionAdd",[]]]],"ExpressionBinary_bin_or":["define",{"sourceInterval":[6773,6816]},null,[],["seq",{"sourceInterval":[6773,6807]},["app",{"sourceInterval":[6773,6789]},"ExpressionBinary",[]],["terminal",{"sourceInterval":[6790,6793]},"|"],["app",{"sourceInterval":[6794,6807]},"ExpressionAdd",[]]]],"ExpressionBinary":["define",{"sourceInterval":[6559,6852]},null,[],["alt",{"sourceInterval":[6578,6852]},["app",{"sourceInterval":[6578,6613]},"ExpressionBinary_shr",[]],["app",{"sourceInterval":[6642,6677]},"ExpressionBinary_shl",[]],["app",{"sourceInterval":[6706,6740]},"ExpressionBinary_bin_and",[]],["app",{"sourceInterval":[6773,6807]},"ExpressionBinary_bin_or",[]],["app",{"sourceInterval":[6839,6852]},"ExpressionAdd",[]]]],"ExpressionAdd_add":["define",{"sourceInterval":[6873,6915]},null,[],["seq",{"sourceInterval":[6873,6909]},["app",{"sourceInterval":[6873,6886]},"ExpressionAdd",[]],["terminal",{"sourceInterval":[6887,6890]},"+"],["not",{"sourceInterval":[6891,6895]},["terminal",{"sourceInterval":[6892,6895]},"+"]],["app",{"sourceInterval":[6896,6909]},"ExpressionMul",[]]]],"ExpressionAdd_sub":["define",{"sourceInterval":[6936,6978]},null,[],["seq",{"sourceInterval":[6936,6972]},["app",{"sourceInterval":[6936,6949]},"ExpressionAdd",[]],["terminal",{"sourceInterval":[6950,6953]},"-"],["not",{"sourceInterval":[6954,6958]},["terminal",{"sourceInterval":[6955,6958]},"-"]],["app",{"sourceInterval":[6959,6972]},"ExpressionMul",[]]]],"ExpressionAdd":["define",{"sourceInterval":[6857,7012]},null,[],["alt",{"sourceInterval":[6873,7012]},["app",{"sourceInterval":[6873,6909]},"ExpressionAdd_add",[]],["app",{"sourceInterval":[6936,6972]},"ExpressionAdd_sub",[]],["app",{"sourceInterval":[6999,7012]},"ExpressionMul",[]]]],"ExpressionMul_mul":["define",{"sourceInterval":[7033,7072]},null,[],["seq",{"sourceInterval":[7033,7066]},["app",{"sourceInterval":[7033,7046]},"ExpressionMul",[]],["terminal",{"sourceInterval":[7047,7050]},"*"],["app",{"sourceInterval":[7051,7066]},"ExpressionUnary",[]]]],"ExpressionMul_div":["define",{"sourceInterval":[7093,7132]},null,[],["seq",{"sourceInterval":[7093,7126]},["app",{"sourceInterval":[7093,7106]},"ExpressionMul",[]],["terminal",{"sourceInterval":[7107,7110]},"/"],["app",{"sourceInterval":[7111,7126]},"ExpressionUnary",[]]]],"ExpressionMul_rem":["define",{"sourceInterval":[7153,7192]},null,[],["seq",{"sourceInterval":[7153,7186]},["app",{"sourceInterval":[7153,7166]},"ExpressionMul",[]],["terminal",{"sourceInterval":[7167,7170]},"%"],["app",{"sourceInterval":[7171,7186]},"ExpressionUnary",[]]]],"ExpressionMul":["define",{"sourceInterval":[7017,7228]},null,[],["alt",{"sourceInterval":[7033,7228]},["app",{"sourceInterval":[7033,7066]},"ExpressionMul_mul",[]],["app",{"sourceInterval":[7093,7126]},"ExpressionMul_div",[]],["app",{"sourceInterval":[7153,7186]},"ExpressionMul_rem",[]],["app",{"sourceInterval":[7213,7228]},"ExpressionUnary",[]]]],"ExpressionUnary_neg":["define",{"sourceInterval":[7251,7282]},null,[],["seq",{"sourceInterval":[7251,7276]},["terminal",{"sourceInterval":[7251,7254]},"-"],["app",{"sourceInterval":[7255,7276]},"ExpressionUnarySuffix",[]]]],"ExpressionUnary_add":["define",{"sourceInterval":[7305,7336]},null,[],["seq",{"sourceInterval":[7305,7330]},["terminal",{"sourceInterval":[7305,7308]},"+"],["app",{"sourceInterval":[7309,7330]},"ExpressionUnarySuffix",[]]]],"ExpressionUnary_not":["define",{"sourceInterval":[7359,7390]},null,[],["seq",{"sourceInterval":[7359,7384]},["terminal",{"sourceInterval":[7359,7362]},"!"],["app",{"sourceInterval":[7363,7384]},"ExpressionUnarySuffix",[]]]],"ExpressionUnary":["define",{"sourceInterval":[7233,7434]},null,[],["alt",{"sourceInterval":[7251,7434]},["app",{"sourceInterval":[7251,7276]},"ExpressionUnary_neg",[]],["app",{"sourceInterval":[7305,7330]},"ExpressionUnary_add",[]],["app",{"sourceInterval":[7359,7384]},"ExpressionUnary_not",[]],["app",{"sourceInterval":[7413,7434]},"ExpressionUnarySuffix",[]]]],"ExpressionUnarySuffix_notNull":["define",{"sourceInterval":[7463,7493]},null,[],["seq",{"sourceInterval":[7463,7483]},["app",{"sourceInterval":[7463,7478]},"ExpressionValue",[]],["terminal",{"sourceInterval":[7479,7483]},"!!"]]],"ExpressionUnarySuffix":["define",{"sourceInterval":[7439,7537]},null,[],["alt",{"sourceInterval":[7463,7537]},["app",{"sourceInterval":[7463,7483]},"ExpressionUnarySuffix_notNull",[]],["app",{"sourceInterval":[7522,7537]},"ExpressionValue",[]]]],"ExpressionBracket":["define",{"sourceInterval":[7542,7580]},null,[],["seq",{"sourceInterval":[7562,7580]},["terminal",{"sourceInterval":[7562,7565]},"("],["app",{"sourceInterval":[7566,7576]},"Expression",[]],["terminal",{"sourceInterval":[7577,7580]},")"]]],"ExpressionValue":["define",{"sourceInterval":[7612,8002]},null,[],["alt",{"sourceInterval":[7630,8002]},["app",{"sourceInterval":[7630,7644]},"ExpressionCall",[]],["app",{"sourceInterval":[7667,7682]},"ExpressionField",[]],["app",{"sourceInterval":[7705,7725]},"ExpressionStaticCall",[]],["app",{"sourceInterval":[7748,7765]},"ExpressionBracket",[]],["app",{"sourceInterval":[7788,7801]},"ExpressionNew",[]],["app",{"sourceInterval":[7824,7838]},"integerLiteral",[]],["app",{"sourceInterval":[7861,7872]},"boolLiteral",[]],["app",{"sourceInterval":[7895,7897]},"id",[]],["app",{"sourceInterval":[7920,7924]},"null",[]],["app",{"sourceInterval":[7947,7963]},"ExpressionInitOf",[]],["app",{"sourceInterval":[7986,8002]},"ExpressionString",[]]]],"ExpressionString":["define",{"sourceInterval":[8007,8039]},null,[],["app",{"sourceInterval":[8026,8039]},"stringLiteral",[]]],"ExpressionField":["define",{"sourceInterval":[8044,8089]},null,[],["seq",{"sourceInterval":[8062,8089]},["app",{"sourceInterval":[8062,8077]},"ExpressionValue",[]],["terminal",{"sourceInterval":[8078,8081]},"."],["app",{"sourceInterval":[8082,8084]},"id",[]],["not",{"sourceInterval":[8085,8089]},["terminal",{"sourceInterval":[8086,8089]},"("]]]],"ExpressionCall":["define",{"sourceInterval":[8094,8165]},null,[],["seq",{"sourceInterval":[8111,8165]},["app",{"sourceInterval":[8111,8126]},"ExpressionValue",[]],["terminal",{"sourceInterval":[8127,8130]},"."],["app",{"sourceInterval":[8131,8133]},"id",[]],["terminal",{"sourceInterval":[8134,8137]},"("],["app",{"sourceInterval":[8138,8161]},"ListOf",[["app",{"sourceInterval":[8145,8155]},"Expression",[]],["terminal",{"sourceInterval":[8157,8160]},","]]],["terminal",{"sourceInterval":[8162,8165]},")"]]],"ExpressionNew":["define",{"sourceInterval":[8170,8222]},null,[],["seq",{"sourceInterval":[8186,8222]},["app",{"sourceInterval":[8186,8188]},"id",[]],["terminal",{"sourceInterval":[8189,8192]},"{"],["app",{"sourceInterval":[8193,8218]},"ListOf",[["app",{"sourceInterval":[8200,8212]},"NewParameter",[]],["terminal",{"sourceInterval":[8214,8217]},","]]],["terminal",{"sourceInterval":[8219,8222]},"}"]]],"NewParameter":["define",{"sourceInterval":[8227,8259]},null,[],["seq",{"sourceInterval":[8242,8259]},["app",{"sourceInterval":[8242,8244]},"id",[]],["terminal",{"sourceInterval":[8245,8248]},":"],["app",{"sourceInterval":[8249,8259]},"Expression",[]]]],"ExpressionStaticCall":["define",{"sourceInterval":[8264,8321]},null,[],["seq",{"sourceInterval":[8287,8321]},["app",{"sourceInterval":[8287,8289]},"id",[]],["terminal",{"sourceInterval":[8290,8293]},"("],["app",{"sourceInterval":[8294,8317]},"ListOf",[["app",{"sourceInterval":[8301,8311]},"Expression",[]],["terminal",{"sourceInterval":[8313,8316]},","]]],["terminal",{"sourceInterval":[8318,8321]},")"]]],"ExpressionInitOf":["define",{"sourceInterval":[8326,8386]},null,[],["seq",{"sourceInterval":[8345,8386]},["app",{"sourceInterval":[8345,8351]},"initOf",[]],["app",{"sourceInterval":[8352,8354]},"id",[]],["terminal",{"sourceInterval":[8355,8358]},"("],["app",{"sourceInterval":[8359,8382]},"ListOf",[["app",{"sourceInterval":[8366,8376]},"Expression",[]],["terminal",{"sourceInterval":[8378,8381]},","]]],["terminal",{"sourceInterval":[8383,8386]},")"]]],"typeLiteral":["define",{"sourceInterval":[8412,8456]},null,[],["seq",{"sourceInterval":[8426,8456]},["app",{"sourceInterval":[8426,8439]},"letterAsciiUC",[]],["star",{"sourceInterval":[8440,8456]},["app",{"sourceInterval":[8440,8455]},"typeLiteralPart",[]]]]],"typeLiteralPart":["define",{"sourceInterval":[8461,8504]},null,[],["alt",{"sourceInterval":[8479,8504]},["app",{"sourceInterval":[8479,8490]},"letterAscii",[]],["app",{"sourceInterval":[8493,8498]},"digit",[]],["terminal",{"sourceInterval":[8501,8504]},"_"]]],"integerLiteral":["define",{"sourceInterval":[8711,8805]},null,[],["alt",{"sourceInterval":[8728,8805]},["app",{"sourceInterval":[8728,8745]},"integerLiteralHex",[]],["app",{"sourceInterval":[8748,8765]},"integerLiteralBin",[]],["app",{"sourceInterval":[8768,8785]},"integerLiteralOct",[]],["app",{"sourceInterval":[8788,8805]},"integerLiteralDec",[]]]],"integerLiteralDec_nonZeroIntegerLiteralDec":["define",{"sourceInterval":[8852,8906]},null,[],["seq",{"sourceInterval":[8852,8878]},["app",{"sourceInterval":[8852,8864]},"nonZeroDigit",[]],["star",{"sourceInterval":[8865,8878]},["seq",{"sourceInterval":[8866,8876]},["opt",{"sourceInterval":[8866,8870]},["terminal",{"sourceInterval":[8866,8869]},"_"]],["app",{"sourceInterval":[8871,8876]},"digit",[]]]]]],"integerLiteralDec_integerLiteralWithLeadingZero":["define",{"sourceInterval":[8931,8990]},null,[],["seq",{"sourceInterval":[8931,8941]},["terminal",{"sourceInterval":[8931,8934]},"0"],["star",{"sourceInterval":[8935,8941]},["app",{"sourceInterval":[8935,8940]},"digit",[]]]]],"integerLiteralDec":["define",{"sourceInterval":[8832,8990]},null,[],["alt",{"sourceInterval":[8852,8990]},["app",{"sourceInterval":[8852,8878]},"integerLiteralDec_nonZeroIntegerLiteralDec",[]],["app",{"sourceInterval":[8931,8941]},"integerLiteralDec_integerLiteralWithLeadingZero",[]]]],"integerLiteralHex":["define",{"sourceInterval":[8995,9054]},null,[],["seq",{"sourceInterval":[9015,9054]},["alt",{"sourceInterval":[9016,9027]},["terminal",{"sourceInterval":[9016,9020]},"0x"],["terminal",{"sourceInterval":[9023,9027]},"0X"]],["app",{"sourceInterval":[9029,9037]},"hexDigit",[]],["star",{"sourceInterval":[9038,9054]},["seq",{"sourceInterval":[9039,9052]},["opt",{"sourceInterval":[9039,9043]},["terminal",{"sourceInterval":[9039,9042]},"_"]],["app",{"sourceInterval":[9044,9052]},"hexDigit",[]]]]]],"integerLiteralBin":["define",{"sourceInterval":[9059,9118]},null,[],["seq",{"sourceInterval":[9079,9118]},["alt",{"sourceInterval":[9080,9091]},["terminal",{"sourceInterval":[9080,9084]},"0b"],["terminal",{"sourceInterval":[9087,9091]},"0B"]],["app",{"sourceInterval":[9093,9101]},"binDigit",[]],["star",{"sourceInterval":[9102,9118]},["seq",{"sourceInterval":[9103,9116]},["opt",{"sourceInterval":[9103,9107]},["terminal",{"sourceInterval":[9103,9106]},"_"]],["app",{"sourceInterval":[9108,9116]},"binDigit",[]]]]]],"integerLiteralOct":["define",{"sourceInterval":[9123,9182]},null,[],["seq",{"sourceInterval":[9143,9182]},["alt",{"sourceInterval":[9144,9155]},["terminal",{"sourceInterval":[9144,9148]},"0o"],["terminal",{"sourceInterval":[9151,9155]},"0O"]],["app",{"sourceInterval":[9157,9165]},"octDigit",[]],["star",{"sourceInterval":[9166,9182]},["seq",{"sourceInterval":[9167,9180]},["opt",{"sourceInterval":[9167,9171]},["terminal",{"sourceInterval":[9167,9170]},"_"]],["app",{"sourceInterval":[9172,9180]},"octDigit",[]]]]]],"binDigit":["define",{"sourceInterval":[9187,9207]},null,[],["alt",{"sourceInterval":[9198,9207]},["terminal",{"sourceInterval":[9198,9201]},"0"],["terminal",{"sourceInterval":[9204,9207]},"1"]]],"octDigit":["define",{"sourceInterval":[9212,9231]},null,[],["range",{"sourceInterval":[9223,9231]},"0","7"]],"nonZeroDigit":["define",{"sourceInterval":[9236,9259]},null,[],["range",{"sourceInterval":[9251,9259]},"1","9"]],"letterAsciiLC":["define",{"sourceInterval":[9280,9304]},null,[],["range",{"sourceInterval":[9296,9304]},"a","z"]],"letterAsciiUC":["define",{"sourceInterval":[9309,9333]},null,[],["range",{"sourceInterval":[9325,9333]},"A","Z"]],"letterAscii":["define",{"sourceInterval":[9338,9381]},null,[],["alt",{"sourceInterval":[9352,9381]},["app",{"sourceInterval":[9352,9365]},"letterAsciiLC",[]],["app",{"sourceInterval":[9368,9381]},"letterAsciiUC",[]]]],"letterComment":["define",{"sourceInterval":[9386,9445]},null,[],["alt",{"sourceInterval":[9402,9445]},["app",{"sourceInterval":[9402,9415]},"letterAsciiLC",[]],["app",{"sourceInterval":[9418,9431]},"letterAsciiUC",[]],["app",{"sourceInterval":[9434,9439]},"digit",[]],["terminal",{"sourceInterval":[9442,9445]},"_"]]],"idStart":["define",{"sourceInterval":[9469,9496]},null,[],["alt",{"sourceInterval":[9479,9496]},["app",{"sourceInterval":[9479,9490]},"letterAscii",[]],["terminal",{"sourceInterval":[9493,9496]},"_"]]],"idPart":["define",{"sourceInterval":[9501,9535]},null,[],["alt",{"sourceInterval":[9510,9535]},["app",{"sourceInterval":[9510,9521]},"letterAscii",[]],["app",{"sourceInterval":[9524,9529]},"digit",[]],["terminal",{"sourceInterval":[9532,9535]},"_"]]],"id":["define",{"sourceInterval":[9540,9578]},null,[],["seq",{"sourceInterval":[9545,9578]},["not",{"sourceInterval":[9545,9558]},["app",{"sourceInterval":[9546,9558]},"reservedWord",[]]],["lex",{"sourceInterval":[9559,9567]},["app",{"sourceInterval":[9560,9567]},"idStart",[]]],["lex",{"sourceInterval":[9568,9578]},["star",{"sourceInterval":[9570,9577]},["app",{"sourceInterval":[9570,9576]},"idPart",[]]]]]],"funcLetter":["define",{"sourceInterval":[9599,9660]},null,[],["alt",{"sourceInterval":[9612,9660]},["app",{"sourceInterval":[9612,9623]},"letterAscii",[]],["terminal",{"sourceInterval":[9626,9629]},"_"],["terminal",{"sourceInterval":[9632,9635]},"'"],["terminal",{"sourceInterval":[9638,9641]},"?"],["terminal",{"sourceInterval":[9644,9647]},"!"],["terminal",{"sourceInterval":[9650,9654]},"::"],["terminal",{"sourceInterval":[9657,9660]},"&"]]],"funcId":["define",{"sourceInterval":[9665,9707]},null,[],["seq",{"sourceInterval":[9674,9707]},["app",{"sourceInterval":[9674,9684]},"funcLetter",[]],["star",{"sourceInterval":[9685,9707]},["lex",{"sourceInterval":[9685,9706]},["alt",{"sourceInterval":[9687,9705]},["app",{"sourceInterval":[9687,9697]},"funcLetter",[]],["app",{"sourceInterval":[9700,9705]},"digit",[]]]]]]],"boolLiteral":["define",{"sourceInterval":[9733,9773]},null,[],["seq",{"sourceInterval":[9747,9773]},["alt",{"sourceInterval":[9748,9764]},["terminal",{"sourceInterval":[9748,9754]},"true"],["terminal",{"sourceInterval":[9757,9764]},"false"]],["not",{"sourceInterval":[9766,9773]},["app",{"sourceInterval":[9767,9773]},"idPart",[]]]]],"stringLiteralCharacter":["define",{"sourceInterval":[9801,9861]},null,[],["seq",{"sourceInterval":[9826,9861]},["not",{"sourceInterval":[9826,9857]},["alt",{"sourceInterval":[9828,9856]},["terminal",{"sourceInterval":[9828,9832]},"\""],["terminal",{"sourceInterval":[9835,9839]},"\\"],["app",{"sourceInterval":[9842,9856]},"lineTerminator",[]]]],["app",{"sourceInterval":[9858,9861]},"any",[]]]],"stringLiteral":["define",{"sourceInterval":[9866,9915]},null,[],["seq",{"sourceInterval":[9882,9915]},["terminal",{"sourceInterval":[9882,9886]},"\""],["star",{"sourceInterval":[9887,9910]},["app",{"sourceInterval":[9887,9909]},"stringLiteralCharacter",[]]],["terminal",{"sourceInterval":[9911,9915]},"\""]]],"keyword":["define",{"sourceInterval":[9968,10481]},null,[],["alt",{"sourceInterval":[9978,10481]},["app",{"sourceInterval":[9978,9981]},"fun",[]],["app",{"sourceInterval":[9997,10000]},"let",[]],["app",{"sourceInterval":[10015,10021]},"return",[]],["app",{"sourceInterval":[10037,10043]},"extend",[]],["app",{"sourceInterval":[10059,10065]},"native",[]],["app",{"sourceInterval":[10081,10087]},"public",[]],["app",{"sourceInterval":[10103,10107]},"null",[]],["app",{"sourceInterval":[10123,10125]},"if",[]],["app",{"sourceInterval":[10141,10145]},"else",[]],["app",{"sourceInterval":[10161,10166]},"while",[]],["app",{"sourceInterval":[10182,10188]},"repeat",[]],["app",{"sourceInterval":[10204,10206]},"do",[]],["app",{"sourceInterval":[10222,10227]},"until",[]],["app",{"sourceInterval":[10243,10245]},"as",[]],["app",{"sourceInterval":[10262,10269]},"mutates",[]],["app",{"sourceInterval":[10284,10291]},"extends",[]],["app",{"sourceInterval":[10306,10312]},"import",[]],["app",{"sourceInterval":[10327,10331]},"with",[]],["app",{"sourceInterval":[10346,10351]},"trait",[]],["app",{"sourceInterval":[10366,10372]},"initOf",[]],["app",{"sourceInterval":[10387,10395]},"override",[]],["app",{"sourceInterval":[10410,10418]},"abstract",[]],["app",{"sourceInterval":[10433,10440]},"virtual",[]],["app",{"sourceInterval":[10455,10461]},"inline",[]],["app",{"sourceInterval":[10476,10481]},"const",[]]]],"contract":["define",{"sourceInterval":[10486,10515]},null,[],["seq",{"sourceInterval":[10497,10515]},["terminal",{"sourceInterval":[10497,10507]},"contract"],["not",{"sourceInterval":[10508,10515]},["app",{"sourceInterval":[10509,10515]},"idPart",[]]]]],"let":["define",{"sourceInterval":[10520,10539]},null,[],["seq",{"sourceInterval":[10526,10539]},["terminal",{"sourceInterval":[10526,10531]},"let"],["not",{"sourceInterval":[10532,10539]},["app",{"sourceInterval":[10533,10539]},"idPart",[]]]]],"fun":["define",{"sourceInterval":[10544,10563]},null,[],["seq",{"sourceInterval":[10550,10563]},["terminal",{"sourceInterval":[10550,10555]},"fun"],["not",{"sourceInterval":[10556,10563]},["app",{"sourceInterval":[10557,10563]},"idPart",[]]]]],"return":["define",{"sourceInterval":[10568,10593]},null,[],["seq",{"sourceInterval":[10577,10593]},["terminal",{"sourceInterval":[10577,10585]},"return"],["not",{"sourceInterval":[10586,10593]},["app",{"sourceInterval":[10587,10593]},"idPart",[]]]]],"extend":["define",{"sourceInterval":[10598,10623]},null,[],["seq",{"sourceInterval":[10607,10623]},["terminal",{"sourceInterval":[10607,10615]},"extend"],["not",{"sourceInterval":[10616,10623]},["app",{"sourceInterval":[10617,10623]},"idPart",[]]]]],"native":["define",{"sourceInterval":[10628,10653]},null,[],["seq",{"sourceInterval":[10637,10653]},["terminal",{"sourceInterval":[10637,10645]},"native"],["not",{"sourceInterval":[10646,10653]},["app",{"sourceInterval":[10647,10653]},"idPart",[]]]]],"public":["define",{"sourceInterval":[10658,10683]},null,[],["seq",{"sourceInterval":[10667,10683]},["terminal",{"sourceInterval":[10667,10675]},"public"],["not",{"sourceInterval":[10676,10683]},["app",{"sourceInterval":[10677,10683]},"idPart",[]]]]],"null":["define",{"sourceInterval":[10688,10709]},null,[],["seq",{"sourceInterval":[10695,10709]},["terminal",{"sourceInterval":[10695,10701]},"null"],["not",{"sourceInterval":[10702,10709]},["app",{"sourceInterval":[10703,10709]},"idPart",[]]]]],"if":["define",{"sourceInterval":[10714,10731]},null,[],["seq",{"sourceInterval":[10719,10731]},["terminal",{"sourceInterval":[10719,10723]},"if"],["not",{"sourceInterval":[10724,10731]},["app",{"sourceInterval":[10725,10731]},"idPart",[]]]]],"else":["define",{"sourceInterval":[10736,10757]},null,[],["seq",{"sourceInterval":[10743,10757]},["terminal",{"sourceInterval":[10743,10749]},"else"],["not",{"sourceInterval":[10750,10757]},["app",{"sourceInterval":[10751,10757]},"idPart",[]]]]],"while":["define",{"sourceInterval":[10762,10785]},null,[],["seq",{"sourceInterval":[10770,10785]},["terminal",{"sourceInterval":[10770,10777]},"while"],["not",{"sourceInterval":[10778,10785]},["app",{"sourceInterval":[10779,10785]},"idPart",[]]]]],"repeat":["define",{"sourceInterval":[10790,10815]},null,[],["seq",{"sourceInterval":[10799,10815]},["terminal",{"sourceInterval":[10799,10807]},"repeat"],["not",{"sourceInterval":[10808,10815]},["app",{"sourceInterval":[10809,10815]},"idPart",[]]]]],"do":["define",{"sourceInterval":[10820,10837]},null,[],["seq",{"sourceInterval":[10825,10837]},["terminal",{"sourceInterval":[10825,10829]},"do"],["not",{"sourceInterval":[10830,10837]},["app",{"sourceInterval":[10831,10837]},"idPart",[]]]]],"until":["define",{"sourceInterval":[10842,10865]},null,[],["seq",{"sourceInterval":[10850,10865]},["terminal",{"sourceInterval":[10850,10857]},"until"],["not",{"sourceInterval":[10858,10865]},["app",{"sourceInterval":[10859,10865]},"idPart",[]]]]],"as":["define",{"sourceInterval":[10870,10887]},null,[],["seq",{"sourceInterval":[10875,10887]},["terminal",{"sourceInterval":[10875,10879]},"as"],["not",{"sourceInterval":[10880,10887]},["app",{"sourceInterval":[10881,10887]},"idPart",[]]]]],"mutates":["define",{"sourceInterval":[10892,10919]},null,[],["seq",{"sourceInterval":[10902,10919]},["terminal",{"sourceInterval":[10902,10911]},"mutates"],["not",{"sourceInterval":[10912,10919]},["app",{"sourceInterval":[10913,10919]},"idPart",[]]]]],"extends":["define",{"sourceInterval":[10924,10951]},null,[],["seq",{"sourceInterval":[10934,10951]},["terminal",{"sourceInterval":[10934,10943]},"extends"],["not",{"sourceInterval":[10944,10951]},["app",{"sourceInterval":[10945,10951]},"idPart",[]]]]],"import":["define",{"sourceInterval":[10956,10981]},null,[],["seq",{"sourceInterval":[10965,10981]},["terminal",{"sourceInterval":[10965,10973]},"import"],["not",{"sourceInterval":[10974,10981]},["app",{"sourceInterval":[10975,10981]},"idPart",[]]]]],"with":["define",{"sourceInterval":[10986,11007]},null,[],["seq",{"sourceInterval":[10993,11007]},["terminal",{"sourceInterval":[10993,10999]},"with"],["not",{"sourceInterval":[11000,11007]},["app",{"sourceInterval":[11001,11007]},"idPart",[]]]]],"trait":["define",{"sourceInterval":[11012,11035]},null,[],["seq",{"sourceInterval":[11020,11035]},["terminal",{"sourceInterval":[11020,11027]},"trait"],["not",{"sourceInterval":[11028,11035]},["app",{"sourceInterval":[11029,11035]},"idPart",[]]]]],"initOf":["define",{"sourceInterval":[11040,11065]},null,[],["seq",{"sourceInterval":[11049,11065]},["terminal",{"sourceInterval":[11049,11057]},"initOf"],["not",{"sourceInterval":[11058,11065]},["app",{"sourceInterval":[11059,11065]},"idPart",[]]]]],"virtual":["define",{"sourceInterval":[11070,11097]},null,[],["seq",{"sourceInterval":[11080,11097]},["terminal",{"sourceInterval":[11080,11089]},"virtual"],["not",{"sourceInterval":[11090,11097]},["app",{"sourceInterval":[11091,11097]},"idPart",[]]]]],"override":["define",{"sourceInterval":[11102,11131]},null,[],["seq",{"sourceInterval":[11113,11131]},["terminal",{"sourceInterval":[11113,11123]},"override"],["not",{"sourceInterval":[11124,11131]},["app",{"sourceInterval":[11125,11131]},"idPart",[]]]]],"inline":["define",{"sourceInterval":[11136,11161]},null,[],["seq",{"sourceInterval":[11145,11161]},["terminal",{"sourceInterval":[11145,11153]},"inline"],["not",{"sourceInterval":[11154,11161]},["app",{"sourceInterval":[11155,11161]},"idPart",[]]]]],"const":["define",{"sourceInterval":[11166,11189]},null,[],["seq",{"sourceInterval":[11174,11189]},["terminal",{"sourceInterval":[11174,11181]},"const"],["not",{"sourceInterval":[11182,11189]},["app",{"sourceInterval":[11183,11189]},"idPart",[]]]]],"abstract":["define",{"sourceInterval":[11194,11223]},null,[],["seq",{"sourceInterval":[11205,11223]},["terminal",{"sourceInterval":[11205,11215]},"abstract"],["not",{"sourceInterval":[11216,11223]},["app",{"sourceInterval":[11217,11223]},"idPart",[]]]]],"nameAttribute":["define",{"sourceInterval":[11247,11270]},null,[],["terminal",{"sourceInterval":[11263,11270]},"@name"]],"reservedWord":["define",{"sourceInterval":[11292,11314]},null,[],["app",{"sourceInterval":[11307,11314]},"keyword",[]]],"space":["extend",{"sourceInterval":[11336,11369]},null,[],["alt",{"sourceInterval":[11345,11369]},["app",{"sourceInterval":[11345,11352]},"comment",[]],["app",{"sourceInterval":[11355,11369]},"lineTerminator",[]]]],"comment":["define",{"sourceInterval":[11374,11420]},null,[],["alt",{"sourceInterval":[11384,11420]},["app",{"sourceInterval":[11384,11400]},"multiLineComment",[]],["app",{"sourceInterval":[11403,11420]},"singleLineComment",[]]]],"lineTerminator":["define",{"sourceInterval":[11425,11475]},null,[],["alt",{"sourceInterval":[11442,11475]},["terminal",{"sourceInterval":[11442,11446]},"\n"],["terminal",{"sourceInterval":[11449,11453]},"\r"],["terminal",{"sourceInterval":[11456,11464]},"\u2028"],["terminal",{"sourceInterval":[11467,11475]},"\u2029"]]],"multiLineComment":["define",{"sourceInterval":[11480,11521]},null,[],["seq",{"sourceInterval":[11499,11521]},["terminal",{"sourceInterval":[11499,11503]},"/*"],["star",{"sourceInterval":[11504,11516]},["seq",{"sourceInterval":[11505,11514]},["not",{"sourceInterval":[11505,11510]},["terminal",{"sourceInterval":[11506,11510]},"*/"]],["app",{"sourceInterval":[11511,11514]},"any",[]]]],["terminal",{"sourceInterval":[11517,11521]},"*/"]]],"singleLineComment":["define",{"sourceInterval":[11526,11573]},null,[],["seq",{"sourceInterval":[11546,11573]},["terminal",{"sourceInterval":[11546,11550]},"//"],["star",{"sourceInterval":[11551,11573]},["seq",{"sourceInterval":[11552,11571]},["not",{"sourceInterval":[11552,11567]},["app",{"sourceInterval":[11553,11567]},"lineTerminator",[]]],["app",{"sourceInterval":[11568,11571]},"any",[]]]]]]}]);module.exports=result; \ No newline at end of file +'use strict';const ohm=(require('ohm-js').default || require('ohm-js'));const result=ohm.makeRecipe(["grammar",{"source":"Tact {\n\n // Starting point of the program\n Program = ProgramItem*\n ProgramItem = Struct\n | Contract\n | Primitive\n | StaticFunction\n | NativeFunction\n | ProgramImport\n | Trait\n | Constant\n ProgramImport = import stringLiteral \";\"\n\n // Built-in declarations\n Primitive = \"primitive\" Type \";\"\n\n // Static function\n StaticFunction = Function\n NativeFunction = nameAttribute \"(\" funcId \")\" FunctionAttribute* native id \"(\" ListOf \")\" \";\" --withVoid\n | nameAttribute \"(\" funcId \")\" FunctionAttribute* native id \"(\" ListOf \")\" \":\" Type \";\" --withType\n \n // Field declarations\n Type = typeLiteral \"?\" --optional\n | typeLiteral --required\n | \"map\" \"<\" typeLiteral (as id)? \",\" typeLiteral (as id)? \">\" --map\n | \"bounced\" \"<\" typeLiteral \">\" --bounced\n Field = id \":\" Type \";\" --default\n | id \":\" Type \"=\" Expression \";\" --defaultWithInit\n | id \":\" Type as id \";\" --withSerialization\n | id \":\" Type as id \"=\" Expression \";\" --withSerializationAndInit\n \n // Constant\n ConstantAttribute = virtual --virtual\n | override --override\n | abstract --abstract\n Constant = ConstantAttribute* ~fun const id \":\" Type \"=\" Expression \";\" --withValue\n | ConstantAttribute* ~fun const id \":\" Type \";\" --withEmpty\n\n // Struct\n Struct = \"struct\" typeLiteral \"{\" StructBody* \"}\" --originary\n | \"message\" typeLiteral \"{\" StructBody* \"}\" --message\n | \"message\" \"(\" integerLiteral \")\" typeLiteral \"{\" StructBody* \"}\" --messageWithId\n StructBody = Field\n\n // Contract\n Contract = ContractAttribute* contract id \"{\" ContractBody* \"}\" --simple\n | ContractAttribute* contract id with ListOf \"{\" ContractBody* \"}\" --withTraits\n ContractInit = \"init\" \"(\" ListOf \")\" \"{\" Statement* \"}\"\n ContractBody = Field\n | ContractInit\n | ReceiveFunction\n | Function\n | Constant\n \n // Trait\n Trait = ContractAttribute* trait id \"{\" TraitBody* \"}\" --originary\n | ContractAttribute* trait id with ListOf \"{\" TraitBody* \"}\" --withTraits\n TraitBody = Field\n | ReceiveFunction\n | Function\n | Constant\n\n // Contract attributes\n ContractAttribute = \"@interface\" \"(\" stringLiteral \")\" --interface\n\n // Function\n FunctionAttribute = \"get\" --getter\n | mutates --mutates\n | extends --extends\n | virtual --virtual\n | override --override\n | inline --inline\n | abstract --abstract\n Function = FunctionAttribute* fun id \"(\" ListOf \")\" \"{\" Statement* \"}\" --withVoid\n | FunctionAttribute* fun id \"(\" ListOf \")\" \":\" Type \"{\" Statement* \"}\" --withType\n | FunctionAttribute* fun id \"(\" ListOf \")\" \";\" --abstractVoid\n | FunctionAttribute* fun id \"(\" ListOf \")\" \":\" Type \";\" --abstractType\n FunctionArg = id \":\" Type\n \n ReceiveFunction = \"receive\" \"(\" FunctionArg \")\" \"{\" Statement* \"}\" --simple\n | \"receive\" \"(\" \")\" \"{\" Statement* \"}\" --empty\n | \"receive\" \"(\" stringLiteral \")\" \"{\" Statement* \"}\" --comment\n | \"bounced\" \"(\" FunctionArg \")\" \"{\" Statement* \"}\" --bounced\n | \"external\" \"(\" FunctionArg \")\" \"{\" Statement* \"}\" --externalSimple\n | \"external\" \"(\" stringLiteral \")\" \"{\" Statement* \"}\" --externalComment\n | \"external\" \"(\" \")\" \"{\" Statement* \"}\" --externalEmpty\n\n // Statements\n Statement = StatementLet\n | StatementBlock\n | StatementReturn\n | StatementExpression\n | StatementAssign\n | StatementAugmentedAssign\n | StatementCondition\n | StatementWhile\n | StatementRepeat\n | StatementUntil\n StatementBlock = \"{\" Statement* \"}\"\n StatementLet = let id \":\" Type \"=\" Expression \";\" --withType\n | let id \"=\" Expression \";\" --withoutType\n StatementReturn = return Expression \";\" --withExpression\n | return \";\" --withoutExpression \n StatementExpression = Expression \";\"\n StatementAssign = LValue \"=\" Expression \";\"\n StatementAugmentedAssign = StatementAugmentedAssignAdd\n | StatementAugmentedAssignSub\n | StatementAugmentedAssignMul\n | StatementAugmentedAssignDiv\n | StatementAugmentedAssignRem\n StatementAugmentedAssignAdd = LValue \"+=\" Expression \";\"\n StatementAugmentedAssignSub = LValue \"-=\" Expression \";\"\n StatementAugmentedAssignMul = LValue \"*=\" Expression \";\"\n StatementAugmentedAssignDiv = LValue \"/=\" Expression \";\"\n StatementAugmentedAssignRem = LValue \"%=\" Expression \";\"\n StatementCondition = if Expression \"{\" Statement* \"}\" ~else --simple\n | if Expression \"{\" Statement* \"}\" else \"{\" Statement* \"}\" --withElse\n | if Expression \"{\" Statement* \"}\" else StatementCondition --withElseIf\n StatementWhile = while \"(\" Expression \")\" \"{\" Statement* \"}\"\n StatementRepeat = repeat \"(\" Expression \")\" \"{\" Statement* \"}\"\n StatementUntil = do \"{\" Statement* \"}\" until \"(\" Expression \")\" \";\"\n\n // L-value\n LValue = id \".\" LValue --more\n | id --single\n\n // Expressions\n Expression = ExpressionConditional\n ExpressionConditional = ExpressionOr \"?\" ExpressionOr \":\" ExpressionConditional --ternary\n | ExpressionOr\n ExpressionOr = ExpressionOr \"||\" ExpressionAnd --or\n | ExpressionAnd\n ExpressionAnd = ExpressionAnd \"&&\" ExpressionCompare --and\n | ExpressionCompare\n ExpressionCompare = ExpressionCompare \"!=\" ExpressionBinary --not\n | ExpressionCompare \"==\" ExpressionBinary --eq\n | ExpressionCompare \">\" ExpressionBinary --gt\n | ExpressionCompare \">=\" ExpressionBinary --gte\n | ExpressionCompare \"<\" ExpressionBinary --lt\n | ExpressionCompare \"<=\" ExpressionBinary --lte\n | ExpressionBinary\n ExpressionBinary = ExpressionBinary \">>\" ExpressionAdd --shr\n | ExpressionBinary \"<<\" ExpressionAdd --shl\n | ExpressionBinary \"&\" ExpressionAdd --bin_and\n | ExpressionBinary \"|\" ExpressionAdd --bin_or\n | ExpressionAdd\n ExpressionAdd = ExpressionAdd \"+\" ~\"+\" ExpressionMul --add\n | ExpressionAdd \"-\" ~\"-\" ExpressionMul --sub\n | ExpressionMul\n ExpressionMul = ExpressionMul \"*\" ExpressionUnary --mul\n | ExpressionMul \"/\" ExpressionUnary --div\n | ExpressionMul \"%\" ExpressionUnary --rem\n | ExpressionUnary\n ExpressionUnary = \"-\" ExpressionUnarySuffix --neg\n | \"+\" ExpressionUnarySuffix --add\n | \"!\" ExpressionUnarySuffix --not\n | ExpressionUnarySuffix\n ExpressionUnarySuffix = ExpressionValue \"!!\" --notNull\n | ExpressionValue\n ExpressionBracket = \"(\" Expression \")\"\n\n // Order is important\n ExpressionValue = ExpressionCall\n | ExpressionField\n | ExpressionStaticCall\n | ExpressionBracket\n | ExpressionNew\n | integerLiteral\n | boolLiteral\n | id\n | null\n | ExpressionInitOf\n | ExpressionString\n ExpressionString = stringLiteral\n ExpressionField = ExpressionValue \".\" id ~\"(\"\n ExpressionCall = ExpressionValue \".\" id \"(\" ListOf \")\"\n ExpressionNew = id \"{\" ListOf \"}\"\n NewParameter = id \":\" Expression\n ExpressionStaticCall = id \"(\" ListOf \")\"\n ExpressionInitOf = initOf id \"(\" ListOf \")\"\n\n // Type Literal\n typeLiteral = letterAsciiUC typeLiteralPart*\n typeLiteralPart = letterAscii | digit | \"_\"\n\n // Integer Literal\n // hexDigit defined in Ohm's built-in rules (otherwise: hexDigit = \"0\"..\"9\" | \"a\"..\"f\" | \"A\"..\"F\")\n // digit defined in Ohm's built-in rules (otherwise: digit = \"0\"..\"9\")\n integerLiteral = integerLiteralHex | integerLiteralBin | integerLiteralOct | integerLiteralDec // Order is important\n integerLiteralDec = nonZeroDigit (\"_\"? digit)* --nonZeroIntegerLiteralDec\n | \"0\" digit* --integerLiteralWithLeadingZero\n integerLiteralHex = (\"0x\" | \"0X\") hexDigit (\"_\"? hexDigit)*\n integerLiteralBin = (\"0b\" | \"0B\") binDigit (\"_\"? binDigit)*\n integerLiteralOct = (\"0o\" | \"0O\") octDigit (\"_\"? octDigit)*\n binDigit = \"0\" | \"1\"\n octDigit = \"0\"..\"7\"\n nonZeroDigit = \"1\"..\"9\"\n\n // Letters\n letterAsciiLC = \"a\"..\"z\"\n letterAsciiUC = \"A\"..\"Z\"\n letterAscii = letterAsciiLC | letterAsciiUC\n letterComment = letterAsciiLC | letterAsciiUC | digit | \"_\"\n\n // ID Literal\n idStart = letterAscii | \"_\"\n idPart = letterAscii | digit | \"_\"\n id = ~reservedWord #idStart #(idPart*)\n\n // FunC id\n funcLetter = letterAscii | \"_\" | \"'\" | \"?\" | \"!\" | \"::\" | \"&\"\n funcId = funcLetter #(funcLetter | digit)*\n\n // Bool Literal\n boolLiteral = (\"true\" | \"false\") ~idPart\n\n // String literal\n stringLiteralCharacter = ~(\"\\\"\" | \"\\\\\" | lineTerminator) any\n stringLiteral = \"\\\"\" stringLiteralCharacter* \"\\\"\"\n\n // Keywords\n // NOTE Order is important\n keyword = fun \n | let\n | return \n | extend \n | native \n | public \n | null \n | if \n | else \n | while \n | repeat \n | do \n | until \n | as \n | mutates\n | extends\n | import\n | with\n | trait\n | initOf\n | override\n | abstract\n | virtual\n | inline\n | const\n contract = \"contract\" ~idPart\n let = \"let\" ~idPart\n fun = \"fun\" ~idPart\n return = \"return\" ~idPart\n extend = \"extend\" ~idPart\n native = \"native\" ~idPart\n public = \"public\" ~idPart\n null = \"null\" ~idPart\n if = \"if\" ~idPart\n else = \"else\" ~idPart\n while = \"while\" ~idPart\n repeat = \"repeat\" ~idPart\n do = \"do\" ~idPart\n until = \"until\" ~idPart\n as = \"as\" ~idPart\n mutates = \"mutates\" ~idPart\n extends = \"extends\" ~idPart\n import = \"import\" ~idPart\n with = \"with\" ~idPart\n trait = \"trait\" ~idPart\n initOf = \"initOf\" ~idPart\n virtual = \"virtual\" ~idPart\n override = \"override\" ~idPart\n inline = \"inline\" ~idPart\n const = \"const\" ~idPart\n abstract = \"abstract\" ~idPart\n\n // Attributes\n nameAttribute = \"@name\"\n\n // Reserved\n reservedWord = keyword\n\n // Comments\n space += comment | lineTerminator\n comment = multiLineComment | singleLineComment\n lineTerminator = \"\\n\" | \"\\r\" | \"\\u2028\" | \"\\u2029\"\n multiLineComment = \"/*\" (~\"*/\" any)* \"*/\"\n singleLineComment = \"//\" (~lineTerminator any)*\n}"},"Tact",null,"Program",{"Program":["define",{"sourceInterval":[49,71]},null,[],["star",{"sourceInterval":[59,71]},["app",{"sourceInterval":[59,70]},"ProgramItem",[]]]],"ProgramItem":["define",{"sourceInterval":[76,300]},null,[],["alt",{"sourceInterval":[90,300]},["app",{"sourceInterval":[90,96]},"Struct",[]],["app",{"sourceInterval":[115,123]},"Contract",[]],["app",{"sourceInterval":[142,151]},"Primitive",[]],["app",{"sourceInterval":[170,184]},"StaticFunction",[]],["app",{"sourceInterval":[203,217]},"NativeFunction",[]],["app",{"sourceInterval":[236,249]},"ProgramImport",[]],["app",{"sourceInterval":[268,273]},"Trait",[]],["app",{"sourceInterval":[292,300]},"Constant",[]]]],"ProgramImport":["define",{"sourceInterval":[305,345]},null,[],["seq",{"sourceInterval":[321,345]},["app",{"sourceInterval":[321,327]},"import",[]],["app",{"sourceInterval":[328,341]},"stringLiteral",[]],["terminal",{"sourceInterval":[342,345]},";"]]],"Primitive":["define",{"sourceInterval":[380,412]},null,[],["seq",{"sourceInterval":[392,412]},["terminal",{"sourceInterval":[392,403]},"primitive"],["app",{"sourceInterval":[404,408]},"Type",[]],["terminal",{"sourceInterval":[409,412]},";"]]],"StaticFunction":["define",{"sourceInterval":[441,466]},null,[],["app",{"sourceInterval":[458,466]},"Function",[]]],"NativeFunction_withVoid":["define",{"sourceInterval":[488,592]},null,[],["seq",{"sourceInterval":[488,581]},["app",{"sourceInterval":[488,501]},"nameAttribute",[]],["terminal",{"sourceInterval":[502,505]},"("],["app",{"sourceInterval":[506,512]},"funcId",[]],["terminal",{"sourceInterval":[513,516]},")"],["star",{"sourceInterval":[517,535]},["app",{"sourceInterval":[517,534]},"FunctionAttribute",[]]],["app",{"sourceInterval":[536,542]},"native",[]],["app",{"sourceInterval":[543,545]},"id",[]],["terminal",{"sourceInterval":[546,549]},"("],["app",{"sourceInterval":[550,573]},"ListOf",[["app",{"sourceInterval":[557,568]},"FunctionArg",[]],["terminal",{"sourceInterval":[569,572]},","]]],["terminal",{"sourceInterval":[574,577]},")"],["terminal",{"sourceInterval":[578,581]},";"]]],"NativeFunction_withType":["define",{"sourceInterval":[614,727]},null,[],["seq",{"sourceInterval":[614,716]},["app",{"sourceInterval":[614,627]},"nameAttribute",[]],["terminal",{"sourceInterval":[628,631]},"("],["app",{"sourceInterval":[632,638]},"funcId",[]],["terminal",{"sourceInterval":[639,642]},")"],["star",{"sourceInterval":[643,661]},["app",{"sourceInterval":[643,660]},"FunctionAttribute",[]]],["app",{"sourceInterval":[662,668]},"native",[]],["app",{"sourceInterval":[669,671]},"id",[]],["terminal",{"sourceInterval":[672,675]},"("],["app",{"sourceInterval":[676,699]},"ListOf",[["app",{"sourceInterval":[683,694]},"FunctionArg",[]],["terminal",{"sourceInterval":[695,698]},","]]],["terminal",{"sourceInterval":[700,703]},")"],["terminal",{"sourceInterval":[704,707]},":"],["app",{"sourceInterval":[708,712]},"Type",[]],["terminal",{"sourceInterval":[713,716]},";"]]],"NativeFunction":["define",{"sourceInterval":[471,727]},null,[],["alt",{"sourceInterval":[488,727]},["app",{"sourceInterval":[488,581]},"NativeFunction_withVoid",[]],["app",{"sourceInterval":[614,716]},"NativeFunction_withType",[]]]],"Type_optional":["define",{"sourceInterval":[770,796]},null,[],["seq",{"sourceInterval":[770,785]},["app",{"sourceInterval":[770,781]},"typeLiteral",[]],["terminal",{"sourceInterval":[782,785]},"?"]]],"Type_required":["define",{"sourceInterval":[808,830]},null,[],["app",{"sourceInterval":[808,819]},"typeLiteral",[]]],"Type_map":["define",{"sourceInterval":[842,907]},null,[],["seq",{"sourceInterval":[842,901]},["terminal",{"sourceInterval":[842,847]},"map"],["terminal",{"sourceInterval":[848,851]},"<"],["app",{"sourceInterval":[852,863]},"typeLiteral",[]],["opt",{"sourceInterval":[864,872]},["seq",{"sourceInterval":[865,870]},["app",{"sourceInterval":[865,867]},"as",[]],["app",{"sourceInterval":[868,870]},"id",[]]]],["terminal",{"sourceInterval":[873,876]},","],["app",{"sourceInterval":[877,888]},"typeLiteral",[]],["opt",{"sourceInterval":[889,897]},["seq",{"sourceInterval":[890,895]},["app",{"sourceInterval":[890,892]},"as",[]],["app",{"sourceInterval":[893,895]},"id",[]]]],["terminal",{"sourceInterval":[898,901]},">"]]],"Type_bounced":["define",{"sourceInterval":[919,958]},null,[],["seq",{"sourceInterval":[919,948]},["terminal",{"sourceInterval":[919,928]},"bounced"],["terminal",{"sourceInterval":[929,932]},"<"],["app",{"sourceInterval":[933,944]},"typeLiteral",[]],["terminal",{"sourceInterval":[945,948]},">"]]],"Type":["define",{"sourceInterval":[763,958]},null,[],["alt",{"sourceInterval":[770,958]},["app",{"sourceInterval":[770,785]},"Type_optional",[]],["app",{"sourceInterval":[808,819]},"Type_required",[]],["app",{"sourceInterval":[842,901]},"Type_map",[]],["app",{"sourceInterval":[919,948]},"Type_bounced",[]]]],"Field_default":["define",{"sourceInterval":[971,996]},null,[],["seq",{"sourceInterval":[971,986]},["app",{"sourceInterval":[971,973]},"id",[]],["terminal",{"sourceInterval":[974,977]},":"],["app",{"sourceInterval":[978,982]},"Type",[]],["terminal",{"sourceInterval":[983,986]},";"]]],"Field_defaultWithInit":["define",{"sourceInterval":[1009,1057]},null,[],["seq",{"sourceInterval":[1009,1039]},["app",{"sourceInterval":[1009,1011]},"id",[]],["terminal",{"sourceInterval":[1012,1015]},":"],["app",{"sourceInterval":[1016,1020]},"Type",[]],["terminal",{"sourceInterval":[1021,1024]},"="],["app",{"sourceInterval":[1025,1035]},"Expression",[]],["terminal",{"sourceInterval":[1036,1039]},";"]]],"Field_withSerialization":["define",{"sourceInterval":[1070,1111]},null,[],["seq",{"sourceInterval":[1070,1091]},["app",{"sourceInterval":[1070,1072]},"id",[]],["terminal",{"sourceInterval":[1073,1076]},":"],["app",{"sourceInterval":[1077,1081]},"Type",[]],["app",{"sourceInterval":[1082,1084]},"as",[]],["app",{"sourceInterval":[1085,1087]},"id",[]],["terminal",{"sourceInterval":[1088,1091]},";"]]],"Field_withSerializationAndInit":["define",{"sourceInterval":[1124,1187]},null,[],["seq",{"sourceInterval":[1124,1160]},["app",{"sourceInterval":[1124,1126]},"id",[]],["terminal",{"sourceInterval":[1127,1130]},":"],["app",{"sourceInterval":[1131,1135]},"Type",[]],["app",{"sourceInterval":[1136,1138]},"as",[]],["app",{"sourceInterval":[1139,1141]},"id",[]],["terminal",{"sourceInterval":[1142,1145]},"="],["app",{"sourceInterval":[1146,1156]},"Expression",[]],["terminal",{"sourceInterval":[1157,1160]},";"]]],"Field":["define",{"sourceInterval":[963,1187]},null,[],["alt",{"sourceInterval":[971,1187]},["app",{"sourceInterval":[971,986]},"Field_default",[]],["app",{"sourceInterval":[1009,1039]},"Field_defaultWithInit",[]],["app",{"sourceInterval":[1070,1091]},"Field_withSerialization",[]],["app",{"sourceInterval":[1124,1160]},"Field_withSerializationAndInit",[]]]],"ConstantAttribute_virtual":["define",{"sourceInterval":[1233,1253]},null,[],["app",{"sourceInterval":[1233,1240]},"virtual",[]]],"ConstantAttribute_override":["define",{"sourceInterval":[1278,1299]},null,[],["app",{"sourceInterval":[1278,1286]},"override",[]]],"ConstantAttribute_abstract":["define",{"sourceInterval":[1324,1345]},null,[],["app",{"sourceInterval":[1324,1332]},"abstract",[]]],"ConstantAttribute":["define",{"sourceInterval":[1213,1345]},null,[],["alt",{"sourceInterval":[1233,1345]},["app",{"sourceInterval":[1233,1240]},"ConstantAttribute_virtual",[]],["app",{"sourceInterval":[1278,1286]},"ConstantAttribute_override",[]],["app",{"sourceInterval":[1324,1332]},"ConstantAttribute_abstract",[]]]],"Constant_withValue":["define",{"sourceInterval":[1361,1433]},null,[],["seq",{"sourceInterval":[1361,1421]},["star",{"sourceInterval":[1361,1379]},["app",{"sourceInterval":[1361,1378]},"ConstantAttribute",[]]],["not",{"sourceInterval":[1380,1384]},["app",{"sourceInterval":[1381,1384]},"fun",[]]],["app",{"sourceInterval":[1385,1390]},"const",[]],["app",{"sourceInterval":[1391,1393]},"id",[]],["terminal",{"sourceInterval":[1394,1397]},":"],["app",{"sourceInterval":[1398,1402]},"Type",[]],["terminal",{"sourceInterval":[1403,1406]},"="],["app",{"sourceInterval":[1407,1417]},"Expression",[]],["terminal",{"sourceInterval":[1418,1421]},";"]]],"Constant_withEmpty":["define",{"sourceInterval":[1449,1521]},null,[],["seq",{"sourceInterval":[1449,1494]},["star",{"sourceInterval":[1449,1467]},["app",{"sourceInterval":[1449,1466]},"ConstantAttribute",[]]],["not",{"sourceInterval":[1468,1472]},["app",{"sourceInterval":[1469,1472]},"fun",[]]],["app",{"sourceInterval":[1473,1478]},"const",[]],["app",{"sourceInterval":[1479,1481]},"id",[]],["terminal",{"sourceInterval":[1482,1485]},":"],["app",{"sourceInterval":[1486,1490]},"Type",[]],["terminal",{"sourceInterval":[1491,1494]},";"]]],"Constant":["define",{"sourceInterval":[1350,1521]},null,[],["alt",{"sourceInterval":[1361,1521]},["app",{"sourceInterval":[1361,1421]},"Constant_withValue",[]],["app",{"sourceInterval":[1449,1494]},"Constant_withEmpty",[]]]],"Struct_originary":["define",{"sourceInterval":[1550,1602]},null,[],["seq",{"sourceInterval":[1550,1590]},["terminal",{"sourceInterval":[1550,1558]},"struct"],["app",{"sourceInterval":[1559,1570]},"typeLiteral",[]],["terminal",{"sourceInterval":[1571,1574]},"{"],["star",{"sourceInterval":[1575,1586]},["app",{"sourceInterval":[1575,1585]},"StructBody",[]]],["terminal",{"sourceInterval":[1587,1590]},"}"]]],"Struct_message":["define",{"sourceInterval":[1616,1667]},null,[],["seq",{"sourceInterval":[1616,1657]},["terminal",{"sourceInterval":[1616,1625]},"message"],["app",{"sourceInterval":[1626,1637]},"typeLiteral",[]],["terminal",{"sourceInterval":[1638,1641]},"{"],["star",{"sourceInterval":[1642,1653]},["app",{"sourceInterval":[1642,1652]},"StructBody",[]]],["terminal",{"sourceInterval":[1654,1657]},"}"]]],"Struct_messageWithId":["define",{"sourceInterval":[1681,1761]},null,[],["seq",{"sourceInterval":[1681,1745]},["terminal",{"sourceInterval":[1681,1690]},"message"],["terminal",{"sourceInterval":[1691,1694]},"("],["app",{"sourceInterval":[1695,1709]},"integerLiteral",[]],["terminal",{"sourceInterval":[1710,1713]},")"],["app",{"sourceInterval":[1714,1725]},"typeLiteral",[]],["terminal",{"sourceInterval":[1726,1729]},"{"],["star",{"sourceInterval":[1730,1741]},["app",{"sourceInterval":[1730,1740]},"StructBody",[]]],["terminal",{"sourceInterval":[1742,1745]},"}"]]],"Struct":["define",{"sourceInterval":[1541,1761]},null,[],["alt",{"sourceInterval":[1550,1761]},["app",{"sourceInterval":[1550,1590]},"Struct_originary",[]],["app",{"sourceInterval":[1616,1657]},"Struct_message",[]],["app",{"sourceInterval":[1681,1745]},"Struct_messageWithId",[]]]],"StructBody":["define",{"sourceInterval":[1766,1784]},null,[],["app",{"sourceInterval":[1779,1784]},"Field",[]]],"Contract_simple":["define",{"sourceInterval":[1817,1878]},null,[],["seq",{"sourceInterval":[1817,1869]},["star",{"sourceInterval":[1817,1835]},["app",{"sourceInterval":[1817,1834]},"ContractAttribute",[]]],["app",{"sourceInterval":[1836,1844]},"contract",[]],["app",{"sourceInterval":[1845,1847]},"id",[]],["terminal",{"sourceInterval":[1848,1851]},"{"],["star",{"sourceInterval":[1852,1865]},["app",{"sourceInterval":[1852,1864]},"ContractBody",[]]],["terminal",{"sourceInterval":[1866,1869]},"}"]]],"Contract_withTraits":["define",{"sourceInterval":[1894,1979]},null,[],["seq",{"sourceInterval":[1894,1966]},["star",{"sourceInterval":[1894,1912]},["app",{"sourceInterval":[1894,1911]},"ContractAttribute",[]]],["app",{"sourceInterval":[1913,1921]},"contract",[]],["app",{"sourceInterval":[1922,1924]},"id",[]],["app",{"sourceInterval":[1925,1929]},"with",[]],["app",{"sourceInterval":[1930,1944]},"ListOf",[["app",{"sourceInterval":[1937,1939]},"id",[]],["terminal",{"sourceInterval":[1940,1943]},","]]],["terminal",{"sourceInterval":[1945,1948]},"{"],["star",{"sourceInterval":[1949,1962]},["app",{"sourceInterval":[1949,1961]},"ContractBody",[]]],["terminal",{"sourceInterval":[1963,1966]},"}"]]],"Contract":["define",{"sourceInterval":[1806,1979]},null,[],["alt",{"sourceInterval":[1817,1979]},["app",{"sourceInterval":[1817,1869]},"Contract_simple",[]],["app",{"sourceInterval":[1894,1966]},"Contract_withTraits",[]]]],"ContractInit":["define",{"sourceInterval":[1984,2056]},null,[],["seq",{"sourceInterval":[1999,2056]},["terminal",{"sourceInterval":[1999,2005]},"init"],["terminal",{"sourceInterval":[2006,2009]},"("],["app",{"sourceInterval":[2010,2033]},"ListOf",[["app",{"sourceInterval":[2017,2028]},"FunctionArg",[]],["terminal",{"sourceInterval":[2029,2032]},","]]],["terminal",{"sourceInterval":[2034,2037]},")"],["terminal",{"sourceInterval":[2038,2041]},"{"],["star",{"sourceInterval":[2042,2052]},["app",{"sourceInterval":[2042,2051]},"Statement",[]]],["terminal",{"sourceInterval":[2053,2056]},"}"]]],"ContractBody":["define",{"sourceInterval":[2061,2204]},null,[],["alt",{"sourceInterval":[2076,2204]},["app",{"sourceInterval":[2076,2081]},"Field",[]],["app",{"sourceInterval":[2101,2113]},"ContractInit",[]],["app",{"sourceInterval":[2133,2148]},"ReceiveFunction",[]],["app",{"sourceInterval":[2168,2176]},"Function",[]],["app",{"sourceInterval":[2196,2204]},"Constant",[]]]],"Trait_originary":["define",{"sourceInterval":[2235,2293]},null,[],["seq",{"sourceInterval":[2235,2281]},["star",{"sourceInterval":[2235,2253]},["app",{"sourceInterval":[2235,2252]},"ContractAttribute",[]]],["app",{"sourceInterval":[2254,2259]},"trait",[]],["app",{"sourceInterval":[2260,2262]},"id",[]],["terminal",{"sourceInterval":[2263,2266]},"{"],["star",{"sourceInterval":[2267,2277]},["app",{"sourceInterval":[2267,2276]},"TraitBody",[]]],["terminal",{"sourceInterval":[2278,2281]},"}"]]],"Trait_withTraits":["define",{"sourceInterval":[2306,2385]},null,[],["seq",{"sourceInterval":[2306,2372]},["star",{"sourceInterval":[2306,2324]},["app",{"sourceInterval":[2306,2323]},"ContractAttribute",[]]],["app",{"sourceInterval":[2325,2330]},"trait",[]],["app",{"sourceInterval":[2331,2333]},"id",[]],["app",{"sourceInterval":[2334,2338]},"with",[]],["app",{"sourceInterval":[2339,2353]},"ListOf",[["app",{"sourceInterval":[2346,2348]},"id",[]],["terminal",{"sourceInterval":[2349,2352]},","]]],["terminal",{"sourceInterval":[2354,2357]},"{"],["star",{"sourceInterval":[2358,2368]},["app",{"sourceInterval":[2358,2367]},"TraitBody",[]]],["terminal",{"sourceInterval":[2369,2372]},"}"]]],"Trait":["define",{"sourceInterval":[2227,2385]},null,[],["alt",{"sourceInterval":[2235,2385]},["app",{"sourceInterval":[2235,2281]},"Trait_originary",[]],["app",{"sourceInterval":[2306,2372]},"Trait_withTraits",[]]]],"TraitBody":["define",{"sourceInterval":[2390,2489]},null,[],["alt",{"sourceInterval":[2402,2489]},["app",{"sourceInterval":[2402,2407]},"Field",[]],["app",{"sourceInterval":[2424,2439]},"ReceiveFunction",[]],["app",{"sourceInterval":[2456,2464]},"Function",[]],["app",{"sourceInterval":[2481,2489]},"Constant",[]]]],"ContractAttribute_interface":["define",{"sourceInterval":[2542,2588]},null,[],["seq",{"sourceInterval":[2542,2576]},["terminal",{"sourceInterval":[2542,2554]},"@interface"],["terminal",{"sourceInterval":[2555,2558]},"("],["app",{"sourceInterval":[2559,2572]},"stringLiteral",[]],["terminal",{"sourceInterval":[2573,2576]},")"]]],"ContractAttribute":["define",{"sourceInterval":[2522,2588]},null,[],["app",{"sourceInterval":[2542,2588]},"ContractAttribute_interface",[]]],"FunctionAttribute_getter":["define",{"sourceInterval":[2630,2648]},null,[],["terminal",{"sourceInterval":[2630,2635]},"get"]],"FunctionAttribute_mutates":["define",{"sourceInterval":[2673,2692]},null,[],["app",{"sourceInterval":[2673,2680]},"mutates",[]]],"FunctionAttribute_extends":["define",{"sourceInterval":[2717,2736]},null,[],["app",{"sourceInterval":[2717,2724]},"extends",[]]],"FunctionAttribute_virtual":["define",{"sourceInterval":[2761,2780]},null,[],["app",{"sourceInterval":[2761,2768]},"virtual",[]]],"FunctionAttribute_override":["define",{"sourceInterval":[2805,2825]},null,[],["app",{"sourceInterval":[2805,2813]},"override",[]]],"FunctionAttribute_inline":["define",{"sourceInterval":[2850,2868]},null,[],["app",{"sourceInterval":[2850,2856]},"inline",[]]],"FunctionAttribute_abstract":["define",{"sourceInterval":[2893,2913]},null,[],["app",{"sourceInterval":[2893,2901]},"abstract",[]]],"FunctionAttribute":["define",{"sourceInterval":[2610,2913]},null,[],["alt",{"sourceInterval":[2630,2913]},["app",{"sourceInterval":[2630,2635]},"FunctionAttribute_getter",[]],["app",{"sourceInterval":[2673,2680]},"FunctionAttribute_mutates",[]],["app",{"sourceInterval":[2717,2724]},"FunctionAttribute_extends",[]],["app",{"sourceInterval":[2761,2768]},"FunctionAttribute_virtual",[]],["app",{"sourceInterval":[2805,2813]},"FunctionAttribute_override",[]],["app",{"sourceInterval":[2850,2856]},"FunctionAttribute_inline",[]],["app",{"sourceInterval":[2893,2901]},"FunctionAttribute_abstract",[]]]],"Function_withVoid":["define",{"sourceInterval":[2929,3016]},null,[],["seq",{"sourceInterval":[2929,3005]},["star",{"sourceInterval":[2929,2947]},["app",{"sourceInterval":[2929,2946]},"FunctionAttribute",[]]],["app",{"sourceInterval":[2948,2951]},"fun",[]],["app",{"sourceInterval":[2952,2954]},"id",[]],["terminal",{"sourceInterval":[2955,2958]},"("],["app",{"sourceInterval":[2959,2982]},"ListOf",[["app",{"sourceInterval":[2966,2977]},"FunctionArg",[]],["terminal",{"sourceInterval":[2978,2981]},","]]],["terminal",{"sourceInterval":[2983,2986]},")"],["terminal",{"sourceInterval":[2987,2990]},"{"],["star",{"sourceInterval":[2991,3001]},["app",{"sourceInterval":[2991,3000]},"Statement",[]]],["terminal",{"sourceInterval":[3002,3005]},"}"]]],"Function_withType":["define",{"sourceInterval":[3032,3128]},null,[],["seq",{"sourceInterval":[3032,3117]},["star",{"sourceInterval":[3032,3050]},["app",{"sourceInterval":[3032,3049]},"FunctionAttribute",[]]],["app",{"sourceInterval":[3051,3054]},"fun",[]],["app",{"sourceInterval":[3055,3057]},"id",[]],["terminal",{"sourceInterval":[3058,3061]},"("],["app",{"sourceInterval":[3062,3085]},"ListOf",[["app",{"sourceInterval":[3069,3080]},"FunctionArg",[]],["terminal",{"sourceInterval":[3081,3084]},","]]],["terminal",{"sourceInterval":[3086,3089]},")"],["terminal",{"sourceInterval":[3090,3093]},":"],["app",{"sourceInterval":[3094,3098]},"Type",[]],["terminal",{"sourceInterval":[3099,3102]},"{"],["star",{"sourceInterval":[3103,3113]},["app",{"sourceInterval":[3103,3112]},"Statement",[]]],["terminal",{"sourceInterval":[3114,3117]},"}"]]],"Function_abstractVoid":["define",{"sourceInterval":[3144,3220]},null,[],["seq",{"sourceInterval":[3144,3205]},["star",{"sourceInterval":[3144,3162]},["app",{"sourceInterval":[3144,3161]},"FunctionAttribute",[]]],["app",{"sourceInterval":[3163,3166]},"fun",[]],["app",{"sourceInterval":[3167,3169]},"id",[]],["terminal",{"sourceInterval":[3170,3173]},"("],["app",{"sourceInterval":[3174,3197]},"ListOf",[["app",{"sourceInterval":[3181,3192]},"FunctionArg",[]],["terminal",{"sourceInterval":[3193,3196]},","]]],["terminal",{"sourceInterval":[3198,3201]},")"],["terminal",{"sourceInterval":[3202,3205]},";"]]],"Function_abstractType":["define",{"sourceInterval":[3236,3321]},null,[],["seq",{"sourceInterval":[3236,3306]},["star",{"sourceInterval":[3236,3254]},["app",{"sourceInterval":[3236,3253]},"FunctionAttribute",[]]],["app",{"sourceInterval":[3255,3258]},"fun",[]],["app",{"sourceInterval":[3259,3261]},"id",[]],["terminal",{"sourceInterval":[3262,3265]},"("],["app",{"sourceInterval":[3266,3289]},"ListOf",[["app",{"sourceInterval":[3273,3284]},"FunctionArg",[]],["terminal",{"sourceInterval":[3285,3288]},","]]],["terminal",{"sourceInterval":[3290,3293]},")"],["terminal",{"sourceInterval":[3294,3297]},":"],["app",{"sourceInterval":[3298,3302]},"Type",[]],["terminal",{"sourceInterval":[3303,3306]},";"]]],"Function":["define",{"sourceInterval":[2918,3321]},null,[],["alt",{"sourceInterval":[2929,3321]},["app",{"sourceInterval":[2929,3005]},"Function_withVoid",[]],["app",{"sourceInterval":[3032,3117]},"Function_withType",[]],["app",{"sourceInterval":[3144,3205]},"Function_abstractVoid",[]],["app",{"sourceInterval":[3236,3306]},"Function_abstractType",[]]]],"FunctionArg":["define",{"sourceInterval":[3326,3351]},null,[],["seq",{"sourceInterval":[3340,3351]},["app",{"sourceInterval":[3340,3342]},"id",[]],["terminal",{"sourceInterval":[3343,3346]},":"],["app",{"sourceInterval":[3347,3351]},"Type",[]]]],"ReceiveFunction_simple":["define",{"sourceInterval":[3379,3436]},null,[],["seq",{"sourceInterval":[3379,3427]},["terminal",{"sourceInterval":[3379,3388]},"receive"],["terminal",{"sourceInterval":[3389,3392]},"("],["app",{"sourceInterval":[3393,3404]},"FunctionArg",[]],["terminal",{"sourceInterval":[3405,3408]},")"],["terminal",{"sourceInterval":[3409,3412]},"{"],["star",{"sourceInterval":[3413,3423]},["app",{"sourceInterval":[3413,3422]},"Statement",[]]],["terminal",{"sourceInterval":[3424,3427]},"}"]]],"ReceiveFunction_empty":["define",{"sourceInterval":[3459,3503]},null,[],["seq",{"sourceInterval":[3459,3495]},["terminal",{"sourceInterval":[3459,3468]},"receive"],["terminal",{"sourceInterval":[3469,3472]},"("],["terminal",{"sourceInterval":[3473,3476]},")"],["terminal",{"sourceInterval":[3477,3480]},"{"],["star",{"sourceInterval":[3481,3491]},["app",{"sourceInterval":[3481,3490]},"Statement",[]]],["terminal",{"sourceInterval":[3492,3495]},"}"]]],"ReceiveFunction_comment":["define",{"sourceInterval":[3526,3586]},null,[],["seq",{"sourceInterval":[3526,3576]},["terminal",{"sourceInterval":[3526,3535]},"receive"],["terminal",{"sourceInterval":[3536,3539]},"("],["app",{"sourceInterval":[3540,3553]},"stringLiteral",[]],["terminal",{"sourceInterval":[3554,3557]},")"],["terminal",{"sourceInterval":[3558,3561]},"{"],["star",{"sourceInterval":[3562,3572]},["app",{"sourceInterval":[3562,3571]},"Statement",[]]],["terminal",{"sourceInterval":[3573,3576]},"}"]]],"ReceiveFunction_bounced":["define",{"sourceInterval":[3609,3667]},null,[],["seq",{"sourceInterval":[3609,3657]},["terminal",{"sourceInterval":[3609,3618]},"bounced"],["terminal",{"sourceInterval":[3619,3622]},"("],["app",{"sourceInterval":[3623,3634]},"FunctionArg",[]],["terminal",{"sourceInterval":[3635,3638]},")"],["terminal",{"sourceInterval":[3639,3642]},"{"],["star",{"sourceInterval":[3643,3653]},["app",{"sourceInterval":[3643,3652]},"Statement",[]]],["terminal",{"sourceInterval":[3654,3657]},"}"]]],"ReceiveFunction_externalSimple":["define",{"sourceInterval":[3690,3756]},null,[],["seq",{"sourceInterval":[3690,3739]},["terminal",{"sourceInterval":[3690,3700]},"external"],["terminal",{"sourceInterval":[3701,3704]},"("],["app",{"sourceInterval":[3705,3716]},"FunctionArg",[]],["terminal",{"sourceInterval":[3717,3720]},")"],["terminal",{"sourceInterval":[3721,3724]},"{"],["star",{"sourceInterval":[3725,3735]},["app",{"sourceInterval":[3725,3734]},"Statement",[]]],["terminal",{"sourceInterval":[3736,3739]},"}"]]],"ReceiveFunction_externalComment":["define",{"sourceInterval":[3779,3848]},null,[],["seq",{"sourceInterval":[3779,3830]},["terminal",{"sourceInterval":[3779,3789]},"external"],["terminal",{"sourceInterval":[3790,3793]},"("],["app",{"sourceInterval":[3794,3807]},"stringLiteral",[]],["terminal",{"sourceInterval":[3808,3811]},")"],["terminal",{"sourceInterval":[3812,3815]},"{"],["star",{"sourceInterval":[3816,3826]},["app",{"sourceInterval":[3816,3825]},"Statement",[]]],["terminal",{"sourceInterval":[3827,3830]},"}"]]],"ReceiveFunction_externalEmpty":["define",{"sourceInterval":[3871,3924]},null,[],["seq",{"sourceInterval":[3871,3908]},["terminal",{"sourceInterval":[3871,3881]},"external"],["terminal",{"sourceInterval":[3882,3885]},"("],["terminal",{"sourceInterval":[3886,3889]},")"],["terminal",{"sourceInterval":[3890,3893]},"{"],["star",{"sourceInterval":[3894,3904]},["app",{"sourceInterval":[3894,3903]},"Statement",[]]],["terminal",{"sourceInterval":[3905,3908]},"}"]]],"ReceiveFunction":["define",{"sourceInterval":[3361,3924]},null,[],["alt",{"sourceInterval":[3379,3924]},["app",{"sourceInterval":[3379,3427]},"ReceiveFunction_simple",[]],["app",{"sourceInterval":[3459,3495]},"ReceiveFunction_empty",[]],["app",{"sourceInterval":[3526,3576]},"ReceiveFunction_comment",[]],["app",{"sourceInterval":[3609,3657]},"ReceiveFunction_bounced",[]],["app",{"sourceInterval":[3690,3739]},"ReceiveFunction_externalSimple",[]],["app",{"sourceInterval":[3779,3830]},"ReceiveFunction_externalComment",[]],["app",{"sourceInterval":[3871,3908]},"ReceiveFunction_externalEmpty",[]]]],"Statement":["define",{"sourceInterval":[3948,4273]},null,[],["alt",{"sourceInterval":[3960,4273]},["app",{"sourceInterval":[3960,3972]},"StatementLet",[]],["app",{"sourceInterval":[3989,4003]},"StatementBlock",[]],["app",{"sourceInterval":[4020,4035]},"StatementReturn",[]],["app",{"sourceInterval":[4052,4071]},"StatementExpression",[]],["app",{"sourceInterval":[4088,4103]},"StatementAssign",[]],["app",{"sourceInterval":[4120,4144]},"StatementAugmentedAssign",[]],["app",{"sourceInterval":[4161,4179]},"StatementCondition",[]],["app",{"sourceInterval":[4196,4210]},"StatementWhile",[]],["app",{"sourceInterval":[4227,4242]},"StatementRepeat",[]],["app",{"sourceInterval":[4259,4273]},"StatementUntil",[]]]],"StatementBlock":["define",{"sourceInterval":[4278,4313]},null,[],["seq",{"sourceInterval":[4295,4313]},["terminal",{"sourceInterval":[4295,4298]},"{"],["star",{"sourceInterval":[4299,4309]},["app",{"sourceInterval":[4299,4308]},"Statement",[]]],["terminal",{"sourceInterval":[4310,4313]},"}"]]],"StatementLet_withType":["define",{"sourceInterval":[4333,4378]},null,[],["seq",{"sourceInterval":[4333,4367]},["app",{"sourceInterval":[4333,4336]},"let",[]],["app",{"sourceInterval":[4337,4339]},"id",[]],["terminal",{"sourceInterval":[4340,4343]},":"],["app",{"sourceInterval":[4344,4348]},"Type",[]],["terminal",{"sourceInterval":[4349,4352]},"="],["app",{"sourceInterval":[4353,4363]},"Expression",[]],["terminal",{"sourceInterval":[4364,4367]},";"]]],"StatementLet_withoutType":["define",{"sourceInterval":[4398,4437]},null,[],["seq",{"sourceInterval":[4398,4423]},["app",{"sourceInterval":[4398,4401]},"let",[]],["app",{"sourceInterval":[4402,4404]},"id",[]],["terminal",{"sourceInterval":[4405,4408]},"="],["app",{"sourceInterval":[4409,4419]},"Expression",[]],["terminal",{"sourceInterval":[4420,4423]},";"]]],"StatementLet":["define",{"sourceInterval":[4318,4437]},null,[],["alt",{"sourceInterval":[4333,4437]},["app",{"sourceInterval":[4333,4367]},"StatementLet_withType",[]],["app",{"sourceInterval":[4398,4423]},"StatementLet_withoutType",[]]]],"StatementReturn_withExpression":["define",{"sourceInterval":[4460,4498]},null,[],["seq",{"sourceInterval":[4460,4481]},["app",{"sourceInterval":[4460,4466]},"return",[]],["app",{"sourceInterval":[4467,4477]},"Expression",[]],["terminal",{"sourceInterval":[4478,4481]},";"]]],"StatementReturn_withoutExpression":["define",{"sourceInterval":[4521,4551]},null,[],["seq",{"sourceInterval":[4521,4531]},["app",{"sourceInterval":[4521,4527]},"return",[]],["terminal",{"sourceInterval":[4528,4531]},";"]]],"StatementReturn":["define",{"sourceInterval":[4442,4551]},null,[],["alt",{"sourceInterval":[4460,4551]},["app",{"sourceInterval":[4460,4481]},"StatementReturn_withExpression",[]],["app",{"sourceInterval":[4521,4531]},"StatementReturn_withoutExpression",[]]]],"StatementExpression":["define",{"sourceInterval":[4560,4596]},null,[],["seq",{"sourceInterval":[4582,4596]},["app",{"sourceInterval":[4582,4592]},"Expression",[]],["terminal",{"sourceInterval":[4593,4596]},";"]]],"StatementAssign":["define",{"sourceInterval":[4601,4644]},null,[],["seq",{"sourceInterval":[4619,4644]},["app",{"sourceInterval":[4619,4625]},"LValue",[]],["terminal",{"sourceInterval":[4626,4629]},"="],["app",{"sourceInterval":[4630,4640]},"Expression",[]],["terminal",{"sourceInterval":[4641,4644]},";"]]],"StatementAugmentedAssign":["define",{"sourceInterval":[4649,4939]},null,[],["alt",{"sourceInterval":[4676,4939]},["app",{"sourceInterval":[4676,4703]},"StatementAugmentedAssignAdd",[]],["app",{"sourceInterval":[4735,4762]},"StatementAugmentedAssignSub",[]],["app",{"sourceInterval":[4794,4821]},"StatementAugmentedAssignMul",[]],["app",{"sourceInterval":[4853,4880]},"StatementAugmentedAssignDiv",[]],["app",{"sourceInterval":[4912,4939]},"StatementAugmentedAssignRem",[]]]],"StatementAugmentedAssignAdd":["define",{"sourceInterval":[4944,5000]},null,[],["seq",{"sourceInterval":[4974,5000]},["app",{"sourceInterval":[4974,4980]},"LValue",[]],["terminal",{"sourceInterval":[4981,4985]},"+="],["app",{"sourceInterval":[4986,4996]},"Expression",[]],["terminal",{"sourceInterval":[4997,5000]},";"]]],"StatementAugmentedAssignSub":["define",{"sourceInterval":[5005,5061]},null,[],["seq",{"sourceInterval":[5035,5061]},["app",{"sourceInterval":[5035,5041]},"LValue",[]],["terminal",{"sourceInterval":[5042,5046]},"-="],["app",{"sourceInterval":[5047,5057]},"Expression",[]],["terminal",{"sourceInterval":[5058,5061]},";"]]],"StatementAugmentedAssignMul":["define",{"sourceInterval":[5066,5122]},null,[],["seq",{"sourceInterval":[5096,5122]},["app",{"sourceInterval":[5096,5102]},"LValue",[]],["terminal",{"sourceInterval":[5103,5107]},"*="],["app",{"sourceInterval":[5108,5118]},"Expression",[]],["terminal",{"sourceInterval":[5119,5122]},";"]]],"StatementAugmentedAssignDiv":["define",{"sourceInterval":[5127,5183]},null,[],["seq",{"sourceInterval":[5157,5183]},["app",{"sourceInterval":[5157,5163]},"LValue",[]],["terminal",{"sourceInterval":[5164,5168]},"/="],["app",{"sourceInterval":[5169,5179]},"Expression",[]],["terminal",{"sourceInterval":[5180,5183]},";"]]],"StatementAugmentedAssignRem":["define",{"sourceInterval":[5188,5244]},null,[],["seq",{"sourceInterval":[5218,5244]},["app",{"sourceInterval":[5218,5224]},"LValue",[]],["terminal",{"sourceInterval":[5225,5229]},"%="],["app",{"sourceInterval":[5230,5240]},"Expression",[]],["terminal",{"sourceInterval":[5241,5244]},";"]]],"StatementCondition_simple":["define",{"sourceInterval":[5270,5317]},null,[],["seq",{"sourceInterval":[5270,5308]},["app",{"sourceInterval":[5270,5272]},"if",[]],["app",{"sourceInterval":[5273,5283]},"Expression",[]],["terminal",{"sourceInterval":[5284,5287]},"{"],["star",{"sourceInterval":[5288,5298]},["app",{"sourceInterval":[5288,5297]},"Statement",[]]],["terminal",{"sourceInterval":[5299,5302]},"}"],["not",{"sourceInterval":[5303,5308]},["app",{"sourceInterval":[5304,5308]},"else",[]]]]],"StatementCondition_withElse":["define",{"sourceInterval":[5343,5410]},null,[],["seq",{"sourceInterval":[5343,5399]},["app",{"sourceInterval":[5343,5345]},"if",[]],["app",{"sourceInterval":[5346,5356]},"Expression",[]],["terminal",{"sourceInterval":[5357,5360]},"{"],["star",{"sourceInterval":[5361,5371]},["app",{"sourceInterval":[5361,5370]},"Statement",[]]],["terminal",{"sourceInterval":[5372,5375]},"}"],["app",{"sourceInterval":[5376,5380]},"else",[]],["terminal",{"sourceInterval":[5381,5384]},"{"],["star",{"sourceInterval":[5385,5395]},["app",{"sourceInterval":[5385,5394]},"Statement",[]]],["terminal",{"sourceInterval":[5396,5399]},"}"]]],"StatementCondition_withElseIf":["define",{"sourceInterval":[5436,5505]},null,[],["seq",{"sourceInterval":[5436,5492]},["app",{"sourceInterval":[5436,5438]},"if",[]],["app",{"sourceInterval":[5439,5449]},"Expression",[]],["terminal",{"sourceInterval":[5450,5453]},"{"],["star",{"sourceInterval":[5454,5464]},["app",{"sourceInterval":[5454,5463]},"Statement",[]]],["terminal",{"sourceInterval":[5465,5468]},"}"],["app",{"sourceInterval":[5469,5473]},"else",[]],["app",{"sourceInterval":[5474,5492]},"StatementCondition",[]]]],"StatementCondition":["define",{"sourceInterval":[5249,5505]},null,[],["alt",{"sourceInterval":[5270,5505]},["app",{"sourceInterval":[5270,5308]},"StatementCondition_simple",[]],["app",{"sourceInterval":[5343,5399]},"StatementCondition_withElse",[]],["app",{"sourceInterval":[5436,5492]},"StatementCondition_withElseIf",[]]]],"StatementWhile":["define",{"sourceInterval":[5510,5570]},null,[],["seq",{"sourceInterval":[5527,5570]},["app",{"sourceInterval":[5527,5532]},"while",[]],["terminal",{"sourceInterval":[5533,5536]},"("],["app",{"sourceInterval":[5537,5547]},"Expression",[]],["terminal",{"sourceInterval":[5548,5551]},")"],["terminal",{"sourceInterval":[5552,5555]},"{"],["star",{"sourceInterval":[5556,5566]},["app",{"sourceInterval":[5556,5565]},"Statement",[]]],["terminal",{"sourceInterval":[5567,5570]},"}"]]],"StatementRepeat":["define",{"sourceInterval":[5575,5637]},null,[],["seq",{"sourceInterval":[5593,5637]},["app",{"sourceInterval":[5593,5599]},"repeat",[]],["terminal",{"sourceInterval":[5600,5603]},"("],["app",{"sourceInterval":[5604,5614]},"Expression",[]],["terminal",{"sourceInterval":[5615,5618]},")"],["terminal",{"sourceInterval":[5619,5622]},"{"],["star",{"sourceInterval":[5623,5633]},["app",{"sourceInterval":[5623,5632]},"Statement",[]]],["terminal",{"sourceInterval":[5634,5637]},"}"]]],"StatementUntil":["define",{"sourceInterval":[5642,5709]},null,[],["seq",{"sourceInterval":[5659,5709]},["app",{"sourceInterval":[5659,5661]},"do",[]],["terminal",{"sourceInterval":[5662,5665]},"{"],["star",{"sourceInterval":[5666,5676]},["app",{"sourceInterval":[5666,5675]},"Statement",[]]],["terminal",{"sourceInterval":[5677,5680]},"}"],["app",{"sourceInterval":[5681,5686]},"until",[]],["terminal",{"sourceInterval":[5687,5690]},"("],["app",{"sourceInterval":[5691,5701]},"Expression",[]],["terminal",{"sourceInterval":[5702,5705]},")"],["terminal",{"sourceInterval":[5706,5709]},";"]]],"LValue_more":["define",{"sourceInterval":[5739,5759]},null,[],["seq",{"sourceInterval":[5739,5752]},["app",{"sourceInterval":[5739,5741]},"id",[]],["terminal",{"sourceInterval":[5742,5745]},"."],["app",{"sourceInterval":[5746,5752]},"LValue",[]]]],"LValue_single":["define",{"sourceInterval":[5773,5784]},null,[],["app",{"sourceInterval":[5773,5775]},"id",[]]],"LValue":["define",{"sourceInterval":[5730,5784]},null,[],["alt",{"sourceInterval":[5739,5784]},["app",{"sourceInterval":[5739,5752]},"LValue_more",[]],["app",{"sourceInterval":[5773,5775]},"LValue_single",[]]]],"Expression":["define",{"sourceInterval":[5809,5843]},null,[],["app",{"sourceInterval":[5822,5843]},"ExpressionConditional",[]]],"ExpressionConditional_ternary":["define",{"sourceInterval":[5872,5937]},null,[],["seq",{"sourceInterval":[5872,5927]},["app",{"sourceInterval":[5872,5884]},"ExpressionOr",[]],["terminal",{"sourceInterval":[5885,5888]},"?"],["app",{"sourceInterval":[5889,5901]},"ExpressionOr",[]],["terminal",{"sourceInterval":[5902,5905]},":"],["app",{"sourceInterval":[5906,5927]},"ExpressionConditional",[]]]],"ExpressionConditional":["define",{"sourceInterval":[5848,5978]},null,[],["alt",{"sourceInterval":[5872,5978]},["app",{"sourceInterval":[5872,5927]},"ExpressionConditional_ternary",[]],["app",{"sourceInterval":[5966,5978]},"ExpressionOr",[]]]],"ExpressionOr_or":["define",{"sourceInterval":[5998,6034]},null,[],["seq",{"sourceInterval":[5998,6029]},["app",{"sourceInterval":[5998,6010]},"ExpressionOr",[]],["terminal",{"sourceInterval":[6011,6015]},"||"],["app",{"sourceInterval":[6016,6029]},"ExpressionAnd",[]]]],"ExpressionOr":["define",{"sourceInterval":[5983,6067]},null,[],["alt",{"sourceInterval":[5998,6067]},["app",{"sourceInterval":[5998,6029]},"ExpressionOr_or",[]],["app",{"sourceInterval":[6054,6067]},"ExpressionAnd",[]]]],"ExpressionAnd_and":["define",{"sourceInterval":[6088,6130]},null,[],["seq",{"sourceInterval":[6088,6124]},["app",{"sourceInterval":[6088,6101]},"ExpressionAnd",[]],["terminal",{"sourceInterval":[6102,6106]},"&&"],["app",{"sourceInterval":[6107,6124]},"ExpressionCompare",[]]]],"ExpressionAnd":["define",{"sourceInterval":[6072,6168]},null,[],["alt",{"sourceInterval":[6088,6168]},["app",{"sourceInterval":[6088,6124]},"ExpressionAnd_and",[]],["app",{"sourceInterval":[6151,6168]},"ExpressionCompare",[]]]],"ExpressionCompare_not":["define",{"sourceInterval":[6193,6238]},null,[],["seq",{"sourceInterval":[6193,6232]},["app",{"sourceInterval":[6193,6210]},"ExpressionCompare",[]],["terminal",{"sourceInterval":[6211,6215]},"!="],["app",{"sourceInterval":[6216,6232]},"ExpressionBinary",[]]]],"ExpressionCompare_eq":["define",{"sourceInterval":[6263,6307]},null,[],["seq",{"sourceInterval":[6263,6302]},["app",{"sourceInterval":[6263,6280]},"ExpressionCompare",[]],["terminal",{"sourceInterval":[6281,6285]},"=="],["app",{"sourceInterval":[6286,6302]},"ExpressionBinary",[]]]],"ExpressionCompare_gt":["define",{"sourceInterval":[6332,6375]},null,[],["seq",{"sourceInterval":[6332,6370]},["app",{"sourceInterval":[6332,6349]},"ExpressionCompare",[]],["terminal",{"sourceInterval":[6350,6353]},">"],["app",{"sourceInterval":[6354,6370]},"ExpressionBinary",[]]]],"ExpressionCompare_gte":["define",{"sourceInterval":[6400,6445]},null,[],["seq",{"sourceInterval":[6400,6439]},["app",{"sourceInterval":[6400,6417]},"ExpressionCompare",[]],["terminal",{"sourceInterval":[6418,6422]},">="],["app",{"sourceInterval":[6423,6439]},"ExpressionBinary",[]]]],"ExpressionCompare_lt":["define",{"sourceInterval":[6470,6513]},null,[],["seq",{"sourceInterval":[6470,6508]},["app",{"sourceInterval":[6470,6487]},"ExpressionCompare",[]],["terminal",{"sourceInterval":[6488,6491]},"<"],["app",{"sourceInterval":[6492,6508]},"ExpressionBinary",[]]]],"ExpressionCompare_lte":["define",{"sourceInterval":[6538,6583]},null,[],["seq",{"sourceInterval":[6538,6577]},["app",{"sourceInterval":[6538,6555]},"ExpressionCompare",[]],["terminal",{"sourceInterval":[6556,6560]},"<="],["app",{"sourceInterval":[6561,6577]},"ExpressionBinary",[]]]],"ExpressionCompare":["define",{"sourceInterval":[6173,6624]},null,[],["alt",{"sourceInterval":[6193,6624]},["app",{"sourceInterval":[6193,6232]},"ExpressionCompare_not",[]],["app",{"sourceInterval":[6263,6302]},"ExpressionCompare_eq",[]],["app",{"sourceInterval":[6332,6370]},"ExpressionCompare_gt",[]],["app",{"sourceInterval":[6400,6439]},"ExpressionCompare_gte",[]],["app",{"sourceInterval":[6470,6508]},"ExpressionCompare_lt",[]],["app",{"sourceInterval":[6538,6577]},"ExpressionCompare_lte",[]],["app",{"sourceInterval":[6608,6624]},"ExpressionBinary",[]]]],"ExpressionBinary_shr":["define",{"sourceInterval":[6648,6689]},null,[],["seq",{"sourceInterval":[6648,6683]},["app",{"sourceInterval":[6648,6664]},"ExpressionBinary",[]],["terminal",{"sourceInterval":[6665,6669]},">>"],["app",{"sourceInterval":[6670,6683]},"ExpressionAdd",[]]]],"ExpressionBinary_shl":["define",{"sourceInterval":[6712,6753]},null,[],["seq",{"sourceInterval":[6712,6747]},["app",{"sourceInterval":[6712,6728]},"ExpressionBinary",[]],["terminal",{"sourceInterval":[6729,6733]},"<<"],["app",{"sourceInterval":[6734,6747]},"ExpressionAdd",[]]]],"ExpressionBinary_bin_and":["define",{"sourceInterval":[6776,6820]},null,[],["seq",{"sourceInterval":[6776,6810]},["app",{"sourceInterval":[6776,6792]},"ExpressionBinary",[]],["terminal",{"sourceInterval":[6793,6796]},"&"],["app",{"sourceInterval":[6797,6810]},"ExpressionAdd",[]]]],"ExpressionBinary_bin_or":["define",{"sourceInterval":[6843,6886]},null,[],["seq",{"sourceInterval":[6843,6877]},["app",{"sourceInterval":[6843,6859]},"ExpressionBinary",[]],["terminal",{"sourceInterval":[6860,6863]},"|"],["app",{"sourceInterval":[6864,6877]},"ExpressionAdd",[]]]],"ExpressionBinary":["define",{"sourceInterval":[6629,6922]},null,[],["alt",{"sourceInterval":[6648,6922]},["app",{"sourceInterval":[6648,6683]},"ExpressionBinary_shr",[]],["app",{"sourceInterval":[6712,6747]},"ExpressionBinary_shl",[]],["app",{"sourceInterval":[6776,6810]},"ExpressionBinary_bin_and",[]],["app",{"sourceInterval":[6843,6877]},"ExpressionBinary_bin_or",[]],["app",{"sourceInterval":[6909,6922]},"ExpressionAdd",[]]]],"ExpressionAdd_add":["define",{"sourceInterval":[6943,6985]},null,[],["seq",{"sourceInterval":[6943,6979]},["app",{"sourceInterval":[6943,6956]},"ExpressionAdd",[]],["terminal",{"sourceInterval":[6957,6960]},"+"],["not",{"sourceInterval":[6961,6965]},["terminal",{"sourceInterval":[6962,6965]},"+"]],["app",{"sourceInterval":[6966,6979]},"ExpressionMul",[]]]],"ExpressionAdd_sub":["define",{"sourceInterval":[7006,7048]},null,[],["seq",{"sourceInterval":[7006,7042]},["app",{"sourceInterval":[7006,7019]},"ExpressionAdd",[]],["terminal",{"sourceInterval":[7020,7023]},"-"],["not",{"sourceInterval":[7024,7028]},["terminal",{"sourceInterval":[7025,7028]},"-"]],["app",{"sourceInterval":[7029,7042]},"ExpressionMul",[]]]],"ExpressionAdd":["define",{"sourceInterval":[6927,7082]},null,[],["alt",{"sourceInterval":[6943,7082]},["app",{"sourceInterval":[6943,6979]},"ExpressionAdd_add",[]],["app",{"sourceInterval":[7006,7042]},"ExpressionAdd_sub",[]],["app",{"sourceInterval":[7069,7082]},"ExpressionMul",[]]]],"ExpressionMul_mul":["define",{"sourceInterval":[7103,7142]},null,[],["seq",{"sourceInterval":[7103,7136]},["app",{"sourceInterval":[7103,7116]},"ExpressionMul",[]],["terminal",{"sourceInterval":[7117,7120]},"*"],["app",{"sourceInterval":[7121,7136]},"ExpressionUnary",[]]]],"ExpressionMul_div":["define",{"sourceInterval":[7163,7202]},null,[],["seq",{"sourceInterval":[7163,7196]},["app",{"sourceInterval":[7163,7176]},"ExpressionMul",[]],["terminal",{"sourceInterval":[7177,7180]},"/"],["app",{"sourceInterval":[7181,7196]},"ExpressionUnary",[]]]],"ExpressionMul_rem":["define",{"sourceInterval":[7223,7262]},null,[],["seq",{"sourceInterval":[7223,7256]},["app",{"sourceInterval":[7223,7236]},"ExpressionMul",[]],["terminal",{"sourceInterval":[7237,7240]},"%"],["app",{"sourceInterval":[7241,7256]},"ExpressionUnary",[]]]],"ExpressionMul":["define",{"sourceInterval":[7087,7298]},null,[],["alt",{"sourceInterval":[7103,7298]},["app",{"sourceInterval":[7103,7136]},"ExpressionMul_mul",[]],["app",{"sourceInterval":[7163,7196]},"ExpressionMul_div",[]],["app",{"sourceInterval":[7223,7256]},"ExpressionMul_rem",[]],["app",{"sourceInterval":[7283,7298]},"ExpressionUnary",[]]]],"ExpressionUnary_neg":["define",{"sourceInterval":[7321,7352]},null,[],["seq",{"sourceInterval":[7321,7346]},["terminal",{"sourceInterval":[7321,7324]},"-"],["app",{"sourceInterval":[7325,7346]},"ExpressionUnarySuffix",[]]]],"ExpressionUnary_add":["define",{"sourceInterval":[7375,7406]},null,[],["seq",{"sourceInterval":[7375,7400]},["terminal",{"sourceInterval":[7375,7378]},"+"],["app",{"sourceInterval":[7379,7400]},"ExpressionUnarySuffix",[]]]],"ExpressionUnary_not":["define",{"sourceInterval":[7429,7460]},null,[],["seq",{"sourceInterval":[7429,7454]},["terminal",{"sourceInterval":[7429,7432]},"!"],["app",{"sourceInterval":[7433,7454]},"ExpressionUnarySuffix",[]]]],"ExpressionUnary":["define",{"sourceInterval":[7303,7504]},null,[],["alt",{"sourceInterval":[7321,7504]},["app",{"sourceInterval":[7321,7346]},"ExpressionUnary_neg",[]],["app",{"sourceInterval":[7375,7400]},"ExpressionUnary_add",[]],["app",{"sourceInterval":[7429,7454]},"ExpressionUnary_not",[]],["app",{"sourceInterval":[7483,7504]},"ExpressionUnarySuffix",[]]]],"ExpressionUnarySuffix_notNull":["define",{"sourceInterval":[7533,7563]},null,[],["seq",{"sourceInterval":[7533,7553]},["app",{"sourceInterval":[7533,7548]},"ExpressionValue",[]],["terminal",{"sourceInterval":[7549,7553]},"!!"]]],"ExpressionUnarySuffix":["define",{"sourceInterval":[7509,7607]},null,[],["alt",{"sourceInterval":[7533,7607]},["app",{"sourceInterval":[7533,7553]},"ExpressionUnarySuffix_notNull",[]],["app",{"sourceInterval":[7592,7607]},"ExpressionValue",[]]]],"ExpressionBracket":["define",{"sourceInterval":[7612,7650]},null,[],["seq",{"sourceInterval":[7632,7650]},["terminal",{"sourceInterval":[7632,7635]},"("],["app",{"sourceInterval":[7636,7646]},"Expression",[]],["terminal",{"sourceInterval":[7647,7650]},")"]]],"ExpressionValue":["define",{"sourceInterval":[7682,8072]},null,[],["alt",{"sourceInterval":[7700,8072]},["app",{"sourceInterval":[7700,7714]},"ExpressionCall",[]],["app",{"sourceInterval":[7737,7752]},"ExpressionField",[]],["app",{"sourceInterval":[7775,7795]},"ExpressionStaticCall",[]],["app",{"sourceInterval":[7818,7835]},"ExpressionBracket",[]],["app",{"sourceInterval":[7858,7871]},"ExpressionNew",[]],["app",{"sourceInterval":[7894,7908]},"integerLiteral",[]],["app",{"sourceInterval":[7931,7942]},"boolLiteral",[]],["app",{"sourceInterval":[7965,7967]},"id",[]],["app",{"sourceInterval":[7990,7994]},"null",[]],["app",{"sourceInterval":[8017,8033]},"ExpressionInitOf",[]],["app",{"sourceInterval":[8056,8072]},"ExpressionString",[]]]],"ExpressionString":["define",{"sourceInterval":[8077,8109]},null,[],["app",{"sourceInterval":[8096,8109]},"stringLiteral",[]]],"ExpressionField":["define",{"sourceInterval":[8114,8159]},null,[],["seq",{"sourceInterval":[8132,8159]},["app",{"sourceInterval":[8132,8147]},"ExpressionValue",[]],["terminal",{"sourceInterval":[8148,8151]},"."],["app",{"sourceInterval":[8152,8154]},"id",[]],["not",{"sourceInterval":[8155,8159]},["terminal",{"sourceInterval":[8156,8159]},"("]]]],"ExpressionCall":["define",{"sourceInterval":[8164,8235]},null,[],["seq",{"sourceInterval":[8181,8235]},["app",{"sourceInterval":[8181,8196]},"ExpressionValue",[]],["terminal",{"sourceInterval":[8197,8200]},"."],["app",{"sourceInterval":[8201,8203]},"id",[]],["terminal",{"sourceInterval":[8204,8207]},"("],["app",{"sourceInterval":[8208,8231]},"ListOf",[["app",{"sourceInterval":[8215,8225]},"Expression",[]],["terminal",{"sourceInterval":[8227,8230]},","]]],["terminal",{"sourceInterval":[8232,8235]},")"]]],"ExpressionNew":["define",{"sourceInterval":[8240,8292]},null,[],["seq",{"sourceInterval":[8256,8292]},["app",{"sourceInterval":[8256,8258]},"id",[]],["terminal",{"sourceInterval":[8259,8262]},"{"],["app",{"sourceInterval":[8263,8288]},"ListOf",[["app",{"sourceInterval":[8270,8282]},"NewParameter",[]],["terminal",{"sourceInterval":[8284,8287]},","]]],["terminal",{"sourceInterval":[8289,8292]},"}"]]],"NewParameter":["define",{"sourceInterval":[8297,8329]},null,[],["seq",{"sourceInterval":[8312,8329]},["app",{"sourceInterval":[8312,8314]},"id",[]],["terminal",{"sourceInterval":[8315,8318]},":"],["app",{"sourceInterval":[8319,8329]},"Expression",[]]]],"ExpressionStaticCall":["define",{"sourceInterval":[8334,8391]},null,[],["seq",{"sourceInterval":[8357,8391]},["app",{"sourceInterval":[8357,8359]},"id",[]],["terminal",{"sourceInterval":[8360,8363]},"("],["app",{"sourceInterval":[8364,8387]},"ListOf",[["app",{"sourceInterval":[8371,8381]},"Expression",[]],["terminal",{"sourceInterval":[8383,8386]},","]]],["terminal",{"sourceInterval":[8388,8391]},")"]]],"ExpressionInitOf":["define",{"sourceInterval":[8396,8456]},null,[],["seq",{"sourceInterval":[8415,8456]},["app",{"sourceInterval":[8415,8421]},"initOf",[]],["app",{"sourceInterval":[8422,8424]},"id",[]],["terminal",{"sourceInterval":[8425,8428]},"("],["app",{"sourceInterval":[8429,8452]},"ListOf",[["app",{"sourceInterval":[8436,8446]},"Expression",[]],["terminal",{"sourceInterval":[8448,8451]},","]]],["terminal",{"sourceInterval":[8453,8456]},")"]]],"typeLiteral":["define",{"sourceInterval":[8482,8526]},null,[],["seq",{"sourceInterval":[8496,8526]},["app",{"sourceInterval":[8496,8509]},"letterAsciiUC",[]],["star",{"sourceInterval":[8510,8526]},["app",{"sourceInterval":[8510,8525]},"typeLiteralPart",[]]]]],"typeLiteralPart":["define",{"sourceInterval":[8531,8574]},null,[],["alt",{"sourceInterval":[8549,8574]},["app",{"sourceInterval":[8549,8560]},"letterAscii",[]],["app",{"sourceInterval":[8563,8568]},"digit",[]],["terminal",{"sourceInterval":[8571,8574]},"_"]]],"integerLiteral":["define",{"sourceInterval":[8781,8875]},null,[],["alt",{"sourceInterval":[8798,8875]},["app",{"sourceInterval":[8798,8815]},"integerLiteralHex",[]],["app",{"sourceInterval":[8818,8835]},"integerLiteralBin",[]],["app",{"sourceInterval":[8838,8855]},"integerLiteralOct",[]],["app",{"sourceInterval":[8858,8875]},"integerLiteralDec",[]]]],"integerLiteralDec_nonZeroIntegerLiteralDec":["define",{"sourceInterval":[8922,8976]},null,[],["seq",{"sourceInterval":[8922,8948]},["app",{"sourceInterval":[8922,8934]},"nonZeroDigit",[]],["star",{"sourceInterval":[8935,8948]},["seq",{"sourceInterval":[8936,8946]},["opt",{"sourceInterval":[8936,8940]},["terminal",{"sourceInterval":[8936,8939]},"_"]],["app",{"sourceInterval":[8941,8946]},"digit",[]]]]]],"integerLiteralDec_integerLiteralWithLeadingZero":["define",{"sourceInterval":[9001,9060]},null,[],["seq",{"sourceInterval":[9001,9011]},["terminal",{"sourceInterval":[9001,9004]},"0"],["star",{"sourceInterval":[9005,9011]},["app",{"sourceInterval":[9005,9010]},"digit",[]]]]],"integerLiteralDec":["define",{"sourceInterval":[8902,9060]},null,[],["alt",{"sourceInterval":[8922,9060]},["app",{"sourceInterval":[8922,8948]},"integerLiteralDec_nonZeroIntegerLiteralDec",[]],["app",{"sourceInterval":[9001,9011]},"integerLiteralDec_integerLiteralWithLeadingZero",[]]]],"integerLiteralHex":["define",{"sourceInterval":[9065,9124]},null,[],["seq",{"sourceInterval":[9085,9124]},["alt",{"sourceInterval":[9086,9097]},["terminal",{"sourceInterval":[9086,9090]},"0x"],["terminal",{"sourceInterval":[9093,9097]},"0X"]],["app",{"sourceInterval":[9099,9107]},"hexDigit",[]],["star",{"sourceInterval":[9108,9124]},["seq",{"sourceInterval":[9109,9122]},["opt",{"sourceInterval":[9109,9113]},["terminal",{"sourceInterval":[9109,9112]},"_"]],["app",{"sourceInterval":[9114,9122]},"hexDigit",[]]]]]],"integerLiteralBin":["define",{"sourceInterval":[9129,9188]},null,[],["seq",{"sourceInterval":[9149,9188]},["alt",{"sourceInterval":[9150,9161]},["terminal",{"sourceInterval":[9150,9154]},"0b"],["terminal",{"sourceInterval":[9157,9161]},"0B"]],["app",{"sourceInterval":[9163,9171]},"binDigit",[]],["star",{"sourceInterval":[9172,9188]},["seq",{"sourceInterval":[9173,9186]},["opt",{"sourceInterval":[9173,9177]},["terminal",{"sourceInterval":[9173,9176]},"_"]],["app",{"sourceInterval":[9178,9186]},"binDigit",[]]]]]],"integerLiteralOct":["define",{"sourceInterval":[9193,9252]},null,[],["seq",{"sourceInterval":[9213,9252]},["alt",{"sourceInterval":[9214,9225]},["terminal",{"sourceInterval":[9214,9218]},"0o"],["terminal",{"sourceInterval":[9221,9225]},"0O"]],["app",{"sourceInterval":[9227,9235]},"octDigit",[]],["star",{"sourceInterval":[9236,9252]},["seq",{"sourceInterval":[9237,9250]},["opt",{"sourceInterval":[9237,9241]},["terminal",{"sourceInterval":[9237,9240]},"_"]],["app",{"sourceInterval":[9242,9250]},"octDigit",[]]]]]],"binDigit":["define",{"sourceInterval":[9257,9277]},null,[],["alt",{"sourceInterval":[9268,9277]},["terminal",{"sourceInterval":[9268,9271]},"0"],["terminal",{"sourceInterval":[9274,9277]},"1"]]],"octDigit":["define",{"sourceInterval":[9282,9301]},null,[],["range",{"sourceInterval":[9293,9301]},"0","7"]],"nonZeroDigit":["define",{"sourceInterval":[9306,9329]},null,[],["range",{"sourceInterval":[9321,9329]},"1","9"]],"letterAsciiLC":["define",{"sourceInterval":[9350,9374]},null,[],["range",{"sourceInterval":[9366,9374]},"a","z"]],"letterAsciiUC":["define",{"sourceInterval":[9379,9403]},null,[],["range",{"sourceInterval":[9395,9403]},"A","Z"]],"letterAscii":["define",{"sourceInterval":[9408,9451]},null,[],["alt",{"sourceInterval":[9422,9451]},["app",{"sourceInterval":[9422,9435]},"letterAsciiLC",[]],["app",{"sourceInterval":[9438,9451]},"letterAsciiUC",[]]]],"letterComment":["define",{"sourceInterval":[9456,9515]},null,[],["alt",{"sourceInterval":[9472,9515]},["app",{"sourceInterval":[9472,9485]},"letterAsciiLC",[]],["app",{"sourceInterval":[9488,9501]},"letterAsciiUC",[]],["app",{"sourceInterval":[9504,9509]},"digit",[]],["terminal",{"sourceInterval":[9512,9515]},"_"]]],"idStart":["define",{"sourceInterval":[9539,9566]},null,[],["alt",{"sourceInterval":[9549,9566]},["app",{"sourceInterval":[9549,9560]},"letterAscii",[]],["terminal",{"sourceInterval":[9563,9566]},"_"]]],"idPart":["define",{"sourceInterval":[9571,9605]},null,[],["alt",{"sourceInterval":[9580,9605]},["app",{"sourceInterval":[9580,9591]},"letterAscii",[]],["app",{"sourceInterval":[9594,9599]},"digit",[]],["terminal",{"sourceInterval":[9602,9605]},"_"]]],"id":["define",{"sourceInterval":[9610,9648]},null,[],["seq",{"sourceInterval":[9615,9648]},["not",{"sourceInterval":[9615,9628]},["app",{"sourceInterval":[9616,9628]},"reservedWord",[]]],["lex",{"sourceInterval":[9629,9637]},["app",{"sourceInterval":[9630,9637]},"idStart",[]]],["lex",{"sourceInterval":[9638,9648]},["star",{"sourceInterval":[9640,9647]},["app",{"sourceInterval":[9640,9646]},"idPart",[]]]]]],"funcLetter":["define",{"sourceInterval":[9669,9730]},null,[],["alt",{"sourceInterval":[9682,9730]},["app",{"sourceInterval":[9682,9693]},"letterAscii",[]],["terminal",{"sourceInterval":[9696,9699]},"_"],["terminal",{"sourceInterval":[9702,9705]},"'"],["terminal",{"sourceInterval":[9708,9711]},"?"],["terminal",{"sourceInterval":[9714,9717]},"!"],["terminal",{"sourceInterval":[9720,9724]},"::"],["terminal",{"sourceInterval":[9727,9730]},"&"]]],"funcId":["define",{"sourceInterval":[9735,9777]},null,[],["seq",{"sourceInterval":[9744,9777]},["app",{"sourceInterval":[9744,9754]},"funcLetter",[]],["star",{"sourceInterval":[9755,9777]},["lex",{"sourceInterval":[9755,9776]},["alt",{"sourceInterval":[9757,9775]},["app",{"sourceInterval":[9757,9767]},"funcLetter",[]],["app",{"sourceInterval":[9770,9775]},"digit",[]]]]]]],"boolLiteral":["define",{"sourceInterval":[9803,9843]},null,[],["seq",{"sourceInterval":[9817,9843]},["alt",{"sourceInterval":[9818,9834]},["terminal",{"sourceInterval":[9818,9824]},"true"],["terminal",{"sourceInterval":[9827,9834]},"false"]],["not",{"sourceInterval":[9836,9843]},["app",{"sourceInterval":[9837,9843]},"idPart",[]]]]],"stringLiteralCharacter":["define",{"sourceInterval":[9871,9931]},null,[],["seq",{"sourceInterval":[9896,9931]},["not",{"sourceInterval":[9896,9927]},["alt",{"sourceInterval":[9898,9926]},["terminal",{"sourceInterval":[9898,9902]},"\""],["terminal",{"sourceInterval":[9905,9909]},"\\"],["app",{"sourceInterval":[9912,9926]},"lineTerminator",[]]]],["app",{"sourceInterval":[9928,9931]},"any",[]]]],"stringLiteral":["define",{"sourceInterval":[9936,9985]},null,[],["seq",{"sourceInterval":[9952,9985]},["terminal",{"sourceInterval":[9952,9956]},"\""],["star",{"sourceInterval":[9957,9980]},["app",{"sourceInterval":[9957,9979]},"stringLiteralCharacter",[]]],["terminal",{"sourceInterval":[9981,9985]},"\""]]],"keyword":["define",{"sourceInterval":[10038,10551]},null,[],["alt",{"sourceInterval":[10048,10551]},["app",{"sourceInterval":[10048,10051]},"fun",[]],["app",{"sourceInterval":[10067,10070]},"let",[]],["app",{"sourceInterval":[10085,10091]},"return",[]],["app",{"sourceInterval":[10107,10113]},"extend",[]],["app",{"sourceInterval":[10129,10135]},"native",[]],["app",{"sourceInterval":[10151,10157]},"public",[]],["app",{"sourceInterval":[10173,10177]},"null",[]],["app",{"sourceInterval":[10193,10195]},"if",[]],["app",{"sourceInterval":[10211,10215]},"else",[]],["app",{"sourceInterval":[10231,10236]},"while",[]],["app",{"sourceInterval":[10252,10258]},"repeat",[]],["app",{"sourceInterval":[10274,10276]},"do",[]],["app",{"sourceInterval":[10292,10297]},"until",[]],["app",{"sourceInterval":[10313,10315]},"as",[]],["app",{"sourceInterval":[10332,10339]},"mutates",[]],["app",{"sourceInterval":[10354,10361]},"extends",[]],["app",{"sourceInterval":[10376,10382]},"import",[]],["app",{"sourceInterval":[10397,10401]},"with",[]],["app",{"sourceInterval":[10416,10421]},"trait",[]],["app",{"sourceInterval":[10436,10442]},"initOf",[]],["app",{"sourceInterval":[10457,10465]},"override",[]],["app",{"sourceInterval":[10480,10488]},"abstract",[]],["app",{"sourceInterval":[10503,10510]},"virtual",[]],["app",{"sourceInterval":[10525,10531]},"inline",[]],["app",{"sourceInterval":[10546,10551]},"const",[]]]],"contract":["define",{"sourceInterval":[10556,10585]},null,[],["seq",{"sourceInterval":[10567,10585]},["terminal",{"sourceInterval":[10567,10577]},"contract"],["not",{"sourceInterval":[10578,10585]},["app",{"sourceInterval":[10579,10585]},"idPart",[]]]]],"let":["define",{"sourceInterval":[10590,10609]},null,[],["seq",{"sourceInterval":[10596,10609]},["terminal",{"sourceInterval":[10596,10601]},"let"],["not",{"sourceInterval":[10602,10609]},["app",{"sourceInterval":[10603,10609]},"idPart",[]]]]],"fun":["define",{"sourceInterval":[10614,10633]},null,[],["seq",{"sourceInterval":[10620,10633]},["terminal",{"sourceInterval":[10620,10625]},"fun"],["not",{"sourceInterval":[10626,10633]},["app",{"sourceInterval":[10627,10633]},"idPart",[]]]]],"return":["define",{"sourceInterval":[10638,10663]},null,[],["seq",{"sourceInterval":[10647,10663]},["terminal",{"sourceInterval":[10647,10655]},"return"],["not",{"sourceInterval":[10656,10663]},["app",{"sourceInterval":[10657,10663]},"idPart",[]]]]],"extend":["define",{"sourceInterval":[10668,10693]},null,[],["seq",{"sourceInterval":[10677,10693]},["terminal",{"sourceInterval":[10677,10685]},"extend"],["not",{"sourceInterval":[10686,10693]},["app",{"sourceInterval":[10687,10693]},"idPart",[]]]]],"native":["define",{"sourceInterval":[10698,10723]},null,[],["seq",{"sourceInterval":[10707,10723]},["terminal",{"sourceInterval":[10707,10715]},"native"],["not",{"sourceInterval":[10716,10723]},["app",{"sourceInterval":[10717,10723]},"idPart",[]]]]],"public":["define",{"sourceInterval":[10728,10753]},null,[],["seq",{"sourceInterval":[10737,10753]},["terminal",{"sourceInterval":[10737,10745]},"public"],["not",{"sourceInterval":[10746,10753]},["app",{"sourceInterval":[10747,10753]},"idPart",[]]]]],"null":["define",{"sourceInterval":[10758,10779]},null,[],["seq",{"sourceInterval":[10765,10779]},["terminal",{"sourceInterval":[10765,10771]},"null"],["not",{"sourceInterval":[10772,10779]},["app",{"sourceInterval":[10773,10779]},"idPart",[]]]]],"if":["define",{"sourceInterval":[10784,10801]},null,[],["seq",{"sourceInterval":[10789,10801]},["terminal",{"sourceInterval":[10789,10793]},"if"],["not",{"sourceInterval":[10794,10801]},["app",{"sourceInterval":[10795,10801]},"idPart",[]]]]],"else":["define",{"sourceInterval":[10806,10827]},null,[],["seq",{"sourceInterval":[10813,10827]},["terminal",{"sourceInterval":[10813,10819]},"else"],["not",{"sourceInterval":[10820,10827]},["app",{"sourceInterval":[10821,10827]},"idPart",[]]]]],"while":["define",{"sourceInterval":[10832,10855]},null,[],["seq",{"sourceInterval":[10840,10855]},["terminal",{"sourceInterval":[10840,10847]},"while"],["not",{"sourceInterval":[10848,10855]},["app",{"sourceInterval":[10849,10855]},"idPart",[]]]]],"repeat":["define",{"sourceInterval":[10860,10885]},null,[],["seq",{"sourceInterval":[10869,10885]},["terminal",{"sourceInterval":[10869,10877]},"repeat"],["not",{"sourceInterval":[10878,10885]},["app",{"sourceInterval":[10879,10885]},"idPart",[]]]]],"do":["define",{"sourceInterval":[10890,10907]},null,[],["seq",{"sourceInterval":[10895,10907]},["terminal",{"sourceInterval":[10895,10899]},"do"],["not",{"sourceInterval":[10900,10907]},["app",{"sourceInterval":[10901,10907]},"idPart",[]]]]],"until":["define",{"sourceInterval":[10912,10935]},null,[],["seq",{"sourceInterval":[10920,10935]},["terminal",{"sourceInterval":[10920,10927]},"until"],["not",{"sourceInterval":[10928,10935]},["app",{"sourceInterval":[10929,10935]},"idPart",[]]]]],"as":["define",{"sourceInterval":[10940,10957]},null,[],["seq",{"sourceInterval":[10945,10957]},["terminal",{"sourceInterval":[10945,10949]},"as"],["not",{"sourceInterval":[10950,10957]},["app",{"sourceInterval":[10951,10957]},"idPart",[]]]]],"mutates":["define",{"sourceInterval":[10962,10989]},null,[],["seq",{"sourceInterval":[10972,10989]},["terminal",{"sourceInterval":[10972,10981]},"mutates"],["not",{"sourceInterval":[10982,10989]},["app",{"sourceInterval":[10983,10989]},"idPart",[]]]]],"extends":["define",{"sourceInterval":[10994,11021]},null,[],["seq",{"sourceInterval":[11004,11021]},["terminal",{"sourceInterval":[11004,11013]},"extends"],["not",{"sourceInterval":[11014,11021]},["app",{"sourceInterval":[11015,11021]},"idPart",[]]]]],"import":["define",{"sourceInterval":[11026,11051]},null,[],["seq",{"sourceInterval":[11035,11051]},["terminal",{"sourceInterval":[11035,11043]},"import"],["not",{"sourceInterval":[11044,11051]},["app",{"sourceInterval":[11045,11051]},"idPart",[]]]]],"with":["define",{"sourceInterval":[11056,11077]},null,[],["seq",{"sourceInterval":[11063,11077]},["terminal",{"sourceInterval":[11063,11069]},"with"],["not",{"sourceInterval":[11070,11077]},["app",{"sourceInterval":[11071,11077]},"idPart",[]]]]],"trait":["define",{"sourceInterval":[11082,11105]},null,[],["seq",{"sourceInterval":[11090,11105]},["terminal",{"sourceInterval":[11090,11097]},"trait"],["not",{"sourceInterval":[11098,11105]},["app",{"sourceInterval":[11099,11105]},"idPart",[]]]]],"initOf":["define",{"sourceInterval":[11110,11135]},null,[],["seq",{"sourceInterval":[11119,11135]},["terminal",{"sourceInterval":[11119,11127]},"initOf"],["not",{"sourceInterval":[11128,11135]},["app",{"sourceInterval":[11129,11135]},"idPart",[]]]]],"virtual":["define",{"sourceInterval":[11140,11167]},null,[],["seq",{"sourceInterval":[11150,11167]},["terminal",{"sourceInterval":[11150,11159]},"virtual"],["not",{"sourceInterval":[11160,11167]},["app",{"sourceInterval":[11161,11167]},"idPart",[]]]]],"override":["define",{"sourceInterval":[11172,11201]},null,[],["seq",{"sourceInterval":[11183,11201]},["terminal",{"sourceInterval":[11183,11193]},"override"],["not",{"sourceInterval":[11194,11201]},["app",{"sourceInterval":[11195,11201]},"idPart",[]]]]],"inline":["define",{"sourceInterval":[11206,11231]},null,[],["seq",{"sourceInterval":[11215,11231]},["terminal",{"sourceInterval":[11215,11223]},"inline"],["not",{"sourceInterval":[11224,11231]},["app",{"sourceInterval":[11225,11231]},"idPart",[]]]]],"const":["define",{"sourceInterval":[11236,11259]},null,[],["seq",{"sourceInterval":[11244,11259]},["terminal",{"sourceInterval":[11244,11251]},"const"],["not",{"sourceInterval":[11252,11259]},["app",{"sourceInterval":[11253,11259]},"idPart",[]]]]],"abstract":["define",{"sourceInterval":[11264,11293]},null,[],["seq",{"sourceInterval":[11275,11293]},["terminal",{"sourceInterval":[11275,11285]},"abstract"],["not",{"sourceInterval":[11286,11293]},["app",{"sourceInterval":[11287,11293]},"idPart",[]]]]],"nameAttribute":["define",{"sourceInterval":[11317,11340]},null,[],["terminal",{"sourceInterval":[11333,11340]},"@name"]],"reservedWord":["define",{"sourceInterval":[11362,11384]},null,[],["app",{"sourceInterval":[11377,11384]},"keyword",[]]],"space":["extend",{"sourceInterval":[11406,11439]},null,[],["alt",{"sourceInterval":[11415,11439]},["app",{"sourceInterval":[11415,11422]},"comment",[]],["app",{"sourceInterval":[11425,11439]},"lineTerminator",[]]]],"comment":["define",{"sourceInterval":[11444,11490]},null,[],["alt",{"sourceInterval":[11454,11490]},["app",{"sourceInterval":[11454,11470]},"multiLineComment",[]],["app",{"sourceInterval":[11473,11490]},"singleLineComment",[]]]],"lineTerminator":["define",{"sourceInterval":[11495,11545]},null,[],["alt",{"sourceInterval":[11512,11545]},["terminal",{"sourceInterval":[11512,11516]},"\n"],["terminal",{"sourceInterval":[11519,11523]},"\r"],["terminal",{"sourceInterval":[11526,11534]},"\u2028"],["terminal",{"sourceInterval":[11537,11545]},"\u2029"]]],"multiLineComment":["define",{"sourceInterval":[11550,11591]},null,[],["seq",{"sourceInterval":[11569,11591]},["terminal",{"sourceInterval":[11569,11573]},"/*"],["star",{"sourceInterval":[11574,11586]},["seq",{"sourceInterval":[11575,11584]},["not",{"sourceInterval":[11575,11580]},["terminal",{"sourceInterval":[11576,11580]},"*/"]],["app",{"sourceInterval":[11581,11584]},"any",[]]]],["terminal",{"sourceInterval":[11587,11591]},"*/"]]],"singleLineComment":["define",{"sourceInterval":[11596,11643]},null,[],["seq",{"sourceInterval":[11616,11643]},["terminal",{"sourceInterval":[11616,11620]},"//"],["star",{"sourceInterval":[11621,11643]},["seq",{"sourceInterval":[11622,11641]},["not",{"sourceInterval":[11622,11637]},["app",{"sourceInterval":[11623,11637]},"lineTerminator",[]]],["app",{"sourceInterval":[11638,11641]},"any",[]]]]]]}]);module.exports=result; \ No newline at end of file diff --git a/src/grammar/grammar.ts b/src/grammar/grammar.ts index e5d62213f..10f7230ac 100644 --- a/src/grammar/grammar.ts +++ b/src/grammar/grammar.ts @@ -1,11 +1,12 @@ import rawGrammar from './grammar.ohm-bundle'; -import { ASTConstantAttribute, ASTContractAttribute, ASTFunctionAttribute, ASTNode, ASTProgram, ASTRef, ASTString, ASTTypeRef, createNode, createRef, inFile, throwError } from './ast'; +import { ASTConstantAttribute, ASTContractAttribute, ASTExpression, ASTFunctionAttribute, ASTNode, ASTProgram, ASTRef, ASTString, ASTTypeRef, createNode, createRef, inFile, throwError } from './ast'; import { checkVariableName } from './checkVariableName'; import { TactSyntaxError } from './../errors'; import { MatchResult } from 'ohm-js'; import { TypeOrigin } from '../types/types'; import { checkFunctionAttributes } from './checkFunctionAttributes'; import { checkConstAttributes } from './checkConstAttributes'; +import { getExpType } from '../types/resolveExpression'; let ctx: { origin: TypeOrigin } | null; @@ -428,7 +429,7 @@ semantics.addOperation('resolve_declaration', { // Statements semantics.addOperation('resolve_statement', { - StatementLet(_arg0, arg1, _arg2, arg3, _arg4, arg5, _arg6) { + StatementLet_withType(arg0, arg1, arg2, arg3, arg4, arg5, arg6) { checkVariableName(arg1.sourceString, createRef(arg1)); return createNode({ @@ -439,6 +440,16 @@ semantics.addOperation('resolve_statement', { ref: createRef(this) }) }, + StatementLet_withoutType(arg0, arg1, arg2, arg3, arg4) { + checkVariableName(arg1.sourceString, createRef(arg1)); + + return createNode({ + kind: 'statement_let_no_type', + name: arg1.sourceString, + expression: arg3.resolve_expression(), + ref: createRef(this) + }) + }, StatementReturn_withExpression(_arg0, arg1, _arg2) { return createNode({ kind: 'statement_return', diff --git a/src/test/__snapshots__/feature-local-type-inference.spec.ts.snap b/src/test/__snapshots__/feature-local-type-inference.spec.ts.snap new file mode 100644 index 000000000..a61db0b3d --- /dev/null +++ b/src/test/__snapshots__/feature-local-type-inference.spec.ts.snap @@ -0,0 +1,318 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`feature-local-type-inference should automatically set types for let statements 1`] = ` +{ + "errors": { + "10": { + "message": "Dictionary error", + }, + "128": { + "message": "Null reference exception", + }, + "129": { + "message": "Invalid serialization prefix", + }, + "13": { + "message": "Out of gas error", + }, + "130": { + "message": "Invalid incoming message", + }, + "131": { + "message": "Constraints error", + }, + "132": { + "message": "Access denied", + }, + "133": { + "message": "Contract stopped", + }, + "134": { + "message": "Invalid argument", + }, + "135": { + "message": "Code of a contract was not found", + }, + "136": { + "message": "Invalid address", + }, + "137": { + "message": "Masterchain support is not enabled for this contract", + }, + "2": { + "message": "Stack undeflow", + }, + "3": { + "message": "Stack overflow", + }, + "32": { + "message": "Method ID not found", + }, + "34": { + "message": "Action is invalid or not supported", + }, + "37": { + "message": "Not enough TON", + }, + "38": { + "message": "Not enough extra-currencies", + }, + "4": { + "message": "Integer overflow", + }, + "5": { + "message": "Integer out of expected range", + }, + "6": { + "message": "Invalid opcode", + }, + "7": { + "message": "Type check error", + }, + "8": { + "message": "Cell overflow", + }, + "9": { + "message": "Cell underflow", + }, + }, + "getters": [ + { + "arguments": [], + "name": "test1", + "returnType": { + "format": 257, + "kind": "simple", + "optional": false, + "type": "int", + }, + }, + { + "arguments": [], + "name": "test2", + "returnType": { + "format": 257, + "kind": "simple", + "optional": false, + "type": "int", + }, + }, + { + "arguments": [], + "name": "test3", + "returnType": { + "kind": "simple", + "optional": false, + "type": "address", + }, + }, + { + "arguments": [], + "name": "test4", + "returnType": { + "kind": "simple", + "optional": false, + "type": "address", + }, + }, + { + "arguments": [], + "name": "test5", + "returnType": { + "kind": "simple", + "optional": false, + "type": "bool", + }, + }, + ], + "receivers": [ + { + "message": { + "kind": "typed", + "type": "Deploy", + }, + "receiver": "internal", + }, + ], + "types": [ + { + "fields": [ + { + "name": "code", + "type": { + "kind": "simple", + "optional": false, + "type": "cell", + }, + }, + { + "name": "data", + "type": { + "kind": "simple", + "optional": false, + "type": "cell", + }, + }, + ], + "header": null, + "name": "StateInit", + }, + { + "fields": [ + { + "name": "bounced", + "type": { + "kind": "simple", + "optional": false, + "type": "bool", + }, + }, + { + "name": "sender", + "type": { + "kind": "simple", + "optional": false, + "type": "address", + }, + }, + { + "name": "value", + "type": { + "format": 257, + "kind": "simple", + "optional": false, + "type": "int", + }, + }, + { + "name": "raw", + "type": { + "kind": "simple", + "optional": false, + "type": "slice", + }, + }, + ], + "header": null, + "name": "Context", + }, + { + "fields": [ + { + "name": "bounce", + "type": { + "kind": "simple", + "optional": false, + "type": "bool", + }, + }, + { + "name": "to", + "type": { + "kind": "simple", + "optional": false, + "type": "address", + }, + }, + { + "name": "value", + "type": { + "format": 257, + "kind": "simple", + "optional": false, + "type": "int", + }, + }, + { + "name": "mode", + "type": { + "format": 257, + "kind": "simple", + "optional": false, + "type": "int", + }, + }, + { + "name": "body", + "type": { + "kind": "simple", + "optional": true, + "type": "cell", + }, + }, + { + "name": "code", + "type": { + "kind": "simple", + "optional": true, + "type": "cell", + }, + }, + { + "name": "data", + "type": { + "kind": "simple", + "optional": true, + "type": "cell", + }, + }, + ], + "header": null, + "name": "SendParameters", + }, + { + "fields": [ + { + "name": "queryId", + "type": { + "format": 64, + "kind": "simple", + "optional": false, + "type": "uint", + }, + }, + ], + "header": 2490013878, + "name": "Deploy", + }, + { + "fields": [ + { + "name": "queryId", + "type": { + "format": 64, + "kind": "simple", + "optional": false, + "type": "uint", + }, + }, + ], + "header": 2952335191, + "name": "DeployOk", + }, + { + "fields": [ + { + "name": "queryId", + "type": { + "format": 64, + "kind": "simple", + "optional": false, + "type": "uint", + }, + }, + { + "name": "cashback", + "type": { + "kind": "simple", + "optional": false, + "type": "address", + }, + }, + ], + "header": 1829761339, + "name": "FactoryDeploy", + }, + ], +} +`; diff --git a/src/test/feature-local-type-inference.spec.ts b/src/test/feature-local-type-inference.spec.ts new file mode 100644 index 000000000..d44b95d52 --- /dev/null +++ b/src/test/feature-local-type-inference.spec.ts @@ -0,0 +1,27 @@ +import { toNano } from '@ton/core'; +import { ContractSystem } from '@tact-lang/emulator'; +import { __DANGER_resetNodeId } from '../grammar/ast'; +import { LocalTypeInferenceTester } from './features/output/local-type-inference_LocalTypeInferenceTester'; + +describe('feature-local-type-inference', () => { + beforeEach(() => { + __DANGER_resetNodeId(); + }); + it('should automatically set types for let statements', async () => { + + // Init + const system = await ContractSystem.create(); + const treasure = system.treasure('treasure'); + const contract = system.open(await LocalTypeInferenceTester.fromInit()); + const tracker = system.track(contract.address); + await contract.send(treasure, { value: toNano('10') }, { $$type: 'Deploy', queryId: 0n }); + await system.run(); + + expect(contract.abi).toMatchSnapshot(); + expect(await contract.getTest1()).toStrictEqual(1n); + expect(await contract.getTest2()).toStrictEqual(2n); + expect((await contract.getTest3()).toRawString()).toBe(contract.address.toRawString()); + expect((await contract.getTest4()).toRawString()).toBe(contract.address.toRawString()); + expect(await contract.getTest5()).toStrictEqual(true); + }); +}); \ No newline at end of file diff --git a/src/test/features/local-type-inference.tact b/src/test/features/local-type-inference.tact new file mode 100644 index 000000000..56c20b63a --- /dev/null +++ b/src/test/features/local-type-inference.tact @@ -0,0 +1,31 @@ +import "@stdlib/deploy"; + +contract LocalTypeInferenceTester with Deployable { + get fun test1(): Int { + let x = 1; + return x; + } + + get fun test2(): Int { + let x = 1; + let y = x + 1; + return y; + } + + get fun test3(): Address { + let x = myAddress(); + return x; + } + + get fun test4(): Address { + let x = myAddress(); + let y = x; + return y; + } + + get fun test5(): Bool { + let x: Int = 123; + let y = x == 123; + return y; + } +} \ No newline at end of file diff --git a/src/types/resolveStatements.ts b/src/types/resolveStatements.ts index cfbe48df6..9e337c46f 100644 --- a/src/types/resolveStatements.ts +++ b/src/types/resolveStatements.ts @@ -146,6 +146,20 @@ function processStatements(statements: ASTStatement[], sctx: StatementContext, c } sctx = addVariable(s.name, variableType, sctx); + } else if (s.kind === 'statement_let_no_type') { + + // Process expression + ctx = resolveExpression(s.expression, sctx, ctx); + + // Check type + const expressionType = getExpType(ctx, s.expression); + + // Add variable to statement context + if (sctx.vars[s.name]) { + throwError(`Variable already exists: ${s.name}`, s.ref); + } + sctx = addVariable(s.name, expressionType, sctx); + } else if (s.kind === 'statement_assign') { // Process lvalue diff --git a/tact.config.json b/tact.config.json index 36238f424..3af85fdb9 100644 --- a/tact.config.json +++ b/tact.config.json @@ -245,6 +245,14 @@ "debug": true } }, + { + "name": "local-type-inference", + "path": "./src/test/features/local-type-inference.tact", + "output": "./src/test/features/output", + "options": { + "debug": true + } + }, { "name": "benchmark_functions", "path": "./src/benchmarks/contracts/functions.tact",