From ea5191a10c8c189b3c683a7555700d1c8881ec0c Mon Sep 17 00:00:00 2001 From: byakuren-hijiri <159621697+byakuren-hijiri@users.noreply.github.com> Date: Mon, 1 Apr 2024 04:49:57 -0300 Subject: [PATCH 1/6] fix(const-eval): display an error for integer overflow at compile-time (#200) Closes #189 --- CHANGELOG.md | 1 + .../__snapshots__/resolveDescriptors.spec.ts.snap | 10 ++++++++++ src/types/resolveConstantValue.ts | 14 +++++++++++++- src/types/test-failed/case-25.tact | 8 ++++++++ 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 src/types/test-failed/case-25.tact diff --git a/CHANGELOG.md b/CHANGELOG.md index 8349fee5c..03298106b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `log2` and `log` math functions in `@stdlib/math`: PR [#166](https://github.com/tact-lang/tact/pull/166) - Reserve mode constants in `@stdlib/reserve`, namely `ReserveExact`, `ReserveAllExcept`, `ReserveAtMost`, `ReserveAddOriginalBalance`, `ReserveInvertSign`, `ReserveBounceIfActionFail`: PR [#173](https://github.com/tact-lang/tact/pull/173) - JSON Schema for `tact.config.json`: PR [#194](https://github.com/tact-lang/tact/pull/194) +- Display an error for integer overflow at compile-time: PR [#200](https://github.com/tact-lang/tact/pull/200) ### Changed - Update the `dump` function to handle addresses: PR [#175](https://github.com/tact-lang/tact/pull/175) diff --git a/src/types/__snapshots__/resolveDescriptors.spec.ts.snap b/src/types/__snapshots__/resolveDescriptors.spec.ts.snap index a2b389670..390c1f3bf 100644 --- a/src/types/__snapshots__/resolveDescriptors.spec.ts.snap +++ b/src/types/__snapshots__/resolveDescriptors.spec.ts.snap @@ -248,6 +248,16 @@ Line 15, col 3: " `; +exports[`resolveDescriptors should fail descriptors for case-25 1`] = ` +":8:21: Cannot evaluate constant expression due to integer overflow +Line 8, col 21: + 7 | +> 8 | const a: Int = 1 + (1 >> -1073741824); + ^~~~~~~~~~~~~~~~ + 9 | +" +`; + exports[`resolveDescriptors should resolve descriptors for case-0 1`] = ` { "BaseTrait": { diff --git a/src/types/resolveConstantValue.ts b/src/types/resolveConstantValue.ts index 5482c0799..19d0bca2a 100644 --- a/src/types/resolveConstantValue.ts +++ b/src/types/resolveConstantValue.ts @@ -5,7 +5,7 @@ import { ASTExpression, throwError } from "../grammar/ast"; import { printTypeRef, TypeRef } from "./types"; import { sha256_sync } from "@ton/crypto"; -function reduceInt(ast: ASTExpression): bigint { +function reduceIntImpl(ast: ASTExpression): bigint { if (ast.kind === 'number') { return ast.value; } else if (ast.kind === 'op_binary') { @@ -59,6 +59,18 @@ function reduceInt(ast: ASTExpression): bigint { throwError('Cannot reduce expression to a constant integer', ast.ref); } +function reduceInt(ast: ASTExpression): bigint { + try { + return reduceIntImpl(ast) + } catch (error) { + if (error instanceof RangeError) { + throwError('Cannot evaluate constant expression due to integer overflow', ast.ref); + } else { + throw error; + } + } +} + function reduceBool(ast: ASTExpression): boolean { if (ast.kind === 'boolean') { return ast.value; diff --git a/src/types/test-failed/case-25.tact b/src/types/test-failed/case-25.tact new file mode 100644 index 000000000..c9dd18dc4 --- /dev/null +++ b/src/types/test-failed/case-25.tact @@ -0,0 +1,8 @@ +primitive Int; +primitive Bool; + +trait BaseTrait { + +} + +const a: Int = 1 + (1 >> -1073741824); From a7f3ad04eb5ed0905a47dd7bbe21adf8542b0d44 Mon Sep 17 00:00:00 2001 From: Daniil Sedov <42098239+Gusarich@users.noreply.github.com> Date: Mon, 1 Apr 2024 14:22:09 +0300 Subject: [PATCH 2/6] feat[stdlib]: add `concat` method for `StringBuilder` (#217) It returns `self`, thus allowing chaining of `concat` calls --- CHANGELOG.md | 1 + .../writeSerialization.spec.ts.snap | 45 +++++++++++++++++++ src/generator/writers/writeStdlib.ts | 11 +++++ src/imports/stdlib.ts | 44 +++++++++--------- src/test/feature-strings.spec.ts | 1 + src/test/features/strings.tact | 6 +++ stdlib/std/text.tact | 3 ++ 7 files changed, 90 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03298106b..b3d154549 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Reserve mode constants in `@stdlib/reserve`, namely `ReserveExact`, `ReserveAllExcept`, `ReserveAtMost`, `ReserveAddOriginalBalance`, `ReserveInvertSign`, `ReserveBounceIfActionFail`: PR [#173](https://github.com/tact-lang/tact/pull/173) - JSON Schema for `tact.config.json`: PR [#194](https://github.com/tact-lang/tact/pull/194) - Display an error for integer overflow at compile-time: PR [#200](https://github.com/tact-lang/tact/pull/200) +- Non-modifying `StringBuilder`'s `concat` method for chained string concatenations: PR [#217](https://github.com/tact-lang/tact/pull/217) ### Changed - Update the `dump` function to handle addresses: PR [#175](https://github.com/tact-lang/tact/pull/175) diff --git a/src/generator/writers/__snapshots__/writeSerialization.spec.ts.snap b/src/generator/writers/__snapshots__/writeSerialization.spec.ts.snap index 88c126178..470dd6c41 100644 --- a/src/generator/writers/__snapshots__/writeSerialization.spec.ts.snap +++ b/src/generator/writers/__snapshots__/writeSerialization.spec.ts.snap @@ -2996,6 +2996,21 @@ return ((builders), ());", "name": "__tact_string_builder_append", "signature": "((tuple), ()) __tact_string_builder_append(tuple builders, slice sc)", }, + { + "code": { + "code": "builders~__tact_string_builder_append(sc); +return builders;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_string_builder_append", + }, + "flags": Set {}, + "name": "__tact_string_builder_append_not_mut", + "signature": "(tuple) __tact_string_builder_append_not_mut(tuple builders, slice sc)", + }, { "code": { "code": "var b = begin_cell(); @@ -6978,6 +6993,21 @@ return ((builders), ());", "name": "__tact_string_builder_append", "signature": "((tuple), ()) __tact_string_builder_append(tuple builders, slice sc)", }, + { + "code": { + "code": "builders~__tact_string_builder_append(sc); +return builders;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_string_builder_append", + }, + "flags": Set {}, + "name": "__tact_string_builder_append_not_mut", + "signature": "(tuple) __tact_string_builder_append_not_mut(tuple builders, slice sc)", + }, { "code": { "code": "var b = begin_cell(); @@ -10960,6 +10990,21 @@ return ((builders), ());", "name": "__tact_string_builder_append", "signature": "((tuple), ()) __tact_string_builder_append(tuple builders, slice sc)", }, + { + "code": { + "code": "builders~__tact_string_builder_append(sc); +return builders;", + "kind": "generic", + }, + "comment": null, + "context": "stdlib", + "depends": Set { + "__tact_string_builder_append", + }, + "flags": Set {}, + "name": "__tact_string_builder_append_not_mut", + "signature": "(tuple) __tact_string_builder_append_not_mut(tuple builders, slice sc)", + }, { "code": { "code": "var b = begin_cell(); diff --git a/src/generator/writers/writeStdlib.ts b/src/generator/writers/writeStdlib.ts index cef64a740..e41c29b48 100644 --- a/src/generator/writers/writeStdlib.ts +++ b/src/generator/writers/writeStdlib.ts @@ -1227,6 +1227,17 @@ export function writeStdlib(ctx: WriterContext) { }); }); + ctx.fun(`__tact_string_builder_append_not_mut`, () => { + ctx.signature(`(tuple) __tact_string_builder_append_not_mut(tuple builders, slice sc)`); + ctx.context('stdlib'); + ctx.body(() => { + ctx.write(` + builders~${ctx.used('__tact_string_builder_append')}(sc); + return builders; + `); + }); + }); + ctx.fun(`__tact_int_to_string`, () => { ctx.signature(`slice __tact_int_to_string(int src)`); ctx.context('stdlib'); diff --git a/src/imports/stdlib.ts b/src/imports/stdlib.ts index 7a89c2659..8feb81eb5 100644 --- a/src/imports/stdlib.ts +++ b/src/imports/stdlib.ts @@ -228,27 +228,29 @@ files['std/text.tact'] = 'KF9fdGFjdF9zdHJpbmdfYnVpbGRlcl9zdGFydF90YWlsX3N0cmluZykKbmF0aXZlIGJlZ2luVGFpbFN0cmluZygpOiBTdHJpbmdCdWlsZGVyOwoKQG5hbWUoX190YWN0' + 'X3N0cmluZ19idWlsZGVyX3N0YXJ0KQpuYXRpdmUgYmVnaW5TdHJpbmdGcm9tQnVpbGRlcihiOiBCdWlsZGVyKTogU3RyaW5nQnVpbGRlcjsKCkBuYW1lKF9fdGFjdF9z' + 'dHJpbmdfYnVpbGRlcl9hcHBlbmQpCmV4dGVuZHMgbXV0YXRlcyBuYXRpdmUgYXBwZW5kKHNlbGY6IFN0cmluZ0J1aWxkZXIsIHM6IFN0cmluZyk7CgpAbmFtZShfX3Rh' + - 'Y3Rfc3RyaW5nX2J1aWxkZXJfZW5kKQpleHRlbmRzIG5hdGl2ZSB0b0NlbGwoc2VsZjogU3RyaW5nQnVpbGRlcik6IENlbGw7CgpAbmFtZShfX3RhY3Rfc3RyaW5nX2J1' + - 'aWxkZXJfZW5kX3NsaWNlKQpleHRlbmRzIG5hdGl2ZSB0b1N0cmluZyhzZWxmOiBTdHJpbmdCdWlsZGVyKTogU3RyaW5nOwoKQG5hbWUoX190YWN0X3N0cmluZ19idWls' + - 'ZGVyX2VuZF9zbGljZSkKZXh0ZW5kcyBuYXRpdmUgdG9TbGljZShzZWxmOiBTdHJpbmdCdWlsZGVyKTogU2xpY2U7CgovLwovLyBTdHJpbmcgY29udmVyc2lvbgovLwoK' + - 'QG5hbWUoX190YWN0X2ludF90b19zdHJpbmcpCmV4dGVuZHMgbmF0aXZlIHRvU3RyaW5nKHNlbGY6IEludCk6IFN0cmluZzsKCkBuYW1lKF9fdGFjdF9mbG9hdF90b19z' + - 'dHJpbmcpCmV4dGVuZHMgbmF0aXZlIHRvRmxvYXRTdHJpbmcoc2VsZjogSW50LCBkaWdpdHM6IEludCk6IFN0cmluZzsKCmlubGluZSBleHRlbmRzIGZ1biB0b0NvaW5z' + - 'U3RyaW5nKHNlbGY6IEludCk6IFN0cmluZyB7CiAgICByZXR1cm4gc2VsZi50b0Zsb2F0U3RyaW5nKDkpOwp9CgpleHRlbmRzIGZ1biBhc0NvbW1lbnQoc2VsZjogU3Ry' + - 'aW5nKTogQ2VsbCB7CiAgICBsZXQgYjogU3RyaW5nQnVpbGRlciA9IGJlZ2luQ29tbWVudCgpOwogICAgYi5hcHBlbmQoc2VsZik7CiAgICByZXR1cm4gYi50b0NlbGwo' + - 'KTsKfQoKQG5hbWUoX190YWN0X3N0cl90b19zbGljZSkKZXh0ZW5kcyBuYXRpdmUgYXNTbGljZShzZWxmOiBTdHJpbmcpOiBTbGljZTsKCkBuYW1lKF9fdGFjdF9zbGlj' + - 'ZV90b19zdHIpCmV4dGVuZHMgbmF0aXZlIGFzU3RyaW5nKHNlbGY6IFNsaWNlKTogU3RyaW5nOwoKaW5saW5lIGV4dGVuZHMgZnVuIGZyb21CYXNlNjQoc2VsZjogU3Ry' + - 'aW5nKTogU2xpY2UgewogICAgcmV0dXJuIHNlbGYuYXNTbGljZSgpLmZyb21CYXNlNjQoKTsKfQoKZXh0ZW5kcyBmdW4gZnJvbUJhc2U2NChzZWxmOiBTbGljZSk6IFNs' + - 'aWNlIHsKICAgIGxldCBzaXplOiBJbnQgPSBzZWxmLmJpdHMoKSAvIDg7CiAgICBsZXQgcmVzdWx0OiBCdWlsZGVyID0gYmVnaW5DZWxsKCk7CgogICAgcmVwZWF0IChz' + - 'aXplKSB7CiAgICAgICAgbGV0IGNvZGU6IEludCA9IHNlbGYubG9hZFVpbnQoOCk7CiAgICAgICAgaWYgKGNvZGUgPj0gNjUgJiYgY29kZSA8PSA5MCkgeyAvLyBBLVoK' + - 'ICAgICAgICAgICAgcmVzdWx0ID0gcmVzdWx0LnN0b3JlVWludChjb2RlIC0gNjUsIDYpOwogICAgICAgIH0gZWxzZSBpZiAoY29kZSA+PSA5NyAmJiBjb2RlIDw9IDEy' + - 'MikgeyAvLyBhLXoKICAgICAgICAgICAgcmVzdWx0ID0gcmVzdWx0LnN0b3JlVWludChjb2RlIC0gKDk3IC0gMjYpLCA2KTsKICAgICAgICB9IGVsc2UgaWYgKGNvZGUg' + - 'Pj0gNDggJiYgY29kZSA8PSA1NykgeyAvLyAwLTkKICAgICAgICAgICAgcmVzdWx0ID0gcmVzdWx0LnN0b3JlVWludChjb2RlICsgKDUyIC0gNDgpLCA2KTsKICAgICAg' + - 'ICB9IGVsc2UgaWYgKGNvZGUgPT0gNDUgfHwgY29kZSA9PSA0MykgeyAvLyAtIG9yICsKICAgICAgICAgICAgcmVzdWx0ID0gcmVzdWx0LnN0b3JlVWludCg2MiwgNik7' + - 'CiAgICAgICAgfSBlbHNlIGlmIChjb2RlID09IDk1IHx8IGNvZGUgPT0gNDcpIHsgLy8gXyBvciAvCiAgICAgICAgICAgIHJlc3VsdCA9IHJlc3VsdC5zdG9yZVVpbnQo' + - 'NjMsIDYpOwogICAgICAgIH0gZWxzZSBpZiAoY29kZSA9PSA2MSkgeyAvLyA9CiAgICAgICAgICAgIC8vIFNraXAKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICB0' + - 'aHJvdygxMzQpOwogICAgICAgIH0KICAgIH0KCiAgICAvLyBQYWRkaW5nCiAgICBsZXQgdG90YWw6IEludCA9IHJlc3VsdC5iaXRzKCk7CiAgICBsZXQgcGFkZGluZzog' + - 'SW50ID0gdG90YWwgJSA4OwogICAgaWYgKHBhZGRpbmcgIT0gMCkgewogICAgICAgIGxldCBzOiBTbGljZSA9IHJlc3VsdC5hc1NsaWNlKCk7CiAgICAgICAgcmV0dXJu' + - 'IHMubG9hZEJpdHModG90YWwgLSBwYWRkaW5nKTsKICAgIH0gZWxzZSB7CiAgICAgICAgcmV0dXJuIHJlc3VsdC5hc1NsaWNlKCk7CiAgICB9Cn0='; + 'Y3Rfc3RyaW5nX2J1aWxkZXJfYXBwZW5kX25vdF9tdXQpCmV4dGVuZHMgbmF0aXZlIGNvbmNhdChzZWxmOiBTdHJpbmdCdWlsZGVyLCBzOiBTdHJpbmcpOiBTdHJpbmdC' + + 'dWlsZGVyOwoKQG5hbWUoX190YWN0X3N0cmluZ19idWlsZGVyX2VuZCkKZXh0ZW5kcyBuYXRpdmUgdG9DZWxsKHNlbGY6IFN0cmluZ0J1aWxkZXIpOiBDZWxsOwoKQG5h' + + 'bWUoX190YWN0X3N0cmluZ19idWlsZGVyX2VuZF9zbGljZSkKZXh0ZW5kcyBuYXRpdmUgdG9TdHJpbmcoc2VsZjogU3RyaW5nQnVpbGRlcik6IFN0cmluZzsKCkBuYW1l' + + 'KF9fdGFjdF9zdHJpbmdfYnVpbGRlcl9lbmRfc2xpY2UpCmV4dGVuZHMgbmF0aXZlIHRvU2xpY2Uoc2VsZjogU3RyaW5nQnVpbGRlcik6IFNsaWNlOwoKLy8KLy8gU3Ry' + + 'aW5nIGNvbnZlcnNpb24KLy8KCkBuYW1lKF9fdGFjdF9pbnRfdG9fc3RyaW5nKQpleHRlbmRzIG5hdGl2ZSB0b1N0cmluZyhzZWxmOiBJbnQpOiBTdHJpbmc7CgpAbmFt' + + 'ZShfX3RhY3RfZmxvYXRfdG9fc3RyaW5nKQpleHRlbmRzIG5hdGl2ZSB0b0Zsb2F0U3RyaW5nKHNlbGY6IEludCwgZGlnaXRzOiBJbnQpOiBTdHJpbmc7CgppbmxpbmUg' + + 'ZXh0ZW5kcyBmdW4gdG9Db2luc1N0cmluZyhzZWxmOiBJbnQpOiBTdHJpbmcgewogICAgcmV0dXJuIHNlbGYudG9GbG9hdFN0cmluZyg5KTsKfQoKZXh0ZW5kcyBmdW4g' + + 'YXNDb21tZW50KHNlbGY6IFN0cmluZyk6IENlbGwgewogICAgbGV0IGI6IFN0cmluZ0J1aWxkZXIgPSBiZWdpbkNvbW1lbnQoKTsKICAgIGIuYXBwZW5kKHNlbGYpOwog' + + 'ICAgcmV0dXJuIGIudG9DZWxsKCk7Cn0KCkBuYW1lKF9fdGFjdF9zdHJfdG9fc2xpY2UpCmV4dGVuZHMgbmF0aXZlIGFzU2xpY2Uoc2VsZjogU3RyaW5nKTogU2xpY2U7' + + 'CgpAbmFtZShfX3RhY3Rfc2xpY2VfdG9fc3RyKQpleHRlbmRzIG5hdGl2ZSBhc1N0cmluZyhzZWxmOiBTbGljZSk6IFN0cmluZzsKCmlubGluZSBleHRlbmRzIGZ1biBm' + + 'cm9tQmFzZTY0KHNlbGY6IFN0cmluZyk6IFNsaWNlIHsKICAgIHJldHVybiBzZWxmLmFzU2xpY2UoKS5mcm9tQmFzZTY0KCk7Cn0KCmV4dGVuZHMgZnVuIGZyb21CYXNl' + + 'NjQoc2VsZjogU2xpY2UpOiBTbGljZSB7CiAgICBsZXQgc2l6ZTogSW50ID0gc2VsZi5iaXRzKCkgLyA4OwogICAgbGV0IHJlc3VsdDogQnVpbGRlciA9IGJlZ2luQ2Vs' + + 'bCgpOwoKICAgIHJlcGVhdCAoc2l6ZSkgewogICAgICAgIGxldCBjb2RlOiBJbnQgPSBzZWxmLmxvYWRVaW50KDgpOwogICAgICAgIGlmIChjb2RlID49IDY1ICYmIGNv' + + 'ZGUgPD0gOTApIHsgLy8gQS1aCiAgICAgICAgICAgIHJlc3VsdCA9IHJlc3VsdC5zdG9yZVVpbnQoY29kZSAtIDY1LCA2KTsKICAgICAgICB9IGVsc2UgaWYgKGNvZGUg' + + 'Pj0gOTcgJiYgY29kZSA8PSAxMjIpIHsgLy8gYS16CiAgICAgICAgICAgIHJlc3VsdCA9IHJlc3VsdC5zdG9yZVVpbnQoY29kZSAtICg5NyAtIDI2KSwgNik7CiAgICAg' + + 'ICAgfSBlbHNlIGlmIChjb2RlID49IDQ4ICYmIGNvZGUgPD0gNTcpIHsgLy8gMC05CiAgICAgICAgICAgIHJlc3VsdCA9IHJlc3VsdC5zdG9yZVVpbnQoY29kZSArICg1' + + 'MiAtIDQ4KSwgNik7CiAgICAgICAgfSBlbHNlIGlmIChjb2RlID09IDQ1IHx8IGNvZGUgPT0gNDMpIHsgLy8gLSBvciArCiAgICAgICAgICAgIHJlc3VsdCA9IHJlc3Vs' + + 'dC5zdG9yZVVpbnQoNjIsIDYpOwogICAgICAgIH0gZWxzZSBpZiAoY29kZSA9PSA5NSB8fCBjb2RlID09IDQ3KSB7IC8vIF8gb3IgLwogICAgICAgICAgICByZXN1bHQg' + + 'PSByZXN1bHQuc3RvcmVVaW50KDYzLCA2KTsKICAgICAgICB9IGVsc2UgaWYgKGNvZGUgPT0gNjEpIHsgLy8gPQogICAgICAgICAgICAvLyBTa2lwCiAgICAgICAgfSBl' + + 'bHNlIHsKICAgICAgICAgICAgdGhyb3coMTM0KTsKICAgICAgICB9CiAgICB9CgogICAgLy8gUGFkZGluZwogICAgbGV0IHRvdGFsOiBJbnQgPSByZXN1bHQuYml0cygp' + + 'OwogICAgbGV0IHBhZGRpbmc6IEludCA9IHRvdGFsICUgODsKICAgIGlmIChwYWRkaW5nICE9IDApIHsKICAgICAgICBsZXQgczogU2xpY2UgPSByZXN1bHQuYXNTbGlj' + + 'ZSgpOwogICAgICAgIHJldHVybiBzLmxvYWRCaXRzKHRvdGFsIC0gcGFkZGluZyk7CiAgICB9IGVsc2UgewogICAgICAgIHJldHVybiByZXN1bHQuYXNTbGljZSgpOwog' + + 'ICAgfQp9'; files['stdlib_ex.fc'] = 'Zm9yYWxsIFggLT4gdHVwbGUgX190YWN0X3NldCh0dXBsZSB4LCBYIHYsIGludCBpKSBhc20gIlNFVElOREVYVkFSUSI7CigpIF9fdGFjdF9ub3AoKSBhc20gIk5PUCI7' + 'CnNsaWNlIF9fdGFjdF9zdHJfdG9fc2xpY2Uoc2xpY2UgcykgYXNtICJOT1AiOwpzbGljZSBfX3RhY3Rfc2xpY2VfdG9fc3RyKHNsaWNlIHMpIGFzbSAiTk9QIjsKc2xp' + diff --git a/src/test/feature-strings.spec.ts b/src/test/feature-strings.spec.ts index e312e474f..dd49ff047 100644 --- a/src/test/feature-strings.spec.ts +++ b/src/test/feature-strings.spec.ts @@ -22,6 +22,7 @@ describe('feature-strings', () => { const l = 'привет мир 👀 привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀'; expect(await contract.getConstantStringUnicodeLong()).toBe(l); expect((await contract.getDynamicStringCell()).equals(beginCell().storeStringTail('Hello!').endCell())).toBe(true); + expect((await contract.getDynamicStringCell2()).equals(beginCell().storeStringTail('Hello, World!').endCell())).toBe(true); expect((await contract.getDynamicCommentCell()).equals(beginCell().storeUint(0, 32).storeStringTail('Something something world!').endCell())).toBe(true); const l2 = 'Hello!привет мир 👀 привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀привет мир 👀'; expect((await contract.getDynamicCommentCellLarge()).equals(beginCell().storeStringTail(l2).endCell())).toBe(true); diff --git a/src/test/features/strings.tact b/src/test/features/strings.tact index de50366d3..bf32e8280 100644 --- a/src/test/features/strings.tact +++ b/src/test/features/strings.tact @@ -26,6 +26,12 @@ contract StringsTester { return b.toCell(); } + get fun dynamicStringCell2(): Cell { + let b: StringBuilder = beginString(); + b = b.concat("Hello,").concat(" ").concat("World!"); + return b.toCell(); + } + get fun dynamicCommentCell(): Cell { let b: StringBuilder = beginComment(); b.append("Something something world!"); diff --git a/stdlib/std/text.tact b/stdlib/std/text.tact index acaba4477..abc73cfa8 100644 --- a/stdlib/std/text.tact +++ b/stdlib/std/text.tact @@ -17,6 +17,9 @@ native beginStringFromBuilder(b: Builder): StringBuilder; @name(__tact_string_builder_append) extends mutates native append(self: StringBuilder, s: String); +@name(__tact_string_builder_append_not_mut) +extends native concat(self: StringBuilder, s: String): StringBuilder; + @name(__tact_string_builder_end) extends native toCell(self: StringBuilder): Cell; From c1f013f3bba294b3186fecf6cb8700abb7dfe663 Mon Sep 17 00:00:00 2001 From: Daniil Sedov <42098239+Gusarich@users.noreply.github.com> Date: Tue, 2 Apr 2024 14:07:05 +0300 Subject: [PATCH 3/6] fix: use maps instead of objects for tables of globals (#208) to avoid issues with `toString`, `valueOf`, etc. that exist for JS objects and clash with Tact's builtins when querying e.g. the global functions map --- CHANGELOG.md | 1 + src/abi/global.ts | 36 ++--- src/abi/map.ts | 16 +- src/abi/struct.ts | 8 +- src/generator/writers/writeExpression.ts | 19 ++- .../resolveStatements.spec.ts.snap | 77 +++++++++ src/types/resolveDescriptors.ts | 151 +++++++++--------- src/types/resolveExpression.ts | 16 +- src/types/resolveStatements.ts | 15 +- src/types/stmts-failed/case-30.tact | 9 ++ src/types/stmts/case-10.tact | 14 ++ src/types/stmts/case-11.tact | 6 + src/types/stmts/case-12.tact | 17 ++ 13 files changed, 253 insertions(+), 132 deletions(-) create mode 100644 src/types/stmts-failed/case-30.tact create mode 100644 src/types/stmts/case-10.tact create mode 100644 src/types/stmts/case-11.tact create mode 100644 src/types/stmts/case-12.tact diff --git a/CHANGELOG.md b/CHANGELOG.md index b3d154549..4b27b351b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `@stdlib/stoppable` now imports `@stdlib/ownable` so the programmer does not have to do it separately: PR [#193](https://github.com/tact-lang/tact/pull/193) ### Fixed +- Incorrect "already exists" errors when using names such as `toString` or `valueOf`: PR [#208](https://github.com/tact-lang/tact/pull/208) ## [1.2.0] - 2024-02-29 diff --git a/src/abi/global.ts b/src/abi/global.ts index 7265dc589..6f756f8cb 100644 --- a/src/abi/global.ts +++ b/src/abi/global.ts @@ -8,8 +8,8 @@ import { getErrorId } from "../types/resolveErrors"; import { AbiFunction } from "./AbiFunction"; import { sha256_sync } from "@ton/crypto"; -export const GlobalFunctions: { [key: string]: AbiFunction } = { - ton: { +export const GlobalFunctions: Map = new Map([ + ['ton', { name: 'ton', resolve: (ctx, args, ref) => { if (args.length !== 1) { @@ -30,8 +30,8 @@ export const GlobalFunctions: { [key: string]: AbiFunction } = { const str = resolveConstantValue({ kind: 'ref', name: 'String', optional: false }, resolved[0], ctx.ctx) as string; return toNano(str).toString(10); } - }, - pow: { + }], + ['pow', { name: 'pow', resolve: (ctx, args, ref) => { if (args.length !== 2) { @@ -59,8 +59,8 @@ export const GlobalFunctions: { [key: string]: AbiFunction } = { const b = resolveConstantValue({ kind: 'ref', name: 'Int', optional: false }, resolved[1], ctx.ctx) as bigint; return (a ** b).toString(10); } - }, - require: { + }], + ['require', { name: 'require', resolve: (ctx, args, ref) => { if (args.length !== 2) { @@ -87,8 +87,8 @@ export const GlobalFunctions: { [key: string]: AbiFunction } = { const str = resolveConstantValue({ kind: 'ref', name: 'String', optional: false }, resolved[1], ctx.ctx) as string; return `throw_unless(${getErrorId(str, ctx.ctx)}, ${writeExpression(resolved[0], ctx)})`; } - }, - address: { + }], + ['address', { name: 'address', resolve: (ctx, args, ref) => { if (args.length !== 1) { @@ -122,8 +122,8 @@ export const GlobalFunctions: { [key: string]: AbiFunction } = { ctx.used(res); return res + '()'; } - }, - cell: { + }], + ['cell', { name: 'cell', resolve: (ctx, args, ref) => { if (args.length !== 1) { @@ -156,8 +156,8 @@ export const GlobalFunctions: { [key: string]: AbiFunction } = { ctx.used(res); return `${res}()`; } - }, - dump: { + }], + ['dump', { name: 'dump', resolve: (ctx, args, ref) => { if (args.length !== 1) { @@ -196,8 +196,8 @@ export const GlobalFunctions: { [key: string]: AbiFunction } = { throwError('dump() not supported for argument', ref); } } - }, - emptyMap: { + }], + ['emptyMap', { name: 'emptyMap', resolve: (ctx, args, ref) => { if (args.length !== 0) { @@ -208,8 +208,8 @@ export const GlobalFunctions: { [key: string]: AbiFunction } = { generate: (_ctx, _args, _resolved, _ref) => { return 'null()'; } - }, - sha256: { + }], + ['sha256', { name: 'sha256', resolve: (ctx, args, ref) => { if (args.length !== 1) { @@ -254,5 +254,5 @@ export const GlobalFunctions: { [key: string]: AbiFunction } = { throwError('sha256 expects string or slice argument', ref); } - } -} + }] +]) diff --git a/src/abi/map.ts b/src/abi/map.ts index 7e72d1516..881e7f36f 100644 --- a/src/abi/map.ts +++ b/src/abi/map.ts @@ -4,8 +4,8 @@ import { throwError } from "../grammar/ast"; import { getType } from "../types/resolveDescriptors"; import { AbiFunction } from "./AbiFunction"; -export const MapFunctions: { [key: string]: AbiFunction } = { - set: { +export const MapFunctions: Map = new Map([ + ['set', { name: 'set', resolve(ctx, args, ref) { @@ -152,8 +152,8 @@ export const MapFunctions: { [key: string]: AbiFunction } = { throwError(`set expects a map with Int keys`, ref); } - }, - get: { + }], + ['get', { name: 'get', resolve(ctx, args, ref) { @@ -277,8 +277,8 @@ export const MapFunctions: { [key: string]: AbiFunction } = { throwError(`set expects a map with Int keys`, ref); } - }, - asCell: { + }], + ['asCell', { name: 'asCell', resolve(ctx, args, ref) { @@ -304,5 +304,5 @@ export const MapFunctions: { [key: string]: AbiFunction } = { return writeExpression(exprs[0], ctx); } - } -} \ No newline at end of file + }] +]); diff --git a/src/abi/struct.ts b/src/abi/struct.ts index 5d2fc7a90..e8656b35d 100644 --- a/src/abi/struct.ts +++ b/src/abi/struct.ts @@ -4,8 +4,8 @@ import { throwError } from "../grammar/ast"; import { getType } from "../types/resolveDescriptors"; import { AbiFunction } from "./AbiFunction"; -export const StructFunctions: { [key: string]: AbiFunction } = { - toCell: { +export const StructFunctions: Map = new Map([ + ['toCell', { name: 'toCell', resolve: (ctx, args, ref) => { if (args.length !== 1) { @@ -29,5 +29,5 @@ export const StructFunctions: { [key: string]: AbiFunction } = { } return `${ops.writerCell(args[0].name, ctx)}(${resolved.map((v) => writeExpression(v, ctx)).join(', ')})`; } - } -} \ No newline at end of file + }] +]); diff --git a/src/generator/writers/writeExpression.ts b/src/generator/writers/writeExpression.ts index e0eff15b5..0dc1deb42 100644 --- a/src/generator/writers/writeExpression.ts +++ b/src/generator/writers/writeExpression.ts @@ -471,8 +471,8 @@ export function writeExpression(f: ASTExpression, ctx: WriterContext): string { if (f.kind === 'op_static_call') { // Check global functions - if (GlobalFunctions[f.name]) { - return GlobalFunctions[f.name].generate(ctx, + if (GlobalFunctions.has(f.name)) { + return GlobalFunctions.get(f.name)!.generate(ctx, f.args.map((v) => getExpType(ctx.ctx, v)), f.args, f.ref); @@ -531,9 +531,14 @@ export function writeExpression(f: ASTExpression, ctx: WriterContext): string { // Check struct ABI if (t.kind === 'struct') { - const abi = StructFunctions[f.name]; - if (abi) { - return abi.generate(ctx, [src, ...f.args.map((v) => getExpType(ctx.ctx, v))], [f.src, ...f.args], f.ref); + if (StructFunctions.has(f.name)) { + const abi = StructFunctions.get(f.name)!; + return abi.generate( + ctx, + [src, ...f.args.map((v) => getExpType(ctx.ctx, v))], + [f.src, ...f.args], + f.ref + ); } } @@ -577,10 +582,10 @@ export function writeExpression(f: ASTExpression, ctx: WriterContext): string { // Map types if (src.kind === 'map') { - const abf = MapFunctions[f.name]; - if (!abf) { + if (!MapFunctions.has(f.name)) { throwError(`Map function "${f.name}" not found`, f.ref); } + const abf = MapFunctions.get(f.name)!; return abf.generate(ctx, [src, ...f.args.map((v) => getExpType(ctx.ctx, v))], [f.src, ...f.args], f.ref); } diff --git a/src/types/__snapshots__/resolveStatements.spec.ts.snap b/src/types/__snapshots__/resolveStatements.spec.ts.snap index c09d918ed..a873302e2 100644 --- a/src/types/__snapshots__/resolveStatements.spec.ts.snap +++ b/src/types/__snapshots__/resolveStatements.spec.ts.snap @@ -300,6 +300,16 @@ Line 5, col 39: " `; +exports[`resolveStatements should fail statements for case-30 1`] = ` +":7:9: Static function "toString" does not exist +Line 7, col 9: + 6 | init() { +> 7 | toString(); // non-existent function + ^~~~~~~~~~ + 8 | } +" +`; + exports[`resolveStatements should resolve statements for case-0 1`] = ` [ [ @@ -812,3 +822,70 @@ exports[`resolveStatements should resolve statements for case-9 1`] = ` ], ] `; + +exports[`resolveStatements should resolve statements for case-10 1`] = ` +[ + [ + "123", + "Int", + ], + [ + "toString()", + "Int", + ], +] +`; + +exports[`resolveStatements should resolve statements for case-11 1`] = ` +[ + [ + "1", + "Int", + ], + [ + "toString", + "Int", + ], + [ + "dump(toString)", + "", + ], +] +`; + +exports[`resolveStatements should resolve statements for case-12 1`] = ` +[ + [ + "a", + "Int", + ], + [ + "b", + "Int", + ], + [ + "a + b", + "Int", + ], + [ + "2", + "Int", + ], + [ + "(a + b) / 2", + "Int", + ], + [ + "1", + "Int", + ], + [ + "10", + "Int", + ], + [ + "valueOf(1, 10)", + "Int", + ], +] +`; diff --git a/src/types/resolveDescriptors.ts b/src/types/resolveDescriptors.ts index bb025f670..1c7eb53c8 100644 --- a/src/types/resolveDescriptors.ts +++ b/src/types/resolveDescriptors.ts @@ -104,9 +104,9 @@ export function resolveTypeRef(ctx: CompilerContext, src: ASTTypeRef): TypeRef { throw Error('Invalid type ref'); } -function buildTypeRef(src: ASTTypeRef, types: { [key: string]: TypeDescription }): TypeRef { +function buildTypeRef(src: ASTTypeRef, types: Map): TypeRef { if (src.kind === 'type_ref_simple') { - if (!types[src.name]) { + if (!types.has(src.name)) { throwError('Type ' + src.name + ' not found', src.ref); } return { @@ -116,10 +116,10 @@ function buildTypeRef(src: ASTTypeRef, types: { [key: string]: TypeDescription } }; } if (src.kind === 'type_ref_map') { - if (!types[src.key]) { + if (!types.has(src.key)) { throwError('Type ' + src.key + ' not found', src.ref); } - if (!types[src.value]) { + if (!types.has(src.value)) { throwError('Type ' + src.value + ' not found', src.ref); } return { @@ -140,19 +140,19 @@ function buildTypeRef(src: ASTTypeRef, types: { [key: string]: TypeDescription } throw Error('Unknown type ref'); } -function uidForName(name: string, types: { [key: string]: TypeDescription }) { +function uidForName(name: string, types: Map) { // Resolve unique typeid from crc16 let uid = crc16(name); - while (Object.values(types).find((v) => v.uid === uid)) { + while (Array.from(types.values()).find((v) => v.uid === uid)) { uid = (uid + 1) % 65536; } return uid; } export function resolveDescriptors(ctx: CompilerContext) { - const types: { [key: string]: TypeDescription } = {}; - const staticFunctions: { [key: string]: FunctionDescription } = {}; - const staticConstants: { [key: string]: ConstantDescription } = {}; + const types: Map = new Map(); + const staticFunctions: Map = new Map(); + const staticConstants: Map = new Map(); const ast = getRawAST(ctx); // @@ -160,14 +160,14 @@ export function resolveDescriptors(ctx: CompilerContext) { // for (const a of ast.types) { - if (types[a.name]) { + if (types.has(a.name)) { throwError(`Type ${a.name} already exists`, a.ref); } const uid = uidForName(a.name, types); if (a.kind === 'primitive') { - types[a.name] = { + types.set(a.name, { kind: 'primitive', origin: a.origin, name: a.name, @@ -185,9 +185,9 @@ export function resolveDescriptors(ctx: CompilerContext) { interfaces: [], constants: [], partialFieldCount: 0 - }; + }); } else if (a.kind === 'def_contract') { - types[a.name] = { + types.set(a.name, { kind: 'contract', origin: a.origin, name: a.name, @@ -205,9 +205,9 @@ export function resolveDescriptors(ctx: CompilerContext) { interfaces: a.attributes.filter((v) => v.type === 'interface').map((v) => v.name.value), constants: [], partialFieldCount: 0 - }; + }); } else if (a.kind === 'def_struct') { - types[a.name] = { + types.set(a.name, { kind: 'struct', origin: a.origin, name: a.name, @@ -225,9 +225,9 @@ export function resolveDescriptors(ctx: CompilerContext) { interfaces: [], constants: [], partialFieldCount: 0 - }; + }); } else if (a.kind === 'def_trait') { - types[a.name] = { + types.set(a.name, { kind: 'trait', origin: a.origin, name: a.name, @@ -245,7 +245,7 @@ export function resolveDescriptors(ctx: CompilerContext) { interfaces: a.attributes.filter((v) => v.type === 'interface').map((v) => v.name.value), constants: [], partialFieldCount: 0 - }; + }); } } @@ -285,24 +285,24 @@ export function resolveDescriptors(ctx: CompilerContext) { if (a.kind === 'def_contract') { for (const f of a.declarations) { if (f.kind === 'def_field') { - if (types[a.name].fields.find((v) => v.name === f.name)) { + if (types.get(a.name)!.fields.find((v) => v.name === f.name)) { throwError(`Field ${f.name} already exists`, f.ref); } - if (types[a.name].constants.find((v) => v.name === f.name)) { + if (types.get(a.name)!.constants.find((v) => v.name === f.name)) { throwError(`Constant ${f.name} already exists`, f.ref); } - types[a.name].fields.push(buildFieldDescription(f, types[a.name].fields.length)); + types.get(a.name)!.fields.push(buildFieldDescription(f, types.get(a.name)!.fields.length)); } else if (f.kind === 'def_constant') { - if (types[a.name].fields.find((v) => v.name === f.name)) { + if (types.get(a.name)!.fields.find((v) => v.name === f.name)) { throwError(`Field ${f.name} already exists`, f.ref); } - if (types[a.name].constants.find((v) => v.name === f.name)) { + if (types.get(a.name)!.constants.find((v) => v.name === f.name)) { throwError(`Constant ${f.name} already exists`, f.ref); } if (f.attributes.find((v) => v.type !== 'overrides')) { throwError(`Constant can be only overridden`, f.ref); } - types[a.name].constants.push(buildConstantDescription(f)); + types.get(a.name)!.constants.push(buildConstantDescription(f)); } } } @@ -311,10 +311,10 @@ export function resolveDescriptors(ctx: CompilerContext) { if (a.kind === 'def_struct') { for (const f of a.fields) { - if (types[a.name].fields.find((v) => v.name === f.name)) { + if (types.get(a.name)!.fields.find((v) => v.name === f.name)) { throwError(`Field ${f.name} already exists`, f.ref); } - types[a.name].fields.push(buildFieldDescription(f, types[a.name].fields.length)); + types.get(a.name)!.fields.push(buildFieldDescription(f, types.get(a.name)!.fields.length)); } if (a.fields.length === 0 && !a.message) { throwError(`Struct ${a.name} must have at least one field`, a.ref); @@ -325,18 +325,18 @@ export function resolveDescriptors(ctx: CompilerContext) { if (a.kind === 'def_trait') { for (const f of a.declarations) { if (f.kind === 'def_field') { - if (types[a.name].fields.find((v) => v.name === f.name)) { + if (types.get(a.name)!.fields.find((v) => v.name === f.name)) { throwError(`Field ${f.name} already exists`, f.ref); } if (f.as) { throwError(`Trait field cannot have serialization specifier`, f.ref); } - types[a.name].fields.push(buildFieldDescription(f, types[a.name].fields.length)); + types.get(a.name)!.fields.push(buildFieldDescription(f, types.get(a.name)!.fields.length)); } else if (f.kind === 'def_constant') { - if (types[a.name].fields.find((v) => v.name === f.name)) { + if (types.get(a.name)!.fields.find((v) => v.name === f.name)) { throwError(`Field ${f.name} already exists`, f.ref); } - if (types[a.name].constants.find((v) => v.name === f.name)) { + if (types.get(a.name)!.constants.find((v) => v.name === f.name)) { throwError(`Constant ${f.name} already exists`, f.ref); } if (f.attributes.find((v) => v.type === 'overrides')) { @@ -345,7 +345,7 @@ export function resolveDescriptors(ctx: CompilerContext) { // if (f.attributes.find((v) => v.type === 'abstract')) { // continue; // Do not materialize abstract constants // } - types[a.name].constants.push(buildConstantDescription(f)); + types.get(a.name)!.constants.push(buildConstantDescription(f)); } } } @@ -355,8 +355,8 @@ export function resolveDescriptors(ctx: CompilerContext) { // Populate partial serialization info // - for (const t in types) { - types[t].partialFieldCount = resolvePartialFields(ctx, types[t]) + for (const t of types.values()) { + t.partialFieldCount = resolvePartialFields(ctx, t); } // @@ -439,7 +439,7 @@ export function resolveDescriptors(ctx: CompilerContext) { // Check virtual if (isVirtual) { - const t = types[self!]!; + const t = types.get(self!)!; if (t.kind !== 'trait') { throwError('Virtual functions must be defined within a trait', isVirtual.ref); } @@ -447,7 +447,7 @@ export function resolveDescriptors(ctx: CompilerContext) { // Check abstract if (isAbstract) { - const t = types[self!]!; + const t = types.get(self!)!; if (t.kind !== 'trait') { throwError('Abstract functions must be defined within a trait', isAbstract.ref); } @@ -455,7 +455,7 @@ export function resolveDescriptors(ctx: CompilerContext) { // Check overrides if (isOverrides) { - const t = types[self!]!; + const t = types.get(self!)!; if (t.kind !== 'contract') { throwError('Overrides functions must be defined within a contract', isOverrides.ref); } @@ -492,7 +492,7 @@ export function resolveDescriptors(ctx: CompilerContext) { if (args[0].type.optional) { throwError('Extend functions must have a non-optional type as the first argument', args[0].ref); } - if (!types[args[0].type.name]) { + if (!types.has(args[0].type.name)) { throwError('Type ' + args[0].type.name + ' not found', args[0].ref); } @@ -573,7 +573,7 @@ export function resolveDescriptors(ctx: CompilerContext) { for (const a of ast.types) { if (a.kind === 'def_contract' || a.kind === 'def_trait') { - const s = types[a.name]; + const s = types.get(a.name)!; for (const d of a.declarations) { if (d.kind === 'def_function') { const f = resolveFunctionDescriptor(s.name, d, s.origin); @@ -611,7 +611,7 @@ export function resolveDescriptors(ctx: CompilerContext) { } // Check resolved argument type - const t = types[arg.type.name]; + const t = types.get(arg.type.name); if (!t) { throwError('Type ' + arg.type.name + ' not found', d.ref); } @@ -731,7 +731,7 @@ export function resolveDescriptors(ctx: CompilerContext) { ast: d }); } else { - const type = types[arg.type.name]; + const type = types.get(arg.type.name)!; if (type.ast.kind !== 'def_struct' || !type.ast.message) { throwError('Bounce receive function can only accept bounced message, message or Slice', d.ref); } @@ -753,7 +753,7 @@ export function resolveDescriptors(ctx: CompilerContext) { } } else if (arg.type.kind === "type_ref_bounced") { - const t = types[arg.type.name]; + const t = types.get(arg.type.name)!; if (t.kind !== 'struct') { throwError('Bounce receive function can only accept bounced struct types', d.ref); } @@ -793,8 +793,7 @@ export function resolveDescriptors(ctx: CompilerContext) { // Check for missing init methods // - for (const k in types) { - const t = types[k]; + for (const t of types.values()) { if (t.kind === 'contract') { if (!t.init) { t.init = { @@ -814,8 +813,7 @@ export function resolveDescriptors(ctx: CompilerContext) { // Flatten and resolve traits // - for (const k in types) { - const t = types[k]; + for (const t of types.values()) { if (t.ast.kind === 'def_trait' || t.ast.kind === 'def_contract') { // Flatten traits @@ -827,7 +825,7 @@ export function resolveDescriptors(ctx: CompilerContext) { if (visited.has(name)) { return; } - const tt = types[name]; + const tt = types.get(name); if (!tt) { throwError('Trait ' + name + ' not found', t.ast.ref) } @@ -858,21 +856,19 @@ export function resolveDescriptors(ctx: CompilerContext) { // Verify trait fields // - for (const k in types) { - const t = types[k]; - + for (const t of types.values()) { for (const tr of t.traits) { // Check that trait is valid - if (!types[tr.name]) { + if (!types.has(tr.name)) { throwError('Trait ' + tr.name + ' not found', t.ast.ref); } - if (types[tr.name].kind !== 'trait') { + if (types.get(tr.name)!.kind !== 'trait') { throwError('Type ' + tr.name + ' is not a trait', t.ast.ref); } // Check that trait has all required fields - const ttr = types[tr.name]; + const ttr = types.get(tr.name)!; for (const f of ttr.fields) { // Check if field exists @@ -1024,24 +1020,24 @@ export function resolveDescriptors(ctx: CompilerContext) { return; } if (processing.has(name)) { - throwError(`Circular dependency detected for type ${name}`, types[name].ast.ref); + throwError(`Circular dependency detected for type ${name}`, types.get(name)!.ast.ref); } processing.has(name); // Process dependencies first - const dependencies = Object.values(types).filter((v) => v.traits.find((v2) => v2.name === name)); + const dependencies = Array.from(types.values()).filter((v) => v.traits.find((v2) => v2.name === name)); for (const d of dependencies) { processType(d.name); } // Copy traits - copyTraits(types[name]); + copyTraits(types.get(name)!); // Mark as processed processed.add(name); processing.delete(name); } - for (const k in types) { + for (const k of types.keys()) { processType(k); } @@ -1049,12 +1045,11 @@ export function resolveDescriptors(ctx: CompilerContext) { // Register dependencies // - for (const k in types) { - const t = types[k]; + for (const [k, t] of types) { const dependsOn = new Set(); const handler = (src: ASTNode) => { if (src.kind === 'init_of') { - if (!types[src.name]) { + if (!types.has(src.name)) { throwError(`Type ${src.name} not found`, src.ref); } dependsOn.add(src.name); @@ -1072,7 +1067,7 @@ export function resolveDescriptors(ctx: CompilerContext) { // Add dependencies for (const s of dependsOn) { if (s !== k) { - t.dependsOn.push(types[s]!); + t.dependsOn.push(types.get(s)!); } } } @@ -1082,7 +1077,7 @@ export function resolveDescriptors(ctx: CompilerContext) { // function collectTransient(name: string, to: Set) { - const t = types[name]; + const t = types.get(name)!; for (const d of t.dependsOn) { if (to.has(d.name)) { continue; @@ -1091,13 +1086,13 @@ export function resolveDescriptors(ctx: CompilerContext) { collectTransient(d.name, to); } } - for (const k in types) { + for (const k of types.keys()) { const dependsOn = new Set(); dependsOn.add(k); collectTransient(k, dependsOn); for (const s of dependsOn) { - if (s !== k && !types[k].dependsOn.find((v) => v.name === s)) { - types[k].dependsOn.push(types[s]!); + if (s !== k && !types.get(k)!.dependsOn.find((v) => v.name === s)) { + types.get(k)!.dependsOn.push(types.get(s)!); } } } @@ -1109,18 +1104,18 @@ export function resolveDescriptors(ctx: CompilerContext) { for (const a of ast.functions) { const r = resolveFunctionDescriptor(null, a, a.origin); if (r.self) { - if (types[r.self].functions.has(r.name)) { + if (types.get(r.self)!.functions.has(r.name)) { throwError(`Function ${r.name} already exists in type ${r.self}`, r.ast.ref); } - types[r.self].functions.set(r.name, r); + types.get(r.self)!.functions.set(r.name, r); } else { - if (staticFunctions[r.name]) { + if (staticFunctions.has(r.name)) { throwError(`Static function ${r.name} already exists`, r.ast.ref); } - if (staticConstants[r.name]) { + if (staticConstants.has(r.name)) { throwError(`Static constant ${r.name} already exists`, a.ref); } - staticFunctions[r.name] = r; + staticFunctions.set(r.name, r); } } @@ -1129,27 +1124,27 @@ export function resolveDescriptors(ctx: CompilerContext) { // for (const a of ast.constants) { - if (staticConstants[a.name]) { + if (staticConstants.has(a.name)) { throwError(`Static constant ${a.name} already exists`, a.ref); } - if (staticFunctions[a.name]) { + if (staticFunctions.has(a.name)) { throwError(`Static function ${a.name} already exists`, a.ref); } - staticConstants[a.name] = buildConstantDescription(a); + staticConstants.set(a.name, buildConstantDescription(a)); } // // Register types and functions in context // - for (const t in types) { - ctx = store.set(ctx, t, types[t]); + for (const [k, t] of types) { + ctx = store.set(ctx, k, t); } - for (const t in staticFunctions) { - ctx = staticFunctionsStore.set(ctx, t, staticFunctions[t]); + for (const [k, t] of staticFunctions) { + ctx = staticFunctionsStore.set(ctx, k, t); } - for (const t in staticConstants) { - ctx = staticConstantsStore.set(ctx, t, staticConstants[t]); + for (const [k, t] of staticConstants) { + ctx = staticConstantsStore.set(ctx, k, t); } return ctx; diff --git a/src/types/resolveExpression.ts b/src/types/resolveExpression.ts index 360fd8de1..871f97082 100644 --- a/src/types/resolveExpression.ts +++ b/src/types/resolveExpression.ts @@ -239,8 +239,8 @@ function resolveField(exp: ASTOpField, sctx: StatementContext, ctx: CompilerCont function resolveStaticCall(exp: ASTOpCallStatic, sctx: StatementContext, ctx: CompilerContext): CompilerContext { // Check if abi global function - if (GlobalFunctions[exp.name]) { - const f = GlobalFunctions[exp.name]; + if (GlobalFunctions.has(exp.name)) { + const f = GlobalFunctions.get(exp.name)!; // Resolve arguments for (const e of exp.args) { @@ -317,8 +317,8 @@ function resolveCall(exp: ASTOpCall, sctx: StatementContext, ctx: CompilerContex // Check struct ABI if (srcT.kind === 'struct') { - const abi = StructFunctions[exp.name]; - if (abi) { + if (StructFunctions.has(exp.name)) { + const abi = StructFunctions.get(exp.name)!; const resolved = abi.resolve(ctx, [src, ...exp.args.map((v) => getExpType(ctx, v))], exp.ref); return registerExpType(ctx, exp, resolved); } @@ -347,10 +347,10 @@ function resolveCall(exp: ASTOpCall, sctx: StatementContext, ctx: CompilerContex // Handle map if (src.kind === 'map') { - const abf = MapFunctions[exp.name]; - if (!abf) { + if (!MapFunctions.has(exp.name)) { throwError(`Map function "${exp.name}" not found`, exp.ref); } + const abf = MapFunctions.get(exp.name)!; const resolved = abf.resolve(ctx, [src, ...exp.args.map((v) => getExpType(ctx, v))], exp.ref); return registerExpType(ctx, exp, resolved); } @@ -418,7 +418,7 @@ export function resolveConditional(ast: ASTConditional, sctx: StatementContext, export function resolveLValueRef(path: ASTLvalueRef[], sctx: StatementContext, ctx: CompilerContext): CompilerContext { const paths: ASTLvalueRef[] = path; - let t = sctx.vars[paths[0].name]; + let t = sctx.vars.get(paths[0].name); if (!t) { throwError(`Variable "${paths[0].name}" not found`, paths[0].ref); } @@ -487,7 +487,7 @@ export function resolveExpression(exp: ASTExpression, sctx: StatementContext, ct if (exp.kind === 'id') { // Find variable - const v = sctx.vars[exp.value]; + const v = sctx.vars.get(exp.value); if (!v) { if (!hasStaticConstant(ctx, exp.value)) { throwError('Unable to resolve id ' + exp.value, exp.ref); diff --git a/src/types/resolveStatements.ts b/src/types/resolveStatements.ts index cfbe48df6..0f80759ca 100644 --- a/src/types/resolveStatements.ts +++ b/src/types/resolveStatements.ts @@ -8,7 +8,7 @@ import { printTypeRef, TypeRef } from "./types"; export type StatementContext = { root: ASTRef, returns: TypeRef, - vars: { [name: string]: TypeRef }; + vars: Map; requiredFields: string[]; }; @@ -16,7 +16,7 @@ function emptyContext(root: ASTRef, returns: TypeRef): StatementContext { return { root, returns, - vars: {}, + vars: new Map(), requiredFields: [] }; } @@ -46,16 +46,13 @@ function removeRequiredVariable(name: string, src: StatementContext): StatementC } function addVariable(name: string, ref: TypeRef, src: StatementContext): StatementContext { - if (src.vars[name]) { + if (src.vars.has(name)) { throw Error('Variable already exists: ' + name); // Should happen earlier } return { ...src, - vars: { - ...src.vars, - [name]: ref - } - }; + vars: new Map(src.vars).set(name, ref) + } } function processCondition(condition: ASTCondition, sctx: StatementContext, ctx: CompilerContext): { ctx: CompilerContext, sctx: StatementContext } { @@ -141,7 +138,7 @@ function processStatements(statements: ASTStatement[], sctx: StatementContext, c } // Add variable to statement context - if (sctx.vars[s.name]) { + if (sctx.vars.has(s.name)) { throwError(`Variable already exists: ${s.name}`, s.ref); } sctx = addVariable(s.name, variableType, sctx); diff --git a/src/types/stmts-failed/case-30.tact b/src/types/stmts-failed/case-30.tact new file mode 100644 index 000000000..70c1d724c --- /dev/null +++ b/src/types/stmts-failed/case-30.tact @@ -0,0 +1,9 @@ +import "@stdlib/deploy"; + +trait BaseTrait { } + +contract SampleTactContract { + init() { + toString(); // non-existent function + } +} \ No newline at end of file diff --git a/src/types/stmts/case-10.tact b/src/types/stmts/case-10.tact new file mode 100644 index 000000000..ef35a06f1 --- /dev/null +++ b/src/types/stmts/case-10.tact @@ -0,0 +1,14 @@ +import "@stdlib/deploy"; +primitive Int; + +trait BaseTrait { } + +fun toString(): Int { + return 123; +} + +contract SampleTactContract { + init() { + toString(); + } +} \ No newline at end of file diff --git a/src/types/stmts/case-11.tact b/src/types/stmts/case-11.tact new file mode 100644 index 000000000..571d7e457 --- /dev/null +++ b/src/types/stmts/case-11.tact @@ -0,0 +1,6 @@ +primitive Int; + +fun testFunction() { + let toString: Int = 1; + dump(toString); +} \ No newline at end of file diff --git a/src/types/stmts/case-12.tact b/src/types/stmts/case-12.tact new file mode 100644 index 000000000..a6d36ab35 --- /dev/null +++ b/src/types/stmts/case-12.tact @@ -0,0 +1,17 @@ +import "@stdlib/deploy"; + +primitive Int; + +trait BaseTrait { } + +fun valueOf(a: Int, b: Int): Int { + return (a + b) / 2; +} + +contract SampleTactContract { + init() { + } + get fun result(): Int { + return valueOf(1, 10); + } +} \ No newline at end of file From 3b5f211f05771e99ec6c6e81b709807198badd9e Mon Sep 17 00:00:00 2001 From: Daniil Sedov <42098239+Gusarich@users.noreply.github.com> Date: Tue, 2 Apr 2024 20:28:45 +0300 Subject: [PATCH 4/6] feat: string escaping and escape backticks in generated TS error messages (#192) full support for `\n`, `\t`, etc. and Unicode escaping sequences --- CHANGELOG.md | 2 ++ src/bindings/writeTypescript.ts | 6 +++- src/generator/writers/writeExpression.ts | 39 +++++++++++++++++++++++- src/grammar/grammar.ohm | 15 +++++++-- src/grammar/grammar.ohm-bundle.d.ts | 14 ++++++++- src/grammar/grammar.ohm-bundle.js | 2 +- src/test/__snapshots__/bugs.spec.ts.snap | 8 ++--- src/test/bugs.spec.ts | 2 ++ src/test/bugs/bugs.tact | 3 +- src/test/bugs/issue53.tact | 6 ++++ src/test/feature-strings.spec.ts | 13 ++++++++ src/test/features/strings.tact | 18 +++++++++-- 12 files changed, 115 insertions(+), 13 deletions(-) create mode 100644 src/test/bugs/issue53.tact diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b27b351b..cde081cc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,9 +18,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update the `dump` function to handle addresses: PR [#175](https://github.com/tact-lang/tact/pull/175) - The implicit empty `init` function is now present by default in the contract if not declared: PR [#167](https://github.com/tact-lang/tact/pull/167) - `@stdlib/stoppable` now imports `@stdlib/ownable` so the programmer does not have to do it separately: PR [#193](https://github.com/tact-lang/tact/pull/193) +- Support escape sequences for strings (`\\`, `\"`, `\n`, `\r`, `\t`, `\v`, `\b`, `\f`, `\u{ABC}`, `\uABCD`, `\xAB`): PR [#192](https://github.com/tact-lang/tact/pull/192) ### Fixed - Incorrect "already exists" errors when using names such as `toString` or `valueOf`: PR [#208](https://github.com/tact-lang/tact/pull/208) +- Escape backticks in error messages for generated TypeScript code: PR [#192](https://github.com/tact-lang/tact/pull/192) ## [1.2.0] - 2024-02-29 diff --git a/src/bindings/writeTypescript.ts b/src/bindings/writeTypescript.ts index d4b56b74e..4715803e2 100644 --- a/src/bindings/writeTypescript.ts +++ b/src/bindings/writeTypescript.ts @@ -146,7 +146,11 @@ export function writeTypescript(abi: ContractABI, init?: { w.inIndent(() => { if (abi.errors) { for (const k in abi.errors) { - w.append(`${k}: { message: \`${abi.errors[parseInt(k, 10)].message}\` },`); + w.append( + `${k}: { message: \`${abi.errors[ + parseInt(k, 10) + ].message.replaceAll('`', '\\`')}\` },` + ); } } }); diff --git a/src/generator/writers/writeExpression.ts b/src/generator/writers/writeExpression.ts index 0dc1deb42..84c613a1f 100644 --- a/src/generator/writers/writeExpression.ts +++ b/src/generator/writers/writeExpression.ts @@ -132,7 +132,44 @@ export function writeExpression(f: ASTExpression, ctx: WriterContext): string { // if (f.kind === 'string') { - const id = writeString(f.value, ctx); + const s = f.value.replace(/\\\\|\\"|\\n|\\r|\\t|\\v|\\b|\\f|\\u{([0-9A-Fa-f]+)}|\\u([0-9A-Fa-f]{4})|\\x([0-9A-Fa-f]{2})/g, (match, unicodeCodePoint, unicodeEscape, hexEscape) => { + switch (match) { + case '\\\\': + return '\\'; + case '\\"': + return '"'; + case '\\n': + return '\n'; + case '\\r': + return '\r'; + case '\\t': + return '\t'; + case '\\v': + return '\v'; + case '\\b': + return '\b'; + case '\\f': + return '\f'; + default: + // Handle Unicode code point escape + if (unicodeCodePoint) { + const codePoint = parseInt(unicodeCodePoint, 16); + return String.fromCodePoint(codePoint); + } + // Handle Unicode escape + if (unicodeEscape) { + const codeUnit = parseInt(unicodeEscape, 16); + return String.fromCharCode(codeUnit); + } + // Handle hex escape + if (hexEscape) { + const hexValue = parseInt(hexEscape, 16); + return String.fromCharCode(hexValue); + } + return match; + } + }); + const id = writeString(s, ctx); ctx.used(id); return `${id}()`; } diff --git a/src/grammar/grammar.ohm b/src/grammar/grammar.ohm index 1daf08d45..8a4f8b103 100644 --- a/src/grammar/grammar.ohm +++ b/src/grammar/grammar.ohm @@ -215,8 +215,19 @@ Tact { boolLiteral = ("true" | "false") ~idPart // String literal - stringLiteralCharacter = ~("\"" | "\\" | lineTerminator) any - stringLiteral = "\"" stringLiteralCharacter* "\"" + stringLiteral = "\"" (nonQuoteOrBackslashChar | escapeSequence)* "\"" + nonQuoteOrBackslashChar = ~("\"" | "\\") any + escapeSequence = "\\\\" -- backslash + | "\\\"" -- doubleQuote + | "\\n" -- newline + | "\\r" -- carriageReturn + | "\\t" -- tab + | "\\v" -- verticalTab + | "\\b" -- backspace + | "\\f" -- formFeed + | "\\u{" hexDigit hexDigit? hexDigit? hexDigit? hexDigit? hexDigit? "}" -- unicodeCodePoint + | "\\u" hexDigit hexDigit hexDigit hexDigit -- unicodeEscape + | "\\x" hexDigit hexDigit -- hexEscape // Keywords // NOTE Order is important diff --git a/src/grammar/grammar.ohm-bundle.d.ts b/src/grammar/grammar.ohm-bundle.d.ts index 9c26303a7..b9b71fb54 100644 --- a/src/grammar/grammar.ohm-bundle.d.ts +++ b/src/grammar/grammar.ohm-bundle.d.ts @@ -162,8 +162,20 @@ export interface TactActionDict extends ActionDict { funcLetter?: (this: NonterminalNode, arg0: NonterminalNode | TerminalNode) => T; funcId?: (this: NonterminalNode, arg0: NonterminalNode, arg1: IterationNode) => T; boolLiteral?: (this: NonterminalNode, arg0: TerminalNode) => T; - stringLiteralCharacter?: (this: NonterminalNode, arg0: NonterminalNode) => T; stringLiteral?: (this: NonterminalNode, arg0: TerminalNode, arg1: IterationNode, arg2: TerminalNode) => T; + nonQuoteOrBackslashChar?: (this: NonterminalNode, arg0: NonterminalNode) => T; + escapeSequence_backslash?: (this: NonterminalNode, arg0: TerminalNode) => T; + escapeSequence_doubleQuote?: (this: NonterminalNode, arg0: TerminalNode) => T; + escapeSequence_newline?: (this: NonterminalNode, arg0: TerminalNode) => T; + escapeSequence_carriageReturn?: (this: NonterminalNode, arg0: TerminalNode) => T; + escapeSequence_tab?: (this: NonterminalNode, arg0: TerminalNode) => T; + escapeSequence_verticalTab?: (this: NonterminalNode, arg0: TerminalNode) => T; + escapeSequence_backspace?: (this: NonterminalNode, arg0: TerminalNode) => T; + escapeSequence_formFeed?: (this: NonterminalNode, arg0: TerminalNode) => T; + escapeSequence_unicodeCodePoint?: (this: NonterminalNode, arg0: TerminalNode, arg1: NonterminalNode, arg2: IterationNode, arg3: IterationNode, arg4: IterationNode, arg5: IterationNode, arg6: IterationNode, arg7: TerminalNode) => T; + escapeSequence_unicodeEscape?: (this: NonterminalNode, arg0: TerminalNode, arg1: NonterminalNode, arg2: NonterminalNode, arg3: NonterminalNode, arg4: NonterminalNode) => T; + escapeSequence_hexEscape?: (this: NonterminalNode, arg0: TerminalNode, arg1: NonterminalNode, arg2: NonterminalNode) => T; + escapeSequence?: (this: NonterminalNode, arg0: NonterminalNode) => T; keyword?: (this: NonterminalNode, arg0: NonterminalNode) => T; contract?: (this: NonterminalNode, arg0: TerminalNode) => T; let?: (this: NonterminalNode, arg0: TerminalNode) => T; diff --git a/src/grammar/grammar.ohm-bundle.js b/src/grammar/grammar.ohm-bundle.js index ef536397a..c6d1bb093 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 \";\"\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 stringLiteral = \"\\\"\" (nonQuoteOrBackslashChar | escapeSequence)* \"\\\"\"\n nonQuoteOrBackslashChar = ~(\"\\\"\" | \"\\\\\") any\n escapeSequence = \"\\\\\\\\\" -- backslash\n | \"\\\\\\\"\" -- doubleQuote\n | \"\\\\n\" -- newline\n | \"\\\\r\" -- carriageReturn\n | \"\\\\t\" -- tab\n | \"\\\\v\" -- verticalTab\n | \"\\\\b\" -- backspace\n | \"\\\\f\" -- formFeed\n | \"\\\\u{\" hexDigit hexDigit? hexDigit? hexDigit? hexDigit? hexDigit? \"}\" -- unicodeCodePoint\n | \"\\\\u\" hexDigit hexDigit hexDigit hexDigit -- unicodeEscape\n | \"\\\\x\" hexDigit hexDigit -- hexEscape\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",[]]]]],"stringLiteral":["define",{"sourceInterval":[9801,9870]},null,[],["seq",{"sourceInterval":[9817,9870]},["terminal",{"sourceInterval":[9817,9821]},"\""],["star",{"sourceInterval":[9822,9865]},["alt",{"sourceInterval":[9823,9863]},["app",{"sourceInterval":[9823,9846]},"nonQuoteOrBackslashChar",[]],["app",{"sourceInterval":[9849,9863]},"escapeSequence",[]]]],["terminal",{"sourceInterval":[9866,9870]},"\""]]],"nonQuoteOrBackslashChar":["define",{"sourceInterval":[9875,9919]},null,[],["seq",{"sourceInterval":[9901,9919]},["not",{"sourceInterval":[9901,9915]},["alt",{"sourceInterval":[9903,9914]},["terminal",{"sourceInterval":[9903,9907]},"\""],["terminal",{"sourceInterval":[9910,9914]},"\\"]]],["app",{"sourceInterval":[9916,9919]},"any",[]]]],"escapeSequence_backslash":["define",{"sourceInterval":[9941,9960]},null,[],["terminal",{"sourceInterval":[9941,9947]},"\\\\"]],"escapeSequence_doubleQuote":["define",{"sourceInterval":[9982,10003]},null,[],["terminal",{"sourceInterval":[9982,9988]},"\\\""]],"escapeSequence_newline":["define",{"sourceInterval":[10025,10041]},null,[],["terminal",{"sourceInterval":[10025,10030]},"\\n"]],"escapeSequence_carriageReturn":["define",{"sourceInterval":[10063,10086]},null,[],["terminal",{"sourceInterval":[10063,10068]},"\\r"]],"escapeSequence_tab":["define",{"sourceInterval":[10108,10120]},null,[],["terminal",{"sourceInterval":[10108,10113]},"\\t"]],"escapeSequence_verticalTab":["define",{"sourceInterval":[10142,10162]},null,[],["terminal",{"sourceInterval":[10142,10147]},"\\v"]],"escapeSequence_backspace":["define",{"sourceInterval":[10184,10202]},null,[],["terminal",{"sourceInterval":[10184,10189]},"\\b"]],"escapeSequence_formFeed":["define",{"sourceInterval":[10224,10241]},null,[],["terminal",{"sourceInterval":[10224,10229]},"\\f"]],"escapeSequence_unicodeCodePoint":["define",{"sourceInterval":[10263,10352]},null,[],["seq",{"sourceInterval":[10263,10332]},["terminal",{"sourceInterval":[10263,10269]},"\\u{"],["app",{"sourceInterval":[10270,10278]},"hexDigit",[]],["opt",{"sourceInterval":[10279,10288]},["app",{"sourceInterval":[10279,10287]},"hexDigit",[]]],["opt",{"sourceInterval":[10289,10298]},["app",{"sourceInterval":[10289,10297]},"hexDigit",[]]],["opt",{"sourceInterval":[10299,10308]},["app",{"sourceInterval":[10299,10307]},"hexDigit",[]]],["opt",{"sourceInterval":[10309,10318]},["app",{"sourceInterval":[10309,10317]},"hexDigit",[]]],["opt",{"sourceInterval":[10319,10328]},["app",{"sourceInterval":[10319,10327]},"hexDigit",[]]],["terminal",{"sourceInterval":[10329,10332]},"}"]]],"escapeSequence_unicodeEscape":["define",{"sourceInterval":[10374,10432]},null,[],["seq",{"sourceInterval":[10374,10415]},["terminal",{"sourceInterval":[10374,10379]},"\\u"],["app",{"sourceInterval":[10380,10388]},"hexDigit",[]],["app",{"sourceInterval":[10389,10397]},"hexDigit",[]],["app",{"sourceInterval":[10398,10406]},"hexDigit",[]],["app",{"sourceInterval":[10407,10415]},"hexDigit",[]]]],"escapeSequence_hexEscape":["define",{"sourceInterval":[10454,10490]},null,[],["seq",{"sourceInterval":[10454,10477]},["terminal",{"sourceInterval":[10454,10459]},"\\x"],["app",{"sourceInterval":[10460,10468]},"hexDigit",[]],["app",{"sourceInterval":[10469,10477]},"hexDigit",[]]]],"escapeSequence":["define",{"sourceInterval":[9924,10490]},null,[],["alt",{"sourceInterval":[9941,10490]},["app",{"sourceInterval":[9941,9947]},"escapeSequence_backslash",[]],["app",{"sourceInterval":[9982,9988]},"escapeSequence_doubleQuote",[]],["app",{"sourceInterval":[10025,10030]},"escapeSequence_newline",[]],["app",{"sourceInterval":[10063,10068]},"escapeSequence_carriageReturn",[]],["app",{"sourceInterval":[10108,10113]},"escapeSequence_tab",[]],["app",{"sourceInterval":[10142,10147]},"escapeSequence_verticalTab",[]],["app",{"sourceInterval":[10184,10189]},"escapeSequence_backspace",[]],["app",{"sourceInterval":[10224,10229]},"escapeSequence_formFeed",[]],["app",{"sourceInterval":[10263,10332]},"escapeSequence_unicodeCodePoint",[]],["app",{"sourceInterval":[10374,10415]},"escapeSequence_unicodeEscape",[]],["app",{"sourceInterval":[10454,10477]},"escapeSequence_hexEscape",[]]]],"keyword":["define",{"sourceInterval":[10543,11056]},null,[],["alt",{"sourceInterval":[10553,11056]},["app",{"sourceInterval":[10553,10556]},"fun",[]],["app",{"sourceInterval":[10572,10575]},"let",[]],["app",{"sourceInterval":[10590,10596]},"return",[]],["app",{"sourceInterval":[10612,10618]},"extend",[]],["app",{"sourceInterval":[10634,10640]},"native",[]],["app",{"sourceInterval":[10656,10662]},"public",[]],["app",{"sourceInterval":[10678,10682]},"null",[]],["app",{"sourceInterval":[10698,10700]},"if",[]],["app",{"sourceInterval":[10716,10720]},"else",[]],["app",{"sourceInterval":[10736,10741]},"while",[]],["app",{"sourceInterval":[10757,10763]},"repeat",[]],["app",{"sourceInterval":[10779,10781]},"do",[]],["app",{"sourceInterval":[10797,10802]},"until",[]],["app",{"sourceInterval":[10818,10820]},"as",[]],["app",{"sourceInterval":[10837,10844]},"mutates",[]],["app",{"sourceInterval":[10859,10866]},"extends",[]],["app",{"sourceInterval":[10881,10887]},"import",[]],["app",{"sourceInterval":[10902,10906]},"with",[]],["app",{"sourceInterval":[10921,10926]},"trait",[]],["app",{"sourceInterval":[10941,10947]},"initOf",[]],["app",{"sourceInterval":[10962,10970]},"override",[]],["app",{"sourceInterval":[10985,10993]},"abstract",[]],["app",{"sourceInterval":[11008,11015]},"virtual",[]],["app",{"sourceInterval":[11030,11036]},"inline",[]],["app",{"sourceInterval":[11051,11056]},"const",[]]]],"contract":["define",{"sourceInterval":[11061,11090]},null,[],["seq",{"sourceInterval":[11072,11090]},["terminal",{"sourceInterval":[11072,11082]},"contract"],["not",{"sourceInterval":[11083,11090]},["app",{"sourceInterval":[11084,11090]},"idPart",[]]]]],"let":["define",{"sourceInterval":[11095,11114]},null,[],["seq",{"sourceInterval":[11101,11114]},["terminal",{"sourceInterval":[11101,11106]},"let"],["not",{"sourceInterval":[11107,11114]},["app",{"sourceInterval":[11108,11114]},"idPart",[]]]]],"fun":["define",{"sourceInterval":[11119,11138]},null,[],["seq",{"sourceInterval":[11125,11138]},["terminal",{"sourceInterval":[11125,11130]},"fun"],["not",{"sourceInterval":[11131,11138]},["app",{"sourceInterval":[11132,11138]},"idPart",[]]]]],"return":["define",{"sourceInterval":[11143,11168]},null,[],["seq",{"sourceInterval":[11152,11168]},["terminal",{"sourceInterval":[11152,11160]},"return"],["not",{"sourceInterval":[11161,11168]},["app",{"sourceInterval":[11162,11168]},"idPart",[]]]]],"extend":["define",{"sourceInterval":[11173,11198]},null,[],["seq",{"sourceInterval":[11182,11198]},["terminal",{"sourceInterval":[11182,11190]},"extend"],["not",{"sourceInterval":[11191,11198]},["app",{"sourceInterval":[11192,11198]},"idPart",[]]]]],"native":["define",{"sourceInterval":[11203,11228]},null,[],["seq",{"sourceInterval":[11212,11228]},["terminal",{"sourceInterval":[11212,11220]},"native"],["not",{"sourceInterval":[11221,11228]},["app",{"sourceInterval":[11222,11228]},"idPart",[]]]]],"public":["define",{"sourceInterval":[11233,11258]},null,[],["seq",{"sourceInterval":[11242,11258]},["terminal",{"sourceInterval":[11242,11250]},"public"],["not",{"sourceInterval":[11251,11258]},["app",{"sourceInterval":[11252,11258]},"idPart",[]]]]],"null":["define",{"sourceInterval":[11263,11284]},null,[],["seq",{"sourceInterval":[11270,11284]},["terminal",{"sourceInterval":[11270,11276]},"null"],["not",{"sourceInterval":[11277,11284]},["app",{"sourceInterval":[11278,11284]},"idPart",[]]]]],"if":["define",{"sourceInterval":[11289,11306]},null,[],["seq",{"sourceInterval":[11294,11306]},["terminal",{"sourceInterval":[11294,11298]},"if"],["not",{"sourceInterval":[11299,11306]},["app",{"sourceInterval":[11300,11306]},"idPart",[]]]]],"else":["define",{"sourceInterval":[11311,11332]},null,[],["seq",{"sourceInterval":[11318,11332]},["terminal",{"sourceInterval":[11318,11324]},"else"],["not",{"sourceInterval":[11325,11332]},["app",{"sourceInterval":[11326,11332]},"idPart",[]]]]],"while":["define",{"sourceInterval":[11337,11360]},null,[],["seq",{"sourceInterval":[11345,11360]},["terminal",{"sourceInterval":[11345,11352]},"while"],["not",{"sourceInterval":[11353,11360]},["app",{"sourceInterval":[11354,11360]},"idPart",[]]]]],"repeat":["define",{"sourceInterval":[11365,11390]},null,[],["seq",{"sourceInterval":[11374,11390]},["terminal",{"sourceInterval":[11374,11382]},"repeat"],["not",{"sourceInterval":[11383,11390]},["app",{"sourceInterval":[11384,11390]},"idPart",[]]]]],"do":["define",{"sourceInterval":[11395,11412]},null,[],["seq",{"sourceInterval":[11400,11412]},["terminal",{"sourceInterval":[11400,11404]},"do"],["not",{"sourceInterval":[11405,11412]},["app",{"sourceInterval":[11406,11412]},"idPart",[]]]]],"until":["define",{"sourceInterval":[11417,11440]},null,[],["seq",{"sourceInterval":[11425,11440]},["terminal",{"sourceInterval":[11425,11432]},"until"],["not",{"sourceInterval":[11433,11440]},["app",{"sourceInterval":[11434,11440]},"idPart",[]]]]],"as":["define",{"sourceInterval":[11445,11462]},null,[],["seq",{"sourceInterval":[11450,11462]},["terminal",{"sourceInterval":[11450,11454]},"as"],["not",{"sourceInterval":[11455,11462]},["app",{"sourceInterval":[11456,11462]},"idPart",[]]]]],"mutates":["define",{"sourceInterval":[11467,11494]},null,[],["seq",{"sourceInterval":[11477,11494]},["terminal",{"sourceInterval":[11477,11486]},"mutates"],["not",{"sourceInterval":[11487,11494]},["app",{"sourceInterval":[11488,11494]},"idPart",[]]]]],"extends":["define",{"sourceInterval":[11499,11526]},null,[],["seq",{"sourceInterval":[11509,11526]},["terminal",{"sourceInterval":[11509,11518]},"extends"],["not",{"sourceInterval":[11519,11526]},["app",{"sourceInterval":[11520,11526]},"idPart",[]]]]],"import":["define",{"sourceInterval":[11531,11556]},null,[],["seq",{"sourceInterval":[11540,11556]},["terminal",{"sourceInterval":[11540,11548]},"import"],["not",{"sourceInterval":[11549,11556]},["app",{"sourceInterval":[11550,11556]},"idPart",[]]]]],"with":["define",{"sourceInterval":[11561,11582]},null,[],["seq",{"sourceInterval":[11568,11582]},["terminal",{"sourceInterval":[11568,11574]},"with"],["not",{"sourceInterval":[11575,11582]},["app",{"sourceInterval":[11576,11582]},"idPart",[]]]]],"trait":["define",{"sourceInterval":[11587,11610]},null,[],["seq",{"sourceInterval":[11595,11610]},["terminal",{"sourceInterval":[11595,11602]},"trait"],["not",{"sourceInterval":[11603,11610]},["app",{"sourceInterval":[11604,11610]},"idPart",[]]]]],"initOf":["define",{"sourceInterval":[11615,11640]},null,[],["seq",{"sourceInterval":[11624,11640]},["terminal",{"sourceInterval":[11624,11632]},"initOf"],["not",{"sourceInterval":[11633,11640]},["app",{"sourceInterval":[11634,11640]},"idPart",[]]]]],"virtual":["define",{"sourceInterval":[11645,11672]},null,[],["seq",{"sourceInterval":[11655,11672]},["terminal",{"sourceInterval":[11655,11664]},"virtual"],["not",{"sourceInterval":[11665,11672]},["app",{"sourceInterval":[11666,11672]},"idPart",[]]]]],"override":["define",{"sourceInterval":[11677,11706]},null,[],["seq",{"sourceInterval":[11688,11706]},["terminal",{"sourceInterval":[11688,11698]},"override"],["not",{"sourceInterval":[11699,11706]},["app",{"sourceInterval":[11700,11706]},"idPart",[]]]]],"inline":["define",{"sourceInterval":[11711,11736]},null,[],["seq",{"sourceInterval":[11720,11736]},["terminal",{"sourceInterval":[11720,11728]},"inline"],["not",{"sourceInterval":[11729,11736]},["app",{"sourceInterval":[11730,11736]},"idPart",[]]]]],"const":["define",{"sourceInterval":[11741,11764]},null,[],["seq",{"sourceInterval":[11749,11764]},["terminal",{"sourceInterval":[11749,11756]},"const"],["not",{"sourceInterval":[11757,11764]},["app",{"sourceInterval":[11758,11764]},"idPart",[]]]]],"abstract":["define",{"sourceInterval":[11769,11798]},null,[],["seq",{"sourceInterval":[11780,11798]},["terminal",{"sourceInterval":[11780,11790]},"abstract"],["not",{"sourceInterval":[11791,11798]},["app",{"sourceInterval":[11792,11798]},"idPart",[]]]]],"nameAttribute":["define",{"sourceInterval":[11822,11845]},null,[],["terminal",{"sourceInterval":[11838,11845]},"@name"]],"reservedWord":["define",{"sourceInterval":[11867,11889]},null,[],["app",{"sourceInterval":[11882,11889]},"keyword",[]]],"space":["extend",{"sourceInterval":[11911,11944]},null,[],["alt",{"sourceInterval":[11920,11944]},["app",{"sourceInterval":[11920,11927]},"comment",[]],["app",{"sourceInterval":[11930,11944]},"lineTerminator",[]]]],"comment":["define",{"sourceInterval":[11949,11995]},null,[],["alt",{"sourceInterval":[11959,11995]},["app",{"sourceInterval":[11959,11975]},"multiLineComment",[]],["app",{"sourceInterval":[11978,11995]},"singleLineComment",[]]]],"lineTerminator":["define",{"sourceInterval":[12000,12050]},null,[],["alt",{"sourceInterval":[12017,12050]},["terminal",{"sourceInterval":[12017,12021]},"\n"],["terminal",{"sourceInterval":[12024,12028]},"\r"],["terminal",{"sourceInterval":[12031,12039]},"\u2028"],["terminal",{"sourceInterval":[12042,12050]},"\u2029"]]],"multiLineComment":["define",{"sourceInterval":[12055,12096]},null,[],["seq",{"sourceInterval":[12074,12096]},["terminal",{"sourceInterval":[12074,12078]},"/*"],["star",{"sourceInterval":[12079,12091]},["seq",{"sourceInterval":[12080,12089]},["not",{"sourceInterval":[12080,12085]},["terminal",{"sourceInterval":[12081,12085]},"*/"]],["app",{"sourceInterval":[12086,12089]},"any",[]]]],["terminal",{"sourceInterval":[12092,12096]},"*/"]]],"singleLineComment":["define",{"sourceInterval":[12101,12148]},null,[],["seq",{"sourceInterval":[12121,12148]},["terminal",{"sourceInterval":[12121,12125]},"//"],["star",{"sourceInterval":[12126,12148]},["seq",{"sourceInterval":[12127,12146]},["not",{"sourceInterval":[12127,12142]},["app",{"sourceInterval":[12128,12142]},"lineTerminator",[]]],["app",{"sourceInterval":[12143,12146]},"any",[]]]]]]}]);module.exports=result; \ No newline at end of file diff --git a/src/test/__snapshots__/bugs.spec.ts.snap b/src/test/__snapshots__/bugs.spec.ts.snap index 270ddcc2d..e9e1f7db2 100644 --- a/src/test/__snapshots__/bugs.spec.ts.snap +++ b/src/test/__snapshots__/bugs.spec.ts.snap @@ -12,12 +12,12 @@ exports[`bugs should deploy contract correctly 1`] = ` "$type": "received", "message": { "body": { - "cell": "x{178D45190000000000000000502540BE400801D98D6D0FE85B55D6D58229C8ED55470B1C744D6BEEAD475C27236E9908A993110016E3A425A4E75B646191AC9A34FE5D050BD101A5C490F87D01C66D885D09BC1082_}", + "cell": "x{178D45190000000000000000502540BE400800A8651ACEAB81220DBBF8AA566E0CBE7FC77A30EADF32B457F1CF4DE9575E5A210016E3A425A4E75B646191AC9A34FE5D050BD101A5C490F87D01C66D885D09BC1082_}", "type": "cell", }, "bounce": false, - "from": "kQDsxraH9C2q62rBFOR2qqOFjjomtfdWo64TkbdMhFTJiLsN", - "to": "kQBGSDIgoUMAjGBNBXjsdBRlfPtqK5rKgQOD5N7yKFfIXeuh", + "from": "kQBUMo1nVcCRBt38VSs3Bl8_470YdW-ZWiv456b0q68tEE5x", + "to": "kQCzGu8bropdv4KCT6jpaDeRXU1coEBo8pjeCjMAt-xYDAXm", "type": "internal", "value": "9.95885", }, @@ -38,7 +38,7 @@ exports[`bugs should deploy contract correctly 1`] = ` }, }, "bounce": false, - "from": "kQBGSDIgoUMAjGBNBXjsdBRlfPtqK5rKgQOD5N7yKFfIXeuh", + "from": "kQCzGu8bropdv4KCT6jpaDeRXU1coEBo8pjeCjMAt-xYDAXm", "to": "@treasure(treasure)", "type": "internal", "value": "9.914852826", diff --git a/src/test/bugs.spec.ts b/src/test/bugs.spec.ts index 9fc6ccfc9..972f390b4 100644 --- a/src/test/bugs.spec.ts +++ b/src/test/bugs.spec.ts @@ -19,6 +19,8 @@ describe('bugs', () => { await contract.send(treasure, { value: toNano('10') }, { $$type: 'Mint', receiver: treasure.address, amount: toNano('10') }); await system.run(); + expect(contract.abi.errors!['31733'].message).toStrictEqual('condition can`t be...') + expect(tracker.collect()).toMatchSnapshot(); }); }); \ No newline at end of file diff --git a/src/test/bugs/bugs.tact b/src/test/bugs/bugs.tact index 95cd57dce..2d49570e8 100644 --- a/src/test/bugs/bugs.tact +++ b/src/test/bugs/bugs.tact @@ -1,2 +1,3 @@ import "./issue42.tact"; -import "./issue43.tact"; \ No newline at end of file +import "./issue43.tact"; +import "./issue53.tact"; \ No newline at end of file diff --git a/src/test/bugs/issue53.tact b/src/test/bugs/issue53.tact new file mode 100644 index 000000000..fdc3a13f4 --- /dev/null +++ b/src/test/bugs/issue53.tact @@ -0,0 +1,6 @@ +contract Issue53 { + init() {} + receive() { + require(1 == 2, "condition can`t be..."); + } +} \ No newline at end of file diff --git a/src/test/feature-strings.spec.ts b/src/test/feature-strings.spec.ts index dd49ff047..ae157fe1f 100644 --- a/src/test/feature-strings.spec.ts +++ b/src/test/feature-strings.spec.ts @@ -47,5 +47,18 @@ describe('feature-strings', () => { const d = r.beginParse().loadBuffer(r.bits.length / 8); expect(d.toString('hex')).toEqual(s.toString('hex')); } + + expect(await contract.getStringWithEscapedChars1()).toBe( + "test \n \n \\ \\\n \"string\"" + ); + expect(await contract.getStringWithEscapedChars2()).toEqual( + "test \n test \t test \r test \b test \f test \" test ' test \\ \\\\ \"_\" \"\" test" + ); + expect(await contract.getStringWithEscapedChars3()).toEqual( + "test \\n test \\t test \\r test \\\\b\b test \\f test \\\" test \\' test \v \v \\\\ \\\\\\\\ \\\"_\\\" \\\"\\\" test" + ); + expect(await contract.getStringWithEscapedChars4()).toEqual( + "\u{2028}\u{2029} \u0044 \x41\x42\x43" + ); }); }); \ No newline at end of file diff --git a/src/test/features/strings.tact b/src/test/features/strings.tact index bf32e8280..551fc2a60 100644 --- a/src/test/features/strings.tact +++ b/src/test/features/strings.tact @@ -1,5 +1,4 @@ contract StringsTester { - init() { } @@ -66,7 +65,6 @@ contract StringsTester { return b.toString(); } - get fun stringWithLargeNumber(): String { let b: StringBuilder = beginString(); b.append("Hello, your balance: "); @@ -85,4 +83,20 @@ contract StringsTester { get fun processBase64(src: String): Slice { return src.fromBase64(); } + + get fun stringWithEscapedChars1(): String { + return "test \n \n \\ \\\n \"string\""; + } + + get fun stringWithEscapedChars2(): String { + return "test \n test \t test \r test \b test \f test \" test ' test \\ \\\\ \"_\" \"\" test"; + } + + get fun stringWithEscapedChars3(): String { + return "test \\n test \\t test \\r test \\\\b\b test \\f test \\\" test \\' test \v \v \\\\ \\\\\\\\ \\\"_\\\" \\\"\\\" test"; + } + + get fun stringWithEscapedChars4(): String { + return "\u{2028}\u{2029} \u0044 \x41\x42\x43"; + } } \ No newline at end of file From 511bfde924c626fdfa62deceb717f90303e68267 Mon Sep 17 00:00:00 2001 From: Novus Nota <68142933+novusnota@users.noreply.github.com> Date: Tue, 2 Apr 2024 19:58:18 +0200 Subject: [PATCH 5/6] chore(CHANGELOG.md): correct escape sequences description (#223) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cde081cc1..2d2156642 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update the `dump` function to handle addresses: PR [#175](https://github.com/tact-lang/tact/pull/175) - The implicit empty `init` function is now present by default in the contract if not declared: PR [#167](https://github.com/tact-lang/tact/pull/167) - `@stdlib/stoppable` now imports `@stdlib/ownable` so the programmer does not have to do it separately: PR [#193](https://github.com/tact-lang/tact/pull/193) -- Support escape sequences for strings (`\\`, `\"`, `\n`, `\r`, `\t`, `\v`, `\b`, `\f`, `\u{ABC}`, `\uABCD`, `\xAB`): PR [#192](https://github.com/tact-lang/tact/pull/192) +- Support escape sequences for strings (`\\`, `\"`, `\n`, `\r`, `\t`, `\v`, `\b`, `\f`, `\u{0}` through `\u{FFFFFF}`, `\u0000` through `\uFFFF`, `\x00` through `\xFF`): PR [#192](https://github.com/tact-lang/tact/pull/192) ### Fixed - Incorrect "already exists" errors when using names such as `toString` or `valueOf`: PR [#208](https://github.com/tact-lang/tact/pull/208) From 20eb6e01fea4c3b876f17a874e8eed4d662293d8 Mon Sep 17 00:00:00 2001 From: Daniil Sedov <42098239+Gusarich@users.noreply.github.com> Date: Tue, 2 Apr 2024 21:23:47 +0300 Subject: [PATCH 6/6] feat(stdlib): add `toString` extension function for `Address` type (#224) --- CHANGELOG.md | 1 + src/imports/stdlib.ts | 3 ++- src/test/feature-strings.spec.ts | 2 ++ src/test/features/strings.tact | 4 ++++ stdlib/std/text.tact | 9 ++++++++- 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d2156642..1be41e325 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - JSON Schema for `tact.config.json`: PR [#194](https://github.com/tact-lang/tact/pull/194) - Display an error for integer overflow at compile-time: PR [#200](https://github.com/tact-lang/tact/pull/200) - Non-modifying `StringBuilder`'s `concat` method for chained string concatenations: PR [#217](https://github.com/tact-lang/tact/pull/217) +- `toString` extension function for `Address` type: PR [#224](https://github.com/tact-lang/tact/pull/224) ### Changed - Update the `dump` function to handle addresses: PR [#175](https://github.com/tact-lang/tact/pull/175) diff --git a/src/imports/stdlib.ts b/src/imports/stdlib.ts index 8feb81eb5..36befa1d0 100644 --- a/src/imports/stdlib.ts +++ b/src/imports/stdlib.ts @@ -250,7 +250,8 @@ files['std/text.tact'] = 'bHNlIHsKICAgICAgICAgICAgdGhyb3coMTM0KTsKICAgICAgICB9CiAgICB9CgogICAgLy8gUGFkZGluZwogICAgbGV0IHRvdGFsOiBJbnQgPSByZXN1bHQuYml0cygp' + 'OwogICAgbGV0IHBhZGRpbmc6IEludCA9IHRvdGFsICUgODsKICAgIGlmIChwYWRkaW5nICE9IDApIHsKICAgICAgICBsZXQgczogU2xpY2UgPSByZXN1bHQuYXNTbGlj' + 'ZSgpOwogICAgICAgIHJldHVybiBzLmxvYWRCaXRzKHRvdGFsIC0gcGFkZGluZyk7CiAgICB9IGVsc2UgewogICAgICAgIHJldHVybiByZXN1bHQuYXNTbGljZSgpOwog' + - 'ICAgfQp9'; + 'ICAgfQp9CgovLwovLyBBZGRyZXNzIGNvbnZlcnNpb24KLy8KCkBuYW1lKF9fdGFjdF9hZGRyZXNzX3RvX3VzZXJmcmllbmRseSkKZXh0ZW5kcyBuYXRpdmUgdG9TdHJp' + + 'bmcoc2VsZjogQWRkcmVzcyk6IFN0cmluZzs='; files['stdlib_ex.fc'] = 'Zm9yYWxsIFggLT4gdHVwbGUgX190YWN0X3NldCh0dXBsZSB4LCBYIHYsIGludCBpKSBhc20gIlNFVElOREVYVkFSUSI7CigpIF9fdGFjdF9ub3AoKSBhc20gIk5PUCI7' + 'CnNsaWNlIF9fdGFjdF9zdHJfdG9fc2xpY2Uoc2xpY2UgcykgYXNtICJOT1AiOwpzbGljZSBfX3RhY3Rfc2xpY2VfdG9fc3RyKHNsaWNlIHMpIGFzbSAiTk9QIjsKc2xp' + diff --git a/src/test/feature-strings.spec.ts b/src/test/feature-strings.spec.ts index ae157fe1f..5d70cec1e 100644 --- a/src/test/feature-strings.spec.ts +++ b/src/test/feature-strings.spec.ts @@ -60,5 +60,7 @@ describe('feature-strings', () => { expect(await contract.getStringWithEscapedChars4()).toEqual( "\u{2028}\u{2029} \u0044 \x41\x42\x43" ); + + expect(await contract.getStringWithAddress()).toEqual('EQBKgXCNLPexWhs2L79kiARR1phGH1LwXxRbNsCFF9doc2lN'); }); }); \ No newline at end of file diff --git a/src/test/features/strings.tact b/src/test/features/strings.tact index 551fc2a60..a39377b80 100644 --- a/src/test/features/strings.tact +++ b/src/test/features/strings.tact @@ -99,4 +99,8 @@ contract StringsTester { get fun stringWithEscapedChars4(): String { return "\u{2028}\u{2029} \u0044 \x41\x42\x43"; } + + get fun stringWithAddress(): String { + return address("EQBKgXCNLPexWhs2L79kiARR1phGH1LwXxRbNsCFF9doc2lN").toString(); + } } \ No newline at end of file diff --git a/stdlib/std/text.tact b/stdlib/std/text.tact index abc73cfa8..1171158ee 100644 --- a/stdlib/std/text.tact +++ b/stdlib/std/text.tact @@ -91,4 +91,11 @@ extends fun fromBase64(self: Slice): Slice { } else { return result.asSlice(); } -} \ No newline at end of file +} + +// +// Address conversion +// + +@name(__tact_address_to_userfriendly) +extends native toString(self: Address): String; \ No newline at end of file