From c9dd5540be01d6007992821de5e6ffb8fa4e7e68 Mon Sep 17 00:00:00 2001 From: Mathieu Geukens Date: Mon, 14 Jul 2025 21:35:27 +0200 Subject: [PATCH 01/16] added patch for ElectrumNetworkProvider --- packages/cashscript/package.json | 2 +- .../cashscript/src/network/ElectrumNetworkProvider.ts | 2 +- website/docs/releases/release-notes.md | 5 +++++ yarn.lock | 8 ++++---- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/cashscript/package.json b/packages/cashscript/package.json index 8ec41e178..2b627df05 100644 --- a/packages/cashscript/package.json +++ b/packages/cashscript/package.json @@ -47,7 +47,7 @@ "dependencies": { "@bitauth/libauth": "^3.1.0-next.2", "@cashscript/utils": "^0.11.2", - "@electrum-cash/network": "^4.1.1", + "@electrum-cash/network": "^4.1.3", "@mr-zwets/bchn-api-wrapper": "^1.0.1", "delay": "^6.0.0", "fast-deep-equal": "^3.1.3", diff --git a/packages/cashscript/src/network/ElectrumNetworkProvider.ts b/packages/cashscript/src/network/ElectrumNetworkProvider.ts index 49ae44788..414e93f5e 100644 --- a/packages/cashscript/src/network/ElectrumNetworkProvider.ts +++ b/packages/cashscript/src/network/ElectrumNetworkProvider.ts @@ -37,7 +37,7 @@ export default class ElectrumNetworkProvider implements NetworkProvider { private instantiateElectrumClient(network: Network, options: Options): ElectrumClient { if ('electrum' in options) return options.electrum; const server = 'hostname' in options ? options.hostname : this.getServerForNetwork(network); - return new ElectrumClient('CashScript Application', '1.4.1', server); + return new ElectrumClient('CashScript Application', '1.4.1', server, { disableBrowserVisibilityHandling: true }); } // Get Electrum server based on network diff --git a/website/docs/releases/release-notes.md b/website/docs/releases/release-notes.md index ac993d769..4cf6c8395 100644 --- a/website/docs/releases/release-notes.md +++ b/website/docs/releases/release-notes.md @@ -2,6 +2,11 @@ title: Release Notes --- +## v0.11.3 + +#### CashScript SDK +- :bug: Fix bug with where `ElectrumNetworkProvider` would disconnect in browser on visibility change of the page + ## v0.11.2 #### CashScript SDK diff --git a/yarn.lock b/yarn.lock index 0b1d34ae1..4026357e7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1063,10 +1063,10 @@ dependencies: debug "^4.3.7" -"@electrum-cash/network@^4.1.1": - version "4.1.1" - resolved "https://registry.yarnpkg.com/@electrum-cash/network/-/network-4.1.1.tgz#1f9571c783f613ce960374b4bffb73c27b28c429" - integrity sha512-v5abF2qGRTnBoi9tcS/iz7j82D8HYsK9iY0NM5v8/Qu8SnlMGGNz8UDFl+YzRPFXb4SUL3K0uf3Oydy82DB3oA== +"@electrum-cash/network@^4.1.3": + version "4.1.3" + resolved "https://registry.yarnpkg.com/@electrum-cash/network/-/network-4.1.3.tgz#195a96e8bb34493c622223992da0649c753aafff" + integrity sha512-amMvdcEfHhquoUkhN7x/H04KPYfqd5LilOGcg6O1OdUks1Mcrcah8WfHICHW/qyZ3Rgoos9o7Wx8gKz8qcSNzg== dependencies: "@electrum-cash/debug-logs" "^1.0.0" "@electrum-cash/web-socket" "^1.0.0" From f1f99140987eece3dfa1d2be0fa4709942c19669 Mon Sep 17 00:00:00 2001 From: Rosco Kalis Date: Tue, 15 Jul 2025 11:18:57 +0200 Subject: [PATCH 02/16] Add failing tests for new .slice() feature --- .../ParseError/slice_single_parameter.cash | 6 +++ .../TypeError/slice_string_parameter.cash | 6 +++ .../UnsupportedTypeError/slice_ints.cash | 6 +++ packages/cashc/test/generation/fixtures.ts | 53 +++++++++++++++++++ .../valid-contract-files/double_split.cash | 6 +++ .../test/valid-contract-files/slice.cash | 6 +++ .../slice_variable_parameter.cash | 7 +++ 7 files changed, 90 insertions(+) create mode 100644 packages/cashc/test/compiler/ParseError/slice_single_parameter.cash create mode 100644 packages/cashc/test/compiler/TypeError/slice_string_parameter.cash create mode 100644 packages/cashc/test/compiler/UnsupportedTypeError/slice_ints.cash create mode 100644 packages/cashc/test/valid-contract-files/double_split.cash create mode 100644 packages/cashc/test/valid-contract-files/slice.cash create mode 100644 packages/cashc/test/valid-contract-files/slice_variable_parameter.cash diff --git a/packages/cashc/test/compiler/ParseError/slice_single_parameter.cash b/packages/cashc/test/compiler/ParseError/slice_single_parameter.cash new file mode 100644 index 000000000..466b05801 --- /dev/null +++ b/packages/cashc/test/compiler/ParseError/slice_single_parameter.cash @@ -0,0 +1,6 @@ +contract Slice(bytes20 pkh) { + function spend() { + bytes actualPkh = tx.inputs[this.activeInputIndex].lockingBytecode.slice(23); + require(pkh == actualPkh); + } +} diff --git a/packages/cashc/test/compiler/TypeError/slice_string_parameter.cash b/packages/cashc/test/compiler/TypeError/slice_string_parameter.cash new file mode 100644 index 000000000..e8ac5d4af --- /dev/null +++ b/packages/cashc/test/compiler/TypeError/slice_string_parameter.cash @@ -0,0 +1,6 @@ +contract Slice(bytes20 pkh) { + function spend() { + bytes actualPkh = tx.inputs[this.activeInputIndex].lockingBytecode.slice("3", 23); + require(pkh == actualPkh); + } +} diff --git a/packages/cashc/test/compiler/UnsupportedTypeError/slice_ints.cash b/packages/cashc/test/compiler/UnsupportedTypeError/slice_ints.cash new file mode 100644 index 000000000..efb563484 --- /dev/null +++ b/packages/cashc/test/compiler/UnsupportedTypeError/slice_ints.cash @@ -0,0 +1,6 @@ +contract Slice(bytes20 pkh) { + function spend() { + int actualPkh = 1921739821792419.slice(1, 3); + require(pkh == actualPkh); + } +} diff --git a/packages/cashc/test/generation/fixtures.ts b/packages/cashc/test/generation/fixtures.ts index 4f050b3ef..62c801332 100644 --- a/packages/cashc/test/generation/fixtures.ts +++ b/packages/cashc/test/generation/fixtures.ts @@ -825,4 +825,57 @@ export const fixtures: Fixture[] = [ updatedAt: '', }, }, + { + fn: 'double_split.cash', + artifact: { + contractName: 'DoubleSplit', + constructorInputs: [{ name: 'pkh', type: 'bytes20' }], + abi: [{ name: 'spend', inputs: [] }], + bytecode: 'OP_INPUTINDEX OP_UTXOBYTECODE 17 OP_SPLIT OP_DROP OP_3 OP_SPLIT OP_NIP OP_EQUAL', + debug: { + bytecode: 'c0c701177f75537f7787', + sourceMap: '3:36:3:57;:26::74:1;:81::83:0;:26::84:1;:::87;:94::95:0;:26::96:1;:::99;4:8:4:34', + logs: [], + requires: [ + { + ip: 10, + line: 4, + }, + ], + }, + source: fs.readFileSync(new URL('../valid-contract-files/double_split.cash', import.meta.url), { encoding: 'utf-8' }), + compiler: { + name: 'cashc', + version, + }, + updatedAt: '', + }, + }, + { + fn: 'slice.cash', + artifact: { + contractName: 'Slice', + constructorInputs: [{ name: 'pkh', type: 'bytes20' }], + abi: [{ name: 'spend', inputs: [] }], + bytecode: 'OP_INPUTINDEX OP_UTXOBYTECODE 17 OP_SPLIT OP_DROP OP_3 OP_SPLIT OP_NIP OP_EQUAL', + debug: { + bytecode: 'c0c701177f75537f7787', + sourceMap: '3:36:3:57;:26::74:1;:84::86:0;:26::87:1;;:81::82:0;:26::87:1;;4:8:4:34', + logs: [], + requires: [ + { + ip: 10, + line: 4, + message: undefined, + }, + ], + }, + source: fs.readFileSync(new URL('../valid-contract-files/slice.cash', import.meta.url), { encoding: 'utf-8' }), + compiler: { + name: 'cashc', + version, + }, + updatedAt: '', + }, + }, ]; diff --git a/packages/cashc/test/valid-contract-files/double_split.cash b/packages/cashc/test/valid-contract-files/double_split.cash new file mode 100644 index 000000000..b0baa8948 --- /dev/null +++ b/packages/cashc/test/valid-contract-files/double_split.cash @@ -0,0 +1,6 @@ +contract DoubleSplit(bytes20 pkh) { + function spend() { + bytes actualPkh = tx.inputs[this.activeInputIndex].lockingBytecode.split(23)[0].split(3)[1]; + require(pkh == actualPkh); + } +} diff --git a/packages/cashc/test/valid-contract-files/slice.cash b/packages/cashc/test/valid-contract-files/slice.cash new file mode 100644 index 000000000..087014f07 --- /dev/null +++ b/packages/cashc/test/valid-contract-files/slice.cash @@ -0,0 +1,6 @@ +contract Slice(bytes20 pkh) { + function spend() { + bytes actualPkh = tx.inputs[this.activeInputIndex].lockingBytecode.slice(3, 23); + require(pkh == actualPkh); + } +} diff --git a/packages/cashc/test/valid-contract-files/slice_variable_parameter.cash b/packages/cashc/test/valid-contract-files/slice_variable_parameter.cash new file mode 100644 index 000000000..46e914c9c --- /dev/null +++ b/packages/cashc/test/valid-contract-files/slice_variable_parameter.cash @@ -0,0 +1,7 @@ +contract Slice(bytes20 pkh) { + function spend() { + int x = 3; + bytes actualPkh = tx.inputs[this.activeInputIndex].lockingBytecode.slice(x, 23); + require(pkh == actualPkh); + } +} From 1d07ec766e747b1b14334792607be73a0d3c2828 Mon Sep 17 00:00:00 2001 From: Rosco Kalis Date: Tue, 15 Jul 2025 11:19:29 +0200 Subject: [PATCH 03/16] Update grammar for .slice() feature --- packages/cashc/src/grammar/CashScript.g4 | 1 + packages/cashc/src/grammar/CashScript.interp | 4 +- packages/cashc/src/grammar/CashScript.tokens | 74 +-- .../cashc/src/grammar/CashScriptLexer.interp | 5 +- .../cashc/src/grammar/CashScriptLexer.tokens | 74 +-- packages/cashc/src/grammar/CashScriptLexer.ts | 576 +++++++++--------- .../cashc/src/grammar/CashScriptParser.ts | 455 ++++++++------ .../cashc/src/grammar/CashScriptVisitor.ts | 40 +- 8 files changed, 653 insertions(+), 576 deletions(-) diff --git a/packages/cashc/src/grammar/CashScript.g4 b/packages/cashc/src/grammar/CashScript.g4 index b20c0b83e..6b79d54e5 100644 --- a/packages/cashc/src/grammar/CashScript.g4 +++ b/packages/cashc/src/grammar/CashScript.g4 @@ -114,6 +114,7 @@ expression | scope='tx.inputs' '[' expression ']' op=('.value' | '.lockingBytecode' | '.outpointTransactionHash' | '.outpointIndex' | '.unlockingBytecode' | '.sequenceNumber' | '.tokenCategory' | '.nftCommitment' | '.tokenAmount') # UnaryIntrospectionOp | expression op=('.reverse()' | '.length') # UnaryOp | left=expression op='.split' '(' right=expression ')' # BinaryOp + | element=expression '.slice' '(' start=expression ',' end=expression ')' # Slice | op=('!' | '-') expression # UnaryOp | left=expression op=('*' | '/' | '%') right=expression # BinaryOp | left=expression op=('+' | '-') right=expression # BinaryOp diff --git a/packages/cashc/src/grammar/CashScript.interp b/packages/cashc/src/grammar/CashScript.interp index 2fd3ea96c..f59a21362 100644 --- a/packages/cashc/src/grammar/CashScript.interp +++ b/packages/cashc/src/grammar/CashScript.interp @@ -38,6 +38,7 @@ null '.reverse()' '.length' '.split' +'.slice' '!' '-' '*' @@ -134,6 +135,7 @@ null null null null +null VersionLiteral BooleanLiteral NumberUnit @@ -185,4 +187,4 @@ typeName atn: -[4, 1, 74, 365, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 1, 0, 5, 0, 60, 8, 0, 10, 0, 12, 0, 63, 9, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 3, 3, 77, 8, 3, 1, 4, 3, 4, 80, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 91, 8, 6, 10, 6, 12, 6, 94, 9, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 103, 8, 7, 10, 7, 12, 7, 106, 9, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 114, 8, 8, 10, 8, 12, 8, 117, 9, 8, 1, 8, 3, 8, 120, 8, 8, 3, 8, 122, 8, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 5, 10, 131, 8, 10, 10, 10, 12, 10, 134, 9, 10, 1, 10, 1, 10, 3, 10, 138, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 147, 8, 11, 1, 12, 1, 12, 5, 12, 151, 8, 12, 10, 12, 12, 12, 154, 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 182, 8, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 192, 8, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 204, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 3, 20, 214, 8, 20, 1, 21, 1, 21, 1, 21, 1, 21, 5, 21, 220, 8, 21, 10, 21, 12, 21, 223, 9, 21, 1, 21, 3, 21, 226, 8, 21, 3, 21, 228, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 5, 23, 239, 8, 23, 10, 23, 12, 23, 242, 9, 23, 1, 23, 3, 23, 245, 8, 23, 3, 23, 247, 8, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 3, 24, 261, 8, 24, 1, 24, 3, 24, 264, 8, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 5, 24, 290, 8, 24, 10, 24, 12, 24, 293, 9, 24, 1, 24, 3, 24, 296, 8, 24, 3, 24, 298, 8, 24, 1, 24, 1, 24, 1, 24, 1, 24, 3, 24, 304, 8, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 5, 24, 345, 8, 24, 10, 24, 12, 24, 348, 9, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 3, 26, 357, 8, 26, 1, 27, 1, 27, 3, 27, 361, 8, 27, 1, 28, 1, 28, 1, 28, 0, 1, 48, 29, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 0, 10, 1, 0, 4, 10, 1, 0, 26, 30, 2, 0, 26, 30, 32, 35, 1, 0, 39, 40, 1, 0, 41, 43, 2, 0, 40, 40, 44, 44, 1, 0, 6, 9, 1, 0, 45, 46, 1, 0, 36, 37, 2, 0, 52, 57, 64, 64, 394, 0, 61, 1, 0, 0, 0, 2, 67, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 74, 1, 0, 0, 0, 8, 79, 1, 0, 0, 0, 10, 83, 1, 0, 0, 0, 12, 85, 1, 0, 0, 0, 14, 97, 1, 0, 0, 0, 16, 109, 1, 0, 0, 0, 18, 125, 1, 0, 0, 0, 20, 137, 1, 0, 0, 0, 22, 146, 1, 0, 0, 0, 24, 148, 1, 0, 0, 0, 26, 160, 1, 0, 0, 0, 28, 169, 1, 0, 0, 0, 30, 174, 1, 0, 0, 0, 32, 186, 1, 0, 0, 0, 34, 196, 1, 0, 0, 0, 36, 205, 1, 0, 0, 0, 38, 209, 1, 0, 0, 0, 40, 213, 1, 0, 0, 0, 42, 215, 1, 0, 0, 0, 44, 231, 1, 0, 0, 0, 46, 234, 1, 0, 0, 0, 48, 303, 1, 0, 0, 0, 50, 349, 1, 0, 0, 0, 52, 356, 1, 0, 0, 0, 54, 358, 1, 0, 0, 0, 56, 362, 1, 0, 0, 0, 58, 60, 3, 2, 1, 0, 59, 58, 1, 0, 0, 0, 60, 63, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 61, 62, 1, 0, 0, 0, 62, 64, 1, 0, 0, 0, 63, 61, 1, 0, 0, 0, 64, 65, 3, 12, 6, 0, 65, 66, 5, 0, 0, 1, 66, 1, 1, 0, 0, 0, 67, 68, 5, 1, 0, 0, 68, 69, 3, 4, 2, 0, 69, 70, 3, 6, 3, 0, 70, 71, 5, 2, 0, 0, 71, 3, 1, 0, 0, 0, 72, 73, 5, 3, 0, 0, 73, 5, 1, 0, 0, 0, 74, 76, 3, 8, 4, 0, 75, 77, 3, 8, 4, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 7, 1, 0, 0, 0, 78, 80, 3, 10, 5, 0, 79, 78, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 82, 5, 58, 0, 0, 82, 9, 1, 0, 0, 0, 83, 84, 7, 0, 0, 0, 84, 11, 1, 0, 0, 0, 85, 86, 5, 11, 0, 0, 86, 87, 5, 71, 0, 0, 87, 88, 3, 16, 8, 0, 88, 92, 5, 12, 0, 0, 89, 91, 3, 14, 7, 0, 90, 89, 1, 0, 0, 0, 91, 94, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 95, 1, 0, 0, 0, 94, 92, 1, 0, 0, 0, 95, 96, 5, 13, 0, 0, 96, 13, 1, 0, 0, 0, 97, 98, 5, 14, 0, 0, 98, 99, 5, 71, 0, 0, 99, 100, 3, 16, 8, 0, 100, 104, 5, 12, 0, 0, 101, 103, 3, 22, 11, 0, 102, 101, 1, 0, 0, 0, 103, 106, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 108, 5, 13, 0, 0, 108, 15, 1, 0, 0, 0, 109, 121, 5, 15, 0, 0, 110, 115, 3, 18, 9, 0, 111, 112, 5, 16, 0, 0, 112, 114, 3, 18, 9, 0, 113, 111, 1, 0, 0, 0, 114, 117, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116, 119, 1, 0, 0, 0, 117, 115, 1, 0, 0, 0, 118, 120, 5, 16, 0, 0, 119, 118, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 122, 1, 0, 0, 0, 121, 110, 1, 0, 0, 0, 121, 122, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 124, 5, 17, 0, 0, 124, 17, 1, 0, 0, 0, 125, 126, 3, 56, 28, 0, 126, 127, 5, 71, 0, 0, 127, 19, 1, 0, 0, 0, 128, 132, 5, 12, 0, 0, 129, 131, 3, 22, 11, 0, 130, 129, 1, 0, 0, 0, 131, 134, 1, 0, 0, 0, 132, 130, 1, 0, 0, 0, 132, 133, 1, 0, 0, 0, 133, 135, 1, 0, 0, 0, 134, 132, 1, 0, 0, 0, 135, 138, 5, 13, 0, 0, 136, 138, 3, 22, 11, 0, 137, 128, 1, 0, 0, 0, 137, 136, 1, 0, 0, 0, 138, 21, 1, 0, 0, 0, 139, 147, 3, 24, 12, 0, 140, 147, 3, 26, 13, 0, 141, 147, 3, 28, 14, 0, 142, 147, 3, 30, 15, 0, 143, 147, 3, 32, 16, 0, 144, 147, 3, 34, 17, 0, 145, 147, 3, 36, 18, 0, 146, 139, 1, 0, 0, 0, 146, 140, 1, 0, 0, 0, 146, 141, 1, 0, 0, 0, 146, 142, 1, 0, 0, 0, 146, 143, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 146, 145, 1, 0, 0, 0, 147, 23, 1, 0, 0, 0, 148, 152, 3, 56, 28, 0, 149, 151, 3, 50, 25, 0, 150, 149, 1, 0, 0, 0, 151, 154, 1, 0, 0, 0, 152, 150, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 155, 1, 0, 0, 0, 154, 152, 1, 0, 0, 0, 155, 156, 5, 71, 0, 0, 156, 157, 5, 10, 0, 0, 157, 158, 3, 48, 24, 0, 158, 159, 5, 2, 0, 0, 159, 25, 1, 0, 0, 0, 160, 161, 3, 56, 28, 0, 161, 162, 5, 71, 0, 0, 162, 163, 5, 16, 0, 0, 163, 164, 3, 56, 28, 0, 164, 165, 5, 71, 0, 0, 165, 166, 5, 10, 0, 0, 166, 167, 3, 48, 24, 0, 167, 168, 5, 2, 0, 0, 168, 27, 1, 0, 0, 0, 169, 170, 5, 71, 0, 0, 170, 171, 5, 10, 0, 0, 171, 172, 3, 48, 24, 0, 172, 173, 5, 2, 0, 0, 173, 29, 1, 0, 0, 0, 174, 175, 5, 18, 0, 0, 175, 176, 5, 15, 0, 0, 176, 177, 5, 69, 0, 0, 177, 178, 5, 6, 0, 0, 178, 181, 3, 48, 24, 0, 179, 180, 5, 16, 0, 0, 180, 182, 3, 38, 19, 0, 181, 179, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 184, 5, 17, 0, 0, 184, 185, 5, 2, 0, 0, 185, 31, 1, 0, 0, 0, 186, 187, 5, 18, 0, 0, 187, 188, 5, 15, 0, 0, 188, 191, 3, 48, 24, 0, 189, 190, 5, 16, 0, 0, 190, 192, 3, 38, 19, 0, 191, 189, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, 194, 5, 17, 0, 0, 194, 195, 5, 2, 0, 0, 195, 33, 1, 0, 0, 0, 196, 197, 5, 19, 0, 0, 197, 198, 5, 15, 0, 0, 198, 199, 3, 48, 24, 0, 199, 200, 5, 17, 0, 0, 200, 203, 3, 20, 10, 0, 201, 202, 5, 20, 0, 0, 202, 204, 3, 20, 10, 0, 203, 201, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 35, 1, 0, 0, 0, 205, 206, 5, 21, 0, 0, 206, 207, 3, 42, 21, 0, 207, 208, 5, 2, 0, 0, 208, 37, 1, 0, 0, 0, 209, 210, 5, 66, 0, 0, 210, 39, 1, 0, 0, 0, 211, 214, 5, 71, 0, 0, 212, 214, 3, 52, 26, 0, 213, 211, 1, 0, 0, 0, 213, 212, 1, 0, 0, 0, 214, 41, 1, 0, 0, 0, 215, 227, 5, 15, 0, 0, 216, 221, 3, 40, 20, 0, 217, 218, 5, 16, 0, 0, 218, 220, 3, 40, 20, 0, 219, 217, 1, 0, 0, 0, 220, 223, 1, 0, 0, 0, 221, 219, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 225, 1, 0, 0, 0, 223, 221, 1, 0, 0, 0, 224, 226, 5, 16, 0, 0, 225, 224, 1, 0, 0, 0, 225, 226, 1, 0, 0, 0, 226, 228, 1, 0, 0, 0, 227, 216, 1, 0, 0, 0, 227, 228, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 230, 5, 17, 0, 0, 230, 43, 1, 0, 0, 0, 231, 232, 5, 71, 0, 0, 232, 233, 3, 46, 23, 0, 233, 45, 1, 0, 0, 0, 234, 246, 5, 15, 0, 0, 235, 240, 3, 48, 24, 0, 236, 237, 5, 16, 0, 0, 237, 239, 3, 48, 24, 0, 238, 236, 1, 0, 0, 0, 239, 242, 1, 0, 0, 0, 240, 238, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 244, 1, 0, 0, 0, 242, 240, 1, 0, 0, 0, 243, 245, 5, 16, 0, 0, 244, 243, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 247, 1, 0, 0, 0, 246, 235, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 249, 5, 17, 0, 0, 249, 47, 1, 0, 0, 0, 250, 251, 6, 24, -1, 0, 251, 252, 5, 15, 0, 0, 252, 253, 3, 48, 24, 0, 253, 254, 5, 17, 0, 0, 254, 304, 1, 0, 0, 0, 255, 256, 3, 56, 28, 0, 256, 257, 5, 15, 0, 0, 257, 260, 3, 48, 24, 0, 258, 259, 5, 16, 0, 0, 259, 261, 3, 48, 24, 0, 260, 258, 1, 0, 0, 0, 260, 261, 1, 0, 0, 0, 261, 263, 1, 0, 0, 0, 262, 264, 5, 16, 0, 0, 263, 262, 1, 0, 0, 0, 263, 264, 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 266, 5, 17, 0, 0, 266, 304, 1, 0, 0, 0, 267, 304, 3, 44, 22, 0, 268, 269, 5, 22, 0, 0, 269, 270, 5, 71, 0, 0, 270, 304, 3, 46, 23, 0, 271, 272, 5, 25, 0, 0, 272, 273, 5, 23, 0, 0, 273, 274, 3, 48, 24, 0, 274, 275, 5, 24, 0, 0, 275, 276, 7, 1, 0, 0, 276, 304, 1, 0, 0, 0, 277, 278, 5, 31, 0, 0, 278, 279, 5, 23, 0, 0, 279, 280, 3, 48, 24, 0, 280, 281, 5, 24, 0, 0, 281, 282, 7, 2, 0, 0, 282, 304, 1, 0, 0, 0, 283, 284, 7, 3, 0, 0, 284, 304, 3, 48, 24, 14, 285, 297, 5, 23, 0, 0, 286, 291, 3, 48, 24, 0, 287, 288, 5, 16, 0, 0, 288, 290, 3, 48, 24, 0, 289, 287, 1, 0, 0, 0, 290, 293, 1, 0, 0, 0, 291, 289, 1, 0, 0, 0, 291, 292, 1, 0, 0, 0, 292, 295, 1, 0, 0, 0, 293, 291, 1, 0, 0, 0, 294, 296, 5, 16, 0, 0, 295, 294, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 298, 1, 0, 0, 0, 297, 286, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 304, 5, 24, 0, 0, 300, 304, 5, 70, 0, 0, 301, 304, 5, 71, 0, 0, 302, 304, 3, 52, 26, 0, 303, 250, 1, 0, 0, 0, 303, 255, 1, 0, 0, 0, 303, 267, 1, 0, 0, 0, 303, 268, 1, 0, 0, 0, 303, 271, 1, 0, 0, 0, 303, 277, 1, 0, 0, 0, 303, 283, 1, 0, 0, 0, 303, 285, 1, 0, 0, 0, 303, 300, 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, 303, 302, 1, 0, 0, 0, 304, 346, 1, 0, 0, 0, 305, 306, 10, 13, 0, 0, 306, 307, 7, 4, 0, 0, 307, 345, 3, 48, 24, 14, 308, 309, 10, 12, 0, 0, 309, 310, 7, 5, 0, 0, 310, 345, 3, 48, 24, 13, 311, 312, 10, 11, 0, 0, 312, 313, 7, 6, 0, 0, 313, 345, 3, 48, 24, 12, 314, 315, 10, 10, 0, 0, 315, 316, 7, 7, 0, 0, 316, 345, 3, 48, 24, 11, 317, 318, 10, 9, 0, 0, 318, 319, 5, 47, 0, 0, 319, 345, 3, 48, 24, 10, 320, 321, 10, 8, 0, 0, 321, 322, 5, 4, 0, 0, 322, 345, 3, 48, 24, 9, 323, 324, 10, 7, 0, 0, 324, 325, 5, 48, 0, 0, 325, 345, 3, 48, 24, 8, 326, 327, 10, 6, 0, 0, 327, 328, 5, 49, 0, 0, 328, 345, 3, 48, 24, 7, 329, 330, 10, 5, 0, 0, 330, 331, 5, 50, 0, 0, 331, 345, 3, 48, 24, 6, 332, 333, 10, 19, 0, 0, 333, 334, 5, 23, 0, 0, 334, 335, 5, 61, 0, 0, 335, 345, 5, 24, 0, 0, 336, 337, 10, 16, 0, 0, 337, 345, 7, 8, 0, 0, 338, 339, 10, 15, 0, 0, 339, 340, 5, 38, 0, 0, 340, 341, 5, 15, 0, 0, 341, 342, 3, 48, 24, 0, 342, 343, 5, 17, 0, 0, 343, 345, 1, 0, 0, 0, 344, 305, 1, 0, 0, 0, 344, 308, 1, 0, 0, 0, 344, 311, 1, 0, 0, 0, 344, 314, 1, 0, 0, 0, 344, 317, 1, 0, 0, 0, 344, 320, 1, 0, 0, 0, 344, 323, 1, 0, 0, 0, 344, 326, 1, 0, 0, 0, 344, 329, 1, 0, 0, 0, 344, 332, 1, 0, 0, 0, 344, 336, 1, 0, 0, 0, 344, 338, 1, 0, 0, 0, 345, 348, 1, 0, 0, 0, 346, 344, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 49, 1, 0, 0, 0, 348, 346, 1, 0, 0, 0, 349, 350, 5, 51, 0, 0, 350, 51, 1, 0, 0, 0, 351, 357, 5, 59, 0, 0, 352, 357, 3, 54, 27, 0, 353, 357, 5, 66, 0, 0, 354, 357, 5, 67, 0, 0, 355, 357, 5, 68, 0, 0, 356, 351, 1, 0, 0, 0, 356, 352, 1, 0, 0, 0, 356, 353, 1, 0, 0, 0, 356, 354, 1, 0, 0, 0, 356, 355, 1, 0, 0, 0, 357, 53, 1, 0, 0, 0, 358, 360, 5, 61, 0, 0, 359, 361, 5, 60, 0, 0, 360, 359, 1, 0, 0, 0, 360, 361, 1, 0, 0, 0, 361, 55, 1, 0, 0, 0, 362, 363, 7, 9, 0, 0, 363, 57, 1, 0, 0, 0, 32, 61, 76, 79, 92, 104, 115, 119, 121, 132, 137, 146, 152, 181, 191, 203, 213, 221, 225, 227, 240, 244, 246, 260, 263, 291, 295, 297, 303, 344, 346, 356, 360] \ No newline at end of file +[4, 1, 75, 373, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 1, 0, 5, 0, 60, 8, 0, 10, 0, 12, 0, 63, 9, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 3, 3, 77, 8, 3, 1, 4, 3, 4, 80, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 91, 8, 6, 10, 6, 12, 6, 94, 9, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 103, 8, 7, 10, 7, 12, 7, 106, 9, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 114, 8, 8, 10, 8, 12, 8, 117, 9, 8, 1, 8, 3, 8, 120, 8, 8, 3, 8, 122, 8, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 5, 10, 131, 8, 10, 10, 10, 12, 10, 134, 9, 10, 1, 10, 1, 10, 3, 10, 138, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 147, 8, 11, 1, 12, 1, 12, 5, 12, 151, 8, 12, 10, 12, 12, 12, 154, 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 182, 8, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 192, 8, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 204, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 3, 20, 214, 8, 20, 1, 21, 1, 21, 1, 21, 1, 21, 5, 21, 220, 8, 21, 10, 21, 12, 21, 223, 9, 21, 1, 21, 3, 21, 226, 8, 21, 3, 21, 228, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 5, 23, 239, 8, 23, 10, 23, 12, 23, 242, 9, 23, 1, 23, 3, 23, 245, 8, 23, 3, 23, 247, 8, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 3, 24, 261, 8, 24, 1, 24, 3, 24, 264, 8, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 5, 24, 290, 8, 24, 10, 24, 12, 24, 293, 9, 24, 1, 24, 3, 24, 296, 8, 24, 3, 24, 298, 8, 24, 1, 24, 1, 24, 1, 24, 1, 24, 3, 24, 304, 8, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 5, 24, 353, 8, 24, 10, 24, 12, 24, 356, 9, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 3, 26, 365, 8, 26, 1, 27, 1, 27, 3, 27, 369, 8, 27, 1, 28, 1, 28, 1, 28, 0, 1, 48, 29, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 0, 10, 1, 0, 4, 10, 1, 0, 26, 30, 2, 0, 26, 30, 32, 35, 1, 0, 40, 41, 1, 0, 42, 44, 2, 0, 41, 41, 45, 45, 1, 0, 6, 9, 1, 0, 46, 47, 1, 0, 36, 37, 2, 0, 53, 58, 65, 65, 403, 0, 61, 1, 0, 0, 0, 2, 67, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 74, 1, 0, 0, 0, 8, 79, 1, 0, 0, 0, 10, 83, 1, 0, 0, 0, 12, 85, 1, 0, 0, 0, 14, 97, 1, 0, 0, 0, 16, 109, 1, 0, 0, 0, 18, 125, 1, 0, 0, 0, 20, 137, 1, 0, 0, 0, 22, 146, 1, 0, 0, 0, 24, 148, 1, 0, 0, 0, 26, 160, 1, 0, 0, 0, 28, 169, 1, 0, 0, 0, 30, 174, 1, 0, 0, 0, 32, 186, 1, 0, 0, 0, 34, 196, 1, 0, 0, 0, 36, 205, 1, 0, 0, 0, 38, 209, 1, 0, 0, 0, 40, 213, 1, 0, 0, 0, 42, 215, 1, 0, 0, 0, 44, 231, 1, 0, 0, 0, 46, 234, 1, 0, 0, 0, 48, 303, 1, 0, 0, 0, 50, 357, 1, 0, 0, 0, 52, 364, 1, 0, 0, 0, 54, 366, 1, 0, 0, 0, 56, 370, 1, 0, 0, 0, 58, 60, 3, 2, 1, 0, 59, 58, 1, 0, 0, 0, 60, 63, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 61, 62, 1, 0, 0, 0, 62, 64, 1, 0, 0, 0, 63, 61, 1, 0, 0, 0, 64, 65, 3, 12, 6, 0, 65, 66, 5, 0, 0, 1, 66, 1, 1, 0, 0, 0, 67, 68, 5, 1, 0, 0, 68, 69, 3, 4, 2, 0, 69, 70, 3, 6, 3, 0, 70, 71, 5, 2, 0, 0, 71, 3, 1, 0, 0, 0, 72, 73, 5, 3, 0, 0, 73, 5, 1, 0, 0, 0, 74, 76, 3, 8, 4, 0, 75, 77, 3, 8, 4, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 7, 1, 0, 0, 0, 78, 80, 3, 10, 5, 0, 79, 78, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 82, 5, 59, 0, 0, 82, 9, 1, 0, 0, 0, 83, 84, 7, 0, 0, 0, 84, 11, 1, 0, 0, 0, 85, 86, 5, 11, 0, 0, 86, 87, 5, 72, 0, 0, 87, 88, 3, 16, 8, 0, 88, 92, 5, 12, 0, 0, 89, 91, 3, 14, 7, 0, 90, 89, 1, 0, 0, 0, 91, 94, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 95, 1, 0, 0, 0, 94, 92, 1, 0, 0, 0, 95, 96, 5, 13, 0, 0, 96, 13, 1, 0, 0, 0, 97, 98, 5, 14, 0, 0, 98, 99, 5, 72, 0, 0, 99, 100, 3, 16, 8, 0, 100, 104, 5, 12, 0, 0, 101, 103, 3, 22, 11, 0, 102, 101, 1, 0, 0, 0, 103, 106, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 107, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 108, 5, 13, 0, 0, 108, 15, 1, 0, 0, 0, 109, 121, 5, 15, 0, 0, 110, 115, 3, 18, 9, 0, 111, 112, 5, 16, 0, 0, 112, 114, 3, 18, 9, 0, 113, 111, 1, 0, 0, 0, 114, 117, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116, 119, 1, 0, 0, 0, 117, 115, 1, 0, 0, 0, 118, 120, 5, 16, 0, 0, 119, 118, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 122, 1, 0, 0, 0, 121, 110, 1, 0, 0, 0, 121, 122, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 124, 5, 17, 0, 0, 124, 17, 1, 0, 0, 0, 125, 126, 3, 56, 28, 0, 126, 127, 5, 72, 0, 0, 127, 19, 1, 0, 0, 0, 128, 132, 5, 12, 0, 0, 129, 131, 3, 22, 11, 0, 130, 129, 1, 0, 0, 0, 131, 134, 1, 0, 0, 0, 132, 130, 1, 0, 0, 0, 132, 133, 1, 0, 0, 0, 133, 135, 1, 0, 0, 0, 134, 132, 1, 0, 0, 0, 135, 138, 5, 13, 0, 0, 136, 138, 3, 22, 11, 0, 137, 128, 1, 0, 0, 0, 137, 136, 1, 0, 0, 0, 138, 21, 1, 0, 0, 0, 139, 147, 3, 24, 12, 0, 140, 147, 3, 26, 13, 0, 141, 147, 3, 28, 14, 0, 142, 147, 3, 30, 15, 0, 143, 147, 3, 32, 16, 0, 144, 147, 3, 34, 17, 0, 145, 147, 3, 36, 18, 0, 146, 139, 1, 0, 0, 0, 146, 140, 1, 0, 0, 0, 146, 141, 1, 0, 0, 0, 146, 142, 1, 0, 0, 0, 146, 143, 1, 0, 0, 0, 146, 144, 1, 0, 0, 0, 146, 145, 1, 0, 0, 0, 147, 23, 1, 0, 0, 0, 148, 152, 3, 56, 28, 0, 149, 151, 3, 50, 25, 0, 150, 149, 1, 0, 0, 0, 151, 154, 1, 0, 0, 0, 152, 150, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 155, 1, 0, 0, 0, 154, 152, 1, 0, 0, 0, 155, 156, 5, 72, 0, 0, 156, 157, 5, 10, 0, 0, 157, 158, 3, 48, 24, 0, 158, 159, 5, 2, 0, 0, 159, 25, 1, 0, 0, 0, 160, 161, 3, 56, 28, 0, 161, 162, 5, 72, 0, 0, 162, 163, 5, 16, 0, 0, 163, 164, 3, 56, 28, 0, 164, 165, 5, 72, 0, 0, 165, 166, 5, 10, 0, 0, 166, 167, 3, 48, 24, 0, 167, 168, 5, 2, 0, 0, 168, 27, 1, 0, 0, 0, 169, 170, 5, 72, 0, 0, 170, 171, 5, 10, 0, 0, 171, 172, 3, 48, 24, 0, 172, 173, 5, 2, 0, 0, 173, 29, 1, 0, 0, 0, 174, 175, 5, 18, 0, 0, 175, 176, 5, 15, 0, 0, 176, 177, 5, 70, 0, 0, 177, 178, 5, 6, 0, 0, 178, 181, 3, 48, 24, 0, 179, 180, 5, 16, 0, 0, 180, 182, 3, 38, 19, 0, 181, 179, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 184, 5, 17, 0, 0, 184, 185, 5, 2, 0, 0, 185, 31, 1, 0, 0, 0, 186, 187, 5, 18, 0, 0, 187, 188, 5, 15, 0, 0, 188, 191, 3, 48, 24, 0, 189, 190, 5, 16, 0, 0, 190, 192, 3, 38, 19, 0, 191, 189, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, 194, 5, 17, 0, 0, 194, 195, 5, 2, 0, 0, 195, 33, 1, 0, 0, 0, 196, 197, 5, 19, 0, 0, 197, 198, 5, 15, 0, 0, 198, 199, 3, 48, 24, 0, 199, 200, 5, 17, 0, 0, 200, 203, 3, 20, 10, 0, 201, 202, 5, 20, 0, 0, 202, 204, 3, 20, 10, 0, 203, 201, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 35, 1, 0, 0, 0, 205, 206, 5, 21, 0, 0, 206, 207, 3, 42, 21, 0, 207, 208, 5, 2, 0, 0, 208, 37, 1, 0, 0, 0, 209, 210, 5, 67, 0, 0, 210, 39, 1, 0, 0, 0, 211, 214, 5, 72, 0, 0, 212, 214, 3, 52, 26, 0, 213, 211, 1, 0, 0, 0, 213, 212, 1, 0, 0, 0, 214, 41, 1, 0, 0, 0, 215, 227, 5, 15, 0, 0, 216, 221, 3, 40, 20, 0, 217, 218, 5, 16, 0, 0, 218, 220, 3, 40, 20, 0, 219, 217, 1, 0, 0, 0, 220, 223, 1, 0, 0, 0, 221, 219, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 225, 1, 0, 0, 0, 223, 221, 1, 0, 0, 0, 224, 226, 5, 16, 0, 0, 225, 224, 1, 0, 0, 0, 225, 226, 1, 0, 0, 0, 226, 228, 1, 0, 0, 0, 227, 216, 1, 0, 0, 0, 227, 228, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 230, 5, 17, 0, 0, 230, 43, 1, 0, 0, 0, 231, 232, 5, 72, 0, 0, 232, 233, 3, 46, 23, 0, 233, 45, 1, 0, 0, 0, 234, 246, 5, 15, 0, 0, 235, 240, 3, 48, 24, 0, 236, 237, 5, 16, 0, 0, 237, 239, 3, 48, 24, 0, 238, 236, 1, 0, 0, 0, 239, 242, 1, 0, 0, 0, 240, 238, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 244, 1, 0, 0, 0, 242, 240, 1, 0, 0, 0, 243, 245, 5, 16, 0, 0, 244, 243, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 247, 1, 0, 0, 0, 246, 235, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 249, 5, 17, 0, 0, 249, 47, 1, 0, 0, 0, 250, 251, 6, 24, -1, 0, 251, 252, 5, 15, 0, 0, 252, 253, 3, 48, 24, 0, 253, 254, 5, 17, 0, 0, 254, 304, 1, 0, 0, 0, 255, 256, 3, 56, 28, 0, 256, 257, 5, 15, 0, 0, 257, 260, 3, 48, 24, 0, 258, 259, 5, 16, 0, 0, 259, 261, 3, 48, 24, 0, 260, 258, 1, 0, 0, 0, 260, 261, 1, 0, 0, 0, 261, 263, 1, 0, 0, 0, 262, 264, 5, 16, 0, 0, 263, 262, 1, 0, 0, 0, 263, 264, 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 266, 5, 17, 0, 0, 266, 304, 1, 0, 0, 0, 267, 304, 3, 44, 22, 0, 268, 269, 5, 22, 0, 0, 269, 270, 5, 72, 0, 0, 270, 304, 3, 46, 23, 0, 271, 272, 5, 25, 0, 0, 272, 273, 5, 23, 0, 0, 273, 274, 3, 48, 24, 0, 274, 275, 5, 24, 0, 0, 275, 276, 7, 1, 0, 0, 276, 304, 1, 0, 0, 0, 277, 278, 5, 31, 0, 0, 278, 279, 5, 23, 0, 0, 279, 280, 3, 48, 24, 0, 280, 281, 5, 24, 0, 0, 281, 282, 7, 2, 0, 0, 282, 304, 1, 0, 0, 0, 283, 284, 7, 3, 0, 0, 284, 304, 3, 48, 24, 14, 285, 297, 5, 23, 0, 0, 286, 291, 3, 48, 24, 0, 287, 288, 5, 16, 0, 0, 288, 290, 3, 48, 24, 0, 289, 287, 1, 0, 0, 0, 290, 293, 1, 0, 0, 0, 291, 289, 1, 0, 0, 0, 291, 292, 1, 0, 0, 0, 292, 295, 1, 0, 0, 0, 293, 291, 1, 0, 0, 0, 294, 296, 5, 16, 0, 0, 295, 294, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 298, 1, 0, 0, 0, 297, 286, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 304, 5, 24, 0, 0, 300, 304, 5, 71, 0, 0, 301, 304, 5, 72, 0, 0, 302, 304, 3, 52, 26, 0, 303, 250, 1, 0, 0, 0, 303, 255, 1, 0, 0, 0, 303, 267, 1, 0, 0, 0, 303, 268, 1, 0, 0, 0, 303, 271, 1, 0, 0, 0, 303, 277, 1, 0, 0, 0, 303, 283, 1, 0, 0, 0, 303, 285, 1, 0, 0, 0, 303, 300, 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, 303, 302, 1, 0, 0, 0, 304, 354, 1, 0, 0, 0, 305, 306, 10, 13, 0, 0, 306, 307, 7, 4, 0, 0, 307, 353, 3, 48, 24, 14, 308, 309, 10, 12, 0, 0, 309, 310, 7, 5, 0, 0, 310, 353, 3, 48, 24, 13, 311, 312, 10, 11, 0, 0, 312, 313, 7, 6, 0, 0, 313, 353, 3, 48, 24, 12, 314, 315, 10, 10, 0, 0, 315, 316, 7, 7, 0, 0, 316, 353, 3, 48, 24, 11, 317, 318, 10, 9, 0, 0, 318, 319, 5, 48, 0, 0, 319, 353, 3, 48, 24, 10, 320, 321, 10, 8, 0, 0, 321, 322, 5, 4, 0, 0, 322, 353, 3, 48, 24, 9, 323, 324, 10, 7, 0, 0, 324, 325, 5, 49, 0, 0, 325, 353, 3, 48, 24, 8, 326, 327, 10, 6, 0, 0, 327, 328, 5, 50, 0, 0, 328, 353, 3, 48, 24, 7, 329, 330, 10, 5, 0, 0, 330, 331, 5, 51, 0, 0, 331, 353, 3, 48, 24, 6, 332, 333, 10, 20, 0, 0, 333, 334, 5, 23, 0, 0, 334, 335, 5, 62, 0, 0, 335, 353, 5, 24, 0, 0, 336, 337, 10, 17, 0, 0, 337, 353, 7, 8, 0, 0, 338, 339, 10, 16, 0, 0, 339, 340, 5, 38, 0, 0, 340, 341, 5, 15, 0, 0, 341, 342, 3, 48, 24, 0, 342, 343, 5, 17, 0, 0, 343, 353, 1, 0, 0, 0, 344, 345, 10, 15, 0, 0, 345, 346, 5, 39, 0, 0, 346, 347, 5, 15, 0, 0, 347, 348, 3, 48, 24, 0, 348, 349, 5, 16, 0, 0, 349, 350, 3, 48, 24, 0, 350, 351, 5, 17, 0, 0, 351, 353, 1, 0, 0, 0, 352, 305, 1, 0, 0, 0, 352, 308, 1, 0, 0, 0, 352, 311, 1, 0, 0, 0, 352, 314, 1, 0, 0, 0, 352, 317, 1, 0, 0, 0, 352, 320, 1, 0, 0, 0, 352, 323, 1, 0, 0, 0, 352, 326, 1, 0, 0, 0, 352, 329, 1, 0, 0, 0, 352, 332, 1, 0, 0, 0, 352, 336, 1, 0, 0, 0, 352, 338, 1, 0, 0, 0, 352, 344, 1, 0, 0, 0, 353, 356, 1, 0, 0, 0, 354, 352, 1, 0, 0, 0, 354, 355, 1, 0, 0, 0, 355, 49, 1, 0, 0, 0, 356, 354, 1, 0, 0, 0, 357, 358, 5, 52, 0, 0, 358, 51, 1, 0, 0, 0, 359, 365, 5, 60, 0, 0, 360, 365, 3, 54, 27, 0, 361, 365, 5, 67, 0, 0, 362, 365, 5, 68, 0, 0, 363, 365, 5, 69, 0, 0, 364, 359, 1, 0, 0, 0, 364, 360, 1, 0, 0, 0, 364, 361, 1, 0, 0, 0, 364, 362, 1, 0, 0, 0, 364, 363, 1, 0, 0, 0, 365, 53, 1, 0, 0, 0, 366, 368, 5, 62, 0, 0, 367, 369, 5, 61, 0, 0, 368, 367, 1, 0, 0, 0, 368, 369, 1, 0, 0, 0, 369, 55, 1, 0, 0, 0, 370, 371, 7, 9, 0, 0, 371, 57, 1, 0, 0, 0, 32, 61, 76, 79, 92, 104, 115, 119, 121, 132, 137, 146, 152, 181, 191, 203, 213, 221, 225, 227, 240, 244, 246, 260, 263, 291, 295, 297, 303, 352, 354, 364, 368] \ No newline at end of file diff --git a/packages/cashc/src/grammar/CashScript.tokens b/packages/cashc/src/grammar/CashScript.tokens index c4593418f..4e0173da3 100644 --- a/packages/cashc/src/grammar/CashScript.tokens +++ b/packages/cashc/src/grammar/CashScript.tokens @@ -55,23 +55,24 @@ T__53=54 T__54=55 T__55=56 T__56=57 -VersionLiteral=58 -BooleanLiteral=59 -NumberUnit=60 -NumberLiteral=61 -NumberPart=62 -ExponentPart=63 -Bytes=64 -Bound=65 -StringLiteral=66 -DateLiteral=67 -HexLiteral=68 -TxVar=69 -NullaryOp=70 -Identifier=71 -WHITESPACE=72 -COMMENT=73 -LINE_COMMENT=74 +T__57=58 +VersionLiteral=59 +BooleanLiteral=60 +NumberUnit=61 +NumberLiteral=62 +NumberPart=63 +ExponentPart=64 +Bytes=65 +Bound=66 +StringLiteral=67 +DateLiteral=68 +HexLiteral=69 +TxVar=70 +NullaryOp=71 +Identifier=72 +WHITESPACE=73 +COMMENT=74 +LINE_COMMENT=75 'pragma'=1 ';'=2 'cashscript'=3 @@ -110,22 +111,23 @@ LINE_COMMENT=74 '.reverse()'=36 '.length'=37 '.split'=38 -'!'=39 -'-'=40 -'*'=41 -'/'=42 -'%'=43 -'+'=44 -'=='=45 -'!='=46 -'&'=47 -'|'=48 -'&&'=49 -'||'=50 -'constant'=51 -'int'=52 -'bool'=53 -'string'=54 -'pubkey'=55 -'sig'=56 -'datasig'=57 +'.slice'=39 +'!'=40 +'-'=41 +'*'=42 +'/'=43 +'%'=44 +'+'=45 +'=='=46 +'!='=47 +'&'=48 +'|'=49 +'&&'=50 +'||'=51 +'constant'=52 +'int'=53 +'bool'=54 +'string'=55 +'pubkey'=56 +'sig'=57 +'datasig'=58 diff --git a/packages/cashc/src/grammar/CashScriptLexer.interp b/packages/cashc/src/grammar/CashScriptLexer.interp index 7c142a523..a4c165f23 100644 --- a/packages/cashc/src/grammar/CashScriptLexer.interp +++ b/packages/cashc/src/grammar/CashScriptLexer.interp @@ -38,6 +38,7 @@ null '.reverse()' '.length' '.split' +'.slice' '!' '-' '*' @@ -134,6 +135,7 @@ null null null null +null VersionLiteral BooleanLiteral NumberUnit @@ -210,6 +212,7 @@ T__53 T__54 T__55 T__56 +T__57 VersionLiteral BooleanLiteral NumberUnit @@ -236,4 +239,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 74, 836, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 39, 1, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, 1, 57, 4, 57, 512, 8, 57, 11, 57, 12, 57, 513, 1, 57, 1, 57, 4, 57, 518, 8, 57, 11, 57, 12, 57, 519, 1, 57, 1, 57, 4, 57, 524, 8, 57, 11, 57, 12, 57, 525, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 3, 58, 537, 8, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 3, 59, 596, 8, 59, 1, 60, 3, 60, 599, 8, 60, 1, 60, 1, 60, 3, 60, 603, 8, 60, 1, 61, 4, 61, 606, 8, 61, 11, 61, 12, 61, 607, 1, 61, 1, 61, 4, 61, 612, 8, 61, 11, 61, 12, 61, 613, 5, 61, 616, 8, 61, 10, 61, 12, 61, 619, 9, 61, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 3, 63, 631, 8, 63, 1, 63, 1, 63, 1, 63, 1, 63, 3, 63, 637, 8, 63, 1, 64, 1, 64, 5, 64, 641, 8, 64, 10, 64, 12, 64, 644, 9, 64, 1, 65, 1, 65, 1, 65, 1, 65, 5, 65, 650, 8, 65, 10, 65, 12, 65, 653, 9, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 5, 65, 660, 8, 65, 10, 65, 12, 65, 663, 9, 65, 1, 65, 3, 65, 666, 8, 65, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 67, 1, 67, 1, 67, 5, 67, 680, 8, 67, 10, 67, 12, 67, 683, 9, 67, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 3, 68, 700, 8, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 3, 69, 796, 8, 69, 1, 70, 1, 70, 5, 70, 800, 8, 70, 10, 70, 12, 70, 803, 9, 70, 1, 71, 4, 71, 806, 8, 71, 11, 71, 12, 71, 807, 1, 71, 1, 71, 1, 72, 1, 72, 1, 72, 1, 72, 5, 72, 816, 8, 72, 10, 72, 12, 72, 819, 9, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 1, 73, 5, 73, 830, 8, 73, 10, 73, 12, 73, 833, 9, 73, 1, 73, 1, 73, 3, 651, 661, 817, 0, 74, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 53, 107, 54, 109, 55, 111, 56, 113, 57, 115, 58, 117, 59, 119, 60, 121, 61, 123, 62, 125, 63, 127, 64, 129, 65, 131, 66, 133, 67, 135, 68, 137, 69, 139, 70, 141, 71, 143, 72, 145, 73, 147, 74, 1, 0, 11, 1, 0, 48, 57, 2, 0, 69, 69, 101, 101, 1, 0, 49, 57, 3, 0, 10, 10, 13, 13, 34, 34, 3, 0, 10, 10, 13, 13, 39, 39, 2, 0, 88, 88, 120, 120, 3, 0, 48, 57, 65, 70, 97, 102, 2, 0, 65, 90, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 12, 13, 32, 32, 2, 0, 10, 10, 13, 13, 872, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, 0, 109, 1, 0, 0, 0, 0, 111, 1, 0, 0, 0, 0, 113, 1, 0, 0, 0, 0, 115, 1, 0, 0, 0, 0, 117, 1, 0, 0, 0, 0, 119, 1, 0, 0, 0, 0, 121, 1, 0, 0, 0, 0, 123, 1, 0, 0, 0, 0, 125, 1, 0, 0, 0, 0, 127, 1, 0, 0, 0, 0, 129, 1, 0, 0, 0, 0, 131, 1, 0, 0, 0, 0, 133, 1, 0, 0, 0, 0, 135, 1, 0, 0, 0, 0, 137, 1, 0, 0, 0, 0, 139, 1, 0, 0, 0, 0, 141, 1, 0, 0, 0, 0, 143, 1, 0, 0, 0, 0, 145, 1, 0, 0, 0, 0, 147, 1, 0, 0, 0, 1, 149, 1, 0, 0, 0, 3, 156, 1, 0, 0, 0, 5, 158, 1, 0, 0, 0, 7, 169, 1, 0, 0, 0, 9, 171, 1, 0, 0, 0, 11, 173, 1, 0, 0, 0, 13, 176, 1, 0, 0, 0, 15, 178, 1, 0, 0, 0, 17, 180, 1, 0, 0, 0, 19, 183, 1, 0, 0, 0, 21, 185, 1, 0, 0, 0, 23, 194, 1, 0, 0, 0, 25, 196, 1, 0, 0, 0, 27, 198, 1, 0, 0, 0, 29, 207, 1, 0, 0, 0, 31, 209, 1, 0, 0, 0, 33, 211, 1, 0, 0, 0, 35, 213, 1, 0, 0, 0, 37, 221, 1, 0, 0, 0, 39, 224, 1, 0, 0, 0, 41, 229, 1, 0, 0, 0, 43, 241, 1, 0, 0, 0, 45, 245, 1, 0, 0, 0, 47, 247, 1, 0, 0, 0, 49, 249, 1, 0, 0, 0, 51, 260, 1, 0, 0, 0, 53, 267, 1, 0, 0, 0, 55, 284, 1, 0, 0, 0, 57, 299, 1, 0, 0, 0, 59, 314, 1, 0, 0, 0, 61, 327, 1, 0, 0, 0, 63, 337, 1, 0, 0, 0, 65, 362, 1, 0, 0, 0, 67, 377, 1, 0, 0, 0, 69, 396, 1, 0, 0, 0, 71, 412, 1, 0, 0, 0, 73, 423, 1, 0, 0, 0, 75, 431, 1, 0, 0, 0, 77, 438, 1, 0, 0, 0, 79, 440, 1, 0, 0, 0, 81, 442, 1, 0, 0, 0, 83, 444, 1, 0, 0, 0, 85, 446, 1, 0, 0, 0, 87, 448, 1, 0, 0, 0, 89, 450, 1, 0, 0, 0, 91, 453, 1, 0, 0, 0, 93, 456, 1, 0, 0, 0, 95, 458, 1, 0, 0, 0, 97, 460, 1, 0, 0, 0, 99, 463, 1, 0, 0, 0, 101, 466, 1, 0, 0, 0, 103, 475, 1, 0, 0, 0, 105, 479, 1, 0, 0, 0, 107, 484, 1, 0, 0, 0, 109, 491, 1, 0, 0, 0, 111, 498, 1, 0, 0, 0, 113, 502, 1, 0, 0, 0, 115, 511, 1, 0, 0, 0, 117, 536, 1, 0, 0, 0, 119, 595, 1, 0, 0, 0, 121, 598, 1, 0, 0, 0, 123, 605, 1, 0, 0, 0, 125, 620, 1, 0, 0, 0, 127, 636, 1, 0, 0, 0, 129, 638, 1, 0, 0, 0, 131, 665, 1, 0, 0, 0, 133, 667, 1, 0, 0, 0, 135, 676, 1, 0, 0, 0, 137, 699, 1, 0, 0, 0, 139, 795, 1, 0, 0, 0, 141, 797, 1, 0, 0, 0, 143, 805, 1, 0, 0, 0, 145, 811, 1, 0, 0, 0, 147, 825, 1, 0, 0, 0, 149, 150, 5, 112, 0, 0, 150, 151, 5, 114, 0, 0, 151, 152, 5, 97, 0, 0, 152, 153, 5, 103, 0, 0, 153, 154, 5, 109, 0, 0, 154, 155, 5, 97, 0, 0, 155, 2, 1, 0, 0, 0, 156, 157, 5, 59, 0, 0, 157, 4, 1, 0, 0, 0, 158, 159, 5, 99, 0, 0, 159, 160, 5, 97, 0, 0, 160, 161, 5, 115, 0, 0, 161, 162, 5, 104, 0, 0, 162, 163, 5, 115, 0, 0, 163, 164, 5, 99, 0, 0, 164, 165, 5, 114, 0, 0, 165, 166, 5, 105, 0, 0, 166, 167, 5, 112, 0, 0, 167, 168, 5, 116, 0, 0, 168, 6, 1, 0, 0, 0, 169, 170, 5, 94, 0, 0, 170, 8, 1, 0, 0, 0, 171, 172, 5, 126, 0, 0, 172, 10, 1, 0, 0, 0, 173, 174, 5, 62, 0, 0, 174, 175, 5, 61, 0, 0, 175, 12, 1, 0, 0, 0, 176, 177, 5, 62, 0, 0, 177, 14, 1, 0, 0, 0, 178, 179, 5, 60, 0, 0, 179, 16, 1, 0, 0, 0, 180, 181, 5, 60, 0, 0, 181, 182, 5, 61, 0, 0, 182, 18, 1, 0, 0, 0, 183, 184, 5, 61, 0, 0, 184, 20, 1, 0, 0, 0, 185, 186, 5, 99, 0, 0, 186, 187, 5, 111, 0, 0, 187, 188, 5, 110, 0, 0, 188, 189, 5, 116, 0, 0, 189, 190, 5, 114, 0, 0, 190, 191, 5, 97, 0, 0, 191, 192, 5, 99, 0, 0, 192, 193, 5, 116, 0, 0, 193, 22, 1, 0, 0, 0, 194, 195, 5, 123, 0, 0, 195, 24, 1, 0, 0, 0, 196, 197, 5, 125, 0, 0, 197, 26, 1, 0, 0, 0, 198, 199, 5, 102, 0, 0, 199, 200, 5, 117, 0, 0, 200, 201, 5, 110, 0, 0, 201, 202, 5, 99, 0, 0, 202, 203, 5, 116, 0, 0, 203, 204, 5, 105, 0, 0, 204, 205, 5, 111, 0, 0, 205, 206, 5, 110, 0, 0, 206, 28, 1, 0, 0, 0, 207, 208, 5, 40, 0, 0, 208, 30, 1, 0, 0, 0, 209, 210, 5, 44, 0, 0, 210, 32, 1, 0, 0, 0, 211, 212, 5, 41, 0, 0, 212, 34, 1, 0, 0, 0, 213, 214, 5, 114, 0, 0, 214, 215, 5, 101, 0, 0, 215, 216, 5, 113, 0, 0, 216, 217, 5, 117, 0, 0, 217, 218, 5, 105, 0, 0, 218, 219, 5, 114, 0, 0, 219, 220, 5, 101, 0, 0, 220, 36, 1, 0, 0, 0, 221, 222, 5, 105, 0, 0, 222, 223, 5, 102, 0, 0, 223, 38, 1, 0, 0, 0, 224, 225, 5, 101, 0, 0, 225, 226, 5, 108, 0, 0, 226, 227, 5, 115, 0, 0, 227, 228, 5, 101, 0, 0, 228, 40, 1, 0, 0, 0, 229, 230, 5, 99, 0, 0, 230, 231, 5, 111, 0, 0, 231, 232, 5, 110, 0, 0, 232, 233, 5, 115, 0, 0, 233, 234, 5, 111, 0, 0, 234, 235, 5, 108, 0, 0, 235, 236, 5, 101, 0, 0, 236, 237, 5, 46, 0, 0, 237, 238, 5, 108, 0, 0, 238, 239, 5, 111, 0, 0, 239, 240, 5, 103, 0, 0, 240, 42, 1, 0, 0, 0, 241, 242, 5, 110, 0, 0, 242, 243, 5, 101, 0, 0, 243, 244, 5, 119, 0, 0, 244, 44, 1, 0, 0, 0, 245, 246, 5, 91, 0, 0, 246, 46, 1, 0, 0, 0, 247, 248, 5, 93, 0, 0, 248, 48, 1, 0, 0, 0, 249, 250, 5, 116, 0, 0, 250, 251, 5, 120, 0, 0, 251, 252, 5, 46, 0, 0, 252, 253, 5, 111, 0, 0, 253, 254, 5, 117, 0, 0, 254, 255, 5, 116, 0, 0, 255, 256, 5, 112, 0, 0, 256, 257, 5, 117, 0, 0, 257, 258, 5, 116, 0, 0, 258, 259, 5, 115, 0, 0, 259, 50, 1, 0, 0, 0, 260, 261, 5, 46, 0, 0, 261, 262, 5, 118, 0, 0, 262, 263, 5, 97, 0, 0, 263, 264, 5, 108, 0, 0, 264, 265, 5, 117, 0, 0, 265, 266, 5, 101, 0, 0, 266, 52, 1, 0, 0, 0, 267, 268, 5, 46, 0, 0, 268, 269, 5, 108, 0, 0, 269, 270, 5, 111, 0, 0, 270, 271, 5, 99, 0, 0, 271, 272, 5, 107, 0, 0, 272, 273, 5, 105, 0, 0, 273, 274, 5, 110, 0, 0, 274, 275, 5, 103, 0, 0, 275, 276, 5, 66, 0, 0, 276, 277, 5, 121, 0, 0, 277, 278, 5, 116, 0, 0, 278, 279, 5, 101, 0, 0, 279, 280, 5, 99, 0, 0, 280, 281, 5, 111, 0, 0, 281, 282, 5, 100, 0, 0, 282, 283, 5, 101, 0, 0, 283, 54, 1, 0, 0, 0, 284, 285, 5, 46, 0, 0, 285, 286, 5, 116, 0, 0, 286, 287, 5, 111, 0, 0, 287, 288, 5, 107, 0, 0, 288, 289, 5, 101, 0, 0, 289, 290, 5, 110, 0, 0, 290, 291, 5, 67, 0, 0, 291, 292, 5, 97, 0, 0, 292, 293, 5, 116, 0, 0, 293, 294, 5, 101, 0, 0, 294, 295, 5, 103, 0, 0, 295, 296, 5, 111, 0, 0, 296, 297, 5, 114, 0, 0, 297, 298, 5, 121, 0, 0, 298, 56, 1, 0, 0, 0, 299, 300, 5, 46, 0, 0, 300, 301, 5, 110, 0, 0, 301, 302, 5, 102, 0, 0, 302, 303, 5, 116, 0, 0, 303, 304, 5, 67, 0, 0, 304, 305, 5, 111, 0, 0, 305, 306, 5, 109, 0, 0, 306, 307, 5, 109, 0, 0, 307, 308, 5, 105, 0, 0, 308, 309, 5, 116, 0, 0, 309, 310, 5, 109, 0, 0, 310, 311, 5, 101, 0, 0, 311, 312, 5, 110, 0, 0, 312, 313, 5, 116, 0, 0, 313, 58, 1, 0, 0, 0, 314, 315, 5, 46, 0, 0, 315, 316, 5, 116, 0, 0, 316, 317, 5, 111, 0, 0, 317, 318, 5, 107, 0, 0, 318, 319, 5, 101, 0, 0, 319, 320, 5, 110, 0, 0, 320, 321, 5, 65, 0, 0, 321, 322, 5, 109, 0, 0, 322, 323, 5, 111, 0, 0, 323, 324, 5, 117, 0, 0, 324, 325, 5, 110, 0, 0, 325, 326, 5, 116, 0, 0, 326, 60, 1, 0, 0, 0, 327, 328, 5, 116, 0, 0, 328, 329, 5, 120, 0, 0, 329, 330, 5, 46, 0, 0, 330, 331, 5, 105, 0, 0, 331, 332, 5, 110, 0, 0, 332, 333, 5, 112, 0, 0, 333, 334, 5, 117, 0, 0, 334, 335, 5, 116, 0, 0, 335, 336, 5, 115, 0, 0, 336, 62, 1, 0, 0, 0, 337, 338, 5, 46, 0, 0, 338, 339, 5, 111, 0, 0, 339, 340, 5, 117, 0, 0, 340, 341, 5, 116, 0, 0, 341, 342, 5, 112, 0, 0, 342, 343, 5, 111, 0, 0, 343, 344, 5, 105, 0, 0, 344, 345, 5, 110, 0, 0, 345, 346, 5, 116, 0, 0, 346, 347, 5, 84, 0, 0, 347, 348, 5, 114, 0, 0, 348, 349, 5, 97, 0, 0, 349, 350, 5, 110, 0, 0, 350, 351, 5, 115, 0, 0, 351, 352, 5, 97, 0, 0, 352, 353, 5, 99, 0, 0, 353, 354, 5, 116, 0, 0, 354, 355, 5, 105, 0, 0, 355, 356, 5, 111, 0, 0, 356, 357, 5, 110, 0, 0, 357, 358, 5, 72, 0, 0, 358, 359, 5, 97, 0, 0, 359, 360, 5, 115, 0, 0, 360, 361, 5, 104, 0, 0, 361, 64, 1, 0, 0, 0, 362, 363, 5, 46, 0, 0, 363, 364, 5, 111, 0, 0, 364, 365, 5, 117, 0, 0, 365, 366, 5, 116, 0, 0, 366, 367, 5, 112, 0, 0, 367, 368, 5, 111, 0, 0, 368, 369, 5, 105, 0, 0, 369, 370, 5, 110, 0, 0, 370, 371, 5, 116, 0, 0, 371, 372, 5, 73, 0, 0, 372, 373, 5, 110, 0, 0, 373, 374, 5, 100, 0, 0, 374, 375, 5, 101, 0, 0, 375, 376, 5, 120, 0, 0, 376, 66, 1, 0, 0, 0, 377, 378, 5, 46, 0, 0, 378, 379, 5, 117, 0, 0, 379, 380, 5, 110, 0, 0, 380, 381, 5, 108, 0, 0, 381, 382, 5, 111, 0, 0, 382, 383, 5, 99, 0, 0, 383, 384, 5, 107, 0, 0, 384, 385, 5, 105, 0, 0, 385, 386, 5, 110, 0, 0, 386, 387, 5, 103, 0, 0, 387, 388, 5, 66, 0, 0, 388, 389, 5, 121, 0, 0, 389, 390, 5, 116, 0, 0, 390, 391, 5, 101, 0, 0, 391, 392, 5, 99, 0, 0, 392, 393, 5, 111, 0, 0, 393, 394, 5, 100, 0, 0, 394, 395, 5, 101, 0, 0, 395, 68, 1, 0, 0, 0, 396, 397, 5, 46, 0, 0, 397, 398, 5, 115, 0, 0, 398, 399, 5, 101, 0, 0, 399, 400, 5, 113, 0, 0, 400, 401, 5, 117, 0, 0, 401, 402, 5, 101, 0, 0, 402, 403, 5, 110, 0, 0, 403, 404, 5, 99, 0, 0, 404, 405, 5, 101, 0, 0, 405, 406, 5, 78, 0, 0, 406, 407, 5, 117, 0, 0, 407, 408, 5, 109, 0, 0, 408, 409, 5, 98, 0, 0, 409, 410, 5, 101, 0, 0, 410, 411, 5, 114, 0, 0, 411, 70, 1, 0, 0, 0, 412, 413, 5, 46, 0, 0, 413, 414, 5, 114, 0, 0, 414, 415, 5, 101, 0, 0, 415, 416, 5, 118, 0, 0, 416, 417, 5, 101, 0, 0, 417, 418, 5, 114, 0, 0, 418, 419, 5, 115, 0, 0, 419, 420, 5, 101, 0, 0, 420, 421, 5, 40, 0, 0, 421, 422, 5, 41, 0, 0, 422, 72, 1, 0, 0, 0, 423, 424, 5, 46, 0, 0, 424, 425, 5, 108, 0, 0, 425, 426, 5, 101, 0, 0, 426, 427, 5, 110, 0, 0, 427, 428, 5, 103, 0, 0, 428, 429, 5, 116, 0, 0, 429, 430, 5, 104, 0, 0, 430, 74, 1, 0, 0, 0, 431, 432, 5, 46, 0, 0, 432, 433, 5, 115, 0, 0, 433, 434, 5, 112, 0, 0, 434, 435, 5, 108, 0, 0, 435, 436, 5, 105, 0, 0, 436, 437, 5, 116, 0, 0, 437, 76, 1, 0, 0, 0, 438, 439, 5, 33, 0, 0, 439, 78, 1, 0, 0, 0, 440, 441, 5, 45, 0, 0, 441, 80, 1, 0, 0, 0, 442, 443, 5, 42, 0, 0, 443, 82, 1, 0, 0, 0, 444, 445, 5, 47, 0, 0, 445, 84, 1, 0, 0, 0, 446, 447, 5, 37, 0, 0, 447, 86, 1, 0, 0, 0, 448, 449, 5, 43, 0, 0, 449, 88, 1, 0, 0, 0, 450, 451, 5, 61, 0, 0, 451, 452, 5, 61, 0, 0, 452, 90, 1, 0, 0, 0, 453, 454, 5, 33, 0, 0, 454, 455, 5, 61, 0, 0, 455, 92, 1, 0, 0, 0, 456, 457, 5, 38, 0, 0, 457, 94, 1, 0, 0, 0, 458, 459, 5, 124, 0, 0, 459, 96, 1, 0, 0, 0, 460, 461, 5, 38, 0, 0, 461, 462, 5, 38, 0, 0, 462, 98, 1, 0, 0, 0, 463, 464, 5, 124, 0, 0, 464, 465, 5, 124, 0, 0, 465, 100, 1, 0, 0, 0, 466, 467, 5, 99, 0, 0, 467, 468, 5, 111, 0, 0, 468, 469, 5, 110, 0, 0, 469, 470, 5, 115, 0, 0, 470, 471, 5, 116, 0, 0, 471, 472, 5, 97, 0, 0, 472, 473, 5, 110, 0, 0, 473, 474, 5, 116, 0, 0, 474, 102, 1, 0, 0, 0, 475, 476, 5, 105, 0, 0, 476, 477, 5, 110, 0, 0, 477, 478, 5, 116, 0, 0, 478, 104, 1, 0, 0, 0, 479, 480, 5, 98, 0, 0, 480, 481, 5, 111, 0, 0, 481, 482, 5, 111, 0, 0, 482, 483, 5, 108, 0, 0, 483, 106, 1, 0, 0, 0, 484, 485, 5, 115, 0, 0, 485, 486, 5, 116, 0, 0, 486, 487, 5, 114, 0, 0, 487, 488, 5, 105, 0, 0, 488, 489, 5, 110, 0, 0, 489, 490, 5, 103, 0, 0, 490, 108, 1, 0, 0, 0, 491, 492, 5, 112, 0, 0, 492, 493, 5, 117, 0, 0, 493, 494, 5, 98, 0, 0, 494, 495, 5, 107, 0, 0, 495, 496, 5, 101, 0, 0, 496, 497, 5, 121, 0, 0, 497, 110, 1, 0, 0, 0, 498, 499, 5, 115, 0, 0, 499, 500, 5, 105, 0, 0, 500, 501, 5, 103, 0, 0, 501, 112, 1, 0, 0, 0, 502, 503, 5, 100, 0, 0, 503, 504, 5, 97, 0, 0, 504, 505, 5, 116, 0, 0, 505, 506, 5, 97, 0, 0, 506, 507, 5, 115, 0, 0, 507, 508, 5, 105, 0, 0, 508, 509, 5, 103, 0, 0, 509, 114, 1, 0, 0, 0, 510, 512, 7, 0, 0, 0, 511, 510, 1, 0, 0, 0, 512, 513, 1, 0, 0, 0, 513, 511, 1, 0, 0, 0, 513, 514, 1, 0, 0, 0, 514, 515, 1, 0, 0, 0, 515, 517, 5, 46, 0, 0, 516, 518, 7, 0, 0, 0, 517, 516, 1, 0, 0, 0, 518, 519, 1, 0, 0, 0, 519, 517, 1, 0, 0, 0, 519, 520, 1, 0, 0, 0, 520, 521, 1, 0, 0, 0, 521, 523, 5, 46, 0, 0, 522, 524, 7, 0, 0, 0, 523, 522, 1, 0, 0, 0, 524, 525, 1, 0, 0, 0, 525, 523, 1, 0, 0, 0, 525, 526, 1, 0, 0, 0, 526, 116, 1, 0, 0, 0, 527, 528, 5, 116, 0, 0, 528, 529, 5, 114, 0, 0, 529, 530, 5, 117, 0, 0, 530, 537, 5, 101, 0, 0, 531, 532, 5, 102, 0, 0, 532, 533, 5, 97, 0, 0, 533, 534, 5, 108, 0, 0, 534, 535, 5, 115, 0, 0, 535, 537, 5, 101, 0, 0, 536, 527, 1, 0, 0, 0, 536, 531, 1, 0, 0, 0, 537, 118, 1, 0, 0, 0, 538, 539, 5, 115, 0, 0, 539, 540, 5, 97, 0, 0, 540, 541, 5, 116, 0, 0, 541, 542, 5, 111, 0, 0, 542, 543, 5, 115, 0, 0, 543, 544, 5, 104, 0, 0, 544, 545, 5, 105, 0, 0, 545, 596, 5, 115, 0, 0, 546, 547, 5, 115, 0, 0, 547, 548, 5, 97, 0, 0, 548, 549, 5, 116, 0, 0, 549, 596, 5, 115, 0, 0, 550, 551, 5, 102, 0, 0, 551, 552, 5, 105, 0, 0, 552, 553, 5, 110, 0, 0, 553, 554, 5, 110, 0, 0, 554, 555, 5, 101, 0, 0, 555, 596, 5, 121, 0, 0, 556, 557, 5, 98, 0, 0, 557, 558, 5, 105, 0, 0, 558, 559, 5, 116, 0, 0, 559, 596, 5, 115, 0, 0, 560, 561, 5, 98, 0, 0, 561, 562, 5, 105, 0, 0, 562, 563, 5, 116, 0, 0, 563, 564, 5, 99, 0, 0, 564, 565, 5, 111, 0, 0, 565, 566, 5, 105, 0, 0, 566, 596, 5, 110, 0, 0, 567, 568, 5, 115, 0, 0, 568, 569, 5, 101, 0, 0, 569, 570, 5, 99, 0, 0, 570, 571, 5, 111, 0, 0, 571, 572, 5, 110, 0, 0, 572, 573, 5, 100, 0, 0, 573, 596, 5, 115, 0, 0, 574, 575, 5, 109, 0, 0, 575, 576, 5, 105, 0, 0, 576, 577, 5, 110, 0, 0, 577, 578, 5, 117, 0, 0, 578, 579, 5, 116, 0, 0, 579, 580, 5, 101, 0, 0, 580, 596, 5, 115, 0, 0, 581, 582, 5, 104, 0, 0, 582, 583, 5, 111, 0, 0, 583, 584, 5, 117, 0, 0, 584, 585, 5, 114, 0, 0, 585, 596, 5, 115, 0, 0, 586, 587, 5, 100, 0, 0, 587, 588, 5, 97, 0, 0, 588, 589, 5, 121, 0, 0, 589, 596, 5, 115, 0, 0, 590, 591, 5, 119, 0, 0, 591, 592, 5, 101, 0, 0, 592, 593, 5, 101, 0, 0, 593, 594, 5, 107, 0, 0, 594, 596, 5, 115, 0, 0, 595, 538, 1, 0, 0, 0, 595, 546, 1, 0, 0, 0, 595, 550, 1, 0, 0, 0, 595, 556, 1, 0, 0, 0, 595, 560, 1, 0, 0, 0, 595, 567, 1, 0, 0, 0, 595, 574, 1, 0, 0, 0, 595, 581, 1, 0, 0, 0, 595, 586, 1, 0, 0, 0, 595, 590, 1, 0, 0, 0, 596, 120, 1, 0, 0, 0, 597, 599, 5, 45, 0, 0, 598, 597, 1, 0, 0, 0, 598, 599, 1, 0, 0, 0, 599, 600, 1, 0, 0, 0, 600, 602, 3, 123, 61, 0, 601, 603, 3, 125, 62, 0, 602, 601, 1, 0, 0, 0, 602, 603, 1, 0, 0, 0, 603, 122, 1, 0, 0, 0, 604, 606, 7, 0, 0, 0, 605, 604, 1, 0, 0, 0, 606, 607, 1, 0, 0, 0, 607, 605, 1, 0, 0, 0, 607, 608, 1, 0, 0, 0, 608, 617, 1, 0, 0, 0, 609, 611, 5, 95, 0, 0, 610, 612, 7, 0, 0, 0, 611, 610, 1, 0, 0, 0, 612, 613, 1, 0, 0, 0, 613, 611, 1, 0, 0, 0, 613, 614, 1, 0, 0, 0, 614, 616, 1, 0, 0, 0, 615, 609, 1, 0, 0, 0, 616, 619, 1, 0, 0, 0, 617, 615, 1, 0, 0, 0, 617, 618, 1, 0, 0, 0, 618, 124, 1, 0, 0, 0, 619, 617, 1, 0, 0, 0, 620, 621, 7, 1, 0, 0, 621, 622, 3, 123, 61, 0, 622, 126, 1, 0, 0, 0, 623, 624, 5, 98, 0, 0, 624, 625, 5, 121, 0, 0, 625, 626, 5, 116, 0, 0, 626, 627, 5, 101, 0, 0, 627, 628, 5, 115, 0, 0, 628, 630, 1, 0, 0, 0, 629, 631, 3, 129, 64, 0, 630, 629, 1, 0, 0, 0, 630, 631, 1, 0, 0, 0, 631, 637, 1, 0, 0, 0, 632, 633, 5, 98, 0, 0, 633, 634, 5, 121, 0, 0, 634, 635, 5, 116, 0, 0, 635, 637, 5, 101, 0, 0, 636, 623, 1, 0, 0, 0, 636, 632, 1, 0, 0, 0, 637, 128, 1, 0, 0, 0, 638, 642, 7, 2, 0, 0, 639, 641, 7, 0, 0, 0, 640, 639, 1, 0, 0, 0, 641, 644, 1, 0, 0, 0, 642, 640, 1, 0, 0, 0, 642, 643, 1, 0, 0, 0, 643, 130, 1, 0, 0, 0, 644, 642, 1, 0, 0, 0, 645, 651, 5, 34, 0, 0, 646, 647, 5, 92, 0, 0, 647, 650, 5, 34, 0, 0, 648, 650, 8, 3, 0, 0, 649, 646, 1, 0, 0, 0, 649, 648, 1, 0, 0, 0, 650, 653, 1, 0, 0, 0, 651, 652, 1, 0, 0, 0, 651, 649, 1, 0, 0, 0, 652, 654, 1, 0, 0, 0, 653, 651, 1, 0, 0, 0, 654, 666, 5, 34, 0, 0, 655, 661, 5, 39, 0, 0, 656, 657, 5, 92, 0, 0, 657, 660, 5, 39, 0, 0, 658, 660, 8, 4, 0, 0, 659, 656, 1, 0, 0, 0, 659, 658, 1, 0, 0, 0, 660, 663, 1, 0, 0, 0, 661, 662, 1, 0, 0, 0, 661, 659, 1, 0, 0, 0, 662, 664, 1, 0, 0, 0, 663, 661, 1, 0, 0, 0, 664, 666, 5, 39, 0, 0, 665, 645, 1, 0, 0, 0, 665, 655, 1, 0, 0, 0, 666, 132, 1, 0, 0, 0, 667, 668, 5, 100, 0, 0, 668, 669, 5, 97, 0, 0, 669, 670, 5, 116, 0, 0, 670, 671, 5, 101, 0, 0, 671, 672, 5, 40, 0, 0, 672, 673, 1, 0, 0, 0, 673, 674, 3, 131, 65, 0, 674, 675, 5, 41, 0, 0, 675, 134, 1, 0, 0, 0, 676, 677, 5, 48, 0, 0, 677, 681, 7, 5, 0, 0, 678, 680, 7, 6, 0, 0, 679, 678, 1, 0, 0, 0, 680, 683, 1, 0, 0, 0, 681, 679, 1, 0, 0, 0, 681, 682, 1, 0, 0, 0, 682, 136, 1, 0, 0, 0, 683, 681, 1, 0, 0, 0, 684, 685, 5, 116, 0, 0, 685, 686, 5, 104, 0, 0, 686, 687, 5, 105, 0, 0, 687, 688, 5, 115, 0, 0, 688, 689, 5, 46, 0, 0, 689, 690, 5, 97, 0, 0, 690, 691, 5, 103, 0, 0, 691, 700, 5, 101, 0, 0, 692, 693, 5, 116, 0, 0, 693, 694, 5, 120, 0, 0, 694, 695, 5, 46, 0, 0, 695, 696, 5, 116, 0, 0, 696, 697, 5, 105, 0, 0, 697, 698, 5, 109, 0, 0, 698, 700, 5, 101, 0, 0, 699, 684, 1, 0, 0, 0, 699, 692, 1, 0, 0, 0, 700, 138, 1, 0, 0, 0, 701, 702, 5, 116, 0, 0, 702, 703, 5, 104, 0, 0, 703, 704, 5, 105, 0, 0, 704, 705, 5, 115, 0, 0, 705, 706, 5, 46, 0, 0, 706, 707, 5, 97, 0, 0, 707, 708, 5, 99, 0, 0, 708, 709, 5, 116, 0, 0, 709, 710, 5, 105, 0, 0, 710, 711, 5, 118, 0, 0, 711, 712, 5, 101, 0, 0, 712, 713, 5, 73, 0, 0, 713, 714, 5, 110, 0, 0, 714, 715, 5, 112, 0, 0, 715, 716, 5, 117, 0, 0, 716, 717, 5, 116, 0, 0, 717, 718, 5, 73, 0, 0, 718, 719, 5, 110, 0, 0, 719, 720, 5, 100, 0, 0, 720, 721, 5, 101, 0, 0, 721, 796, 5, 120, 0, 0, 722, 723, 5, 116, 0, 0, 723, 724, 5, 104, 0, 0, 724, 725, 5, 105, 0, 0, 725, 726, 5, 115, 0, 0, 726, 727, 5, 46, 0, 0, 727, 728, 5, 97, 0, 0, 728, 729, 5, 99, 0, 0, 729, 730, 5, 116, 0, 0, 730, 731, 5, 105, 0, 0, 731, 732, 5, 118, 0, 0, 732, 733, 5, 101, 0, 0, 733, 734, 5, 66, 0, 0, 734, 735, 5, 121, 0, 0, 735, 736, 5, 116, 0, 0, 736, 737, 5, 101, 0, 0, 737, 738, 5, 99, 0, 0, 738, 739, 5, 111, 0, 0, 739, 740, 5, 100, 0, 0, 740, 796, 5, 101, 0, 0, 741, 742, 5, 116, 0, 0, 742, 743, 5, 120, 0, 0, 743, 744, 5, 46, 0, 0, 744, 745, 5, 105, 0, 0, 745, 746, 5, 110, 0, 0, 746, 747, 5, 112, 0, 0, 747, 748, 5, 117, 0, 0, 748, 749, 5, 116, 0, 0, 749, 750, 5, 115, 0, 0, 750, 751, 5, 46, 0, 0, 751, 752, 5, 108, 0, 0, 752, 753, 5, 101, 0, 0, 753, 754, 5, 110, 0, 0, 754, 755, 5, 103, 0, 0, 755, 756, 5, 116, 0, 0, 756, 796, 5, 104, 0, 0, 757, 758, 5, 116, 0, 0, 758, 759, 5, 120, 0, 0, 759, 760, 5, 46, 0, 0, 760, 761, 5, 111, 0, 0, 761, 762, 5, 117, 0, 0, 762, 763, 5, 116, 0, 0, 763, 764, 5, 112, 0, 0, 764, 765, 5, 117, 0, 0, 765, 766, 5, 116, 0, 0, 766, 767, 5, 115, 0, 0, 767, 768, 5, 46, 0, 0, 768, 769, 5, 108, 0, 0, 769, 770, 5, 101, 0, 0, 770, 771, 5, 110, 0, 0, 771, 772, 5, 103, 0, 0, 772, 773, 5, 116, 0, 0, 773, 796, 5, 104, 0, 0, 774, 775, 5, 116, 0, 0, 775, 776, 5, 120, 0, 0, 776, 777, 5, 46, 0, 0, 777, 778, 5, 118, 0, 0, 778, 779, 5, 101, 0, 0, 779, 780, 5, 114, 0, 0, 780, 781, 5, 115, 0, 0, 781, 782, 5, 105, 0, 0, 782, 783, 5, 111, 0, 0, 783, 796, 5, 110, 0, 0, 784, 785, 5, 116, 0, 0, 785, 786, 5, 120, 0, 0, 786, 787, 5, 46, 0, 0, 787, 788, 5, 108, 0, 0, 788, 789, 5, 111, 0, 0, 789, 790, 5, 99, 0, 0, 790, 791, 5, 107, 0, 0, 791, 792, 5, 116, 0, 0, 792, 793, 5, 105, 0, 0, 793, 794, 5, 109, 0, 0, 794, 796, 5, 101, 0, 0, 795, 701, 1, 0, 0, 0, 795, 722, 1, 0, 0, 0, 795, 741, 1, 0, 0, 0, 795, 757, 1, 0, 0, 0, 795, 774, 1, 0, 0, 0, 795, 784, 1, 0, 0, 0, 796, 140, 1, 0, 0, 0, 797, 801, 7, 7, 0, 0, 798, 800, 7, 8, 0, 0, 799, 798, 1, 0, 0, 0, 800, 803, 1, 0, 0, 0, 801, 799, 1, 0, 0, 0, 801, 802, 1, 0, 0, 0, 802, 142, 1, 0, 0, 0, 803, 801, 1, 0, 0, 0, 804, 806, 7, 9, 0, 0, 805, 804, 1, 0, 0, 0, 806, 807, 1, 0, 0, 0, 807, 805, 1, 0, 0, 0, 807, 808, 1, 0, 0, 0, 808, 809, 1, 0, 0, 0, 809, 810, 6, 71, 0, 0, 810, 144, 1, 0, 0, 0, 811, 812, 5, 47, 0, 0, 812, 813, 5, 42, 0, 0, 813, 817, 1, 0, 0, 0, 814, 816, 9, 0, 0, 0, 815, 814, 1, 0, 0, 0, 816, 819, 1, 0, 0, 0, 817, 818, 1, 0, 0, 0, 817, 815, 1, 0, 0, 0, 818, 820, 1, 0, 0, 0, 819, 817, 1, 0, 0, 0, 820, 821, 5, 42, 0, 0, 821, 822, 5, 47, 0, 0, 822, 823, 1, 0, 0, 0, 823, 824, 6, 72, 1, 0, 824, 146, 1, 0, 0, 0, 825, 826, 5, 47, 0, 0, 826, 827, 5, 47, 0, 0, 827, 831, 1, 0, 0, 0, 828, 830, 8, 10, 0, 0, 829, 828, 1, 0, 0, 0, 830, 833, 1, 0, 0, 0, 831, 829, 1, 0, 0, 0, 831, 832, 1, 0, 0, 0, 832, 834, 1, 0, 0, 0, 833, 831, 1, 0, 0, 0, 834, 835, 6, 73, 1, 0, 835, 148, 1, 0, 0, 0, 26, 0, 513, 519, 525, 536, 595, 598, 602, 607, 613, 617, 630, 636, 642, 649, 651, 659, 661, 665, 681, 699, 795, 801, 807, 817, 831, 2, 6, 0, 0, 0, 1, 0] \ No newline at end of file +[4, 0, 75, 845, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 43, 1, 43, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 58, 4, 58, 521, 8, 58, 11, 58, 12, 58, 522, 1, 58, 1, 58, 4, 58, 527, 8, 58, 11, 58, 12, 58, 528, 1, 58, 1, 58, 4, 58, 533, 8, 58, 11, 58, 12, 58, 534, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 3, 59, 546, 8, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 3, 60, 605, 8, 60, 1, 61, 3, 61, 608, 8, 61, 1, 61, 1, 61, 3, 61, 612, 8, 61, 1, 62, 4, 62, 615, 8, 62, 11, 62, 12, 62, 616, 1, 62, 1, 62, 4, 62, 621, 8, 62, 11, 62, 12, 62, 622, 5, 62, 625, 8, 62, 10, 62, 12, 62, 628, 9, 62, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 3, 64, 640, 8, 64, 1, 64, 1, 64, 1, 64, 1, 64, 3, 64, 646, 8, 64, 1, 65, 1, 65, 5, 65, 650, 8, 65, 10, 65, 12, 65, 653, 9, 65, 1, 66, 1, 66, 1, 66, 1, 66, 5, 66, 659, 8, 66, 10, 66, 12, 66, 662, 9, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 5, 66, 669, 8, 66, 10, 66, 12, 66, 672, 9, 66, 1, 66, 3, 66, 675, 8, 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 68, 1, 68, 1, 68, 5, 68, 689, 8, 68, 10, 68, 12, 68, 692, 9, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 3, 69, 709, 8, 69, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 3, 70, 805, 8, 70, 1, 71, 1, 71, 5, 71, 809, 8, 71, 10, 71, 12, 71, 812, 9, 71, 1, 72, 4, 72, 815, 8, 72, 11, 72, 12, 72, 816, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 1, 73, 5, 73, 825, 8, 73, 10, 73, 12, 73, 828, 9, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 74, 1, 74, 1, 74, 1, 74, 5, 74, 839, 8, 74, 10, 74, 12, 74, 842, 9, 74, 1, 74, 1, 74, 3, 660, 670, 826, 0, 75, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 53, 107, 54, 109, 55, 111, 56, 113, 57, 115, 58, 117, 59, 119, 60, 121, 61, 123, 62, 125, 63, 127, 64, 129, 65, 131, 66, 133, 67, 135, 68, 137, 69, 139, 70, 141, 71, 143, 72, 145, 73, 147, 74, 149, 75, 1, 0, 11, 1, 0, 48, 57, 2, 0, 69, 69, 101, 101, 1, 0, 49, 57, 3, 0, 10, 10, 13, 13, 34, 34, 3, 0, 10, 10, 13, 13, 39, 39, 2, 0, 88, 88, 120, 120, 3, 0, 48, 57, 65, 70, 97, 102, 2, 0, 65, 90, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 12, 13, 32, 32, 2, 0, 10, 10, 13, 13, 881, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, 0, 109, 1, 0, 0, 0, 0, 111, 1, 0, 0, 0, 0, 113, 1, 0, 0, 0, 0, 115, 1, 0, 0, 0, 0, 117, 1, 0, 0, 0, 0, 119, 1, 0, 0, 0, 0, 121, 1, 0, 0, 0, 0, 123, 1, 0, 0, 0, 0, 125, 1, 0, 0, 0, 0, 127, 1, 0, 0, 0, 0, 129, 1, 0, 0, 0, 0, 131, 1, 0, 0, 0, 0, 133, 1, 0, 0, 0, 0, 135, 1, 0, 0, 0, 0, 137, 1, 0, 0, 0, 0, 139, 1, 0, 0, 0, 0, 141, 1, 0, 0, 0, 0, 143, 1, 0, 0, 0, 0, 145, 1, 0, 0, 0, 0, 147, 1, 0, 0, 0, 0, 149, 1, 0, 0, 0, 1, 151, 1, 0, 0, 0, 3, 158, 1, 0, 0, 0, 5, 160, 1, 0, 0, 0, 7, 171, 1, 0, 0, 0, 9, 173, 1, 0, 0, 0, 11, 175, 1, 0, 0, 0, 13, 178, 1, 0, 0, 0, 15, 180, 1, 0, 0, 0, 17, 182, 1, 0, 0, 0, 19, 185, 1, 0, 0, 0, 21, 187, 1, 0, 0, 0, 23, 196, 1, 0, 0, 0, 25, 198, 1, 0, 0, 0, 27, 200, 1, 0, 0, 0, 29, 209, 1, 0, 0, 0, 31, 211, 1, 0, 0, 0, 33, 213, 1, 0, 0, 0, 35, 215, 1, 0, 0, 0, 37, 223, 1, 0, 0, 0, 39, 226, 1, 0, 0, 0, 41, 231, 1, 0, 0, 0, 43, 243, 1, 0, 0, 0, 45, 247, 1, 0, 0, 0, 47, 249, 1, 0, 0, 0, 49, 251, 1, 0, 0, 0, 51, 262, 1, 0, 0, 0, 53, 269, 1, 0, 0, 0, 55, 286, 1, 0, 0, 0, 57, 301, 1, 0, 0, 0, 59, 316, 1, 0, 0, 0, 61, 329, 1, 0, 0, 0, 63, 339, 1, 0, 0, 0, 65, 364, 1, 0, 0, 0, 67, 379, 1, 0, 0, 0, 69, 398, 1, 0, 0, 0, 71, 414, 1, 0, 0, 0, 73, 425, 1, 0, 0, 0, 75, 433, 1, 0, 0, 0, 77, 440, 1, 0, 0, 0, 79, 447, 1, 0, 0, 0, 81, 449, 1, 0, 0, 0, 83, 451, 1, 0, 0, 0, 85, 453, 1, 0, 0, 0, 87, 455, 1, 0, 0, 0, 89, 457, 1, 0, 0, 0, 91, 459, 1, 0, 0, 0, 93, 462, 1, 0, 0, 0, 95, 465, 1, 0, 0, 0, 97, 467, 1, 0, 0, 0, 99, 469, 1, 0, 0, 0, 101, 472, 1, 0, 0, 0, 103, 475, 1, 0, 0, 0, 105, 484, 1, 0, 0, 0, 107, 488, 1, 0, 0, 0, 109, 493, 1, 0, 0, 0, 111, 500, 1, 0, 0, 0, 113, 507, 1, 0, 0, 0, 115, 511, 1, 0, 0, 0, 117, 520, 1, 0, 0, 0, 119, 545, 1, 0, 0, 0, 121, 604, 1, 0, 0, 0, 123, 607, 1, 0, 0, 0, 125, 614, 1, 0, 0, 0, 127, 629, 1, 0, 0, 0, 129, 645, 1, 0, 0, 0, 131, 647, 1, 0, 0, 0, 133, 674, 1, 0, 0, 0, 135, 676, 1, 0, 0, 0, 137, 685, 1, 0, 0, 0, 139, 708, 1, 0, 0, 0, 141, 804, 1, 0, 0, 0, 143, 806, 1, 0, 0, 0, 145, 814, 1, 0, 0, 0, 147, 820, 1, 0, 0, 0, 149, 834, 1, 0, 0, 0, 151, 152, 5, 112, 0, 0, 152, 153, 5, 114, 0, 0, 153, 154, 5, 97, 0, 0, 154, 155, 5, 103, 0, 0, 155, 156, 5, 109, 0, 0, 156, 157, 5, 97, 0, 0, 157, 2, 1, 0, 0, 0, 158, 159, 5, 59, 0, 0, 159, 4, 1, 0, 0, 0, 160, 161, 5, 99, 0, 0, 161, 162, 5, 97, 0, 0, 162, 163, 5, 115, 0, 0, 163, 164, 5, 104, 0, 0, 164, 165, 5, 115, 0, 0, 165, 166, 5, 99, 0, 0, 166, 167, 5, 114, 0, 0, 167, 168, 5, 105, 0, 0, 168, 169, 5, 112, 0, 0, 169, 170, 5, 116, 0, 0, 170, 6, 1, 0, 0, 0, 171, 172, 5, 94, 0, 0, 172, 8, 1, 0, 0, 0, 173, 174, 5, 126, 0, 0, 174, 10, 1, 0, 0, 0, 175, 176, 5, 62, 0, 0, 176, 177, 5, 61, 0, 0, 177, 12, 1, 0, 0, 0, 178, 179, 5, 62, 0, 0, 179, 14, 1, 0, 0, 0, 180, 181, 5, 60, 0, 0, 181, 16, 1, 0, 0, 0, 182, 183, 5, 60, 0, 0, 183, 184, 5, 61, 0, 0, 184, 18, 1, 0, 0, 0, 185, 186, 5, 61, 0, 0, 186, 20, 1, 0, 0, 0, 187, 188, 5, 99, 0, 0, 188, 189, 5, 111, 0, 0, 189, 190, 5, 110, 0, 0, 190, 191, 5, 116, 0, 0, 191, 192, 5, 114, 0, 0, 192, 193, 5, 97, 0, 0, 193, 194, 5, 99, 0, 0, 194, 195, 5, 116, 0, 0, 195, 22, 1, 0, 0, 0, 196, 197, 5, 123, 0, 0, 197, 24, 1, 0, 0, 0, 198, 199, 5, 125, 0, 0, 199, 26, 1, 0, 0, 0, 200, 201, 5, 102, 0, 0, 201, 202, 5, 117, 0, 0, 202, 203, 5, 110, 0, 0, 203, 204, 5, 99, 0, 0, 204, 205, 5, 116, 0, 0, 205, 206, 5, 105, 0, 0, 206, 207, 5, 111, 0, 0, 207, 208, 5, 110, 0, 0, 208, 28, 1, 0, 0, 0, 209, 210, 5, 40, 0, 0, 210, 30, 1, 0, 0, 0, 211, 212, 5, 44, 0, 0, 212, 32, 1, 0, 0, 0, 213, 214, 5, 41, 0, 0, 214, 34, 1, 0, 0, 0, 215, 216, 5, 114, 0, 0, 216, 217, 5, 101, 0, 0, 217, 218, 5, 113, 0, 0, 218, 219, 5, 117, 0, 0, 219, 220, 5, 105, 0, 0, 220, 221, 5, 114, 0, 0, 221, 222, 5, 101, 0, 0, 222, 36, 1, 0, 0, 0, 223, 224, 5, 105, 0, 0, 224, 225, 5, 102, 0, 0, 225, 38, 1, 0, 0, 0, 226, 227, 5, 101, 0, 0, 227, 228, 5, 108, 0, 0, 228, 229, 5, 115, 0, 0, 229, 230, 5, 101, 0, 0, 230, 40, 1, 0, 0, 0, 231, 232, 5, 99, 0, 0, 232, 233, 5, 111, 0, 0, 233, 234, 5, 110, 0, 0, 234, 235, 5, 115, 0, 0, 235, 236, 5, 111, 0, 0, 236, 237, 5, 108, 0, 0, 237, 238, 5, 101, 0, 0, 238, 239, 5, 46, 0, 0, 239, 240, 5, 108, 0, 0, 240, 241, 5, 111, 0, 0, 241, 242, 5, 103, 0, 0, 242, 42, 1, 0, 0, 0, 243, 244, 5, 110, 0, 0, 244, 245, 5, 101, 0, 0, 245, 246, 5, 119, 0, 0, 246, 44, 1, 0, 0, 0, 247, 248, 5, 91, 0, 0, 248, 46, 1, 0, 0, 0, 249, 250, 5, 93, 0, 0, 250, 48, 1, 0, 0, 0, 251, 252, 5, 116, 0, 0, 252, 253, 5, 120, 0, 0, 253, 254, 5, 46, 0, 0, 254, 255, 5, 111, 0, 0, 255, 256, 5, 117, 0, 0, 256, 257, 5, 116, 0, 0, 257, 258, 5, 112, 0, 0, 258, 259, 5, 117, 0, 0, 259, 260, 5, 116, 0, 0, 260, 261, 5, 115, 0, 0, 261, 50, 1, 0, 0, 0, 262, 263, 5, 46, 0, 0, 263, 264, 5, 118, 0, 0, 264, 265, 5, 97, 0, 0, 265, 266, 5, 108, 0, 0, 266, 267, 5, 117, 0, 0, 267, 268, 5, 101, 0, 0, 268, 52, 1, 0, 0, 0, 269, 270, 5, 46, 0, 0, 270, 271, 5, 108, 0, 0, 271, 272, 5, 111, 0, 0, 272, 273, 5, 99, 0, 0, 273, 274, 5, 107, 0, 0, 274, 275, 5, 105, 0, 0, 275, 276, 5, 110, 0, 0, 276, 277, 5, 103, 0, 0, 277, 278, 5, 66, 0, 0, 278, 279, 5, 121, 0, 0, 279, 280, 5, 116, 0, 0, 280, 281, 5, 101, 0, 0, 281, 282, 5, 99, 0, 0, 282, 283, 5, 111, 0, 0, 283, 284, 5, 100, 0, 0, 284, 285, 5, 101, 0, 0, 285, 54, 1, 0, 0, 0, 286, 287, 5, 46, 0, 0, 287, 288, 5, 116, 0, 0, 288, 289, 5, 111, 0, 0, 289, 290, 5, 107, 0, 0, 290, 291, 5, 101, 0, 0, 291, 292, 5, 110, 0, 0, 292, 293, 5, 67, 0, 0, 293, 294, 5, 97, 0, 0, 294, 295, 5, 116, 0, 0, 295, 296, 5, 101, 0, 0, 296, 297, 5, 103, 0, 0, 297, 298, 5, 111, 0, 0, 298, 299, 5, 114, 0, 0, 299, 300, 5, 121, 0, 0, 300, 56, 1, 0, 0, 0, 301, 302, 5, 46, 0, 0, 302, 303, 5, 110, 0, 0, 303, 304, 5, 102, 0, 0, 304, 305, 5, 116, 0, 0, 305, 306, 5, 67, 0, 0, 306, 307, 5, 111, 0, 0, 307, 308, 5, 109, 0, 0, 308, 309, 5, 109, 0, 0, 309, 310, 5, 105, 0, 0, 310, 311, 5, 116, 0, 0, 311, 312, 5, 109, 0, 0, 312, 313, 5, 101, 0, 0, 313, 314, 5, 110, 0, 0, 314, 315, 5, 116, 0, 0, 315, 58, 1, 0, 0, 0, 316, 317, 5, 46, 0, 0, 317, 318, 5, 116, 0, 0, 318, 319, 5, 111, 0, 0, 319, 320, 5, 107, 0, 0, 320, 321, 5, 101, 0, 0, 321, 322, 5, 110, 0, 0, 322, 323, 5, 65, 0, 0, 323, 324, 5, 109, 0, 0, 324, 325, 5, 111, 0, 0, 325, 326, 5, 117, 0, 0, 326, 327, 5, 110, 0, 0, 327, 328, 5, 116, 0, 0, 328, 60, 1, 0, 0, 0, 329, 330, 5, 116, 0, 0, 330, 331, 5, 120, 0, 0, 331, 332, 5, 46, 0, 0, 332, 333, 5, 105, 0, 0, 333, 334, 5, 110, 0, 0, 334, 335, 5, 112, 0, 0, 335, 336, 5, 117, 0, 0, 336, 337, 5, 116, 0, 0, 337, 338, 5, 115, 0, 0, 338, 62, 1, 0, 0, 0, 339, 340, 5, 46, 0, 0, 340, 341, 5, 111, 0, 0, 341, 342, 5, 117, 0, 0, 342, 343, 5, 116, 0, 0, 343, 344, 5, 112, 0, 0, 344, 345, 5, 111, 0, 0, 345, 346, 5, 105, 0, 0, 346, 347, 5, 110, 0, 0, 347, 348, 5, 116, 0, 0, 348, 349, 5, 84, 0, 0, 349, 350, 5, 114, 0, 0, 350, 351, 5, 97, 0, 0, 351, 352, 5, 110, 0, 0, 352, 353, 5, 115, 0, 0, 353, 354, 5, 97, 0, 0, 354, 355, 5, 99, 0, 0, 355, 356, 5, 116, 0, 0, 356, 357, 5, 105, 0, 0, 357, 358, 5, 111, 0, 0, 358, 359, 5, 110, 0, 0, 359, 360, 5, 72, 0, 0, 360, 361, 5, 97, 0, 0, 361, 362, 5, 115, 0, 0, 362, 363, 5, 104, 0, 0, 363, 64, 1, 0, 0, 0, 364, 365, 5, 46, 0, 0, 365, 366, 5, 111, 0, 0, 366, 367, 5, 117, 0, 0, 367, 368, 5, 116, 0, 0, 368, 369, 5, 112, 0, 0, 369, 370, 5, 111, 0, 0, 370, 371, 5, 105, 0, 0, 371, 372, 5, 110, 0, 0, 372, 373, 5, 116, 0, 0, 373, 374, 5, 73, 0, 0, 374, 375, 5, 110, 0, 0, 375, 376, 5, 100, 0, 0, 376, 377, 5, 101, 0, 0, 377, 378, 5, 120, 0, 0, 378, 66, 1, 0, 0, 0, 379, 380, 5, 46, 0, 0, 380, 381, 5, 117, 0, 0, 381, 382, 5, 110, 0, 0, 382, 383, 5, 108, 0, 0, 383, 384, 5, 111, 0, 0, 384, 385, 5, 99, 0, 0, 385, 386, 5, 107, 0, 0, 386, 387, 5, 105, 0, 0, 387, 388, 5, 110, 0, 0, 388, 389, 5, 103, 0, 0, 389, 390, 5, 66, 0, 0, 390, 391, 5, 121, 0, 0, 391, 392, 5, 116, 0, 0, 392, 393, 5, 101, 0, 0, 393, 394, 5, 99, 0, 0, 394, 395, 5, 111, 0, 0, 395, 396, 5, 100, 0, 0, 396, 397, 5, 101, 0, 0, 397, 68, 1, 0, 0, 0, 398, 399, 5, 46, 0, 0, 399, 400, 5, 115, 0, 0, 400, 401, 5, 101, 0, 0, 401, 402, 5, 113, 0, 0, 402, 403, 5, 117, 0, 0, 403, 404, 5, 101, 0, 0, 404, 405, 5, 110, 0, 0, 405, 406, 5, 99, 0, 0, 406, 407, 5, 101, 0, 0, 407, 408, 5, 78, 0, 0, 408, 409, 5, 117, 0, 0, 409, 410, 5, 109, 0, 0, 410, 411, 5, 98, 0, 0, 411, 412, 5, 101, 0, 0, 412, 413, 5, 114, 0, 0, 413, 70, 1, 0, 0, 0, 414, 415, 5, 46, 0, 0, 415, 416, 5, 114, 0, 0, 416, 417, 5, 101, 0, 0, 417, 418, 5, 118, 0, 0, 418, 419, 5, 101, 0, 0, 419, 420, 5, 114, 0, 0, 420, 421, 5, 115, 0, 0, 421, 422, 5, 101, 0, 0, 422, 423, 5, 40, 0, 0, 423, 424, 5, 41, 0, 0, 424, 72, 1, 0, 0, 0, 425, 426, 5, 46, 0, 0, 426, 427, 5, 108, 0, 0, 427, 428, 5, 101, 0, 0, 428, 429, 5, 110, 0, 0, 429, 430, 5, 103, 0, 0, 430, 431, 5, 116, 0, 0, 431, 432, 5, 104, 0, 0, 432, 74, 1, 0, 0, 0, 433, 434, 5, 46, 0, 0, 434, 435, 5, 115, 0, 0, 435, 436, 5, 112, 0, 0, 436, 437, 5, 108, 0, 0, 437, 438, 5, 105, 0, 0, 438, 439, 5, 116, 0, 0, 439, 76, 1, 0, 0, 0, 440, 441, 5, 46, 0, 0, 441, 442, 5, 115, 0, 0, 442, 443, 5, 108, 0, 0, 443, 444, 5, 105, 0, 0, 444, 445, 5, 99, 0, 0, 445, 446, 5, 101, 0, 0, 446, 78, 1, 0, 0, 0, 447, 448, 5, 33, 0, 0, 448, 80, 1, 0, 0, 0, 449, 450, 5, 45, 0, 0, 450, 82, 1, 0, 0, 0, 451, 452, 5, 42, 0, 0, 452, 84, 1, 0, 0, 0, 453, 454, 5, 47, 0, 0, 454, 86, 1, 0, 0, 0, 455, 456, 5, 37, 0, 0, 456, 88, 1, 0, 0, 0, 457, 458, 5, 43, 0, 0, 458, 90, 1, 0, 0, 0, 459, 460, 5, 61, 0, 0, 460, 461, 5, 61, 0, 0, 461, 92, 1, 0, 0, 0, 462, 463, 5, 33, 0, 0, 463, 464, 5, 61, 0, 0, 464, 94, 1, 0, 0, 0, 465, 466, 5, 38, 0, 0, 466, 96, 1, 0, 0, 0, 467, 468, 5, 124, 0, 0, 468, 98, 1, 0, 0, 0, 469, 470, 5, 38, 0, 0, 470, 471, 5, 38, 0, 0, 471, 100, 1, 0, 0, 0, 472, 473, 5, 124, 0, 0, 473, 474, 5, 124, 0, 0, 474, 102, 1, 0, 0, 0, 475, 476, 5, 99, 0, 0, 476, 477, 5, 111, 0, 0, 477, 478, 5, 110, 0, 0, 478, 479, 5, 115, 0, 0, 479, 480, 5, 116, 0, 0, 480, 481, 5, 97, 0, 0, 481, 482, 5, 110, 0, 0, 482, 483, 5, 116, 0, 0, 483, 104, 1, 0, 0, 0, 484, 485, 5, 105, 0, 0, 485, 486, 5, 110, 0, 0, 486, 487, 5, 116, 0, 0, 487, 106, 1, 0, 0, 0, 488, 489, 5, 98, 0, 0, 489, 490, 5, 111, 0, 0, 490, 491, 5, 111, 0, 0, 491, 492, 5, 108, 0, 0, 492, 108, 1, 0, 0, 0, 493, 494, 5, 115, 0, 0, 494, 495, 5, 116, 0, 0, 495, 496, 5, 114, 0, 0, 496, 497, 5, 105, 0, 0, 497, 498, 5, 110, 0, 0, 498, 499, 5, 103, 0, 0, 499, 110, 1, 0, 0, 0, 500, 501, 5, 112, 0, 0, 501, 502, 5, 117, 0, 0, 502, 503, 5, 98, 0, 0, 503, 504, 5, 107, 0, 0, 504, 505, 5, 101, 0, 0, 505, 506, 5, 121, 0, 0, 506, 112, 1, 0, 0, 0, 507, 508, 5, 115, 0, 0, 508, 509, 5, 105, 0, 0, 509, 510, 5, 103, 0, 0, 510, 114, 1, 0, 0, 0, 511, 512, 5, 100, 0, 0, 512, 513, 5, 97, 0, 0, 513, 514, 5, 116, 0, 0, 514, 515, 5, 97, 0, 0, 515, 516, 5, 115, 0, 0, 516, 517, 5, 105, 0, 0, 517, 518, 5, 103, 0, 0, 518, 116, 1, 0, 0, 0, 519, 521, 7, 0, 0, 0, 520, 519, 1, 0, 0, 0, 521, 522, 1, 0, 0, 0, 522, 520, 1, 0, 0, 0, 522, 523, 1, 0, 0, 0, 523, 524, 1, 0, 0, 0, 524, 526, 5, 46, 0, 0, 525, 527, 7, 0, 0, 0, 526, 525, 1, 0, 0, 0, 527, 528, 1, 0, 0, 0, 528, 526, 1, 0, 0, 0, 528, 529, 1, 0, 0, 0, 529, 530, 1, 0, 0, 0, 530, 532, 5, 46, 0, 0, 531, 533, 7, 0, 0, 0, 532, 531, 1, 0, 0, 0, 533, 534, 1, 0, 0, 0, 534, 532, 1, 0, 0, 0, 534, 535, 1, 0, 0, 0, 535, 118, 1, 0, 0, 0, 536, 537, 5, 116, 0, 0, 537, 538, 5, 114, 0, 0, 538, 539, 5, 117, 0, 0, 539, 546, 5, 101, 0, 0, 540, 541, 5, 102, 0, 0, 541, 542, 5, 97, 0, 0, 542, 543, 5, 108, 0, 0, 543, 544, 5, 115, 0, 0, 544, 546, 5, 101, 0, 0, 545, 536, 1, 0, 0, 0, 545, 540, 1, 0, 0, 0, 546, 120, 1, 0, 0, 0, 547, 548, 5, 115, 0, 0, 548, 549, 5, 97, 0, 0, 549, 550, 5, 116, 0, 0, 550, 551, 5, 111, 0, 0, 551, 552, 5, 115, 0, 0, 552, 553, 5, 104, 0, 0, 553, 554, 5, 105, 0, 0, 554, 605, 5, 115, 0, 0, 555, 556, 5, 115, 0, 0, 556, 557, 5, 97, 0, 0, 557, 558, 5, 116, 0, 0, 558, 605, 5, 115, 0, 0, 559, 560, 5, 102, 0, 0, 560, 561, 5, 105, 0, 0, 561, 562, 5, 110, 0, 0, 562, 563, 5, 110, 0, 0, 563, 564, 5, 101, 0, 0, 564, 605, 5, 121, 0, 0, 565, 566, 5, 98, 0, 0, 566, 567, 5, 105, 0, 0, 567, 568, 5, 116, 0, 0, 568, 605, 5, 115, 0, 0, 569, 570, 5, 98, 0, 0, 570, 571, 5, 105, 0, 0, 571, 572, 5, 116, 0, 0, 572, 573, 5, 99, 0, 0, 573, 574, 5, 111, 0, 0, 574, 575, 5, 105, 0, 0, 575, 605, 5, 110, 0, 0, 576, 577, 5, 115, 0, 0, 577, 578, 5, 101, 0, 0, 578, 579, 5, 99, 0, 0, 579, 580, 5, 111, 0, 0, 580, 581, 5, 110, 0, 0, 581, 582, 5, 100, 0, 0, 582, 605, 5, 115, 0, 0, 583, 584, 5, 109, 0, 0, 584, 585, 5, 105, 0, 0, 585, 586, 5, 110, 0, 0, 586, 587, 5, 117, 0, 0, 587, 588, 5, 116, 0, 0, 588, 589, 5, 101, 0, 0, 589, 605, 5, 115, 0, 0, 590, 591, 5, 104, 0, 0, 591, 592, 5, 111, 0, 0, 592, 593, 5, 117, 0, 0, 593, 594, 5, 114, 0, 0, 594, 605, 5, 115, 0, 0, 595, 596, 5, 100, 0, 0, 596, 597, 5, 97, 0, 0, 597, 598, 5, 121, 0, 0, 598, 605, 5, 115, 0, 0, 599, 600, 5, 119, 0, 0, 600, 601, 5, 101, 0, 0, 601, 602, 5, 101, 0, 0, 602, 603, 5, 107, 0, 0, 603, 605, 5, 115, 0, 0, 604, 547, 1, 0, 0, 0, 604, 555, 1, 0, 0, 0, 604, 559, 1, 0, 0, 0, 604, 565, 1, 0, 0, 0, 604, 569, 1, 0, 0, 0, 604, 576, 1, 0, 0, 0, 604, 583, 1, 0, 0, 0, 604, 590, 1, 0, 0, 0, 604, 595, 1, 0, 0, 0, 604, 599, 1, 0, 0, 0, 605, 122, 1, 0, 0, 0, 606, 608, 5, 45, 0, 0, 607, 606, 1, 0, 0, 0, 607, 608, 1, 0, 0, 0, 608, 609, 1, 0, 0, 0, 609, 611, 3, 125, 62, 0, 610, 612, 3, 127, 63, 0, 611, 610, 1, 0, 0, 0, 611, 612, 1, 0, 0, 0, 612, 124, 1, 0, 0, 0, 613, 615, 7, 0, 0, 0, 614, 613, 1, 0, 0, 0, 615, 616, 1, 0, 0, 0, 616, 614, 1, 0, 0, 0, 616, 617, 1, 0, 0, 0, 617, 626, 1, 0, 0, 0, 618, 620, 5, 95, 0, 0, 619, 621, 7, 0, 0, 0, 620, 619, 1, 0, 0, 0, 621, 622, 1, 0, 0, 0, 622, 620, 1, 0, 0, 0, 622, 623, 1, 0, 0, 0, 623, 625, 1, 0, 0, 0, 624, 618, 1, 0, 0, 0, 625, 628, 1, 0, 0, 0, 626, 624, 1, 0, 0, 0, 626, 627, 1, 0, 0, 0, 627, 126, 1, 0, 0, 0, 628, 626, 1, 0, 0, 0, 629, 630, 7, 1, 0, 0, 630, 631, 3, 125, 62, 0, 631, 128, 1, 0, 0, 0, 632, 633, 5, 98, 0, 0, 633, 634, 5, 121, 0, 0, 634, 635, 5, 116, 0, 0, 635, 636, 5, 101, 0, 0, 636, 637, 5, 115, 0, 0, 637, 639, 1, 0, 0, 0, 638, 640, 3, 131, 65, 0, 639, 638, 1, 0, 0, 0, 639, 640, 1, 0, 0, 0, 640, 646, 1, 0, 0, 0, 641, 642, 5, 98, 0, 0, 642, 643, 5, 121, 0, 0, 643, 644, 5, 116, 0, 0, 644, 646, 5, 101, 0, 0, 645, 632, 1, 0, 0, 0, 645, 641, 1, 0, 0, 0, 646, 130, 1, 0, 0, 0, 647, 651, 7, 2, 0, 0, 648, 650, 7, 0, 0, 0, 649, 648, 1, 0, 0, 0, 650, 653, 1, 0, 0, 0, 651, 649, 1, 0, 0, 0, 651, 652, 1, 0, 0, 0, 652, 132, 1, 0, 0, 0, 653, 651, 1, 0, 0, 0, 654, 660, 5, 34, 0, 0, 655, 656, 5, 92, 0, 0, 656, 659, 5, 34, 0, 0, 657, 659, 8, 3, 0, 0, 658, 655, 1, 0, 0, 0, 658, 657, 1, 0, 0, 0, 659, 662, 1, 0, 0, 0, 660, 661, 1, 0, 0, 0, 660, 658, 1, 0, 0, 0, 661, 663, 1, 0, 0, 0, 662, 660, 1, 0, 0, 0, 663, 675, 5, 34, 0, 0, 664, 670, 5, 39, 0, 0, 665, 666, 5, 92, 0, 0, 666, 669, 5, 39, 0, 0, 667, 669, 8, 4, 0, 0, 668, 665, 1, 0, 0, 0, 668, 667, 1, 0, 0, 0, 669, 672, 1, 0, 0, 0, 670, 671, 1, 0, 0, 0, 670, 668, 1, 0, 0, 0, 671, 673, 1, 0, 0, 0, 672, 670, 1, 0, 0, 0, 673, 675, 5, 39, 0, 0, 674, 654, 1, 0, 0, 0, 674, 664, 1, 0, 0, 0, 675, 134, 1, 0, 0, 0, 676, 677, 5, 100, 0, 0, 677, 678, 5, 97, 0, 0, 678, 679, 5, 116, 0, 0, 679, 680, 5, 101, 0, 0, 680, 681, 5, 40, 0, 0, 681, 682, 1, 0, 0, 0, 682, 683, 3, 133, 66, 0, 683, 684, 5, 41, 0, 0, 684, 136, 1, 0, 0, 0, 685, 686, 5, 48, 0, 0, 686, 690, 7, 5, 0, 0, 687, 689, 7, 6, 0, 0, 688, 687, 1, 0, 0, 0, 689, 692, 1, 0, 0, 0, 690, 688, 1, 0, 0, 0, 690, 691, 1, 0, 0, 0, 691, 138, 1, 0, 0, 0, 692, 690, 1, 0, 0, 0, 693, 694, 5, 116, 0, 0, 694, 695, 5, 104, 0, 0, 695, 696, 5, 105, 0, 0, 696, 697, 5, 115, 0, 0, 697, 698, 5, 46, 0, 0, 698, 699, 5, 97, 0, 0, 699, 700, 5, 103, 0, 0, 700, 709, 5, 101, 0, 0, 701, 702, 5, 116, 0, 0, 702, 703, 5, 120, 0, 0, 703, 704, 5, 46, 0, 0, 704, 705, 5, 116, 0, 0, 705, 706, 5, 105, 0, 0, 706, 707, 5, 109, 0, 0, 707, 709, 5, 101, 0, 0, 708, 693, 1, 0, 0, 0, 708, 701, 1, 0, 0, 0, 709, 140, 1, 0, 0, 0, 710, 711, 5, 116, 0, 0, 711, 712, 5, 104, 0, 0, 712, 713, 5, 105, 0, 0, 713, 714, 5, 115, 0, 0, 714, 715, 5, 46, 0, 0, 715, 716, 5, 97, 0, 0, 716, 717, 5, 99, 0, 0, 717, 718, 5, 116, 0, 0, 718, 719, 5, 105, 0, 0, 719, 720, 5, 118, 0, 0, 720, 721, 5, 101, 0, 0, 721, 722, 5, 73, 0, 0, 722, 723, 5, 110, 0, 0, 723, 724, 5, 112, 0, 0, 724, 725, 5, 117, 0, 0, 725, 726, 5, 116, 0, 0, 726, 727, 5, 73, 0, 0, 727, 728, 5, 110, 0, 0, 728, 729, 5, 100, 0, 0, 729, 730, 5, 101, 0, 0, 730, 805, 5, 120, 0, 0, 731, 732, 5, 116, 0, 0, 732, 733, 5, 104, 0, 0, 733, 734, 5, 105, 0, 0, 734, 735, 5, 115, 0, 0, 735, 736, 5, 46, 0, 0, 736, 737, 5, 97, 0, 0, 737, 738, 5, 99, 0, 0, 738, 739, 5, 116, 0, 0, 739, 740, 5, 105, 0, 0, 740, 741, 5, 118, 0, 0, 741, 742, 5, 101, 0, 0, 742, 743, 5, 66, 0, 0, 743, 744, 5, 121, 0, 0, 744, 745, 5, 116, 0, 0, 745, 746, 5, 101, 0, 0, 746, 747, 5, 99, 0, 0, 747, 748, 5, 111, 0, 0, 748, 749, 5, 100, 0, 0, 749, 805, 5, 101, 0, 0, 750, 751, 5, 116, 0, 0, 751, 752, 5, 120, 0, 0, 752, 753, 5, 46, 0, 0, 753, 754, 5, 105, 0, 0, 754, 755, 5, 110, 0, 0, 755, 756, 5, 112, 0, 0, 756, 757, 5, 117, 0, 0, 757, 758, 5, 116, 0, 0, 758, 759, 5, 115, 0, 0, 759, 760, 5, 46, 0, 0, 760, 761, 5, 108, 0, 0, 761, 762, 5, 101, 0, 0, 762, 763, 5, 110, 0, 0, 763, 764, 5, 103, 0, 0, 764, 765, 5, 116, 0, 0, 765, 805, 5, 104, 0, 0, 766, 767, 5, 116, 0, 0, 767, 768, 5, 120, 0, 0, 768, 769, 5, 46, 0, 0, 769, 770, 5, 111, 0, 0, 770, 771, 5, 117, 0, 0, 771, 772, 5, 116, 0, 0, 772, 773, 5, 112, 0, 0, 773, 774, 5, 117, 0, 0, 774, 775, 5, 116, 0, 0, 775, 776, 5, 115, 0, 0, 776, 777, 5, 46, 0, 0, 777, 778, 5, 108, 0, 0, 778, 779, 5, 101, 0, 0, 779, 780, 5, 110, 0, 0, 780, 781, 5, 103, 0, 0, 781, 782, 5, 116, 0, 0, 782, 805, 5, 104, 0, 0, 783, 784, 5, 116, 0, 0, 784, 785, 5, 120, 0, 0, 785, 786, 5, 46, 0, 0, 786, 787, 5, 118, 0, 0, 787, 788, 5, 101, 0, 0, 788, 789, 5, 114, 0, 0, 789, 790, 5, 115, 0, 0, 790, 791, 5, 105, 0, 0, 791, 792, 5, 111, 0, 0, 792, 805, 5, 110, 0, 0, 793, 794, 5, 116, 0, 0, 794, 795, 5, 120, 0, 0, 795, 796, 5, 46, 0, 0, 796, 797, 5, 108, 0, 0, 797, 798, 5, 111, 0, 0, 798, 799, 5, 99, 0, 0, 799, 800, 5, 107, 0, 0, 800, 801, 5, 116, 0, 0, 801, 802, 5, 105, 0, 0, 802, 803, 5, 109, 0, 0, 803, 805, 5, 101, 0, 0, 804, 710, 1, 0, 0, 0, 804, 731, 1, 0, 0, 0, 804, 750, 1, 0, 0, 0, 804, 766, 1, 0, 0, 0, 804, 783, 1, 0, 0, 0, 804, 793, 1, 0, 0, 0, 805, 142, 1, 0, 0, 0, 806, 810, 7, 7, 0, 0, 807, 809, 7, 8, 0, 0, 808, 807, 1, 0, 0, 0, 809, 812, 1, 0, 0, 0, 810, 808, 1, 0, 0, 0, 810, 811, 1, 0, 0, 0, 811, 144, 1, 0, 0, 0, 812, 810, 1, 0, 0, 0, 813, 815, 7, 9, 0, 0, 814, 813, 1, 0, 0, 0, 815, 816, 1, 0, 0, 0, 816, 814, 1, 0, 0, 0, 816, 817, 1, 0, 0, 0, 817, 818, 1, 0, 0, 0, 818, 819, 6, 72, 0, 0, 819, 146, 1, 0, 0, 0, 820, 821, 5, 47, 0, 0, 821, 822, 5, 42, 0, 0, 822, 826, 1, 0, 0, 0, 823, 825, 9, 0, 0, 0, 824, 823, 1, 0, 0, 0, 825, 828, 1, 0, 0, 0, 826, 827, 1, 0, 0, 0, 826, 824, 1, 0, 0, 0, 827, 829, 1, 0, 0, 0, 828, 826, 1, 0, 0, 0, 829, 830, 5, 42, 0, 0, 830, 831, 5, 47, 0, 0, 831, 832, 1, 0, 0, 0, 832, 833, 6, 73, 1, 0, 833, 148, 1, 0, 0, 0, 834, 835, 5, 47, 0, 0, 835, 836, 5, 47, 0, 0, 836, 840, 1, 0, 0, 0, 837, 839, 8, 10, 0, 0, 838, 837, 1, 0, 0, 0, 839, 842, 1, 0, 0, 0, 840, 838, 1, 0, 0, 0, 840, 841, 1, 0, 0, 0, 841, 843, 1, 0, 0, 0, 842, 840, 1, 0, 0, 0, 843, 844, 6, 74, 1, 0, 844, 150, 1, 0, 0, 0, 26, 0, 522, 528, 534, 545, 604, 607, 611, 616, 622, 626, 639, 645, 651, 658, 660, 668, 670, 674, 690, 708, 804, 810, 816, 826, 840, 2, 6, 0, 0, 0, 1, 0] \ No newline at end of file diff --git a/packages/cashc/src/grammar/CashScriptLexer.tokens b/packages/cashc/src/grammar/CashScriptLexer.tokens index c4593418f..4e0173da3 100644 --- a/packages/cashc/src/grammar/CashScriptLexer.tokens +++ b/packages/cashc/src/grammar/CashScriptLexer.tokens @@ -55,23 +55,24 @@ T__53=54 T__54=55 T__55=56 T__56=57 -VersionLiteral=58 -BooleanLiteral=59 -NumberUnit=60 -NumberLiteral=61 -NumberPart=62 -ExponentPart=63 -Bytes=64 -Bound=65 -StringLiteral=66 -DateLiteral=67 -HexLiteral=68 -TxVar=69 -NullaryOp=70 -Identifier=71 -WHITESPACE=72 -COMMENT=73 -LINE_COMMENT=74 +T__57=58 +VersionLiteral=59 +BooleanLiteral=60 +NumberUnit=61 +NumberLiteral=62 +NumberPart=63 +ExponentPart=64 +Bytes=65 +Bound=66 +StringLiteral=67 +DateLiteral=68 +HexLiteral=69 +TxVar=70 +NullaryOp=71 +Identifier=72 +WHITESPACE=73 +COMMENT=74 +LINE_COMMENT=75 'pragma'=1 ';'=2 'cashscript'=3 @@ -110,22 +111,23 @@ LINE_COMMENT=74 '.reverse()'=36 '.length'=37 '.split'=38 -'!'=39 -'-'=40 -'*'=41 -'/'=42 -'%'=43 -'+'=44 -'=='=45 -'!='=46 -'&'=47 -'|'=48 -'&&'=49 -'||'=50 -'constant'=51 -'int'=52 -'bool'=53 -'string'=54 -'pubkey'=55 -'sig'=56 -'datasig'=57 +'.slice'=39 +'!'=40 +'-'=41 +'*'=42 +'/'=43 +'%'=44 +'+'=45 +'=='=46 +'!='=47 +'&'=48 +'|'=49 +'&&'=50 +'||'=51 +'constant'=52 +'int'=53 +'bool'=54 +'string'=55 +'pubkey'=56 +'sig'=57 +'datasig'=58 diff --git a/packages/cashc/src/grammar/CashScriptLexer.ts b/packages/cashc/src/grammar/CashScriptLexer.ts index 87add6e5b..73ad0dcbb 100644 --- a/packages/cashc/src/grammar/CashScriptLexer.ts +++ b/packages/cashc/src/grammar/CashScriptLexer.ts @@ -69,23 +69,24 @@ export default class CashScriptLexer extends Lexer { public static readonly T__54 = 55; public static readonly T__55 = 56; public static readonly T__56 = 57; - public static readonly VersionLiteral = 58; - public static readonly BooleanLiteral = 59; - public static readonly NumberUnit = 60; - public static readonly NumberLiteral = 61; - public static readonly NumberPart = 62; - public static readonly ExponentPart = 63; - public static readonly Bytes = 64; - public static readonly Bound = 65; - public static readonly StringLiteral = 66; - public static readonly DateLiteral = 67; - public static readonly HexLiteral = 68; - public static readonly TxVar = 69; - public static readonly NullaryOp = 70; - public static readonly Identifier = 71; - public static readonly WHITESPACE = 72; - public static readonly COMMENT = 73; - public static readonly LINE_COMMENT = 74; + public static readonly T__57 = 58; + public static readonly VersionLiteral = 59; + public static readonly BooleanLiteral = 60; + public static readonly NumberUnit = 61; + public static readonly NumberLiteral = 62; + public static readonly NumberPart = 63; + public static readonly ExponentPart = 64; + public static readonly Bytes = 65; + public static readonly Bound = 66; + public static readonly StringLiteral = 67; + public static readonly DateLiteral = 68; + public static readonly HexLiteral = 69; + public static readonly TxVar = 70; + public static readonly NullaryOp = 71; + public static readonly Identifier = 72; + public static readonly WHITESPACE = 73; + public static readonly COMMENT = 74; + public static readonly LINE_COMMENT = 75; public static readonly EOF = Token.EOF; public static readonly channelNames: string[] = [ "DEFAULT_TOKEN_CHANNEL", "HIDDEN" ]; @@ -116,6 +117,7 @@ export default class CashScriptLexer extends Lexer { "'.reverse()'", "'.length'", "'.split'", + "'.slice'", "'!'", "'-'", "'*'", "'/'", "'%'", "'+'", @@ -156,7 +158,7 @@ export default class CashScriptLexer extends Lexer { null, null, null, null, null, null, - "VersionLiteral", + null, "VersionLiteral", "BooleanLiteral", "NumberUnit", "NumberLiteral", @@ -181,9 +183,10 @@ export default class CashScriptLexer extends Lexer { "T__33", "T__34", "T__35", "T__36", "T__37", "T__38", "T__39", "T__40", "T__41", "T__42", "T__43", "T__44", "T__45", "T__46", "T__47", "T__48", "T__49", "T__50", "T__51", "T__52", "T__53", "T__54", "T__55", "T__56", - "VersionLiteral", "BooleanLiteral", "NumberUnit", "NumberLiteral", "NumberPart", - "ExponentPart", "Bytes", "Bound", "StringLiteral", "DateLiteral", "HexLiteral", - "TxVar", "NullaryOp", "Identifier", "WHITESPACE", "COMMENT", "LINE_COMMENT", + "T__57", "VersionLiteral", "BooleanLiteral", "NumberUnit", "NumberLiteral", + "NumberPart", "ExponentPart", "Bytes", "Bound", "StringLiteral", "DateLiteral", + "HexLiteral", "TxVar", "NullaryOp", "Identifier", "WHITESPACE", "COMMENT", + "LINE_COMMENT", ]; @@ -204,7 +207,7 @@ export default class CashScriptLexer extends Lexer { public get modeNames(): string[] { return CashScriptLexer.modeNames; } - public static readonly _serializedATN: number[] = [4,0,74,836,6,-1,2,0, + public static readonly _serializedATN: number[] = [4,0,75,845,6,-1,2,0, 7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9, 7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7, 16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23, @@ -214,270 +217,273 @@ export default class CashScriptLexer extends Lexer { 45,2,46,7,46,2,47,7,47,2,48,7,48,2,49,7,49,2,50,7,50,2,51,7,51,2,52,7,52, 2,53,7,53,2,54,7,54,2,55,7,55,2,56,7,56,2,57,7,57,2,58,7,58,2,59,7,59,2, 60,7,60,2,61,7,61,2,62,7,62,2,63,7,63,2,64,7,64,2,65,7,65,2,66,7,66,2,67, - 7,67,2,68,7,68,2,69,7,69,2,70,7,70,2,71,7,71,2,72,7,72,2,73,7,73,1,0,1, - 0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1, - 2,1,3,1,3,1,4,1,4,1,5,1,5,1,5,1,6,1,6,1,7,1,7,1,8,1,8,1,8,1,9,1,9,1,10, - 1,10,1,10,1,10,1,10,1,10,1,10,1,10,1,10,1,11,1,11,1,12,1,12,1,13,1,13,1, - 13,1,13,1,13,1,13,1,13,1,13,1,13,1,14,1,14,1,15,1,15,1,16,1,16,1,17,1,17, - 1,17,1,17,1,17,1,17,1,17,1,17,1,18,1,18,1,18,1,19,1,19,1,19,1,19,1,19,1, - 20,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,21,1,21,1,21, - 1,21,1,22,1,22,1,23,1,23,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1, - 24,1,24,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,26,1,26,1,26,1,26,1,26,1,26, - 1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,27,1,27,1,27,1, - 27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,28,1,28,1,28, - 1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,29,1,29,1, - 29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,30,1,30,1,30,1,30, - 1,30,1,30,1,30,1,30,1,30,1,30,1,31,1,31,1,31,1,31,1,31,1,31,1,31,1,31,1, + 7,67,2,68,7,68,2,69,7,69,2,70,7,70,2,71,7,71,2,72,7,72,2,73,7,73,2,74,7, + 74,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2, + 1,2,1,2,1,2,1,3,1,3,1,4,1,4,1,5,1,5,1,5,1,6,1,6,1,7,1,7,1,8,1,8,1,8,1,9, + 1,9,1,10,1,10,1,10,1,10,1,10,1,10,1,10,1,10,1,10,1,11,1,11,1,12,1,12,1, + 13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,14,1,14,1,15,1,15,1,16,1,16, + 1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,18,1,18,1,18,1,19,1,19,1,19,1, + 19,1,19,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,21, + 1,21,1,21,1,21,1,22,1,22,1,23,1,23,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1, + 24,1,24,1,24,1,24,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,26,1,26,1,26,1,26, + 1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,27,1, + 27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,28, + 1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1, + 29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,30,1,30, + 1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,31,1,31,1,31,1,31,1,31,1,31,1, 31,1,31,1,31,1,31,1,31,1,31,1,31,1,31,1,31,1,31,1,31,1,31,1,31,1,31,1,31, - 1,31,1,31,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1, - 32,1,32,1,32,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33, - 1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1, - 34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,35,1,35,1,35,1,35,1,35,1,35, - 1,35,1,35,1,35,1,35,1,35,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,37,1, - 37,1,37,1,37,1,37,1,37,1,37,1,38,1,38,1,39,1,39,1,40,1,40,1,41,1,41,1,42, - 1,42,1,43,1,43,1,44,1,44,1,44,1,45,1,45,1,45,1,46,1,46,1,47,1,47,1,48,1, - 48,1,48,1,49,1,49,1,49,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,51, - 1,51,1,51,1,51,1,52,1,52,1,52,1,52,1,52,1,53,1,53,1,53,1,53,1,53,1,53,1, - 53,1,54,1,54,1,54,1,54,1,54,1,54,1,54,1,55,1,55,1,55,1,55,1,56,1,56,1,56, - 1,56,1,56,1,56,1,56,1,56,1,57,4,57,512,8,57,11,57,12,57,513,1,57,1,57,4, - 57,518,8,57,11,57,12,57,519,1,57,1,57,4,57,524,8,57,11,57,12,57,525,1,58, - 1,58,1,58,1,58,1,58,1,58,1,58,1,58,1,58,3,58,537,8,58,1,59,1,59,1,59,1, - 59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59, - 1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1, - 59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59, - 1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,59,3,59,596,8,59,1,60,3, - 60,599,8,60,1,60,1,60,3,60,603,8,60,1,61,4,61,606,8,61,11,61,12,61,607, - 1,61,1,61,4,61,612,8,61,11,61,12,61,613,5,61,616,8,61,10,61,12,61,619,9, - 61,1,62,1,62,1,62,1,63,1,63,1,63,1,63,1,63,1,63,1,63,3,63,631,8,63,1,63, - 1,63,1,63,1,63,3,63,637,8,63,1,64,1,64,5,64,641,8,64,10,64,12,64,644,9, - 64,1,65,1,65,1,65,1,65,5,65,650,8,65,10,65,12,65,653,9,65,1,65,1,65,1,65, - 1,65,1,65,5,65,660,8,65,10,65,12,65,663,9,65,1,65,3,65,666,8,65,1,66,1, - 66,1,66,1,66,1,66,1,66,1,66,1,66,1,66,1,67,1,67,1,67,5,67,680,8,67,10,67, - 12,67,683,9,67,1,68,1,68,1,68,1,68,1,68,1,68,1,68,1,68,1,68,1,68,1,68,1, - 68,1,68,1,68,1,68,3,68,700,8,68,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69, - 1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1, - 69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69, - 1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1, - 69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69, - 1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1, - 69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,3,69, - 796,8,69,1,70,1,70,5,70,800,8,70,10,70,12,70,803,9,70,1,71,4,71,806,8,71, - 11,71,12,71,807,1,71,1,71,1,72,1,72,1,72,1,72,5,72,816,8,72,10,72,12,72, - 819,9,72,1,72,1,72,1,72,1,72,1,72,1,73,1,73,1,73,1,73,5,73,830,8,73,10, - 73,12,73,833,9,73,1,73,1,73,3,651,661,817,0,74,1,1,3,2,5,3,7,4,9,5,11,6, - 13,7,15,8,17,9,19,10,21,11,23,12,25,13,27,14,29,15,31,16,33,17,35,18,37, - 19,39,20,41,21,43,22,45,23,47,24,49,25,51,26,53,27,55,28,57,29,59,30,61, - 31,63,32,65,33,67,34,69,35,71,36,73,37,75,38,77,39,79,40,81,41,83,42,85, - 43,87,44,89,45,91,46,93,47,95,48,97,49,99,50,101,51,103,52,105,53,107,54, - 109,55,111,56,113,57,115,58,117,59,119,60,121,61,123,62,125,63,127,64,129, - 65,131,66,133,67,135,68,137,69,139,70,141,71,143,72,145,73,147,74,1,0,11, - 1,0,48,57,2,0,69,69,101,101,1,0,49,57,3,0,10,10,13,13,34,34,3,0,10,10,13, - 13,39,39,2,0,88,88,120,120,3,0,48,57,65,70,97,102,2,0,65,90,97,122,4,0, - 48,57,65,90,95,95,97,122,3,0,9,10,12,13,32,32,2,0,10,10,13,13,872,0,1,1, - 0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13, - 1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0, - 0,0,25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35, - 1,0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0, - 0,0,47,1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,0,0,0,0,57, - 1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,0,0,65,1,0,0,0,0,67,1,0,0, - 0,0,69,1,0,0,0,0,71,1,0,0,0,0,73,1,0,0,0,0,75,1,0,0,0,0,77,1,0,0,0,0,79, - 1,0,0,0,0,81,1,0,0,0,0,83,1,0,0,0,0,85,1,0,0,0,0,87,1,0,0,0,0,89,1,0,0, - 0,0,91,1,0,0,0,0,93,1,0,0,0,0,95,1,0,0,0,0,97,1,0,0,0,0,99,1,0,0,0,0,101, - 1,0,0,0,0,103,1,0,0,0,0,105,1,0,0,0,0,107,1,0,0,0,0,109,1,0,0,0,0,111,1, - 0,0,0,0,113,1,0,0,0,0,115,1,0,0,0,0,117,1,0,0,0,0,119,1,0,0,0,0,121,1,0, - 0,0,0,123,1,0,0,0,0,125,1,0,0,0,0,127,1,0,0,0,0,129,1,0,0,0,0,131,1,0,0, - 0,0,133,1,0,0,0,0,135,1,0,0,0,0,137,1,0,0,0,0,139,1,0,0,0,0,141,1,0,0,0, - 0,143,1,0,0,0,0,145,1,0,0,0,0,147,1,0,0,0,1,149,1,0,0,0,3,156,1,0,0,0,5, - 158,1,0,0,0,7,169,1,0,0,0,9,171,1,0,0,0,11,173,1,0,0,0,13,176,1,0,0,0,15, - 178,1,0,0,0,17,180,1,0,0,0,19,183,1,0,0,0,21,185,1,0,0,0,23,194,1,0,0,0, - 25,196,1,0,0,0,27,198,1,0,0,0,29,207,1,0,0,0,31,209,1,0,0,0,33,211,1,0, - 0,0,35,213,1,0,0,0,37,221,1,0,0,0,39,224,1,0,0,0,41,229,1,0,0,0,43,241, - 1,0,0,0,45,245,1,0,0,0,47,247,1,0,0,0,49,249,1,0,0,0,51,260,1,0,0,0,53, - 267,1,0,0,0,55,284,1,0,0,0,57,299,1,0,0,0,59,314,1,0,0,0,61,327,1,0,0,0, - 63,337,1,0,0,0,65,362,1,0,0,0,67,377,1,0,0,0,69,396,1,0,0,0,71,412,1,0, - 0,0,73,423,1,0,0,0,75,431,1,0,0,0,77,438,1,0,0,0,79,440,1,0,0,0,81,442, - 1,0,0,0,83,444,1,0,0,0,85,446,1,0,0,0,87,448,1,0,0,0,89,450,1,0,0,0,91, - 453,1,0,0,0,93,456,1,0,0,0,95,458,1,0,0,0,97,460,1,0,0,0,99,463,1,0,0,0, - 101,466,1,0,0,0,103,475,1,0,0,0,105,479,1,0,0,0,107,484,1,0,0,0,109,491, - 1,0,0,0,111,498,1,0,0,0,113,502,1,0,0,0,115,511,1,0,0,0,117,536,1,0,0,0, - 119,595,1,0,0,0,121,598,1,0,0,0,123,605,1,0,0,0,125,620,1,0,0,0,127,636, - 1,0,0,0,129,638,1,0,0,0,131,665,1,0,0,0,133,667,1,0,0,0,135,676,1,0,0,0, - 137,699,1,0,0,0,139,795,1,0,0,0,141,797,1,0,0,0,143,805,1,0,0,0,145,811, - 1,0,0,0,147,825,1,0,0,0,149,150,5,112,0,0,150,151,5,114,0,0,151,152,5,97, - 0,0,152,153,5,103,0,0,153,154,5,109,0,0,154,155,5,97,0,0,155,2,1,0,0,0, - 156,157,5,59,0,0,157,4,1,0,0,0,158,159,5,99,0,0,159,160,5,97,0,0,160,161, - 5,115,0,0,161,162,5,104,0,0,162,163,5,115,0,0,163,164,5,99,0,0,164,165, - 5,114,0,0,165,166,5,105,0,0,166,167,5,112,0,0,167,168,5,116,0,0,168,6,1, - 0,0,0,169,170,5,94,0,0,170,8,1,0,0,0,171,172,5,126,0,0,172,10,1,0,0,0,173, - 174,5,62,0,0,174,175,5,61,0,0,175,12,1,0,0,0,176,177,5,62,0,0,177,14,1, - 0,0,0,178,179,5,60,0,0,179,16,1,0,0,0,180,181,5,60,0,0,181,182,5,61,0,0, - 182,18,1,0,0,0,183,184,5,61,0,0,184,20,1,0,0,0,185,186,5,99,0,0,186,187, - 5,111,0,0,187,188,5,110,0,0,188,189,5,116,0,0,189,190,5,114,0,0,190,191, - 5,97,0,0,191,192,5,99,0,0,192,193,5,116,0,0,193,22,1,0,0,0,194,195,5,123, - 0,0,195,24,1,0,0,0,196,197,5,125,0,0,197,26,1,0,0,0,198,199,5,102,0,0,199, - 200,5,117,0,0,200,201,5,110,0,0,201,202,5,99,0,0,202,203,5,116,0,0,203, - 204,5,105,0,0,204,205,5,111,0,0,205,206,5,110,0,0,206,28,1,0,0,0,207,208, - 5,40,0,0,208,30,1,0,0,0,209,210,5,44,0,0,210,32,1,0,0,0,211,212,5,41,0, - 0,212,34,1,0,0,0,213,214,5,114,0,0,214,215,5,101,0,0,215,216,5,113,0,0, - 216,217,5,117,0,0,217,218,5,105,0,0,218,219,5,114,0,0,219,220,5,101,0,0, - 220,36,1,0,0,0,221,222,5,105,0,0,222,223,5,102,0,0,223,38,1,0,0,0,224,225, - 5,101,0,0,225,226,5,108,0,0,226,227,5,115,0,0,227,228,5,101,0,0,228,40, - 1,0,0,0,229,230,5,99,0,0,230,231,5,111,0,0,231,232,5,110,0,0,232,233,5, - 115,0,0,233,234,5,111,0,0,234,235,5,108,0,0,235,236,5,101,0,0,236,237,5, - 46,0,0,237,238,5,108,0,0,238,239,5,111,0,0,239,240,5,103,0,0,240,42,1,0, - 0,0,241,242,5,110,0,0,242,243,5,101,0,0,243,244,5,119,0,0,244,44,1,0,0, - 0,245,246,5,91,0,0,246,46,1,0,0,0,247,248,5,93,0,0,248,48,1,0,0,0,249,250, - 5,116,0,0,250,251,5,120,0,0,251,252,5,46,0,0,252,253,5,111,0,0,253,254, - 5,117,0,0,254,255,5,116,0,0,255,256,5,112,0,0,256,257,5,117,0,0,257,258, - 5,116,0,0,258,259,5,115,0,0,259,50,1,0,0,0,260,261,5,46,0,0,261,262,5,118, - 0,0,262,263,5,97,0,0,263,264,5,108,0,0,264,265,5,117,0,0,265,266,5,101, - 0,0,266,52,1,0,0,0,267,268,5,46,0,0,268,269,5,108,0,0,269,270,5,111,0,0, - 270,271,5,99,0,0,271,272,5,107,0,0,272,273,5,105,0,0,273,274,5,110,0,0, - 274,275,5,103,0,0,275,276,5,66,0,0,276,277,5,121,0,0,277,278,5,116,0,0, - 278,279,5,101,0,0,279,280,5,99,0,0,280,281,5,111,0,0,281,282,5,100,0,0, - 282,283,5,101,0,0,283,54,1,0,0,0,284,285,5,46,0,0,285,286,5,116,0,0,286, - 287,5,111,0,0,287,288,5,107,0,0,288,289,5,101,0,0,289,290,5,110,0,0,290, - 291,5,67,0,0,291,292,5,97,0,0,292,293,5,116,0,0,293,294,5,101,0,0,294,295, - 5,103,0,0,295,296,5,111,0,0,296,297,5,114,0,0,297,298,5,121,0,0,298,56, - 1,0,0,0,299,300,5,46,0,0,300,301,5,110,0,0,301,302,5,102,0,0,302,303,5, - 116,0,0,303,304,5,67,0,0,304,305,5,111,0,0,305,306,5,109,0,0,306,307,5, - 109,0,0,307,308,5,105,0,0,308,309,5,116,0,0,309,310,5,109,0,0,310,311,5, - 101,0,0,311,312,5,110,0,0,312,313,5,116,0,0,313,58,1,0,0,0,314,315,5,46, - 0,0,315,316,5,116,0,0,316,317,5,111,0,0,317,318,5,107,0,0,318,319,5,101, - 0,0,319,320,5,110,0,0,320,321,5,65,0,0,321,322,5,109,0,0,322,323,5,111, - 0,0,323,324,5,117,0,0,324,325,5,110,0,0,325,326,5,116,0,0,326,60,1,0,0, - 0,327,328,5,116,0,0,328,329,5,120,0,0,329,330,5,46,0,0,330,331,5,105,0, - 0,331,332,5,110,0,0,332,333,5,112,0,0,333,334,5,117,0,0,334,335,5,116,0, - 0,335,336,5,115,0,0,336,62,1,0,0,0,337,338,5,46,0,0,338,339,5,111,0,0,339, - 340,5,117,0,0,340,341,5,116,0,0,341,342,5,112,0,0,342,343,5,111,0,0,343, - 344,5,105,0,0,344,345,5,110,0,0,345,346,5,116,0,0,346,347,5,84,0,0,347, - 348,5,114,0,0,348,349,5,97,0,0,349,350,5,110,0,0,350,351,5,115,0,0,351, - 352,5,97,0,0,352,353,5,99,0,0,353,354,5,116,0,0,354,355,5,105,0,0,355,356, - 5,111,0,0,356,357,5,110,0,0,357,358,5,72,0,0,358,359,5,97,0,0,359,360,5, - 115,0,0,360,361,5,104,0,0,361,64,1,0,0,0,362,363,5,46,0,0,363,364,5,111, - 0,0,364,365,5,117,0,0,365,366,5,116,0,0,366,367,5,112,0,0,367,368,5,111, - 0,0,368,369,5,105,0,0,369,370,5,110,0,0,370,371,5,116,0,0,371,372,5,73, - 0,0,372,373,5,110,0,0,373,374,5,100,0,0,374,375,5,101,0,0,375,376,5,120, - 0,0,376,66,1,0,0,0,377,378,5,46,0,0,378,379,5,117,0,0,379,380,5,110,0,0, - 380,381,5,108,0,0,381,382,5,111,0,0,382,383,5,99,0,0,383,384,5,107,0,0, - 384,385,5,105,0,0,385,386,5,110,0,0,386,387,5,103,0,0,387,388,5,66,0,0, - 388,389,5,121,0,0,389,390,5,116,0,0,390,391,5,101,0,0,391,392,5,99,0,0, - 392,393,5,111,0,0,393,394,5,100,0,0,394,395,5,101,0,0,395,68,1,0,0,0,396, - 397,5,46,0,0,397,398,5,115,0,0,398,399,5,101,0,0,399,400,5,113,0,0,400, - 401,5,117,0,0,401,402,5,101,0,0,402,403,5,110,0,0,403,404,5,99,0,0,404, - 405,5,101,0,0,405,406,5,78,0,0,406,407,5,117,0,0,407,408,5,109,0,0,408, - 409,5,98,0,0,409,410,5,101,0,0,410,411,5,114,0,0,411,70,1,0,0,0,412,413, - 5,46,0,0,413,414,5,114,0,0,414,415,5,101,0,0,415,416,5,118,0,0,416,417, - 5,101,0,0,417,418,5,114,0,0,418,419,5,115,0,0,419,420,5,101,0,0,420,421, - 5,40,0,0,421,422,5,41,0,0,422,72,1,0,0,0,423,424,5,46,0,0,424,425,5,108, - 0,0,425,426,5,101,0,0,426,427,5,110,0,0,427,428,5,103,0,0,428,429,5,116, - 0,0,429,430,5,104,0,0,430,74,1,0,0,0,431,432,5,46,0,0,432,433,5,115,0,0, - 433,434,5,112,0,0,434,435,5,108,0,0,435,436,5,105,0,0,436,437,5,116,0,0, - 437,76,1,0,0,0,438,439,5,33,0,0,439,78,1,0,0,0,440,441,5,45,0,0,441,80, - 1,0,0,0,442,443,5,42,0,0,443,82,1,0,0,0,444,445,5,47,0,0,445,84,1,0,0,0, - 446,447,5,37,0,0,447,86,1,0,0,0,448,449,5,43,0,0,449,88,1,0,0,0,450,451, - 5,61,0,0,451,452,5,61,0,0,452,90,1,0,0,0,453,454,5,33,0,0,454,455,5,61, - 0,0,455,92,1,0,0,0,456,457,5,38,0,0,457,94,1,0,0,0,458,459,5,124,0,0,459, - 96,1,0,0,0,460,461,5,38,0,0,461,462,5,38,0,0,462,98,1,0,0,0,463,464,5,124, - 0,0,464,465,5,124,0,0,465,100,1,0,0,0,466,467,5,99,0,0,467,468,5,111,0, - 0,468,469,5,110,0,0,469,470,5,115,0,0,470,471,5,116,0,0,471,472,5,97,0, - 0,472,473,5,110,0,0,473,474,5,116,0,0,474,102,1,0,0,0,475,476,5,105,0,0, - 476,477,5,110,0,0,477,478,5,116,0,0,478,104,1,0,0,0,479,480,5,98,0,0,480, - 481,5,111,0,0,481,482,5,111,0,0,482,483,5,108,0,0,483,106,1,0,0,0,484,485, - 5,115,0,0,485,486,5,116,0,0,486,487,5,114,0,0,487,488,5,105,0,0,488,489, - 5,110,0,0,489,490,5,103,0,0,490,108,1,0,0,0,491,492,5,112,0,0,492,493,5, - 117,0,0,493,494,5,98,0,0,494,495,5,107,0,0,495,496,5,101,0,0,496,497,5, - 121,0,0,497,110,1,0,0,0,498,499,5,115,0,0,499,500,5,105,0,0,500,501,5,103, - 0,0,501,112,1,0,0,0,502,503,5,100,0,0,503,504,5,97,0,0,504,505,5,116,0, - 0,505,506,5,97,0,0,506,507,5,115,0,0,507,508,5,105,0,0,508,509,5,103,0, - 0,509,114,1,0,0,0,510,512,7,0,0,0,511,510,1,0,0,0,512,513,1,0,0,0,513,511, - 1,0,0,0,513,514,1,0,0,0,514,515,1,0,0,0,515,517,5,46,0,0,516,518,7,0,0, - 0,517,516,1,0,0,0,518,519,1,0,0,0,519,517,1,0,0,0,519,520,1,0,0,0,520,521, - 1,0,0,0,521,523,5,46,0,0,522,524,7,0,0,0,523,522,1,0,0,0,524,525,1,0,0, - 0,525,523,1,0,0,0,525,526,1,0,0,0,526,116,1,0,0,0,527,528,5,116,0,0,528, - 529,5,114,0,0,529,530,5,117,0,0,530,537,5,101,0,0,531,532,5,102,0,0,532, - 533,5,97,0,0,533,534,5,108,0,0,534,535,5,115,0,0,535,537,5,101,0,0,536, - 527,1,0,0,0,536,531,1,0,0,0,537,118,1,0,0,0,538,539,5,115,0,0,539,540,5, - 97,0,0,540,541,5,116,0,0,541,542,5,111,0,0,542,543,5,115,0,0,543,544,5, - 104,0,0,544,545,5,105,0,0,545,596,5,115,0,0,546,547,5,115,0,0,547,548,5, - 97,0,0,548,549,5,116,0,0,549,596,5,115,0,0,550,551,5,102,0,0,551,552,5, - 105,0,0,552,553,5,110,0,0,553,554,5,110,0,0,554,555,5,101,0,0,555,596,5, - 121,0,0,556,557,5,98,0,0,557,558,5,105,0,0,558,559,5,116,0,0,559,596,5, - 115,0,0,560,561,5,98,0,0,561,562,5,105,0,0,562,563,5,116,0,0,563,564,5, - 99,0,0,564,565,5,111,0,0,565,566,5,105,0,0,566,596,5,110,0,0,567,568,5, - 115,0,0,568,569,5,101,0,0,569,570,5,99,0,0,570,571,5,111,0,0,571,572,5, - 110,0,0,572,573,5,100,0,0,573,596,5,115,0,0,574,575,5,109,0,0,575,576,5, - 105,0,0,576,577,5,110,0,0,577,578,5,117,0,0,578,579,5,116,0,0,579,580,5, - 101,0,0,580,596,5,115,0,0,581,582,5,104,0,0,582,583,5,111,0,0,583,584,5, - 117,0,0,584,585,5,114,0,0,585,596,5,115,0,0,586,587,5,100,0,0,587,588,5, - 97,0,0,588,589,5,121,0,0,589,596,5,115,0,0,590,591,5,119,0,0,591,592,5, - 101,0,0,592,593,5,101,0,0,593,594,5,107,0,0,594,596,5,115,0,0,595,538,1, - 0,0,0,595,546,1,0,0,0,595,550,1,0,0,0,595,556,1,0,0,0,595,560,1,0,0,0,595, - 567,1,0,0,0,595,574,1,0,0,0,595,581,1,0,0,0,595,586,1,0,0,0,595,590,1,0, - 0,0,596,120,1,0,0,0,597,599,5,45,0,0,598,597,1,0,0,0,598,599,1,0,0,0,599, - 600,1,0,0,0,600,602,3,123,61,0,601,603,3,125,62,0,602,601,1,0,0,0,602,603, - 1,0,0,0,603,122,1,0,0,0,604,606,7,0,0,0,605,604,1,0,0,0,606,607,1,0,0,0, - 607,605,1,0,0,0,607,608,1,0,0,0,608,617,1,0,0,0,609,611,5,95,0,0,610,612, - 7,0,0,0,611,610,1,0,0,0,612,613,1,0,0,0,613,611,1,0,0,0,613,614,1,0,0,0, - 614,616,1,0,0,0,615,609,1,0,0,0,616,619,1,0,0,0,617,615,1,0,0,0,617,618, - 1,0,0,0,618,124,1,0,0,0,619,617,1,0,0,0,620,621,7,1,0,0,621,622,3,123,61, - 0,622,126,1,0,0,0,623,624,5,98,0,0,624,625,5,121,0,0,625,626,5,116,0,0, - 626,627,5,101,0,0,627,628,5,115,0,0,628,630,1,0,0,0,629,631,3,129,64,0, - 630,629,1,0,0,0,630,631,1,0,0,0,631,637,1,0,0,0,632,633,5,98,0,0,633,634, - 5,121,0,0,634,635,5,116,0,0,635,637,5,101,0,0,636,623,1,0,0,0,636,632,1, - 0,0,0,637,128,1,0,0,0,638,642,7,2,0,0,639,641,7,0,0,0,640,639,1,0,0,0,641, - 644,1,0,0,0,642,640,1,0,0,0,642,643,1,0,0,0,643,130,1,0,0,0,644,642,1,0, - 0,0,645,651,5,34,0,0,646,647,5,92,0,0,647,650,5,34,0,0,648,650,8,3,0,0, - 649,646,1,0,0,0,649,648,1,0,0,0,650,653,1,0,0,0,651,652,1,0,0,0,651,649, - 1,0,0,0,652,654,1,0,0,0,653,651,1,0,0,0,654,666,5,34,0,0,655,661,5,39,0, - 0,656,657,5,92,0,0,657,660,5,39,0,0,658,660,8,4,0,0,659,656,1,0,0,0,659, - 658,1,0,0,0,660,663,1,0,0,0,661,662,1,0,0,0,661,659,1,0,0,0,662,664,1,0, - 0,0,663,661,1,0,0,0,664,666,5,39,0,0,665,645,1,0,0,0,665,655,1,0,0,0,666, - 132,1,0,0,0,667,668,5,100,0,0,668,669,5,97,0,0,669,670,5,116,0,0,670,671, - 5,101,0,0,671,672,5,40,0,0,672,673,1,0,0,0,673,674,3,131,65,0,674,675,5, - 41,0,0,675,134,1,0,0,0,676,677,5,48,0,0,677,681,7,5,0,0,678,680,7,6,0,0, - 679,678,1,0,0,0,680,683,1,0,0,0,681,679,1,0,0,0,681,682,1,0,0,0,682,136, - 1,0,0,0,683,681,1,0,0,0,684,685,5,116,0,0,685,686,5,104,0,0,686,687,5,105, - 0,0,687,688,5,115,0,0,688,689,5,46,0,0,689,690,5,97,0,0,690,691,5,103,0, - 0,691,700,5,101,0,0,692,693,5,116,0,0,693,694,5,120,0,0,694,695,5,46,0, - 0,695,696,5,116,0,0,696,697,5,105,0,0,697,698,5,109,0,0,698,700,5,101,0, - 0,699,684,1,0,0,0,699,692,1,0,0,0,700,138,1,0,0,0,701,702,5,116,0,0,702, - 703,5,104,0,0,703,704,5,105,0,0,704,705,5,115,0,0,705,706,5,46,0,0,706, - 707,5,97,0,0,707,708,5,99,0,0,708,709,5,116,0,0,709,710,5,105,0,0,710,711, - 5,118,0,0,711,712,5,101,0,0,712,713,5,73,0,0,713,714,5,110,0,0,714,715, - 5,112,0,0,715,716,5,117,0,0,716,717,5,116,0,0,717,718,5,73,0,0,718,719, - 5,110,0,0,719,720,5,100,0,0,720,721,5,101,0,0,721,796,5,120,0,0,722,723, - 5,116,0,0,723,724,5,104,0,0,724,725,5,105,0,0,725,726,5,115,0,0,726,727, - 5,46,0,0,727,728,5,97,0,0,728,729,5,99,0,0,729,730,5,116,0,0,730,731,5, - 105,0,0,731,732,5,118,0,0,732,733,5,101,0,0,733,734,5,66,0,0,734,735,5, - 121,0,0,735,736,5,116,0,0,736,737,5,101,0,0,737,738,5,99,0,0,738,739,5, - 111,0,0,739,740,5,100,0,0,740,796,5,101,0,0,741,742,5,116,0,0,742,743,5, - 120,0,0,743,744,5,46,0,0,744,745,5,105,0,0,745,746,5,110,0,0,746,747,5, - 112,0,0,747,748,5,117,0,0,748,749,5,116,0,0,749,750,5,115,0,0,750,751,5, - 46,0,0,751,752,5,108,0,0,752,753,5,101,0,0,753,754,5,110,0,0,754,755,5, - 103,0,0,755,756,5,116,0,0,756,796,5,104,0,0,757,758,5,116,0,0,758,759,5, - 120,0,0,759,760,5,46,0,0,760,761,5,111,0,0,761,762,5,117,0,0,762,763,5, - 116,0,0,763,764,5,112,0,0,764,765,5,117,0,0,765,766,5,116,0,0,766,767,5, - 115,0,0,767,768,5,46,0,0,768,769,5,108,0,0,769,770,5,101,0,0,770,771,5, - 110,0,0,771,772,5,103,0,0,772,773,5,116,0,0,773,796,5,104,0,0,774,775,5, - 116,0,0,775,776,5,120,0,0,776,777,5,46,0,0,777,778,5,118,0,0,778,779,5, - 101,0,0,779,780,5,114,0,0,780,781,5,115,0,0,781,782,5,105,0,0,782,783,5, - 111,0,0,783,796,5,110,0,0,784,785,5,116,0,0,785,786,5,120,0,0,786,787,5, - 46,0,0,787,788,5,108,0,0,788,789,5,111,0,0,789,790,5,99,0,0,790,791,5,107, - 0,0,791,792,5,116,0,0,792,793,5,105,0,0,793,794,5,109,0,0,794,796,5,101, - 0,0,795,701,1,0,0,0,795,722,1,0,0,0,795,741,1,0,0,0,795,757,1,0,0,0,795, - 774,1,0,0,0,795,784,1,0,0,0,796,140,1,0,0,0,797,801,7,7,0,0,798,800,7,8, - 0,0,799,798,1,0,0,0,800,803,1,0,0,0,801,799,1,0,0,0,801,802,1,0,0,0,802, - 142,1,0,0,0,803,801,1,0,0,0,804,806,7,9,0,0,805,804,1,0,0,0,806,807,1,0, - 0,0,807,805,1,0,0,0,807,808,1,0,0,0,808,809,1,0,0,0,809,810,6,71,0,0,810, - 144,1,0,0,0,811,812,5,47,0,0,812,813,5,42,0,0,813,817,1,0,0,0,814,816,9, - 0,0,0,815,814,1,0,0,0,816,819,1,0,0,0,817,818,1,0,0,0,817,815,1,0,0,0,818, - 820,1,0,0,0,819,817,1,0,0,0,820,821,5,42,0,0,821,822,5,47,0,0,822,823,1, - 0,0,0,823,824,6,72,1,0,824,146,1,0,0,0,825,826,5,47,0,0,826,827,5,47,0, - 0,827,831,1,0,0,0,828,830,8,10,0,0,829,828,1,0,0,0,830,833,1,0,0,0,831, - 829,1,0,0,0,831,832,1,0,0,0,832,834,1,0,0,0,833,831,1,0,0,0,834,835,6,73, - 1,0,835,148,1,0,0,0,26,0,513,519,525,536,595,598,602,607,613,617,630,636, - 642,649,651,659,661,665,681,699,795,801,807,817,831,2,6,0,0,0,1,0]; + 1,31,1,31,1,31,1,31,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1, + 32,1,32,1,32,1,32,1,32,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33, + 1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,34,1,34,1,34,1,34,1,34,1, + 34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,35,1,35,1,35,1,35, + 1,35,1,35,1,35,1,35,1,35,1,35,1,35,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1, + 36,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,38,1,38,1,38,1,38,1,38,1,38,1,38, + 1,39,1,39,1,40,1,40,1,41,1,41,1,42,1,42,1,43,1,43,1,44,1,44,1,45,1,45,1, + 45,1,46,1,46,1,46,1,47,1,47,1,48,1,48,1,49,1,49,1,49,1,50,1,50,1,50,1,51, + 1,51,1,51,1,51,1,51,1,51,1,51,1,51,1,51,1,52,1,52,1,52,1,52,1,53,1,53,1, + 53,1,53,1,53,1,54,1,54,1,54,1,54,1,54,1,54,1,54,1,55,1,55,1,55,1,55,1,55, + 1,55,1,55,1,56,1,56,1,56,1,56,1,57,1,57,1,57,1,57,1,57,1,57,1,57,1,57,1, + 58,4,58,521,8,58,11,58,12,58,522,1,58,1,58,4,58,527,8,58,11,58,12,58,528, + 1,58,1,58,4,58,533,8,58,11,58,12,58,534,1,59,1,59,1,59,1,59,1,59,1,59,1, + 59,1,59,1,59,3,59,546,8,59,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60, + 1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1, + 60,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60, + 1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1,60,1, + 60,1,60,1,60,1,60,1,60,3,60,605,8,60,1,61,3,61,608,8,61,1,61,1,61,3,61, + 612,8,61,1,62,4,62,615,8,62,11,62,12,62,616,1,62,1,62,4,62,621,8,62,11, + 62,12,62,622,5,62,625,8,62,10,62,12,62,628,9,62,1,63,1,63,1,63,1,64,1,64, + 1,64,1,64,1,64,1,64,1,64,3,64,640,8,64,1,64,1,64,1,64,1,64,3,64,646,8,64, + 1,65,1,65,5,65,650,8,65,10,65,12,65,653,9,65,1,66,1,66,1,66,1,66,5,66,659, + 8,66,10,66,12,66,662,9,66,1,66,1,66,1,66,1,66,1,66,5,66,669,8,66,10,66, + 12,66,672,9,66,1,66,3,66,675,8,66,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1, + 67,1,67,1,68,1,68,1,68,5,68,689,8,68,10,68,12,68,692,9,68,1,69,1,69,1,69, + 1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,3,69,709,8, + 69,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70, + 1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1, + 70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70, + 1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1, + 70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70, + 1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1, + 70,1,70,1,70,1,70,1,70,1,70,1,70,1,70,3,70,805,8,70,1,71,1,71,5,71,809, + 8,71,10,71,12,71,812,9,71,1,72,4,72,815,8,72,11,72,12,72,816,1,72,1,72, + 1,73,1,73,1,73,1,73,5,73,825,8,73,10,73,12,73,828,9,73,1,73,1,73,1,73,1, + 73,1,73,1,74,1,74,1,74,1,74,5,74,839,8,74,10,74,12,74,842,9,74,1,74,1,74, + 3,660,670,826,0,75,1,1,3,2,5,3,7,4,9,5,11,6,13,7,15,8,17,9,19,10,21,11, + 23,12,25,13,27,14,29,15,31,16,33,17,35,18,37,19,39,20,41,21,43,22,45,23, + 47,24,49,25,51,26,53,27,55,28,57,29,59,30,61,31,63,32,65,33,67,34,69,35, + 71,36,73,37,75,38,77,39,79,40,81,41,83,42,85,43,87,44,89,45,91,46,93,47, + 95,48,97,49,99,50,101,51,103,52,105,53,107,54,109,55,111,56,113,57,115, + 58,117,59,119,60,121,61,123,62,125,63,127,64,129,65,131,66,133,67,135,68, + 137,69,139,70,141,71,143,72,145,73,147,74,149,75,1,0,11,1,0,48,57,2,0,69, + 69,101,101,1,0,49,57,3,0,10,10,13,13,34,34,3,0,10,10,13,13,39,39,2,0,88, + 88,120,120,3,0,48,57,65,70,97,102,2,0,65,90,97,122,4,0,48,57,65,90,95,95, + 97,122,3,0,9,10,12,13,32,32,2,0,10,10,13,13,881,0,1,1,0,0,0,0,3,1,0,0,0, + 0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0, + 0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0, + 27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,0,0,0,0,37,1,0, + 0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0,0,0,47,1,0,0,0,0, + 49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,0,0,0,0,57,1,0,0,0,0,59,1,0, + 0,0,0,61,1,0,0,0,0,63,1,0,0,0,0,65,1,0,0,0,0,67,1,0,0,0,0,69,1,0,0,0,0, + 71,1,0,0,0,0,73,1,0,0,0,0,75,1,0,0,0,0,77,1,0,0,0,0,79,1,0,0,0,0,81,1,0, + 0,0,0,83,1,0,0,0,0,85,1,0,0,0,0,87,1,0,0,0,0,89,1,0,0,0,0,91,1,0,0,0,0, + 93,1,0,0,0,0,95,1,0,0,0,0,97,1,0,0,0,0,99,1,0,0,0,0,101,1,0,0,0,0,103,1, + 0,0,0,0,105,1,0,0,0,0,107,1,0,0,0,0,109,1,0,0,0,0,111,1,0,0,0,0,113,1,0, + 0,0,0,115,1,0,0,0,0,117,1,0,0,0,0,119,1,0,0,0,0,121,1,0,0,0,0,123,1,0,0, + 0,0,125,1,0,0,0,0,127,1,0,0,0,0,129,1,0,0,0,0,131,1,0,0,0,0,133,1,0,0,0, + 0,135,1,0,0,0,0,137,1,0,0,0,0,139,1,0,0,0,0,141,1,0,0,0,0,143,1,0,0,0,0, + 145,1,0,0,0,0,147,1,0,0,0,0,149,1,0,0,0,1,151,1,0,0,0,3,158,1,0,0,0,5,160, + 1,0,0,0,7,171,1,0,0,0,9,173,1,0,0,0,11,175,1,0,0,0,13,178,1,0,0,0,15,180, + 1,0,0,0,17,182,1,0,0,0,19,185,1,0,0,0,21,187,1,0,0,0,23,196,1,0,0,0,25, + 198,1,0,0,0,27,200,1,0,0,0,29,209,1,0,0,0,31,211,1,0,0,0,33,213,1,0,0,0, + 35,215,1,0,0,0,37,223,1,0,0,0,39,226,1,0,0,0,41,231,1,0,0,0,43,243,1,0, + 0,0,45,247,1,0,0,0,47,249,1,0,0,0,49,251,1,0,0,0,51,262,1,0,0,0,53,269, + 1,0,0,0,55,286,1,0,0,0,57,301,1,0,0,0,59,316,1,0,0,0,61,329,1,0,0,0,63, + 339,1,0,0,0,65,364,1,0,0,0,67,379,1,0,0,0,69,398,1,0,0,0,71,414,1,0,0,0, + 73,425,1,0,0,0,75,433,1,0,0,0,77,440,1,0,0,0,79,447,1,0,0,0,81,449,1,0, + 0,0,83,451,1,0,0,0,85,453,1,0,0,0,87,455,1,0,0,0,89,457,1,0,0,0,91,459, + 1,0,0,0,93,462,1,0,0,0,95,465,1,0,0,0,97,467,1,0,0,0,99,469,1,0,0,0,101, + 472,1,0,0,0,103,475,1,0,0,0,105,484,1,0,0,0,107,488,1,0,0,0,109,493,1,0, + 0,0,111,500,1,0,0,0,113,507,1,0,0,0,115,511,1,0,0,0,117,520,1,0,0,0,119, + 545,1,0,0,0,121,604,1,0,0,0,123,607,1,0,0,0,125,614,1,0,0,0,127,629,1,0, + 0,0,129,645,1,0,0,0,131,647,1,0,0,0,133,674,1,0,0,0,135,676,1,0,0,0,137, + 685,1,0,0,0,139,708,1,0,0,0,141,804,1,0,0,0,143,806,1,0,0,0,145,814,1,0, + 0,0,147,820,1,0,0,0,149,834,1,0,0,0,151,152,5,112,0,0,152,153,5,114,0,0, + 153,154,5,97,0,0,154,155,5,103,0,0,155,156,5,109,0,0,156,157,5,97,0,0,157, + 2,1,0,0,0,158,159,5,59,0,0,159,4,1,0,0,0,160,161,5,99,0,0,161,162,5,97, + 0,0,162,163,5,115,0,0,163,164,5,104,0,0,164,165,5,115,0,0,165,166,5,99, + 0,0,166,167,5,114,0,0,167,168,5,105,0,0,168,169,5,112,0,0,169,170,5,116, + 0,0,170,6,1,0,0,0,171,172,5,94,0,0,172,8,1,0,0,0,173,174,5,126,0,0,174, + 10,1,0,0,0,175,176,5,62,0,0,176,177,5,61,0,0,177,12,1,0,0,0,178,179,5,62, + 0,0,179,14,1,0,0,0,180,181,5,60,0,0,181,16,1,0,0,0,182,183,5,60,0,0,183, + 184,5,61,0,0,184,18,1,0,0,0,185,186,5,61,0,0,186,20,1,0,0,0,187,188,5,99, + 0,0,188,189,5,111,0,0,189,190,5,110,0,0,190,191,5,116,0,0,191,192,5,114, + 0,0,192,193,5,97,0,0,193,194,5,99,0,0,194,195,5,116,0,0,195,22,1,0,0,0, + 196,197,5,123,0,0,197,24,1,0,0,0,198,199,5,125,0,0,199,26,1,0,0,0,200,201, + 5,102,0,0,201,202,5,117,0,0,202,203,5,110,0,0,203,204,5,99,0,0,204,205, + 5,116,0,0,205,206,5,105,0,0,206,207,5,111,0,0,207,208,5,110,0,0,208,28, + 1,0,0,0,209,210,5,40,0,0,210,30,1,0,0,0,211,212,5,44,0,0,212,32,1,0,0,0, + 213,214,5,41,0,0,214,34,1,0,0,0,215,216,5,114,0,0,216,217,5,101,0,0,217, + 218,5,113,0,0,218,219,5,117,0,0,219,220,5,105,0,0,220,221,5,114,0,0,221, + 222,5,101,0,0,222,36,1,0,0,0,223,224,5,105,0,0,224,225,5,102,0,0,225,38, + 1,0,0,0,226,227,5,101,0,0,227,228,5,108,0,0,228,229,5,115,0,0,229,230,5, + 101,0,0,230,40,1,0,0,0,231,232,5,99,0,0,232,233,5,111,0,0,233,234,5,110, + 0,0,234,235,5,115,0,0,235,236,5,111,0,0,236,237,5,108,0,0,237,238,5,101, + 0,0,238,239,5,46,0,0,239,240,5,108,0,0,240,241,5,111,0,0,241,242,5,103, + 0,0,242,42,1,0,0,0,243,244,5,110,0,0,244,245,5,101,0,0,245,246,5,119,0, + 0,246,44,1,0,0,0,247,248,5,91,0,0,248,46,1,0,0,0,249,250,5,93,0,0,250,48, + 1,0,0,0,251,252,5,116,0,0,252,253,5,120,0,0,253,254,5,46,0,0,254,255,5, + 111,0,0,255,256,5,117,0,0,256,257,5,116,0,0,257,258,5,112,0,0,258,259,5, + 117,0,0,259,260,5,116,0,0,260,261,5,115,0,0,261,50,1,0,0,0,262,263,5,46, + 0,0,263,264,5,118,0,0,264,265,5,97,0,0,265,266,5,108,0,0,266,267,5,117, + 0,0,267,268,5,101,0,0,268,52,1,0,0,0,269,270,5,46,0,0,270,271,5,108,0,0, + 271,272,5,111,0,0,272,273,5,99,0,0,273,274,5,107,0,0,274,275,5,105,0,0, + 275,276,5,110,0,0,276,277,5,103,0,0,277,278,5,66,0,0,278,279,5,121,0,0, + 279,280,5,116,0,0,280,281,5,101,0,0,281,282,5,99,0,0,282,283,5,111,0,0, + 283,284,5,100,0,0,284,285,5,101,0,0,285,54,1,0,0,0,286,287,5,46,0,0,287, + 288,5,116,0,0,288,289,5,111,0,0,289,290,5,107,0,0,290,291,5,101,0,0,291, + 292,5,110,0,0,292,293,5,67,0,0,293,294,5,97,0,0,294,295,5,116,0,0,295,296, + 5,101,0,0,296,297,5,103,0,0,297,298,5,111,0,0,298,299,5,114,0,0,299,300, + 5,121,0,0,300,56,1,0,0,0,301,302,5,46,0,0,302,303,5,110,0,0,303,304,5,102, + 0,0,304,305,5,116,0,0,305,306,5,67,0,0,306,307,5,111,0,0,307,308,5,109, + 0,0,308,309,5,109,0,0,309,310,5,105,0,0,310,311,5,116,0,0,311,312,5,109, + 0,0,312,313,5,101,0,0,313,314,5,110,0,0,314,315,5,116,0,0,315,58,1,0,0, + 0,316,317,5,46,0,0,317,318,5,116,0,0,318,319,5,111,0,0,319,320,5,107,0, + 0,320,321,5,101,0,0,321,322,5,110,0,0,322,323,5,65,0,0,323,324,5,109,0, + 0,324,325,5,111,0,0,325,326,5,117,0,0,326,327,5,110,0,0,327,328,5,116,0, + 0,328,60,1,0,0,0,329,330,5,116,0,0,330,331,5,120,0,0,331,332,5,46,0,0,332, + 333,5,105,0,0,333,334,5,110,0,0,334,335,5,112,0,0,335,336,5,117,0,0,336, + 337,5,116,0,0,337,338,5,115,0,0,338,62,1,0,0,0,339,340,5,46,0,0,340,341, + 5,111,0,0,341,342,5,117,0,0,342,343,5,116,0,0,343,344,5,112,0,0,344,345, + 5,111,0,0,345,346,5,105,0,0,346,347,5,110,0,0,347,348,5,116,0,0,348,349, + 5,84,0,0,349,350,5,114,0,0,350,351,5,97,0,0,351,352,5,110,0,0,352,353,5, + 115,0,0,353,354,5,97,0,0,354,355,5,99,0,0,355,356,5,116,0,0,356,357,5,105, + 0,0,357,358,5,111,0,0,358,359,5,110,0,0,359,360,5,72,0,0,360,361,5,97,0, + 0,361,362,5,115,0,0,362,363,5,104,0,0,363,64,1,0,0,0,364,365,5,46,0,0,365, + 366,5,111,0,0,366,367,5,117,0,0,367,368,5,116,0,0,368,369,5,112,0,0,369, + 370,5,111,0,0,370,371,5,105,0,0,371,372,5,110,0,0,372,373,5,116,0,0,373, + 374,5,73,0,0,374,375,5,110,0,0,375,376,5,100,0,0,376,377,5,101,0,0,377, + 378,5,120,0,0,378,66,1,0,0,0,379,380,5,46,0,0,380,381,5,117,0,0,381,382, + 5,110,0,0,382,383,5,108,0,0,383,384,5,111,0,0,384,385,5,99,0,0,385,386, + 5,107,0,0,386,387,5,105,0,0,387,388,5,110,0,0,388,389,5,103,0,0,389,390, + 5,66,0,0,390,391,5,121,0,0,391,392,5,116,0,0,392,393,5,101,0,0,393,394, + 5,99,0,0,394,395,5,111,0,0,395,396,5,100,0,0,396,397,5,101,0,0,397,68,1, + 0,0,0,398,399,5,46,0,0,399,400,5,115,0,0,400,401,5,101,0,0,401,402,5,113, + 0,0,402,403,5,117,0,0,403,404,5,101,0,0,404,405,5,110,0,0,405,406,5,99, + 0,0,406,407,5,101,0,0,407,408,5,78,0,0,408,409,5,117,0,0,409,410,5,109, + 0,0,410,411,5,98,0,0,411,412,5,101,0,0,412,413,5,114,0,0,413,70,1,0,0,0, + 414,415,5,46,0,0,415,416,5,114,0,0,416,417,5,101,0,0,417,418,5,118,0,0, + 418,419,5,101,0,0,419,420,5,114,0,0,420,421,5,115,0,0,421,422,5,101,0,0, + 422,423,5,40,0,0,423,424,5,41,0,0,424,72,1,0,0,0,425,426,5,46,0,0,426,427, + 5,108,0,0,427,428,5,101,0,0,428,429,5,110,0,0,429,430,5,103,0,0,430,431, + 5,116,0,0,431,432,5,104,0,0,432,74,1,0,0,0,433,434,5,46,0,0,434,435,5,115, + 0,0,435,436,5,112,0,0,436,437,5,108,0,0,437,438,5,105,0,0,438,439,5,116, + 0,0,439,76,1,0,0,0,440,441,5,46,0,0,441,442,5,115,0,0,442,443,5,108,0,0, + 443,444,5,105,0,0,444,445,5,99,0,0,445,446,5,101,0,0,446,78,1,0,0,0,447, + 448,5,33,0,0,448,80,1,0,0,0,449,450,5,45,0,0,450,82,1,0,0,0,451,452,5,42, + 0,0,452,84,1,0,0,0,453,454,5,47,0,0,454,86,1,0,0,0,455,456,5,37,0,0,456, + 88,1,0,0,0,457,458,5,43,0,0,458,90,1,0,0,0,459,460,5,61,0,0,460,461,5,61, + 0,0,461,92,1,0,0,0,462,463,5,33,0,0,463,464,5,61,0,0,464,94,1,0,0,0,465, + 466,5,38,0,0,466,96,1,0,0,0,467,468,5,124,0,0,468,98,1,0,0,0,469,470,5, + 38,0,0,470,471,5,38,0,0,471,100,1,0,0,0,472,473,5,124,0,0,473,474,5,124, + 0,0,474,102,1,0,0,0,475,476,5,99,0,0,476,477,5,111,0,0,477,478,5,110,0, + 0,478,479,5,115,0,0,479,480,5,116,0,0,480,481,5,97,0,0,481,482,5,110,0, + 0,482,483,5,116,0,0,483,104,1,0,0,0,484,485,5,105,0,0,485,486,5,110,0,0, + 486,487,5,116,0,0,487,106,1,0,0,0,488,489,5,98,0,0,489,490,5,111,0,0,490, + 491,5,111,0,0,491,492,5,108,0,0,492,108,1,0,0,0,493,494,5,115,0,0,494,495, + 5,116,0,0,495,496,5,114,0,0,496,497,5,105,0,0,497,498,5,110,0,0,498,499, + 5,103,0,0,499,110,1,0,0,0,500,501,5,112,0,0,501,502,5,117,0,0,502,503,5, + 98,0,0,503,504,5,107,0,0,504,505,5,101,0,0,505,506,5,121,0,0,506,112,1, + 0,0,0,507,508,5,115,0,0,508,509,5,105,0,0,509,510,5,103,0,0,510,114,1,0, + 0,0,511,512,5,100,0,0,512,513,5,97,0,0,513,514,5,116,0,0,514,515,5,97,0, + 0,515,516,5,115,0,0,516,517,5,105,0,0,517,518,5,103,0,0,518,116,1,0,0,0, + 519,521,7,0,0,0,520,519,1,0,0,0,521,522,1,0,0,0,522,520,1,0,0,0,522,523, + 1,0,0,0,523,524,1,0,0,0,524,526,5,46,0,0,525,527,7,0,0,0,526,525,1,0,0, + 0,527,528,1,0,0,0,528,526,1,0,0,0,528,529,1,0,0,0,529,530,1,0,0,0,530,532, + 5,46,0,0,531,533,7,0,0,0,532,531,1,0,0,0,533,534,1,0,0,0,534,532,1,0,0, + 0,534,535,1,0,0,0,535,118,1,0,0,0,536,537,5,116,0,0,537,538,5,114,0,0,538, + 539,5,117,0,0,539,546,5,101,0,0,540,541,5,102,0,0,541,542,5,97,0,0,542, + 543,5,108,0,0,543,544,5,115,0,0,544,546,5,101,0,0,545,536,1,0,0,0,545,540, + 1,0,0,0,546,120,1,0,0,0,547,548,5,115,0,0,548,549,5,97,0,0,549,550,5,116, + 0,0,550,551,5,111,0,0,551,552,5,115,0,0,552,553,5,104,0,0,553,554,5,105, + 0,0,554,605,5,115,0,0,555,556,5,115,0,0,556,557,5,97,0,0,557,558,5,116, + 0,0,558,605,5,115,0,0,559,560,5,102,0,0,560,561,5,105,0,0,561,562,5,110, + 0,0,562,563,5,110,0,0,563,564,5,101,0,0,564,605,5,121,0,0,565,566,5,98, + 0,0,566,567,5,105,0,0,567,568,5,116,0,0,568,605,5,115,0,0,569,570,5,98, + 0,0,570,571,5,105,0,0,571,572,5,116,0,0,572,573,5,99,0,0,573,574,5,111, + 0,0,574,575,5,105,0,0,575,605,5,110,0,0,576,577,5,115,0,0,577,578,5,101, + 0,0,578,579,5,99,0,0,579,580,5,111,0,0,580,581,5,110,0,0,581,582,5,100, + 0,0,582,605,5,115,0,0,583,584,5,109,0,0,584,585,5,105,0,0,585,586,5,110, + 0,0,586,587,5,117,0,0,587,588,5,116,0,0,588,589,5,101,0,0,589,605,5,115, + 0,0,590,591,5,104,0,0,591,592,5,111,0,0,592,593,5,117,0,0,593,594,5,114, + 0,0,594,605,5,115,0,0,595,596,5,100,0,0,596,597,5,97,0,0,597,598,5,121, + 0,0,598,605,5,115,0,0,599,600,5,119,0,0,600,601,5,101,0,0,601,602,5,101, + 0,0,602,603,5,107,0,0,603,605,5,115,0,0,604,547,1,0,0,0,604,555,1,0,0,0, + 604,559,1,0,0,0,604,565,1,0,0,0,604,569,1,0,0,0,604,576,1,0,0,0,604,583, + 1,0,0,0,604,590,1,0,0,0,604,595,1,0,0,0,604,599,1,0,0,0,605,122,1,0,0,0, + 606,608,5,45,0,0,607,606,1,0,0,0,607,608,1,0,0,0,608,609,1,0,0,0,609,611, + 3,125,62,0,610,612,3,127,63,0,611,610,1,0,0,0,611,612,1,0,0,0,612,124,1, + 0,0,0,613,615,7,0,0,0,614,613,1,0,0,0,615,616,1,0,0,0,616,614,1,0,0,0,616, + 617,1,0,0,0,617,626,1,0,0,0,618,620,5,95,0,0,619,621,7,0,0,0,620,619,1, + 0,0,0,621,622,1,0,0,0,622,620,1,0,0,0,622,623,1,0,0,0,623,625,1,0,0,0,624, + 618,1,0,0,0,625,628,1,0,0,0,626,624,1,0,0,0,626,627,1,0,0,0,627,126,1,0, + 0,0,628,626,1,0,0,0,629,630,7,1,0,0,630,631,3,125,62,0,631,128,1,0,0,0, + 632,633,5,98,0,0,633,634,5,121,0,0,634,635,5,116,0,0,635,636,5,101,0,0, + 636,637,5,115,0,0,637,639,1,0,0,0,638,640,3,131,65,0,639,638,1,0,0,0,639, + 640,1,0,0,0,640,646,1,0,0,0,641,642,5,98,0,0,642,643,5,121,0,0,643,644, + 5,116,0,0,644,646,5,101,0,0,645,632,1,0,0,0,645,641,1,0,0,0,646,130,1,0, + 0,0,647,651,7,2,0,0,648,650,7,0,0,0,649,648,1,0,0,0,650,653,1,0,0,0,651, + 649,1,0,0,0,651,652,1,0,0,0,652,132,1,0,0,0,653,651,1,0,0,0,654,660,5,34, + 0,0,655,656,5,92,0,0,656,659,5,34,0,0,657,659,8,3,0,0,658,655,1,0,0,0,658, + 657,1,0,0,0,659,662,1,0,0,0,660,661,1,0,0,0,660,658,1,0,0,0,661,663,1,0, + 0,0,662,660,1,0,0,0,663,675,5,34,0,0,664,670,5,39,0,0,665,666,5,92,0,0, + 666,669,5,39,0,0,667,669,8,4,0,0,668,665,1,0,0,0,668,667,1,0,0,0,669,672, + 1,0,0,0,670,671,1,0,0,0,670,668,1,0,0,0,671,673,1,0,0,0,672,670,1,0,0,0, + 673,675,5,39,0,0,674,654,1,0,0,0,674,664,1,0,0,0,675,134,1,0,0,0,676,677, + 5,100,0,0,677,678,5,97,0,0,678,679,5,116,0,0,679,680,5,101,0,0,680,681, + 5,40,0,0,681,682,1,0,0,0,682,683,3,133,66,0,683,684,5,41,0,0,684,136,1, + 0,0,0,685,686,5,48,0,0,686,690,7,5,0,0,687,689,7,6,0,0,688,687,1,0,0,0, + 689,692,1,0,0,0,690,688,1,0,0,0,690,691,1,0,0,0,691,138,1,0,0,0,692,690, + 1,0,0,0,693,694,5,116,0,0,694,695,5,104,0,0,695,696,5,105,0,0,696,697,5, + 115,0,0,697,698,5,46,0,0,698,699,5,97,0,0,699,700,5,103,0,0,700,709,5,101, + 0,0,701,702,5,116,0,0,702,703,5,120,0,0,703,704,5,46,0,0,704,705,5,116, + 0,0,705,706,5,105,0,0,706,707,5,109,0,0,707,709,5,101,0,0,708,693,1,0,0, + 0,708,701,1,0,0,0,709,140,1,0,0,0,710,711,5,116,0,0,711,712,5,104,0,0,712, + 713,5,105,0,0,713,714,5,115,0,0,714,715,5,46,0,0,715,716,5,97,0,0,716,717, + 5,99,0,0,717,718,5,116,0,0,718,719,5,105,0,0,719,720,5,118,0,0,720,721, + 5,101,0,0,721,722,5,73,0,0,722,723,5,110,0,0,723,724,5,112,0,0,724,725, + 5,117,0,0,725,726,5,116,0,0,726,727,5,73,0,0,727,728,5,110,0,0,728,729, + 5,100,0,0,729,730,5,101,0,0,730,805,5,120,0,0,731,732,5,116,0,0,732,733, + 5,104,0,0,733,734,5,105,0,0,734,735,5,115,0,0,735,736,5,46,0,0,736,737, + 5,97,0,0,737,738,5,99,0,0,738,739,5,116,0,0,739,740,5,105,0,0,740,741,5, + 118,0,0,741,742,5,101,0,0,742,743,5,66,0,0,743,744,5,121,0,0,744,745,5, + 116,0,0,745,746,5,101,0,0,746,747,5,99,0,0,747,748,5,111,0,0,748,749,5, + 100,0,0,749,805,5,101,0,0,750,751,5,116,0,0,751,752,5,120,0,0,752,753,5, + 46,0,0,753,754,5,105,0,0,754,755,5,110,0,0,755,756,5,112,0,0,756,757,5, + 117,0,0,757,758,5,116,0,0,758,759,5,115,0,0,759,760,5,46,0,0,760,761,5, + 108,0,0,761,762,5,101,0,0,762,763,5,110,0,0,763,764,5,103,0,0,764,765,5, + 116,0,0,765,805,5,104,0,0,766,767,5,116,0,0,767,768,5,120,0,0,768,769,5, + 46,0,0,769,770,5,111,0,0,770,771,5,117,0,0,771,772,5,116,0,0,772,773,5, + 112,0,0,773,774,5,117,0,0,774,775,5,116,0,0,775,776,5,115,0,0,776,777,5, + 46,0,0,777,778,5,108,0,0,778,779,5,101,0,0,779,780,5,110,0,0,780,781,5, + 103,0,0,781,782,5,116,0,0,782,805,5,104,0,0,783,784,5,116,0,0,784,785,5, + 120,0,0,785,786,5,46,0,0,786,787,5,118,0,0,787,788,5,101,0,0,788,789,5, + 114,0,0,789,790,5,115,0,0,790,791,5,105,0,0,791,792,5,111,0,0,792,805,5, + 110,0,0,793,794,5,116,0,0,794,795,5,120,0,0,795,796,5,46,0,0,796,797,5, + 108,0,0,797,798,5,111,0,0,798,799,5,99,0,0,799,800,5,107,0,0,800,801,5, + 116,0,0,801,802,5,105,0,0,802,803,5,109,0,0,803,805,5,101,0,0,804,710,1, + 0,0,0,804,731,1,0,0,0,804,750,1,0,0,0,804,766,1,0,0,0,804,783,1,0,0,0,804, + 793,1,0,0,0,805,142,1,0,0,0,806,810,7,7,0,0,807,809,7,8,0,0,808,807,1,0, + 0,0,809,812,1,0,0,0,810,808,1,0,0,0,810,811,1,0,0,0,811,144,1,0,0,0,812, + 810,1,0,0,0,813,815,7,9,0,0,814,813,1,0,0,0,815,816,1,0,0,0,816,814,1,0, + 0,0,816,817,1,0,0,0,817,818,1,0,0,0,818,819,6,72,0,0,819,146,1,0,0,0,820, + 821,5,47,0,0,821,822,5,42,0,0,822,826,1,0,0,0,823,825,9,0,0,0,824,823,1, + 0,0,0,825,828,1,0,0,0,826,827,1,0,0,0,826,824,1,0,0,0,827,829,1,0,0,0,828, + 826,1,0,0,0,829,830,5,42,0,0,830,831,5,47,0,0,831,832,1,0,0,0,832,833,6, + 73,1,0,833,148,1,0,0,0,834,835,5,47,0,0,835,836,5,47,0,0,836,840,1,0,0, + 0,837,839,8,10,0,0,838,837,1,0,0,0,839,842,1,0,0,0,840,838,1,0,0,0,840, + 841,1,0,0,0,841,843,1,0,0,0,842,840,1,0,0,0,843,844,6,74,1,0,844,150,1, + 0,0,0,26,0,522,528,534,545,604,607,611,616,622,626,639,645,651,658,660, + 668,670,674,690,708,804,810,816,826,840,2,6,0,0,0,1,0]; private static __ATN: ATN; public static get _ATN(): ATN { diff --git a/packages/cashc/src/grammar/CashScriptParser.ts b/packages/cashc/src/grammar/CashScriptParser.ts index 1d1a622cf..24ec7f97b 100644 --- a/packages/cashc/src/grammar/CashScriptParser.ts +++ b/packages/cashc/src/grammar/CashScriptParser.ts @@ -75,23 +75,24 @@ export default class CashScriptParser extends Parser { public static readonly T__54 = 55; public static readonly T__55 = 56; public static readonly T__56 = 57; - public static readonly VersionLiteral = 58; - public static readonly BooleanLiteral = 59; - public static readonly NumberUnit = 60; - public static readonly NumberLiteral = 61; - public static readonly NumberPart = 62; - public static readonly ExponentPart = 63; - public static readonly Bytes = 64; - public static readonly Bound = 65; - public static readonly StringLiteral = 66; - public static readonly DateLiteral = 67; - public static readonly HexLiteral = 68; - public static readonly TxVar = 69; - public static readonly NullaryOp = 70; - public static readonly Identifier = 71; - public static readonly WHITESPACE = 72; - public static readonly COMMENT = 73; - public static readonly LINE_COMMENT = 74; + public static readonly T__57 = 58; + public static readonly VersionLiteral = 59; + public static readonly BooleanLiteral = 60; + public static readonly NumberUnit = 61; + public static readonly NumberLiteral = 62; + public static readonly NumberPart = 63; + public static readonly ExponentPart = 64; + public static readonly Bytes = 65; + public static readonly Bound = 66; + public static readonly StringLiteral = 67; + public static readonly DateLiteral = 68; + public static readonly HexLiteral = 69; + public static readonly TxVar = 70; + public static readonly NullaryOp = 71; + public static readonly Identifier = 72; + public static readonly WHITESPACE = 73; + public static readonly COMMENT = 74; + public static readonly LINE_COMMENT = 75; public static readonly EOF = Token.EOF; public static readonly RULE_sourceFile = 0; public static readonly RULE_pragmaDirective = 1; @@ -149,6 +150,7 @@ export default class CashScriptParser extends Parser { "'.reverse()'", "'.length'", "'.split'", + "'.slice'", "'!'", "'-'", "'*'", "'/'", "'%'", "'+'", @@ -189,7 +191,7 @@ export default class CashScriptParser extends Parser { null, null, null, null, null, null, - "VersionLiteral", + null, "VersionLiteral", "BooleanLiteral", "NumberUnit", "NumberLiteral", @@ -339,7 +341,7 @@ export default class CashScriptParser extends Parser { this.state = 76; this._errHandler.sync(this); _la = this._input.LA(1); - if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 2032) !== 0) || _la===58) { + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 2032) !== 0) || _la===59) { { this.state = 75; this.versionConstraint(); @@ -498,7 +500,7 @@ export default class CashScriptParser extends Parser { this.state = 104; this._errHandler.sync(this); _la = this._input.LA(1); - while ((((_la) & ~0x1F) === 0 && ((1 << _la) & 2883584) !== 0) || ((((_la - 52)) & ~0x1F) === 0 && ((1 << (_la - 52)) & 528447) !== 0)) { + while ((((_la) & ~0x1F) === 0 && ((1 << _la) & 2883584) !== 0) || ((((_la - 53)) & ~0x1F) === 0 && ((1 << (_la - 53)) & 528447) !== 0)) { { { this.state = 101; @@ -541,7 +543,7 @@ export default class CashScriptParser extends Parser { this.state = 121; this._errHandler.sync(this); _la = this._input.LA(1); - if (((((_la - 52)) & ~0x1F) === 0 && ((1 << (_la - 52)) & 4159) !== 0)) { + if (((((_la - 53)) & ~0x1F) === 0 && ((1 << (_la - 53)) & 4159) !== 0)) { { this.state = 110; this.parameter(); @@ -638,7 +640,7 @@ export default class CashScriptParser extends Parser { this.state = 132; this._errHandler.sync(this); _la = this._input.LA(1); - while ((((_la) & ~0x1F) === 0 && ((1 << _la) & 2883584) !== 0) || ((((_la - 52)) & ~0x1F) === 0 && ((1 << (_la - 52)) & 528447) !== 0)) { + while ((((_la) & ~0x1F) === 0 && ((1 << _la) & 2883584) !== 0) || ((((_la - 53)) & ~0x1F) === 0 && ((1 << (_la - 53)) & 528447) !== 0)) { { { this.state = 129; @@ -656,14 +658,14 @@ export default class CashScriptParser extends Parser { case 18: case 19: case 21: - case 52: case 53: case 54: case 55: case 56: case 57: - case 64: - case 71: + case 58: + case 65: + case 72: this.enterOuterAlt(localctx, 2); { this.state = 136; @@ -774,7 +776,7 @@ export default class CashScriptParser extends Parser { this.state = 152; this._errHandler.sync(this); _la = this._input.LA(1); - while (_la===51) { + while (_la===52) { { { this.state = 149; @@ -1082,18 +1084,18 @@ export default class CashScriptParser extends Parser { this.state = 213; this._errHandler.sync(this); switch (this._input.LA(1)) { - case 71: + case 72: this.enterOuterAlt(localctx, 1); { this.state = 211; this.match(CashScriptParser.Identifier); } break; - case 59: - case 61: - case 66: + case 60: + case 62: case 67: case 68: + case 69: this.enterOuterAlt(localctx, 2); { this.state = 212; @@ -1132,7 +1134,7 @@ export default class CashScriptParser extends Parser { this.state = 227; this._errHandler.sync(this); _la = this._input.LA(1); - if (((((_la - 59)) & ~0x1F) === 0 && ((1 << (_la - 59)) & 4997) !== 0)) { + if (((((_la - 60)) & ~0x1F) === 0 && ((1 << (_la - 60)) & 4997) !== 0)) { { this.state = 216; this.consoleParameter(); @@ -1226,7 +1228,7 @@ export default class CashScriptParser extends Parser { this.state = 246; this._errHandler.sync(this); _la = this._input.LA(1); - if (((((_la - 15)) & ~0x1F) === 0 && ((1 << (_la - 15)) & 50398593) !== 0) || ((((_la - 52)) & ~0x1F) === 0 && ((1 << (_la - 52)) & 905919) !== 0)) { + if (((((_la - 15)) & ~0x1F) === 0 && ((1 << (_la - 15)) & 100730241) !== 0) || ((((_la - 53)) & ~0x1F) === 0 && ((1 << (_la - 53)) & 905919) !== 0)) { { this.state = 235; this.expression(0); @@ -1433,7 +1435,7 @@ export default class CashScriptParser extends Parser { this.state = 283; (localctx as UnaryOpContext)._op = this._input.LT(1); _la = this._input.LA(1); - if(!(_la===39 || _la===40)) { + if(!(_la===40 || _la===41)) { (localctx as UnaryOpContext)._op = this._errHandler.recoverInline(this); } else { @@ -1454,7 +1456,7 @@ export default class CashScriptParser extends Parser { this.state = 297; this._errHandler.sync(this); _la = this._input.LA(1); - if (((((_la - 15)) & ~0x1F) === 0 && ((1 << (_la - 15)) & 50398593) !== 0) || ((((_la - 52)) & ~0x1F) === 0 && ((1 << (_la - 52)) & 905919) !== 0)) { + if (((((_la - 15)) & ~0x1F) === 0 && ((1 << (_la - 15)) & 100730241) !== 0) || ((((_la - 53)) & ~0x1F) === 0 && ((1 << (_la - 53)) & 905919) !== 0)) { { this.state = 286; this.expression(0); @@ -1522,7 +1524,7 @@ export default class CashScriptParser extends Parser { break; } this._ctx.stop = this._input.LT(-1); - this.state = 346; + this.state = 354; this._errHandler.sync(this); _alt = this._interp.adaptivePredict(this._input, 29, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { @@ -1532,7 +1534,7 @@ export default class CashScriptParser extends Parser { } _prevctx = localctx; { - this.state = 344; + this.state = 352; this._errHandler.sync(this); switch ( this._interp.adaptivePredict(this._input, 28, this._ctx) ) { case 1: @@ -1547,7 +1549,7 @@ export default class CashScriptParser extends Parser { this.state = 306; (localctx as BinaryOpContext)._op = this._input.LT(1); _la = this._input.LA(1); - if(!(((((_la - 41)) & ~0x1F) === 0 && ((1 << (_la - 41)) & 7) !== 0))) { + if(!(((((_la - 42)) & ~0x1F) === 0 && ((1 << (_la - 42)) & 7) !== 0))) { (localctx as BinaryOpContext)._op = this._errHandler.recoverInline(this); } else { @@ -1570,7 +1572,7 @@ export default class CashScriptParser extends Parser { this.state = 309; (localctx as BinaryOpContext)._op = this._input.LT(1); _la = this._input.LA(1); - if(!(_la===40 || _la===44)) { + if(!(_la===41 || _la===45)) { (localctx as BinaryOpContext)._op = this._errHandler.recoverInline(this); } else { @@ -1616,7 +1618,7 @@ export default class CashScriptParser extends Parser { this.state = 315; (localctx as BinaryOpContext)._op = this._input.LT(1); _la = this._input.LA(1); - if(!(_la===45 || _la===46)) { + if(!(_la===46 || _la===47)) { (localctx as BinaryOpContext)._op = this._errHandler.recoverInline(this); } else { @@ -1637,7 +1639,7 @@ export default class CashScriptParser extends Parser { throw this.createFailedPredicateException("this.precpred(this._ctx, 9)"); } this.state = 318; - (localctx as BinaryOpContext)._op = this.match(CashScriptParser.T__46); + (localctx as BinaryOpContext)._op = this.match(CashScriptParser.T__47); this.state = 319; (localctx as BinaryOpContext)._right = this.expression(10); } @@ -1667,7 +1669,7 @@ export default class CashScriptParser extends Parser { throw this.createFailedPredicateException("this.precpred(this._ctx, 7)"); } this.state = 324; - (localctx as BinaryOpContext)._op = this.match(CashScriptParser.T__47); + (localctx as BinaryOpContext)._op = this.match(CashScriptParser.T__48); this.state = 325; (localctx as BinaryOpContext)._right = this.expression(8); } @@ -1682,7 +1684,7 @@ export default class CashScriptParser extends Parser { throw this.createFailedPredicateException("this.precpred(this._ctx, 6)"); } this.state = 327; - (localctx as BinaryOpContext)._op = this.match(CashScriptParser.T__48); + (localctx as BinaryOpContext)._op = this.match(CashScriptParser.T__49); this.state = 328; (localctx as BinaryOpContext)._right = this.expression(7); } @@ -1697,7 +1699,7 @@ export default class CashScriptParser extends Parser { throw this.createFailedPredicateException("this.precpred(this._ctx, 5)"); } this.state = 330; - (localctx as BinaryOpContext)._op = this.match(CashScriptParser.T__49); + (localctx as BinaryOpContext)._op = this.match(CashScriptParser.T__50); this.state = 331; (localctx as BinaryOpContext)._right = this.expression(6); } @@ -1707,8 +1709,8 @@ export default class CashScriptParser extends Parser { localctx = new TupleIndexOpContext(this, new ExpressionContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, CashScriptParser.RULE_expression); this.state = 332; - if (!(this.precpred(this._ctx, 19))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 19)"); + if (!(this.precpred(this._ctx, 20))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 20)"); } this.state = 333; this.match(CashScriptParser.T__22); @@ -1723,8 +1725,8 @@ export default class CashScriptParser extends Parser { localctx = new UnaryOpContext(this, new ExpressionContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, CashScriptParser.RULE_expression); this.state = 336; - if (!(this.precpred(this._ctx, 16))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 16)"); + if (!(this.precpred(this._ctx, 17))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 17)"); } this.state = 337; (localctx as UnaryOpContext)._op = this._input.LT(1); @@ -1744,8 +1746,8 @@ export default class CashScriptParser extends Parser { (localctx as BinaryOpContext)._left = _prevctx; this.pushNewRecursionContext(localctx, _startState, CashScriptParser.RULE_expression); this.state = 338; - if (!(this.precpred(this._ctx, 15))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 15)"); + if (!(this.precpred(this._ctx, 16))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 16)"); } this.state = 339; (localctx as BinaryOpContext)._op = this.match(CashScriptParser.T__37); @@ -1757,10 +1759,33 @@ export default class CashScriptParser extends Parser { this.match(CashScriptParser.T__16); } break; + case 13: + { + localctx = new SliceContext(this, new ExpressionContext(this, _parentctx, _parentState)); + (localctx as SliceContext)._element = _prevctx; + this.pushNewRecursionContext(localctx, _startState, CashScriptParser.RULE_expression); + this.state = 344; + if (!(this.precpred(this._ctx, 15))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 15)"); + } + this.state = 345; + this.match(CashScriptParser.T__38); + this.state = 346; + this.match(CashScriptParser.T__14); + this.state = 347; + (localctx as SliceContext)._start = this.expression(0); + this.state = 348; + this.match(CashScriptParser.T__15); + this.state = 349; + (localctx as SliceContext)._end = this.expression(0); + this.state = 350; + this.match(CashScriptParser.T__16); + } + break; } } } - this.state = 348; + this.state = 356; this._errHandler.sync(this); _alt = this._interp.adaptivePredict(this._input, 29, this._ctx); } @@ -1787,8 +1812,8 @@ export default class CashScriptParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 349; - this.match(CashScriptParser.T__50); + this.state = 357; + this.match(CashScriptParser.T__51); } } catch (re) { @@ -1810,41 +1835,41 @@ export default class CashScriptParser extends Parser { let localctx: LiteralContext = new LiteralContext(this, this._ctx, this.state); this.enterRule(localctx, 52, CashScriptParser.RULE_literal); try { - this.state = 356; + this.state = 364; this._errHandler.sync(this); switch (this._input.LA(1)) { - case 59: + case 60: this.enterOuterAlt(localctx, 1); { - this.state = 351; + this.state = 359; this.match(CashScriptParser.BooleanLiteral); } break; - case 61: + case 62: this.enterOuterAlt(localctx, 2); { - this.state = 352; + this.state = 360; this.numberLiteral(); } break; - case 66: + case 67: this.enterOuterAlt(localctx, 3); { - this.state = 353; + this.state = 361; this.match(CashScriptParser.StringLiteral); } break; - case 67: + case 68: this.enterOuterAlt(localctx, 4); { - this.state = 354; + this.state = 362; this.match(CashScriptParser.DateLiteral); } break; - case 68: + case 69: this.enterOuterAlt(localctx, 5); { - this.state = 355; + this.state = 363; this.match(CashScriptParser.HexLiteral); } break; @@ -1873,14 +1898,14 @@ export default class CashScriptParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 358; + this.state = 366; this.match(CashScriptParser.NumberLiteral); - this.state = 360; + this.state = 368; this._errHandler.sync(this); switch ( this._interp.adaptivePredict(this._input, 31, this._ctx) ) { case 1: { - this.state = 359; + this.state = 367; this.match(CashScriptParser.NumberUnit); } break; @@ -1909,9 +1934,9 @@ export default class CashScriptParser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 362; + this.state = 370; _la = this._input.LA(1); - if(!(((((_la - 52)) & ~0x1F) === 0 && ((1 << (_la - 52)) & 4159) !== 0))) { + if(!(((((_la - 53)) & ~0x1F) === 0 && ((1 << (_la - 53)) & 4159) !== 0))) { this._errHandler.recoverInline(this); } else { @@ -1963,16 +1988,18 @@ export default class CashScriptParser extends Parser { case 8: return this.precpred(this._ctx, 5); case 9: - return this.precpred(this._ctx, 19); + return this.precpred(this._ctx, 20); case 10: - return this.precpred(this._ctx, 16); + return this.precpred(this._ctx, 17); case 11: + return this.precpred(this._ctx, 16); + case 12: return this.precpred(this._ctx, 15); } return true; } - public static readonly _serializedATN: number[] = [4,1,74,365,2,0,7,0,2, + public static readonly _serializedATN: number[] = [4,1,75,373,2,0,7,0,2, 1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2, 10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17, 7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7, @@ -1997,102 +2024,105 @@ export default class CashScriptParser extends Parser { 9,24,1,24,3,24,296,8,24,3,24,298,8,24,1,24,1,24,1,24,1,24,3,24,304,8,24, 1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1, 24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24, - 1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,5,24,345,8,24,10,24,12, - 24,348,9,24,1,25,1,25,1,26,1,26,1,26,1,26,1,26,3,26,357,8,26,1,27,1,27, - 3,27,361,8,27,1,28,1,28,1,28,0,1,48,29,0,2,4,6,8,10,12,14,16,18,20,22,24, - 26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,0,10,1,0,4,10,1,0,26,30, - 2,0,26,30,32,35,1,0,39,40,1,0,41,43,2,0,40,40,44,44,1,0,6,9,1,0,45,46,1, - 0,36,37,2,0,52,57,64,64,394,0,61,1,0,0,0,2,67,1,0,0,0,4,72,1,0,0,0,6,74, - 1,0,0,0,8,79,1,0,0,0,10,83,1,0,0,0,12,85,1,0,0,0,14,97,1,0,0,0,16,109,1, - 0,0,0,18,125,1,0,0,0,20,137,1,0,0,0,22,146,1,0,0,0,24,148,1,0,0,0,26,160, - 1,0,0,0,28,169,1,0,0,0,30,174,1,0,0,0,32,186,1,0,0,0,34,196,1,0,0,0,36, - 205,1,0,0,0,38,209,1,0,0,0,40,213,1,0,0,0,42,215,1,0,0,0,44,231,1,0,0,0, - 46,234,1,0,0,0,48,303,1,0,0,0,50,349,1,0,0,0,52,356,1,0,0,0,54,358,1,0, - 0,0,56,362,1,0,0,0,58,60,3,2,1,0,59,58,1,0,0,0,60,63,1,0,0,0,61,59,1,0, - 0,0,61,62,1,0,0,0,62,64,1,0,0,0,63,61,1,0,0,0,64,65,3,12,6,0,65,66,5,0, - 0,1,66,1,1,0,0,0,67,68,5,1,0,0,68,69,3,4,2,0,69,70,3,6,3,0,70,71,5,2,0, - 0,71,3,1,0,0,0,72,73,5,3,0,0,73,5,1,0,0,0,74,76,3,8,4,0,75,77,3,8,4,0,76, - 75,1,0,0,0,76,77,1,0,0,0,77,7,1,0,0,0,78,80,3,10,5,0,79,78,1,0,0,0,79,80, - 1,0,0,0,80,81,1,0,0,0,81,82,5,58,0,0,82,9,1,0,0,0,83,84,7,0,0,0,84,11,1, - 0,0,0,85,86,5,11,0,0,86,87,5,71,0,0,87,88,3,16,8,0,88,92,5,12,0,0,89,91, - 3,14,7,0,90,89,1,0,0,0,91,94,1,0,0,0,92,90,1,0,0,0,92,93,1,0,0,0,93,95, - 1,0,0,0,94,92,1,0,0,0,95,96,5,13,0,0,96,13,1,0,0,0,97,98,5,14,0,0,98,99, - 5,71,0,0,99,100,3,16,8,0,100,104,5,12,0,0,101,103,3,22,11,0,102,101,1,0, - 0,0,103,106,1,0,0,0,104,102,1,0,0,0,104,105,1,0,0,0,105,107,1,0,0,0,106, - 104,1,0,0,0,107,108,5,13,0,0,108,15,1,0,0,0,109,121,5,15,0,0,110,115,3, - 18,9,0,111,112,5,16,0,0,112,114,3,18,9,0,113,111,1,0,0,0,114,117,1,0,0, - 0,115,113,1,0,0,0,115,116,1,0,0,0,116,119,1,0,0,0,117,115,1,0,0,0,118,120, - 5,16,0,0,119,118,1,0,0,0,119,120,1,0,0,0,120,122,1,0,0,0,121,110,1,0,0, - 0,121,122,1,0,0,0,122,123,1,0,0,0,123,124,5,17,0,0,124,17,1,0,0,0,125,126, - 3,56,28,0,126,127,5,71,0,0,127,19,1,0,0,0,128,132,5,12,0,0,129,131,3,22, - 11,0,130,129,1,0,0,0,131,134,1,0,0,0,132,130,1,0,0,0,132,133,1,0,0,0,133, - 135,1,0,0,0,134,132,1,0,0,0,135,138,5,13,0,0,136,138,3,22,11,0,137,128, - 1,0,0,0,137,136,1,0,0,0,138,21,1,0,0,0,139,147,3,24,12,0,140,147,3,26,13, - 0,141,147,3,28,14,0,142,147,3,30,15,0,143,147,3,32,16,0,144,147,3,34,17, - 0,145,147,3,36,18,0,146,139,1,0,0,0,146,140,1,0,0,0,146,141,1,0,0,0,146, - 142,1,0,0,0,146,143,1,0,0,0,146,144,1,0,0,0,146,145,1,0,0,0,147,23,1,0, - 0,0,148,152,3,56,28,0,149,151,3,50,25,0,150,149,1,0,0,0,151,154,1,0,0,0, - 152,150,1,0,0,0,152,153,1,0,0,0,153,155,1,0,0,0,154,152,1,0,0,0,155,156, - 5,71,0,0,156,157,5,10,0,0,157,158,3,48,24,0,158,159,5,2,0,0,159,25,1,0, - 0,0,160,161,3,56,28,0,161,162,5,71,0,0,162,163,5,16,0,0,163,164,3,56,28, - 0,164,165,5,71,0,0,165,166,5,10,0,0,166,167,3,48,24,0,167,168,5,2,0,0,168, - 27,1,0,0,0,169,170,5,71,0,0,170,171,5,10,0,0,171,172,3,48,24,0,172,173, - 5,2,0,0,173,29,1,0,0,0,174,175,5,18,0,0,175,176,5,15,0,0,176,177,5,69,0, - 0,177,178,5,6,0,0,178,181,3,48,24,0,179,180,5,16,0,0,180,182,3,38,19,0, - 181,179,1,0,0,0,181,182,1,0,0,0,182,183,1,0,0,0,183,184,5,17,0,0,184,185, - 5,2,0,0,185,31,1,0,0,0,186,187,5,18,0,0,187,188,5,15,0,0,188,191,3,48,24, - 0,189,190,5,16,0,0,190,192,3,38,19,0,191,189,1,0,0,0,191,192,1,0,0,0,192, - 193,1,0,0,0,193,194,5,17,0,0,194,195,5,2,0,0,195,33,1,0,0,0,196,197,5,19, - 0,0,197,198,5,15,0,0,198,199,3,48,24,0,199,200,5,17,0,0,200,203,3,20,10, - 0,201,202,5,20,0,0,202,204,3,20,10,0,203,201,1,0,0,0,203,204,1,0,0,0,204, - 35,1,0,0,0,205,206,5,21,0,0,206,207,3,42,21,0,207,208,5,2,0,0,208,37,1, - 0,0,0,209,210,5,66,0,0,210,39,1,0,0,0,211,214,5,71,0,0,212,214,3,52,26, - 0,213,211,1,0,0,0,213,212,1,0,0,0,214,41,1,0,0,0,215,227,5,15,0,0,216,221, - 3,40,20,0,217,218,5,16,0,0,218,220,3,40,20,0,219,217,1,0,0,0,220,223,1, - 0,0,0,221,219,1,0,0,0,221,222,1,0,0,0,222,225,1,0,0,0,223,221,1,0,0,0,224, - 226,5,16,0,0,225,224,1,0,0,0,225,226,1,0,0,0,226,228,1,0,0,0,227,216,1, - 0,0,0,227,228,1,0,0,0,228,229,1,0,0,0,229,230,5,17,0,0,230,43,1,0,0,0,231, - 232,5,71,0,0,232,233,3,46,23,0,233,45,1,0,0,0,234,246,5,15,0,0,235,240, - 3,48,24,0,236,237,5,16,0,0,237,239,3,48,24,0,238,236,1,0,0,0,239,242,1, - 0,0,0,240,238,1,0,0,0,240,241,1,0,0,0,241,244,1,0,0,0,242,240,1,0,0,0,243, - 245,5,16,0,0,244,243,1,0,0,0,244,245,1,0,0,0,245,247,1,0,0,0,246,235,1, - 0,0,0,246,247,1,0,0,0,247,248,1,0,0,0,248,249,5,17,0,0,249,47,1,0,0,0,250, - 251,6,24,-1,0,251,252,5,15,0,0,252,253,3,48,24,0,253,254,5,17,0,0,254,304, - 1,0,0,0,255,256,3,56,28,0,256,257,5,15,0,0,257,260,3,48,24,0,258,259,5, - 16,0,0,259,261,3,48,24,0,260,258,1,0,0,0,260,261,1,0,0,0,261,263,1,0,0, - 0,262,264,5,16,0,0,263,262,1,0,0,0,263,264,1,0,0,0,264,265,1,0,0,0,265, - 266,5,17,0,0,266,304,1,0,0,0,267,304,3,44,22,0,268,269,5,22,0,0,269,270, - 5,71,0,0,270,304,3,46,23,0,271,272,5,25,0,0,272,273,5,23,0,0,273,274,3, - 48,24,0,274,275,5,24,0,0,275,276,7,1,0,0,276,304,1,0,0,0,277,278,5,31,0, - 0,278,279,5,23,0,0,279,280,3,48,24,0,280,281,5,24,0,0,281,282,7,2,0,0,282, - 304,1,0,0,0,283,284,7,3,0,0,284,304,3,48,24,14,285,297,5,23,0,0,286,291, - 3,48,24,0,287,288,5,16,0,0,288,290,3,48,24,0,289,287,1,0,0,0,290,293,1, - 0,0,0,291,289,1,0,0,0,291,292,1,0,0,0,292,295,1,0,0,0,293,291,1,0,0,0,294, - 296,5,16,0,0,295,294,1,0,0,0,295,296,1,0,0,0,296,298,1,0,0,0,297,286,1, - 0,0,0,297,298,1,0,0,0,298,299,1,0,0,0,299,304,5,24,0,0,300,304,5,70,0,0, - 301,304,5,71,0,0,302,304,3,52,26,0,303,250,1,0,0,0,303,255,1,0,0,0,303, - 267,1,0,0,0,303,268,1,0,0,0,303,271,1,0,0,0,303,277,1,0,0,0,303,283,1,0, - 0,0,303,285,1,0,0,0,303,300,1,0,0,0,303,301,1,0,0,0,303,302,1,0,0,0,304, - 346,1,0,0,0,305,306,10,13,0,0,306,307,7,4,0,0,307,345,3,48,24,14,308,309, - 10,12,0,0,309,310,7,5,0,0,310,345,3,48,24,13,311,312,10,11,0,0,312,313, - 7,6,0,0,313,345,3,48,24,12,314,315,10,10,0,0,315,316,7,7,0,0,316,345,3, - 48,24,11,317,318,10,9,0,0,318,319,5,47,0,0,319,345,3,48,24,10,320,321,10, - 8,0,0,321,322,5,4,0,0,322,345,3,48,24,9,323,324,10,7,0,0,324,325,5,48,0, - 0,325,345,3,48,24,8,326,327,10,6,0,0,327,328,5,49,0,0,328,345,3,48,24,7, - 329,330,10,5,0,0,330,331,5,50,0,0,331,345,3,48,24,6,332,333,10,19,0,0,333, - 334,5,23,0,0,334,335,5,61,0,0,335,345,5,24,0,0,336,337,10,16,0,0,337,345, - 7,8,0,0,338,339,10,15,0,0,339,340,5,38,0,0,340,341,5,15,0,0,341,342,3,48, - 24,0,342,343,5,17,0,0,343,345,1,0,0,0,344,305,1,0,0,0,344,308,1,0,0,0,344, - 311,1,0,0,0,344,314,1,0,0,0,344,317,1,0,0,0,344,320,1,0,0,0,344,323,1,0, - 0,0,344,326,1,0,0,0,344,329,1,0,0,0,344,332,1,0,0,0,344,336,1,0,0,0,344, - 338,1,0,0,0,345,348,1,0,0,0,346,344,1,0,0,0,346,347,1,0,0,0,347,49,1,0, - 0,0,348,346,1,0,0,0,349,350,5,51,0,0,350,51,1,0,0,0,351,357,5,59,0,0,352, - 357,3,54,27,0,353,357,5,66,0,0,354,357,5,67,0,0,355,357,5,68,0,0,356,351, - 1,0,0,0,356,352,1,0,0,0,356,353,1,0,0,0,356,354,1,0,0,0,356,355,1,0,0,0, - 357,53,1,0,0,0,358,360,5,61,0,0,359,361,5,60,0,0,360,359,1,0,0,0,360,361, - 1,0,0,0,361,55,1,0,0,0,362,363,7,9,0,0,363,57,1,0,0,0,32,61,76,79,92,104, + 1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1, + 24,1,24,1,24,1,24,5,24,353,8,24,10,24,12,24,356,9,24,1,25,1,25,1,26,1,26, + 1,26,1,26,1,26,3,26,365,8,26,1,27,1,27,3,27,369,8,27,1,28,1,28,1,28,0,1, + 48,29,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46, + 48,50,52,54,56,0,10,1,0,4,10,1,0,26,30,2,0,26,30,32,35,1,0,40,41,1,0,42, + 44,2,0,41,41,45,45,1,0,6,9,1,0,46,47,1,0,36,37,2,0,53,58,65,65,403,0,61, + 1,0,0,0,2,67,1,0,0,0,4,72,1,0,0,0,6,74,1,0,0,0,8,79,1,0,0,0,10,83,1,0,0, + 0,12,85,1,0,0,0,14,97,1,0,0,0,16,109,1,0,0,0,18,125,1,0,0,0,20,137,1,0, + 0,0,22,146,1,0,0,0,24,148,1,0,0,0,26,160,1,0,0,0,28,169,1,0,0,0,30,174, + 1,0,0,0,32,186,1,0,0,0,34,196,1,0,0,0,36,205,1,0,0,0,38,209,1,0,0,0,40, + 213,1,0,0,0,42,215,1,0,0,0,44,231,1,0,0,0,46,234,1,0,0,0,48,303,1,0,0,0, + 50,357,1,0,0,0,52,364,1,0,0,0,54,366,1,0,0,0,56,370,1,0,0,0,58,60,3,2,1, + 0,59,58,1,0,0,0,60,63,1,0,0,0,61,59,1,0,0,0,61,62,1,0,0,0,62,64,1,0,0,0, + 63,61,1,0,0,0,64,65,3,12,6,0,65,66,5,0,0,1,66,1,1,0,0,0,67,68,5,1,0,0,68, + 69,3,4,2,0,69,70,3,6,3,0,70,71,5,2,0,0,71,3,1,0,0,0,72,73,5,3,0,0,73,5, + 1,0,0,0,74,76,3,8,4,0,75,77,3,8,4,0,76,75,1,0,0,0,76,77,1,0,0,0,77,7,1, + 0,0,0,78,80,3,10,5,0,79,78,1,0,0,0,79,80,1,0,0,0,80,81,1,0,0,0,81,82,5, + 59,0,0,82,9,1,0,0,0,83,84,7,0,0,0,84,11,1,0,0,0,85,86,5,11,0,0,86,87,5, + 72,0,0,87,88,3,16,8,0,88,92,5,12,0,0,89,91,3,14,7,0,90,89,1,0,0,0,91,94, + 1,0,0,0,92,90,1,0,0,0,92,93,1,0,0,0,93,95,1,0,0,0,94,92,1,0,0,0,95,96,5, + 13,0,0,96,13,1,0,0,0,97,98,5,14,0,0,98,99,5,72,0,0,99,100,3,16,8,0,100, + 104,5,12,0,0,101,103,3,22,11,0,102,101,1,0,0,0,103,106,1,0,0,0,104,102, + 1,0,0,0,104,105,1,0,0,0,105,107,1,0,0,0,106,104,1,0,0,0,107,108,5,13,0, + 0,108,15,1,0,0,0,109,121,5,15,0,0,110,115,3,18,9,0,111,112,5,16,0,0,112, + 114,3,18,9,0,113,111,1,0,0,0,114,117,1,0,0,0,115,113,1,0,0,0,115,116,1, + 0,0,0,116,119,1,0,0,0,117,115,1,0,0,0,118,120,5,16,0,0,119,118,1,0,0,0, + 119,120,1,0,0,0,120,122,1,0,0,0,121,110,1,0,0,0,121,122,1,0,0,0,122,123, + 1,0,0,0,123,124,5,17,0,0,124,17,1,0,0,0,125,126,3,56,28,0,126,127,5,72, + 0,0,127,19,1,0,0,0,128,132,5,12,0,0,129,131,3,22,11,0,130,129,1,0,0,0,131, + 134,1,0,0,0,132,130,1,0,0,0,132,133,1,0,0,0,133,135,1,0,0,0,134,132,1,0, + 0,0,135,138,5,13,0,0,136,138,3,22,11,0,137,128,1,0,0,0,137,136,1,0,0,0, + 138,21,1,0,0,0,139,147,3,24,12,0,140,147,3,26,13,0,141,147,3,28,14,0,142, + 147,3,30,15,0,143,147,3,32,16,0,144,147,3,34,17,0,145,147,3,36,18,0,146, + 139,1,0,0,0,146,140,1,0,0,0,146,141,1,0,0,0,146,142,1,0,0,0,146,143,1,0, + 0,0,146,144,1,0,0,0,146,145,1,0,0,0,147,23,1,0,0,0,148,152,3,56,28,0,149, + 151,3,50,25,0,150,149,1,0,0,0,151,154,1,0,0,0,152,150,1,0,0,0,152,153,1, + 0,0,0,153,155,1,0,0,0,154,152,1,0,0,0,155,156,5,72,0,0,156,157,5,10,0,0, + 157,158,3,48,24,0,158,159,5,2,0,0,159,25,1,0,0,0,160,161,3,56,28,0,161, + 162,5,72,0,0,162,163,5,16,0,0,163,164,3,56,28,0,164,165,5,72,0,0,165,166, + 5,10,0,0,166,167,3,48,24,0,167,168,5,2,0,0,168,27,1,0,0,0,169,170,5,72, + 0,0,170,171,5,10,0,0,171,172,3,48,24,0,172,173,5,2,0,0,173,29,1,0,0,0,174, + 175,5,18,0,0,175,176,5,15,0,0,176,177,5,70,0,0,177,178,5,6,0,0,178,181, + 3,48,24,0,179,180,5,16,0,0,180,182,3,38,19,0,181,179,1,0,0,0,181,182,1, + 0,0,0,182,183,1,0,0,0,183,184,5,17,0,0,184,185,5,2,0,0,185,31,1,0,0,0,186, + 187,5,18,0,0,187,188,5,15,0,0,188,191,3,48,24,0,189,190,5,16,0,0,190,192, + 3,38,19,0,191,189,1,0,0,0,191,192,1,0,0,0,192,193,1,0,0,0,193,194,5,17, + 0,0,194,195,5,2,0,0,195,33,1,0,0,0,196,197,5,19,0,0,197,198,5,15,0,0,198, + 199,3,48,24,0,199,200,5,17,0,0,200,203,3,20,10,0,201,202,5,20,0,0,202,204, + 3,20,10,0,203,201,1,0,0,0,203,204,1,0,0,0,204,35,1,0,0,0,205,206,5,21,0, + 0,206,207,3,42,21,0,207,208,5,2,0,0,208,37,1,0,0,0,209,210,5,67,0,0,210, + 39,1,0,0,0,211,214,5,72,0,0,212,214,3,52,26,0,213,211,1,0,0,0,213,212,1, + 0,0,0,214,41,1,0,0,0,215,227,5,15,0,0,216,221,3,40,20,0,217,218,5,16,0, + 0,218,220,3,40,20,0,219,217,1,0,0,0,220,223,1,0,0,0,221,219,1,0,0,0,221, + 222,1,0,0,0,222,225,1,0,0,0,223,221,1,0,0,0,224,226,5,16,0,0,225,224,1, + 0,0,0,225,226,1,0,0,0,226,228,1,0,0,0,227,216,1,0,0,0,227,228,1,0,0,0,228, + 229,1,0,0,0,229,230,5,17,0,0,230,43,1,0,0,0,231,232,5,72,0,0,232,233,3, + 46,23,0,233,45,1,0,0,0,234,246,5,15,0,0,235,240,3,48,24,0,236,237,5,16, + 0,0,237,239,3,48,24,0,238,236,1,0,0,0,239,242,1,0,0,0,240,238,1,0,0,0,240, + 241,1,0,0,0,241,244,1,0,0,0,242,240,1,0,0,0,243,245,5,16,0,0,244,243,1, + 0,0,0,244,245,1,0,0,0,245,247,1,0,0,0,246,235,1,0,0,0,246,247,1,0,0,0,247, + 248,1,0,0,0,248,249,5,17,0,0,249,47,1,0,0,0,250,251,6,24,-1,0,251,252,5, + 15,0,0,252,253,3,48,24,0,253,254,5,17,0,0,254,304,1,0,0,0,255,256,3,56, + 28,0,256,257,5,15,0,0,257,260,3,48,24,0,258,259,5,16,0,0,259,261,3,48,24, + 0,260,258,1,0,0,0,260,261,1,0,0,0,261,263,1,0,0,0,262,264,5,16,0,0,263, + 262,1,0,0,0,263,264,1,0,0,0,264,265,1,0,0,0,265,266,5,17,0,0,266,304,1, + 0,0,0,267,304,3,44,22,0,268,269,5,22,0,0,269,270,5,72,0,0,270,304,3,46, + 23,0,271,272,5,25,0,0,272,273,5,23,0,0,273,274,3,48,24,0,274,275,5,24,0, + 0,275,276,7,1,0,0,276,304,1,0,0,0,277,278,5,31,0,0,278,279,5,23,0,0,279, + 280,3,48,24,0,280,281,5,24,0,0,281,282,7,2,0,0,282,304,1,0,0,0,283,284, + 7,3,0,0,284,304,3,48,24,14,285,297,5,23,0,0,286,291,3,48,24,0,287,288,5, + 16,0,0,288,290,3,48,24,0,289,287,1,0,0,0,290,293,1,0,0,0,291,289,1,0,0, + 0,291,292,1,0,0,0,292,295,1,0,0,0,293,291,1,0,0,0,294,296,5,16,0,0,295, + 294,1,0,0,0,295,296,1,0,0,0,296,298,1,0,0,0,297,286,1,0,0,0,297,298,1,0, + 0,0,298,299,1,0,0,0,299,304,5,24,0,0,300,304,5,71,0,0,301,304,5,72,0,0, + 302,304,3,52,26,0,303,250,1,0,0,0,303,255,1,0,0,0,303,267,1,0,0,0,303,268, + 1,0,0,0,303,271,1,0,0,0,303,277,1,0,0,0,303,283,1,0,0,0,303,285,1,0,0,0, + 303,300,1,0,0,0,303,301,1,0,0,0,303,302,1,0,0,0,304,354,1,0,0,0,305,306, + 10,13,0,0,306,307,7,4,0,0,307,353,3,48,24,14,308,309,10,12,0,0,309,310, + 7,5,0,0,310,353,3,48,24,13,311,312,10,11,0,0,312,313,7,6,0,0,313,353,3, + 48,24,12,314,315,10,10,0,0,315,316,7,7,0,0,316,353,3,48,24,11,317,318,10, + 9,0,0,318,319,5,48,0,0,319,353,3,48,24,10,320,321,10,8,0,0,321,322,5,4, + 0,0,322,353,3,48,24,9,323,324,10,7,0,0,324,325,5,49,0,0,325,353,3,48,24, + 8,326,327,10,6,0,0,327,328,5,50,0,0,328,353,3,48,24,7,329,330,10,5,0,0, + 330,331,5,51,0,0,331,353,3,48,24,6,332,333,10,20,0,0,333,334,5,23,0,0,334, + 335,5,62,0,0,335,353,5,24,0,0,336,337,10,17,0,0,337,353,7,8,0,0,338,339, + 10,16,0,0,339,340,5,38,0,0,340,341,5,15,0,0,341,342,3,48,24,0,342,343,5, + 17,0,0,343,353,1,0,0,0,344,345,10,15,0,0,345,346,5,39,0,0,346,347,5,15, + 0,0,347,348,3,48,24,0,348,349,5,16,0,0,349,350,3,48,24,0,350,351,5,17,0, + 0,351,353,1,0,0,0,352,305,1,0,0,0,352,308,1,0,0,0,352,311,1,0,0,0,352,314, + 1,0,0,0,352,317,1,0,0,0,352,320,1,0,0,0,352,323,1,0,0,0,352,326,1,0,0,0, + 352,329,1,0,0,0,352,332,1,0,0,0,352,336,1,0,0,0,352,338,1,0,0,0,352,344, + 1,0,0,0,353,356,1,0,0,0,354,352,1,0,0,0,354,355,1,0,0,0,355,49,1,0,0,0, + 356,354,1,0,0,0,357,358,5,52,0,0,358,51,1,0,0,0,359,365,5,60,0,0,360,365, + 3,54,27,0,361,365,5,67,0,0,362,365,5,68,0,0,363,365,5,69,0,0,364,359,1, + 0,0,0,364,360,1,0,0,0,364,361,1,0,0,0,364,362,1,0,0,0,364,363,1,0,0,0,365, + 53,1,0,0,0,366,368,5,62,0,0,367,369,5,61,0,0,368,367,1,0,0,0,368,369,1, + 0,0,0,369,55,1,0,0,0,370,371,7,9,0,0,371,57,1,0,0,0,32,61,76,79,92,104, 115,119,121,132,137,146,152,181,191,203,213,221,225,227,240,244,246,260, - 263,291,295,297,303,344,346,356,360]; + 263,291,295,297,303,352,354,364,368]; private static __ATN: ATN; public static get _ATN(): ATN { @@ -2805,39 +2835,73 @@ export class UnaryIntrospectionOpContext extends ExpressionContext { } } } -export class ArrayContext extends ExpressionContext { +export class UnaryOpContext extends ExpressionContext { + public _op!: Token; constructor(parser: CashScriptParser, ctx: ExpressionContext) { super(parser, ctx.parentCtx, ctx.invokingState); super.copyFrom(ctx); } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; + public expression(): ExpressionContext { + return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; + // @Override + public accept(visitor: CashScriptVisitor): Result { + if (visitor.visitUnaryOp) { + return visitor.visitUnaryOp(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class LiteralExpressionContext extends ExpressionContext { + constructor(parser: CashScriptParser, ctx: ExpressionContext) { + super(parser, ctx.parentCtx, ctx.invokingState); + super.copyFrom(ctx); + } + public literal(): LiteralContext { + return this.getTypedRuleContext(LiteralContext, 0) as LiteralContext; } // @Override public accept(visitor: CashScriptVisitor): Result { - if (visitor.visitArray) { - return visitor.visitArray(this); + if (visitor.visitLiteralExpression) { + return visitor.visitLiteralExpression(this); } else { return visitor.visitChildren(this); } } } -export class UnaryOpContext extends ExpressionContext { - public _op!: Token; +export class FunctionCallExpressionContext extends ExpressionContext { constructor(parser: CashScriptParser, ctx: ExpressionContext) { super(parser, ctx.parentCtx, ctx.invokingState); super.copyFrom(ctx); } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; + public functionCall(): FunctionCallContext { + return this.getTypedRuleContext(FunctionCallContext, 0) as FunctionCallContext; } // @Override public accept(visitor: CashScriptVisitor): Result { - if (visitor.visitUnaryOp) { - return visitor.visitUnaryOp(this); + if (visitor.visitFunctionCallExpression) { + return visitor.visitFunctionCallExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class ArrayContext extends ExpressionContext { + constructor(parser: CashScriptParser, ctx: ExpressionContext) { + super(parser, ctx.parentCtx, ctx.invokingState); + super.copyFrom(ctx); + } + public expression_list(): ExpressionContext[] { + return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; + } + public expression(i: number): ExpressionContext { + return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; + } + // @Override + public accept(visitor: CashScriptVisitor): Result { + if (visitor.visitArray) { + return visitor.visitArray(this); } else { return visitor.visitChildren(this); } @@ -2860,18 +2924,24 @@ export class IdentifierContext extends ExpressionContext { } } } -export class LiteralExpressionContext extends ExpressionContext { +export class SliceContext extends ExpressionContext { + public _element!: ExpressionContext; + public _start!: ExpressionContext; + public _end!: ExpressionContext; constructor(parser: CashScriptParser, ctx: ExpressionContext) { super(parser, ctx.parentCtx, ctx.invokingState); super.copyFrom(ctx); } - public literal(): LiteralContext { - return this.getTypedRuleContext(LiteralContext, 0) as LiteralContext; + public expression_list(): ExpressionContext[] { + return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; + } + public expression(i: number): ExpressionContext { + return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; } // @Override public accept(visitor: CashScriptVisitor): Result { - if (visitor.visitLiteralExpression) { - return visitor.visitLiteralExpression(this); + if (visitor.visitSlice) { + return visitor.visitSlice(this); } else { return visitor.visitChildren(this); } @@ -2918,23 +2988,6 @@ export class InstantiationContext extends ExpressionContext { } } } -export class FunctionCallExpressionContext extends ExpressionContext { - constructor(parser: CashScriptParser, ctx: ExpressionContext) { - super(parser, ctx.parentCtx, ctx.invokingState); - super.copyFrom(ctx); - } - public functionCall(): FunctionCallContext { - return this.getTypedRuleContext(FunctionCallContext, 0) as FunctionCallContext; - } - // @Override - public accept(visitor: CashScriptVisitor): Result { - if (visitor.visitFunctionCallExpression) { - return visitor.visitFunctionCallExpression(this); - } else { - return visitor.visitChildren(this); - } - } -} export class NullaryOpContext extends ExpressionContext { constructor(parser: CashScriptParser, ctx: ExpressionContext) { super(parser, ctx.parentCtx, ctx.invokingState); diff --git a/packages/cashc/src/grammar/CashScriptVisitor.ts b/packages/cashc/src/grammar/CashScriptVisitor.ts index c8579759c..4e161c03f 100644 --- a/packages/cashc/src/grammar/CashScriptVisitor.ts +++ b/packages/cashc/src/grammar/CashScriptVisitor.ts @@ -29,13 +29,14 @@ import { FunctionCallContext } from "./CashScriptParser.js"; import { ExpressionListContext } from "./CashScriptParser.js"; import { CastContext } from "./CashScriptParser.js"; import { UnaryIntrospectionOpContext } from "./CashScriptParser.js"; -import { ArrayContext } from "./CashScriptParser.js"; import { UnaryOpContext } from "./CashScriptParser.js"; -import { IdentifierContext } from "./CashScriptParser.js"; import { LiteralExpressionContext } from "./CashScriptParser.js"; +import { FunctionCallExpressionContext } from "./CashScriptParser.js"; +import { ArrayContext } from "./CashScriptParser.js"; +import { IdentifierContext } from "./CashScriptParser.js"; +import { SliceContext } from "./CashScriptParser.js"; import { TupleIndexOpContext } from "./CashScriptParser.js"; import { InstantiationContext } from "./CashScriptParser.js"; -import { FunctionCallExpressionContext } from "./CashScriptParser.js"; import { NullaryOpContext } from "./CashScriptParser.js"; import { ParenthesisedContext } from "./CashScriptParser.js"; import { BinaryOpContext } from "./CashScriptParser.js"; @@ -212,19 +213,33 @@ export default class CashScriptVisitor extends ParseTreeVisitor */ visitUnaryIntrospectionOp?: (ctx: UnaryIntrospectionOpContext) => Result; /** - * Visit a parse tree produced by the `Array` + * Visit a parse tree produced by the `UnaryOp` * labeled alternative in `CashScriptParser.expression`. * @param ctx the parse tree * @return the visitor result */ - visitArray?: (ctx: ArrayContext) => Result; + visitUnaryOp?: (ctx: UnaryOpContext) => Result; /** - * Visit a parse tree produced by the `UnaryOp` + * Visit a parse tree produced by the `LiteralExpression` * labeled alternative in `CashScriptParser.expression`. * @param ctx the parse tree * @return the visitor result */ - visitUnaryOp?: (ctx: UnaryOpContext) => Result; + visitLiteralExpression?: (ctx: LiteralExpressionContext) => Result; + /** + * Visit a parse tree produced by the `FunctionCallExpression` + * labeled alternative in `CashScriptParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitFunctionCallExpression?: (ctx: FunctionCallExpressionContext) => Result; + /** + * Visit a parse tree produced by the `Array` + * labeled alternative in `CashScriptParser.expression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitArray?: (ctx: ArrayContext) => Result; /** * Visit a parse tree produced by the `Identifier` * labeled alternative in `CashScriptParser.expression`. @@ -233,12 +248,12 @@ export default class CashScriptVisitor extends ParseTreeVisitor */ visitIdentifier?: (ctx: IdentifierContext) => Result; /** - * Visit a parse tree produced by the `LiteralExpression` + * Visit a parse tree produced by the `Slice` * labeled alternative in `CashScriptParser.expression`. * @param ctx the parse tree * @return the visitor result */ - visitLiteralExpression?: (ctx: LiteralExpressionContext) => Result; + visitSlice?: (ctx: SliceContext) => Result; /** * Visit a parse tree produced by the `TupleIndexOp` * labeled alternative in `CashScriptParser.expression`. @@ -253,13 +268,6 @@ export default class CashScriptVisitor extends ParseTreeVisitor * @return the visitor result */ visitInstantiation?: (ctx: InstantiationContext) => Result; - /** - * Visit a parse tree produced by the `FunctionCallExpression` - * labeled alternative in `CashScriptParser.expression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitFunctionCallExpression?: (ctx: FunctionCallExpressionContext) => Result; /** * Visit a parse tree produced by the `NullaryOp` * labeled alternative in `CashScriptParser.expression`. From 5e9bf98d91f374f21230b45bdba541575ba57747 Mon Sep 17 00:00:00 2001 From: Rosco Kalis Date: Tue, 15 Jul 2025 11:24:11 +0200 Subject: [PATCH 04/16] Implement compiler logic for .slice() feature --- packages/cashc/src/Errors.ts | 7 ++++-- packages/cashc/src/ast/AST.ts | 16 +++++++++++++- packages/cashc/src/ast/AstBuilder.ts | 11 ++++++++++ packages/cashc/src/ast/AstTraversal.ts | 8 +++++++ packages/cashc/src/ast/AstVisitor.ts | 2 ++ .../src/generation/GenerateTargetTraversal.ts | 22 +++++++++++++++++++ .../src/print/OutputSourceCodeTraversal.ts | 11 ++++++++++ .../cashc/src/semantic/TypeCheckTraversal.ts | 18 ++++++++++++++- 8 files changed, 91 insertions(+), 4 deletions(-) diff --git a/packages/cashc/src/Errors.ts b/packages/cashc/src/Errors.ts index 6c966d59c..2a13c2fff 100644 --- a/packages/cashc/src/Errors.ts +++ b/packages/cashc/src/Errors.ts @@ -19,6 +19,7 @@ import { StatementNode, ContractNode, ExpressionNode, + SliceNode, } from './ast/AST.js'; import { Symbol, SymbolType } from './ast/SymbolTable.js'; import { Location, Point } from './ast/Location.js'; @@ -73,7 +74,7 @@ export class InvalidSymbolTypeError extends CashScriptError { } } -export class RedefinitionError extends CashScriptError {} +export class RedefinitionError extends CashScriptError { } export class FunctionRedefinitionError extends RedefinitionError { constructor( @@ -160,7 +161,7 @@ export class UnequalTypeError extends TypeError { export class UnsupportedTypeError extends TypeError { constructor( - node: BinaryOpNode | UnaryOpNode | TimeOpNode | TupleIndexOpNode, + node: BinaryOpNode | UnaryOpNode | TimeOpNode | TupleIndexOpNode | SliceNode, actual?: Type, expected?: Type, ) { @@ -170,6 +171,8 @@ export class UnsupportedTypeError extends TypeError { } else { super(node, actual, expected, `Tried to call member 'split' on unsupported type '${actual}'`); } + } else if (node instanceof SliceNode) { + super(node, actual, expected, `Tried to call member 'slice' on unsupported type '${actual}'`); } else if (node instanceof BinaryOpNode) { super(node, actual, expected, `Tried to apply operator '${node.operator}' to unsupported type '${actual}'`); } else if (node instanceof UnaryOpNode && node.operator.startsWith('.')) { diff --git a/packages/cashc/src/ast/AST.ts b/packages/cashc/src/ast/AST.ts index f8c7b7628..f376718c7 100644 --- a/packages/cashc/src/ast/AST.ts +++ b/packages/cashc/src/ast/AST.ts @@ -79,7 +79,7 @@ export class ParameterNode extends Node implements Named, Typed { } } -export abstract class StatementNode extends Node {} +export abstract class StatementNode extends Node { } export class VariableDefinitionNode extends StatementNode implements Named, Typed { constructor( @@ -235,6 +235,20 @@ export class TupleIndexOpNode extends ExpressionNode { } } +export class SliceNode extends ExpressionNode { + constructor( + public element: ExpressionNode, + public start: ExpressionNode, + public end: ExpressionNode, + ) { + super(); + } + + accept(visitor: AstVisitor): T { + return visitor.visitSlice(this); + } +} + export class BinaryOpNode extends ExpressionNode { constructor( public left: ExpressionNode, diff --git a/packages/cashc/src/ast/AstBuilder.ts b/packages/cashc/src/ast/AstBuilder.ts index 50d0083a9..7f5bc9943 100644 --- a/packages/cashc/src/ast/AstBuilder.ts +++ b/packages/cashc/src/ast/AstBuilder.ts @@ -33,6 +33,7 @@ import { NullaryOpNode, ConsoleStatementNode, ConsoleParameterNode, + SliceNode, } from './AST.js'; import { UnaryOperator, BinaryOperator, NullaryOperator } from './Operator.js'; import type { @@ -66,6 +67,7 @@ import type { ConsoleParameterContext, StatementContext, RequireMessageContext, + SliceContext, } from '../grammar/CashScriptParser.js'; import CashScriptVisitor from '../grammar/CashScriptVisitor.js'; import { Location } from './Location.js'; @@ -262,6 +264,15 @@ export default class AstBuilder return tupleIndexOp; } + visitSlice(ctx: SliceContext): SliceNode { + const element = this.visit(ctx._element); + const start = this.visit(ctx._start); + const end = this.visit(ctx._end); + const slice = new SliceNode(element, start, end); + slice.location = Location.fromCtx(ctx); + return slice; + } + visitNullaryOp(ctx: NullaryOpContext): NullaryOpNode { const operator = ctx.getText() as NullaryOperator; const nullaryOp = new NullaryOpNode(operator); diff --git a/packages/cashc/src/ast/AstTraversal.ts b/packages/cashc/src/ast/AstTraversal.ts index 81e3f3408..4d94df615 100644 --- a/packages/cashc/src/ast/AstTraversal.ts +++ b/packages/cashc/src/ast/AstTraversal.ts @@ -27,6 +27,7 @@ import { NullaryOpNode, ConsoleStatementNode, ConsoleParameterNode, + SliceNode, } from './AST.js'; import AstVisitor from './AstVisitor.js'; @@ -113,6 +114,13 @@ export default class AstTraversal extends AstVisitor { return node; } + visitSlice(node: SliceNode): Node { + node.element = this.visit(node.element); + node.start = this.visit(node.start); + node.end = this.visit(node.end); + return node; + } + visitBinaryOp(node: BinaryOpNode): Node { node.left = this.visit(node.left); node.right = this.visit(node.right); diff --git a/packages/cashc/src/ast/AstVisitor.ts b/packages/cashc/src/ast/AstVisitor.ts index e154b5d16..8e558ed0e 100644 --- a/packages/cashc/src/ast/AstVisitor.ts +++ b/packages/cashc/src/ast/AstVisitor.ts @@ -25,6 +25,7 @@ import { TupleAssignmentNode, NullaryOpNode, ConsoleStatementNode, + SliceNode, } from './AST.js'; export default abstract class AstVisitor { @@ -42,6 +43,7 @@ export default abstract class AstVisitor { abstract visitCast(node: CastNode): T; abstract visitFunctionCall(node: FunctionCallNode): T; abstract visitInstantiation(node: InstantiationNode): T; + abstract visitSlice(node: SliceNode): T; abstract visitTupleIndexOp(node: TupleIndexOpNode): T; abstract visitBinaryOp(node: BinaryOpNode): T; abstract visitUnaryOp(node: UnaryOpNode): T; diff --git a/packages/cashc/src/generation/GenerateTargetTraversal.ts b/packages/cashc/src/generation/GenerateTargetTraversal.ts index 44730dba4..94ad9c536 100644 --- a/packages/cashc/src/generation/GenerateTargetTraversal.ts +++ b/packages/cashc/src/generation/GenerateTargetTraversal.ts @@ -46,6 +46,7 @@ import { NullaryOpNode, ConsoleParameterNode, ConsoleStatementNode, + SliceNode, } from '../ast/AST.js'; import AstTraversal from '../ast/AstTraversal.js'; import { GlobalFunction, Class } from '../ast/Globals.js'; @@ -537,6 +538,27 @@ export default class GenerateTargetTraversalWithLocation extends AstTraversal { return node; } + // element.slice(start, end) is equivalent to element.split(end)[0].split(start)[1] + visitSlice(node: SliceNode): Node { + node.element = this.visit(node.element); + + const locationData = { location: node.location, positionHint: PositionHint.END }; + + this.visit(node.end); + this.emit(Op.OP_SPLIT, locationData); + this.emit(Op.OP_DROP, locationData); + this.popFromStack(2); + this.pushToStack('(value)'); + + this.visit(node.start); + this.emit(Op.OP_SPLIT, locationData); + this.emit(Op.OP_NIP, locationData); + this.popFromStack(2); + this.pushToStack('(value)'); + + return node; + } + visitBinaryOp(node: BinaryOpNode): Node { node.left = this.visit(node.left); node.right = this.visit(node.right); diff --git a/packages/cashc/src/print/OutputSourceCodeTraversal.ts b/packages/cashc/src/print/OutputSourceCodeTraversal.ts index 1f33ae62b..66c387d1b 100644 --- a/packages/cashc/src/print/OutputSourceCodeTraversal.ts +++ b/packages/cashc/src/print/OutputSourceCodeTraversal.ts @@ -28,6 +28,7 @@ import { NullaryOpNode, ConsoleStatementNode, ConsoleParameterNode, + SliceNode, } from '../ast/AST.js'; import AstTraversal from '../ast/AstTraversal.js'; @@ -216,6 +217,16 @@ export default class OutputSourceCodeTraversal extends AstTraversal { return node; } + visitSlice(node: SliceNode): Node { + node.element = this.visit(node.element); + this.addOutput('.slice('); + node.start = this.visit(node.start); + this.addOutput(', '); + node.end = this.visit(node.end); + this.addOutput(')'); + return node; + } + visitBinaryOp(node: BinaryOpNode): Node { if (node.operator.startsWith('.')) { node.left = this.visit(node.left); diff --git a/packages/cashc/src/semantic/TypeCheckTraversal.ts b/packages/cashc/src/semantic/TypeCheckTraversal.ts index b075cb5f1..1306ef486 100644 --- a/packages/cashc/src/semantic/TypeCheckTraversal.ts +++ b/packages/cashc/src/semantic/TypeCheckTraversal.ts @@ -27,6 +27,7 @@ import { InstantiationNode, TupleAssignmentNode, NullaryOpNode, + SliceNode, } from '../ast/AST.js'; import AstTraversal from '../ast/AstTraversal.js'; import { @@ -171,6 +172,21 @@ export default class TypeCheckTraversal extends AstTraversal { return node; } + visitSlice(node: SliceNode): Node { + node.element = this.visit(node.element); + node.start = this.visit(node.start); + node.end = this.visit(node.end); + + expectAnyOfTypes(node, node.element.type, [new BytesType(), PrimitiveType.STRING]); + expectInt(node, node.start.type); + expectInt(node, node.end.type); + + // TODO: Proper typing + node.type = node.element.type instanceof BytesType ? new BytesType() : PrimitiveType.STRING; + + return node; + } + visitBinaryOp(node: BinaryOpNode): Node { node.left = this.visit(node.left); node.right = this.visit(node.right); @@ -325,7 +341,7 @@ export default class TypeCheckTraversal extends AstTraversal { } } -type ExpectedNode = BinaryOpNode | UnaryOpNode | TimeOpNode | TupleIndexOpNode; +type ExpectedNode = BinaryOpNode | UnaryOpNode | TimeOpNode | TupleIndexOpNode | SliceNode; function expectAnyOfTypes(node: ExpectedNode, actual?: Type, expectedTypes?: Type[]): void { if (!expectedTypes || expectedTypes.length === 0) return; if (expectedTypes.find((expected) => implicitlyCastable(actual, expected))) { From a0afaad25439746eb7319a6d390a4217eda1a2e1 Mon Sep 17 00:00:00 2001 From: Rosco Kalis Date: Tue, 15 Jul 2025 11:42:11 +0200 Subject: [PATCH 05/16] Update docs for .slice() feature --- website/docs/language/types.md | 6 ++++-- website/docs/releases/release-notes.md | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/website/docs/language/types.md b/website/docs/language/types.md index 66fae27ec..76ad92c27 100644 --- a/website/docs/language/types.md +++ b/website/docs/language/types.md @@ -65,10 +65,11 @@ Members: - `length`: Number of characters in the string. - `split(int)`: Splits the string at the specified index and returns a tuple with the two resulting strings. +- `slice(int,int)`: Returns a substring from the start index up to (but excluding) the end index. - `reverse()`: Reverses the string. :::caution -The script will fail if `split()` is called with an index that is out of bounds. +The script will fail if `split()`or `slice()` is called with an index that is out of bounds. ::: ## Bytes @@ -89,10 +90,11 @@ Members: - `length`: Number of bytes in the sequence. - `split(int)`: Splits the byte sequence at the specified index and returns a tuple with the two resulting byte sequences. +- `slice(int,int)`: Returns the part of the byte sequence from the start index up to (but excluding) the end index. - `reverse()`: Reverses the byte sequence. :::caution -The script will fail if `split()` is called with an index that is out of bounds. +The script will fail if `split()` or `slice()` is called with an index that is out of bounds. ::: #### Example diff --git a/website/docs/releases/release-notes.md b/website/docs/releases/release-notes.md index 4cf6c8395..2e383d59e 100644 --- a/website/docs/releases/release-notes.md +++ b/website/docs/releases/release-notes.md @@ -4,6 +4,9 @@ title: Release Notes ## v0.11.3 +#### cashc compiler +- :sparkles: Add `.slice(start, end)` operator for bytes and strings. + #### CashScript SDK - :bug: Fix bug with where `ElectrumNetworkProvider` would disconnect in browser on visibility change of the page From 83b88f6f78fde7b247d575057e3d26d5497c3a38 Mon Sep 17 00:00:00 2001 From: Rosco Kalis Date: Tue, 15 Jul 2025 12:06:02 +0200 Subject: [PATCH 06/16] Add .equiv file that compares .slice with similar .split syntax --- packages/cashc/test/cashproof/slice.equiv | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 packages/cashc/test/cashproof/slice.equiv diff --git a/packages/cashc/test/cashproof/slice.equiv b/packages/cashc/test/cashproof/slice.equiv new file mode 100644 index 000000000..9c2a6f44e --- /dev/null +++ b/packages/cashc/test/cashproof/slice.equiv @@ -0,0 +1,10 @@ +!full_script=True; + +# We are unable to run cashproof any more due to Python ecosystem issues, but we're including this file for reference. + +# x.slice(10, 25) & x.split(25)[0].split(10)[1] +25 OP_SPLIT OP_DROP OP_10 OP_SPLIT OP_NIP +<=> +# x.split(10)[1].split(15)[0] +OP_10 OP_SPLIT OP_NIP OP_15 OP_SPLIT OP_DROP +; From c3f49cf066f947a2914e2adf54b028a731eb8c8f Mon Sep 17 00:00:00 2001 From: Rosco Kalis Date: Tue, 22 Jul 2025 10:44:54 +0200 Subject: [PATCH 07/16] Add left/right type to TupleType --- packages/cashc/src/semantic/TypeCheckTraversal.ts | 8 ++++++-- packages/utils/src/types.ts | 11 ++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/cashc/src/semantic/TypeCheckTraversal.ts b/packages/cashc/src/semantic/TypeCheckTraversal.ts index 1306ef486..3546f8477 100644 --- a/packages/cashc/src/semantic/TypeCheckTraversal.ts +++ b/packages/cashc/src/semantic/TypeCheckTraversal.ts @@ -168,7 +168,8 @@ export default class TypeCheckTraversal extends AstTraversal { throw new IndexOutOfBoundsError(node); } - node.type = (node.tuple.type as TupleType).elementType; + node.type = node.index === 0 ? (node.tuple.type as TupleType).leftType : (node.tuple.type as TupleType).rightType; + return node; } @@ -243,6 +244,7 @@ export default class TypeCheckTraversal extends AstTraversal { // Result of split are two unbounded bytes types (could be improved to do type inference) node.type = new TupleType( node.left.type instanceof BytesType ? new BytesType() : PrimitiveType.STRING, + node.left.type instanceof BytesType ? new BytesType() : PrimitiveType.STRING, ); return node; default: @@ -371,7 +373,9 @@ function expectSameSizeBytes(node: BinaryOpNode, left?: Type, right?: Type): voi function expectTuple(node: ExpectedNode, actual?: Type): void { if (!(actual instanceof TupleType)) { - throw new UnsupportedTypeError(node, actual, new TupleType()); + // We use a placeholder tuple to indicate that we're expecting *any* tuple at all + const placeholderTuple = new TupleType(new BytesType(), new BytesType()); + throw new UnsupportedTypeError(node, actual, placeholderTuple); } } diff --git a/packages/utils/src/types.ts b/packages/utils/src/types.ts index 7b68e9234..990d149bf 100644 --- a/packages/utils/src/types.ts +++ b/packages/utils/src/types.ts @@ -4,7 +4,7 @@ export class ArrayType { constructor( public elementType: Type, public bound?: number, - ) {} + ) { } toString(): string { return `${this.elementType}[${this.bound ?? ''}]`; @@ -14,7 +14,7 @@ export class ArrayType { export class BytesType { constructor( public bound?: number, - ) {} + ) { } static fromString(str: string): BytesType { const bound = str === 'byte' ? 1 : Number.parseInt(str.substring(5), 10) || undefined; @@ -28,11 +28,12 @@ export class BytesType { export class TupleType { constructor( - public elementType?: Type, - ) {} + public leftType: Type, + public rightType: Type, + ) { } toString(): string { - return `(${this.elementType}, ${this.elementType})`; + return `(${this.leftType}, ${this.rightType})`; } } From bc3be8a16179bcf692cb5dc14e3c470c7f4de3aa Mon Sep 17 00:00:00 2001 From: Rosco Kalis Date: Tue, 22 Jul 2025 11:49:00 +0200 Subject: [PATCH 08/16] Add extra type inference and type checking for SPLIT - If split() is called with a number literal (e.g.) x.split(12), we infer one or both sides of the split - Extend type checking to use this new type information - Add tests --- packages/cashc/src/Errors.ts | 13 +++- packages/cashc/src/ast/AST.ts | 5 +- .../src/generation/GenerateTargetTraversal.ts | 4 +- .../src/print/OutputSourceCodeTraversal.ts | 2 +- .../src/semantic/SymbolTableTraversal.ts | 2 +- .../cashc/src/semantic/TypeCheckTraversal.ts | 64 +++++++++++++------ .../AssignTypeError/split_wrong_type.cash | 6 ++ .../split_wrong_type_bounded_bytes.cash | 6 ++ .../tuple_unpacking_wrong_type.cash | 6 ++ ...le_unpacking_wrong_type_bounded_bytes.cash | 6 ++ .../split_index_out_of_bounds.cash | 6 ++ .../valid-contract-files/split_signature.cash | 7 ++ .../valid-contract-files/split_typed.cash | 6 ++ .../tuple_unpacking_single_side_type.cash | 6 ++ packages/utils/src/types.ts | 8 ++- 15 files changed, 118 insertions(+), 29 deletions(-) create mode 100644 packages/cashc/test/compiler/AssignTypeError/split_wrong_type.cash create mode 100644 packages/cashc/test/compiler/AssignTypeError/split_wrong_type_bounded_bytes.cash create mode 100644 packages/cashc/test/compiler/AssignTypeError/tuple_unpacking_wrong_type.cash create mode 100644 packages/cashc/test/compiler/AssignTypeError/tuple_unpacking_wrong_type_bounded_bytes.cash create mode 100644 packages/cashc/test/compiler/IndexOutOfBoundsError/split_index_out_of_bounds.cash create mode 100644 packages/cashc/test/valid-contract-files/split_signature.cash create mode 100644 packages/cashc/test/valid-contract-files/split_typed.cash create mode 100644 packages/cashc/test/valid-contract-files/tuple_unpacking_single_side_type.cash diff --git a/packages/cashc/src/Errors.ts b/packages/cashc/src/Errors.ts index 2a13c2fff..839985150 100644 --- a/packages/cashc/src/Errors.ts +++ b/packages/cashc/src/Errors.ts @@ -20,9 +20,11 @@ import { ContractNode, ExpressionNode, SliceNode, + IntLiteralNode, } from './ast/AST.js'; import { Symbol, SymbolType } from './ast/SymbolTable.js'; import { Location, Point } from './ast/Location.js'; +import { BinaryOperator } from './ast/Operator.js'; export class CashScriptError extends Error { node: Node; @@ -252,9 +254,16 @@ export class ArrayElementError extends CashScriptError { export class IndexOutOfBoundsError extends CashScriptError { constructor( - node: TupleIndexOpNode, + node: TupleIndexOpNode | BinaryOpNode, ) { - super(node, `Index ${node.index} out of bounds`); + if (node instanceof TupleIndexOpNode) { + super(node, `Index ${node.index} out of bounds`); + } else if (node.operator === BinaryOperator.SPLIT && node.right instanceof IntLiteralNode) { + const splitIndex = Number(node.right.value); + super(node, `Split index ${splitIndex} out of bounds for type ${node.left.type}`); + } else { + super(node, 'Index out of bounds'); + } } } diff --git a/packages/cashc/src/ast/AST.ts b/packages/cashc/src/ast/AST.ts index f376718c7..b43935dda 100644 --- a/packages/cashc/src/ast/AST.ts +++ b/packages/cashc/src/ast/AST.ts @@ -98,8 +98,9 @@ export class VariableDefinitionNode extends StatementNode implements Named, Type export class TupleAssignmentNode extends StatementNode { constructor( - public var1: { name: string, type: Type }, - public var2: { name: string, type: Type }, + // TODO: Use an IdentifierNode instead of a custom type + public left: { name: string, type: Type }, + public right: { name: string, type: Type }, public tuple: ExpressionNode, ) { super(); diff --git a/packages/cashc/src/generation/GenerateTargetTraversal.ts b/packages/cashc/src/generation/GenerateTargetTraversal.ts index 94ad9c536..6f17eda6e 100644 --- a/packages/cashc/src/generation/GenerateTargetTraversal.ts +++ b/packages/cashc/src/generation/GenerateTargetTraversal.ts @@ -252,8 +252,8 @@ export default class GenerateTargetTraversalWithLocation extends AstTraversal { visitTupleAssignment(node: TupleAssignmentNode): Node { node.tuple = this.visit(node.tuple); this.popFromStack(2); - this.pushToStack(node.var1.name); - this.pushToStack(node.var2.name); + this.pushToStack(node.left.name); + this.pushToStack(node.right.name); return node; } diff --git a/packages/cashc/src/print/OutputSourceCodeTraversal.ts b/packages/cashc/src/print/OutputSourceCodeTraversal.ts index 66c387d1b..df50ee548 100644 --- a/packages/cashc/src/print/OutputSourceCodeTraversal.ts +++ b/packages/cashc/src/print/OutputSourceCodeTraversal.ts @@ -110,7 +110,7 @@ export default class OutputSourceCodeTraversal extends AstTraversal { } visitTupleAssignment(node: TupleAssignmentNode): Node { - this.addOutput(`${node.var1.type} ${node.var1.name}, ${node.var2.type} ${node.var2.name} = `, true); + this.addOutput(`${node.left.type} ${node.left.name}, ${node.right.type} ${node.right.name} = `, true); this.visit(node.tuple); this.addOutput(';\n'); diff --git a/packages/cashc/src/semantic/SymbolTableTraversal.ts b/packages/cashc/src/semantic/SymbolTableTraversal.ts index 0fd0601e1..f49a23d33 100644 --- a/packages/cashc/src/semantic/SymbolTableTraversal.ts +++ b/packages/cashc/src/semantic/SymbolTableTraversal.ts @@ -124,7 +124,7 @@ export default class SymbolTableTraversal extends AstTraversal { } visitTupleAssignment(node: TupleAssignmentNode): Node { - [node.var1, node.var2].forEach(({ name, type }) => { + [node.left, node.right].forEach(({ name, type }) => { if (this.symbolTables[0].get(name)) { throw new VariableRedefinitionError(new VariableDefinitionNode(type, [], name, node.tuple)); } diff --git a/packages/cashc/src/semantic/TypeCheckTraversal.ts b/packages/cashc/src/semantic/TypeCheckTraversal.ts index 3546f8477..e08a18e73 100644 --- a/packages/cashc/src/semantic/TypeCheckTraversal.ts +++ b/packages/cashc/src/semantic/TypeCheckTraversal.ts @@ -28,6 +28,7 @@ import { TupleAssignmentNode, NullaryOpNode, SliceNode, + IntLiteralNode, } from '../ast/AST.js'; import AstTraversal from '../ast/AstTraversal.js'; import { @@ -57,17 +58,13 @@ export default class TypeCheckTraversal extends AstTraversal { if (!(node.tuple instanceof BinaryOpNode) || node.tuple.operator !== BinaryOperator.SPLIT) { throw new TupleAssignmentError(node.tuple); } - const tupleType = node.tuple.left.type; - for (const variable of [node.var1, node.var2]) { - if (!implicitlyCastable(tupleType, variable.type)) { - // Ignore if both are of type byte. problem: bytes16 can be typed to bytes32 - if (tupleType instanceof BytesType && variable.type instanceof BytesType) { - return node; - } - throw new AssignTypeError( - new VariableDefinitionNode(variable.type, [], variable.name, node.tuple), - ); - } + + const assignmentType = new TupleType(node.left.type, node.right.type); + + if (!implicitlyCastable(node.tuple.type, assignmentType)) { + throw new AssignTypeError( + new VariableDefinitionNode(assignmentType, [], node.left.name, node.tuple), + ); } return node; } @@ -240,12 +237,7 @@ export default class TypeCheckTraversal extends AstTraversal { case BinaryOperator.SPLIT: expectAnyOfTypes(node, node.left.type, [new BytesType(), PrimitiveType.STRING]); expectInt(node, node.right.type); - - // Result of split are two unbounded bytes types (could be improved to do type inference) - node.type = new TupleType( - node.left.type instanceof BytesType ? new BytesType() : PrimitiveType.STRING, - node.left.type instanceof BytesType ? new BytesType() : PrimitiveType.STRING, - ); + node.type = inferTupleType(node); return node; default: return node; @@ -346,9 +338,7 @@ export default class TypeCheckTraversal extends AstTraversal { type ExpectedNode = BinaryOpNode | UnaryOpNode | TimeOpNode | TupleIndexOpNode | SliceNode; function expectAnyOfTypes(node: ExpectedNode, actual?: Type, expectedTypes?: Type[]): void { if (!expectedTypes || expectedTypes.length === 0) return; - if (expectedTypes.find((expected) => implicitlyCastable(actual, expected))) { - return; - } + if (expectedTypes.find((expected) => implicitlyCastable(actual, expected))) return; throw new UnsupportedTypeError(node, actual, expectedTypes[0]); } @@ -392,3 +382,37 @@ function expectParameters(node: NodeWithParameters, actual: Type[], expected: Ty throw new InvalidParameterTypeError(node, actual, expected); } } + +// We only call this function for the split operator, so we assume that the node.op is SPLIT +function inferTupleType(node: BinaryOpNode): Type { + // string.split() -> string, string + if (node.left.type === PrimitiveType.STRING) { + return new TupleType(PrimitiveType.STRING, PrimitiveType.STRING); + } + + // If the expression is not a bytes type, then it must be a different compatible type (e.g. sig/pubkey) + // We treat this as an unbounded bytes type for the purposes of splitting + const expressionType = node.left.type instanceof BytesType ? node.left.type : new BytesType(); + + // bytes.split(variable) -> bytes, bytes + if (!(node.right instanceof IntLiteralNode)) { + return new TupleType(new BytesType(), new BytesType()); + } + + const splitIndex = Number(node.right.value); + + // bytes.split(NumberLiteral) -> bytes(NumberLiteral), bytes + if (expressionType.bound === undefined) { + return new TupleType(new BytesType(splitIndex), new BytesType()); + } + + if (splitIndex > expressionType.bound) { + throw new IndexOutOfBoundsError(node); + } + + // bytesX.split(NumberLiteral) -> bytes(NumberLiteral), bytes(X - NumberLiteral) + return new TupleType( + new BytesType(splitIndex), + new BytesType(expressionType.bound! - splitIndex), + ); +} diff --git a/packages/cashc/test/compiler/AssignTypeError/split_wrong_type.cash b/packages/cashc/test/compiler/AssignTypeError/split_wrong_type.cash new file mode 100644 index 000000000..59c131628 --- /dev/null +++ b/packages/cashc/test/compiler/AssignTypeError/split_wrong_type.cash @@ -0,0 +1,6 @@ +contract Test(bytes b) { + function spend() { + bytes2 x = b.split(4)[0]; + require(x != b); + } +} diff --git a/packages/cashc/test/compiler/AssignTypeError/split_wrong_type_bounded_bytes.cash b/packages/cashc/test/compiler/AssignTypeError/split_wrong_type_bounded_bytes.cash new file mode 100644 index 000000000..f39774ef5 --- /dev/null +++ b/packages/cashc/test/compiler/AssignTypeError/split_wrong_type_bounded_bytes.cash @@ -0,0 +1,6 @@ +contract Test(bytes8 b) { + function spend() { + bytes2 x = b.split(4)[1]; + require(x != b); + } +} diff --git a/packages/cashc/test/compiler/AssignTypeError/tuple_unpacking_wrong_type.cash b/packages/cashc/test/compiler/AssignTypeError/tuple_unpacking_wrong_type.cash new file mode 100644 index 000000000..10e9ff9d6 --- /dev/null +++ b/packages/cashc/test/compiler/AssignTypeError/tuple_unpacking_wrong_type.cash @@ -0,0 +1,6 @@ +contract Test(bytes b) { + function spend() { + bytes4 x, bytes4 y = b.split(4); + require(x != y); + } +} diff --git a/packages/cashc/test/compiler/AssignTypeError/tuple_unpacking_wrong_type_bounded_bytes.cash b/packages/cashc/test/compiler/AssignTypeError/tuple_unpacking_wrong_type_bounded_bytes.cash new file mode 100644 index 000000000..d2ceffcbc --- /dev/null +++ b/packages/cashc/test/compiler/AssignTypeError/tuple_unpacking_wrong_type_bounded_bytes.cash @@ -0,0 +1,6 @@ +contract Test(bytes8 b) { + function spend() { + bytes2 x, bytes4 y = b.split(4); + require(x != y); + } +} diff --git a/packages/cashc/test/compiler/IndexOutOfBoundsError/split_index_out_of_bounds.cash b/packages/cashc/test/compiler/IndexOutOfBoundsError/split_index_out_of_bounds.cash new file mode 100644 index 000000000..8a289f761 --- /dev/null +++ b/packages/cashc/test/compiler/IndexOutOfBoundsError/split_index_out_of_bounds.cash @@ -0,0 +1,6 @@ +contract Test(bytes8 b) { + function spend() { + bytes x = b.split(12)[0]; + require(x != b); + } +} diff --git a/packages/cashc/test/valid-contract-files/split_signature.cash b/packages/cashc/test/valid-contract-files/split_signature.cash new file mode 100644 index 000000000..421120cbe --- /dev/null +++ b/packages/cashc/test/valid-contract-files/split_signature.cash @@ -0,0 +1,7 @@ +contract Test(sig signature) { + function spend() { + // Assume Schnorr + bytes hashtype = signature.split(64)[1]; + require(hashtype == 0x01); + } +} diff --git a/packages/cashc/test/valid-contract-files/split_typed.cash b/packages/cashc/test/valid-contract-files/split_typed.cash new file mode 100644 index 000000000..b7a8fcf88 --- /dev/null +++ b/packages/cashc/test/valid-contract-files/split_typed.cash @@ -0,0 +1,6 @@ +contract SplitTyped(bytes b) { + function spend() { + bytes4 x = b.split(4)[0]; + require(x != b); + } +} diff --git a/packages/cashc/test/valid-contract-files/tuple_unpacking_single_side_type.cash b/packages/cashc/test/valid-contract-files/tuple_unpacking_single_side_type.cash new file mode 100644 index 000000000..b4dfa7c5d --- /dev/null +++ b/packages/cashc/test/valid-contract-files/tuple_unpacking_single_side_type.cash @@ -0,0 +1,6 @@ +contract Test() { + function split(bytes b) { + bytes16 x, bytes y = b.split(16); + require(x == y); + } +} diff --git a/packages/utils/src/types.ts b/packages/utils/src/types.ts index 990d149bf..14a6585e2 100644 --- a/packages/utils/src/types.ts +++ b/packages/utils/src/types.ts @@ -111,7 +111,13 @@ export function explicitlyCastable(from?: Type, to?: Type): boolean { export function implicitlyCastable(actual?: Type, expected?: Type): boolean { if (!actual || !expected) return false; - // Tuples can't be cast + if (actual instanceof TupleType && expected instanceof TupleType) { + const leftIsCompatible = implicitlyCastable(actual.leftType, expected.leftType); + const rightIsCompatible = implicitlyCastable(actual.rightType, expected.rightType); + return leftIsCompatible && rightIsCompatible; + } + + // Can't cast between Tuple and non-Tuple if (actual instanceof TupleType || expected instanceof TupleType) return false; // Arrays can be cast if their elements can be cast (don't think this is actually used ever) From 4c5f1a23b92621730e57b6898e7ae894afd27c98 Mon Sep 17 00:00:00 2001 From: Mathieu Geukens Date: Tue, 22 Jul 2025 19:31:49 +0200 Subject: [PATCH 09/16] add to docs & release notes --- website/docs/compiler/compiler.md | 8 ++++++++ website/docs/guides/infrastructure.md | 2 +- website/docs/language/types.md | 8 +++++--- website/docs/releases/release-notes.md | 2 ++ website/docs/sdk/electrum-network-provider.md | 4 ++++ website/docs/sdk/instantiation.md | 5 +++-- 6 files changed, 23 insertions(+), 6 deletions(-) diff --git a/website/docs/compiler/compiler.md b/website/docs/compiler/compiler.md index 24079b5ca..b684a68d4 100644 --- a/website/docs/compiler/compiler.md +++ b/website/docs/compiler/compiler.md @@ -42,6 +42,14 @@ To have the best TypeScript integration, we recommend generating the artifact in cashc ./Contract.cash --output ./artifact.ts --format ts ``` +```bash +cashc ./Contract.cash --size --opcount +``` + +:::info +The size outputs of the `cashc` compiler are based on the bytecode without constructor arguments. This means they are always an underestimate, as the contract hasn't been initialized with contract arguments. +::: + ## JavaScript Compilation Generally CashScript contracts are compiled to an Artifact JSON file using the CLI compiler. As an alternative to this, CashScript contracts can be compiled from within JavaScript apps using the `cashc` package. This package exports two compilation functions. diff --git a/website/docs/guides/infrastructure.md b/website/docs/guides/infrastructure.md index 545504782..46718c482 100644 --- a/website/docs/guides/infrastructure.md +++ b/website/docs/guides/infrastructure.md @@ -65,7 +65,7 @@ Both the `Electrum` and `Chaingraph` indexers allow you to create websocket subs Contract-related events are when you want to update the server state to reflect changes on-chain, for example new contracts being created or existing contracts changing their state in an important way. So contract related events often don't trigger an on-chain transaction directly, but they update the information about the contracts tracked for time/oracle events by the server. :::tip -Only the `Chaingraph` indexer allows for subscriptions to arbitrary on-chain events, with `Electrum` you can create subscriptions for changes in the transaction history of a specific (contract) address. +With `Electrum` you can create subscriptions to transactions for a specific (contract) address, with `Chaingraph` you can create subscriptions to arbitrary on-chain events. ::: ### Oracle-related events diff --git a/website/docs/language/types.md b/website/docs/language/types.md index 76ad92c27..285806258 100644 --- a/website/docs/language/types.md +++ b/website/docs/language/types.md @@ -208,8 +208,9 @@ If you do need to pad bytes to a specific length, you can convert the bytes to ` #### Example ```solidity -bytes data = nftCommitment.split(10)[0]; // (type = bytes, content = 10 bytes) -bytes20 paddedData = bytes20(int(data)); // (type = bytes20, content = 20 bytes) +bytes10 data = nftCommitment.split(10)[0]; +// First convert 'bytes' type to 'int' to cast with padding +bytes20 paddedData = bytes20(int(data)); require(storedContractState == paddedData); ``` @@ -219,7 +220,8 @@ When casting unbounded `bytes` types to bounded `bytes` types (such as `bytes20` #### Example ```solidity -bytes pkh = nftCommitment.split(20)[0]; // (type = bytes, content = 20 bytes) +bytes pkh = tx.inputs[0].nftCommitment; // (type = bytes, content = 20 bytes) +// Typecast the variable to be able to use it for 'new LockingBytecodeP2PKH()' bytes20 bytes20Pkh = bytes20(pkh); // (type = bytes20, content = 20 bytes) bytes25 lockingBytecode = new LockingBytecodeP2PKH(bytes20Pkh); ``` diff --git a/website/docs/releases/release-notes.md b/website/docs/releases/release-notes.md index 2e383d59e..75c87a6b5 100644 --- a/website/docs/releases/release-notes.md +++ b/website/docs/releases/release-notes.md @@ -6,6 +6,8 @@ title: Release Notes #### cashc compiler - :sparkles: Add `.slice(start, end)` operator for bytes and strings. +- :sparkles: Add bounded bytes typing and bounds checking for `.split()` +- :bug: Disallow incorrect bounded bytes typing when using `.split()` #### CashScript SDK - :bug: Fix bug with where `ElectrumNetworkProvider` would disconnect in browser on visibility change of the page diff --git a/website/docs/sdk/electrum-network-provider.md b/website/docs/sdk/electrum-network-provider.md index 9544f5dd0..6a5603438 100644 --- a/website/docs/sdk/electrum-network-provider.md +++ b/website/docs/sdk/electrum-network-provider.md @@ -116,6 +116,10 @@ By default, the ElectrumNetworkProvider will automatically connect and disconnec const provider = new ElectrumNetworkProvider('chipnet', { manualConnectionManagement: true }); ``` +:::tip +If you're providing an `ElectrumClient` and using it to subscribe to address or blockheader events, you need to enable `manualConnectionManagement` to overwrite the default of connecting and disconnecting for each separate request. +::: + #### connect() ```ts provider.connect(): Promise; diff --git a/website/docs/sdk/instantiation.md b/website/docs/sdk/instantiation.md index 13cd1f126..fe6bbaceb 100644 --- a/website/docs/sdk/instantiation.md +++ b/website/docs/sdk/instantiation.md @@ -103,8 +103,9 @@ contract.bytesize: number The size of the contract's bytecode in bytes can be retrieved through the `bytesize` member field. This is useful to ensure that the contract is not too big, since Bitcoin Cash smart contracts can be 1,650 bytes at most. -:::info -The size outputs of the `cashc` compiler are based on the bytecode without constructor arguments. This means they will always be an underestimate, as the contract hasn't been initialized with contract arguments. +:::tip +Using `contract.bytesize` is the best way to get the size of contract bytecode, as it includes the constructor arguments. +The size outputs of the `cashc` compiler are based on the bytecode without constructor arguments so are always an underestimate. ::: #### Example From 2f5d5cbe0c91969e2b5e65fdc36b12fb0ed45141 Mon Sep 17 00:00:00 2001 From: Rosco Kalis Date: Wed, 23 Jul 2025 15:02:46 +0200 Subject: [PATCH 10/16] Check that splitIndex is not negative --- packages/cashc/src/semantic/TypeCheckTraversal.ts | 4 ++++ .../IndexOutOfBoundsError/split_index_negative.cash | 6 ++++++ 2 files changed, 10 insertions(+) create mode 100644 packages/cashc/test/compiler/IndexOutOfBoundsError/split_index_negative.cash diff --git a/packages/cashc/src/semantic/TypeCheckTraversal.ts b/packages/cashc/src/semantic/TypeCheckTraversal.ts index e08a18e73..44a1cbeb7 100644 --- a/packages/cashc/src/semantic/TypeCheckTraversal.ts +++ b/packages/cashc/src/semantic/TypeCheckTraversal.ts @@ -406,6 +406,10 @@ function inferTupleType(node: BinaryOpNode): Type { return new TupleType(new BytesType(splitIndex), new BytesType()); } + if (splitIndex < 0) { + throw new IndexOutOfBoundsError(node); + } + if (splitIndex > expressionType.bound) { throw new IndexOutOfBoundsError(node); } diff --git a/packages/cashc/test/compiler/IndexOutOfBoundsError/split_index_negative.cash b/packages/cashc/test/compiler/IndexOutOfBoundsError/split_index_negative.cash new file mode 100644 index 000000000..7d523f247 --- /dev/null +++ b/packages/cashc/test/compiler/IndexOutOfBoundsError/split_index_negative.cash @@ -0,0 +1,6 @@ +contract Test(bytes8 b) { + function spend() { + bytes x = b.split(-4)[0]; + require(x != b); + } +} From e2358f48e024aade39e28e2afa8966949927e159 Mon Sep 17 00:00:00 2001 From: Rosco Kalis Date: Wed, 23 Jul 2025 15:03:31 +0200 Subject: [PATCH 11/16] Add .slice(0, x) and .slice(x, y.length) bytecode optimisations --- packages/cashc/test/cashproof/slice.equiv | 4 +++ packages/cashc/test/generation/fixtures.ts | 27 +++++++++++++++++++ .../valid-contract-files/slice_optimised.cash | 6 +++++ packages/utils/src/cashproof-optimisations.ts | 4 +++ packages/utils/src/optimisations.ts | 4 +++ website/docs/releases/release-notes.md | 3 ++- 6 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 packages/cashc/test/valid-contract-files/slice_optimised.cash diff --git a/packages/cashc/test/cashproof/slice.equiv b/packages/cashc/test/cashproof/slice.equiv index 9c2a6f44e..e16364cb0 100644 --- a/packages/cashc/test/cashproof/slice.equiv +++ b/packages/cashc/test/cashproof/slice.equiv @@ -8,3 +8,7 @@ # x.split(10)[1].split(15)[0] OP_10 OP_SPLIT OP_NIP OP_15 OP_SPLIT OP_DROP ; + +# Slice optimisation +OP_0 OP_SPLIT OP_NIP <=> ; +OP_SIZE OP_SPLIT OP_DROP <=> ; diff --git a/packages/cashc/test/generation/fixtures.ts b/packages/cashc/test/generation/fixtures.ts index 62c801332..8c51204a4 100644 --- a/packages/cashc/test/generation/fixtures.ts +++ b/packages/cashc/test/generation/fixtures.ts @@ -878,4 +878,31 @@ export const fixtures: Fixture[] = [ updatedAt: '', }, }, + { + fn: 'slice_optimised.cash', + artifact: { + contractName: 'Slice', + constructorInputs: [{ name: 'data', type: 'bytes32' }], + abi: [{ name: 'spend', inputs: [] }], + bytecode: '14 OP_SPLIT OP_DROP OP_0 14 OP_NUM2BIN OP_EQUAL', + debug: { + bytecode: '01147f750001148087', + sourceMap: '3:34:3:36;:20::37:1;;4:31:4:32:0;:23::33:1;;:8::35', + logs: [], + requires: [ + { + ip: 8, + line: 4, + message: undefined, + }, + ], + }, + source: fs.readFileSync(new URL('../valid-contract-files/slice_optimised.cash', import.meta.url), { encoding: 'utf-8' }), + compiler: { + name: 'cashc', + version, + }, + updatedAt: '', + }, + }, ]; diff --git a/packages/cashc/test/valid-contract-files/slice_optimised.cash b/packages/cashc/test/valid-contract-files/slice_optimised.cash new file mode 100644 index 000000000..600be3614 --- /dev/null +++ b/packages/cashc/test/valid-contract-files/slice_optimised.cash @@ -0,0 +1,6 @@ +contract Slice(bytes32 data) { + function spend() { + bytes pkh = data.slice(0, 20); + require(pkh == bytes20(0)); + } +} diff --git a/packages/utils/src/cashproof-optimisations.ts b/packages/utils/src/cashproof-optimisations.ts index 42a8cc484..508101b9a 100644 --- a/packages/utils/src/cashproof-optimisations.ts +++ b/packages/utils/src/cashproof-optimisations.ts @@ -121,4 +121,8 @@ OP_15 OP_NIP <=> OP_DROP OP_15; OP_16 OP_NIP <=> OP_DROP OP_16; OP_2 OP_PICK OP_SWAP OP_2 OP_PICK OP_NIP <=> OP_DROP OP_2DUP; + +# .slice(0, x) optimisation & .slice(x, y.length) optimisation +OP_0 OP_SPLIT OP_NIP <=> ; +OP_SIZE OP_SPLIT OP_DROP <=> ; `; diff --git a/packages/utils/src/optimisations.ts b/packages/utils/src/optimisations.ts index b05dbcde1..6477a7941 100644 --- a/packages/utils/src/optimisations.ts +++ b/packages/utils/src/optimisations.ts @@ -114,6 +114,10 @@ const provableOptimisations = [ ['OP_16 OP_NIP', 'OP_DROP OP_16'], ['OP_2 OP_PICK OP_SWAP OP_2 OP_PICK OP_NIP', 'OP_DROP OP_2DUP'], + + // .slice(0, x) optimisation & .slice(x, y.length) optimisation + ['OP_0 OP_SPLIT OP_NIP', ''], + ['OP_SIZE OP_SPLIT OP_DROP', ''], ] as [string, string][]; const unprovableOptimisations = [ diff --git a/website/docs/releases/release-notes.md b/website/docs/releases/release-notes.md index 75c87a6b5..af0632db0 100644 --- a/website/docs/releases/release-notes.md +++ b/website/docs/releases/release-notes.md @@ -6,7 +6,8 @@ title: Release Notes #### cashc compiler - :sparkles: Add `.slice(start, end)` operator for bytes and strings. -- :sparkles: Add bounded bytes typing and bounds checking for `.split()` +- :sparkles: Add bounded bytes typing and bounds checking for `.split()` (includes checking for negative indices) +- :racehorse: Add optimisation for `.slice(0, x)` and `.slice(x, y.length)` (also applies to `.split(0)[1]`) - :bug: Disallow incorrect bounded bytes typing when using `.split()` #### CashScript SDK From 4baf8109ee9e8eedd2e7d368dee023437723ce45 Mon Sep 17 00:00:00 2001 From: Rosco Kalis Date: Wed, 23 Jul 2025 15:38:12 +0200 Subject: [PATCH 12/16] Add type inference / bounds checking for .slice() --- packages/cashc/src/Errors.ts | 10 +++- .../cashc/src/semantic/TypeCheckTraversal.ts | 58 ++++++++++++++++--- .../slice_invalid_bounded_assign_type.cash | 6 ++ .../slice_index_end_out_of_bounds.cash | 6 ++ .../slice_index_negative.cash | 6 ++ .../slice_index_start_end_reversed.cash | 6 ++ packages/cashc/test/generation/fixtures.ts | 2 +- .../valid-contract-files/slice_optimised.cash | 2 +- 8 files changed, 84 insertions(+), 12 deletions(-) create mode 100644 packages/cashc/test/compiler/AssignTypeError/slice_invalid_bounded_assign_type.cash create mode 100644 packages/cashc/test/compiler/IndexOutOfBoundsError/slice_index_end_out_of_bounds.cash create mode 100644 packages/cashc/test/compiler/IndexOutOfBoundsError/slice_index_negative.cash create mode 100644 packages/cashc/test/compiler/IndexOutOfBoundsError/slice_index_start_end_reversed.cash diff --git a/packages/cashc/src/Errors.ts b/packages/cashc/src/Errors.ts index 839985150..692a85504 100644 --- a/packages/cashc/src/Errors.ts +++ b/packages/cashc/src/Errors.ts @@ -254,13 +254,19 @@ export class ArrayElementError extends CashScriptError { export class IndexOutOfBoundsError extends CashScriptError { constructor( - node: TupleIndexOpNode | BinaryOpNode, + node: TupleIndexOpNode | BinaryOpNode | SliceNode, ) { if (node instanceof TupleIndexOpNode) { super(node, `Index ${node.index} out of bounds`); - } else if (node.operator === BinaryOperator.SPLIT && node.right instanceof IntLiteralNode) { + } else if ( + node instanceof BinaryOpNode && node.operator === BinaryOperator.SPLIT && node.right instanceof IntLiteralNode + ) { const splitIndex = Number(node.right.value); super(node, `Split index ${splitIndex} out of bounds for type ${node.left.type}`); + } else if (node instanceof SliceNode) { + const start = node.start instanceof IntLiteralNode ? Number(node.start.value) : 'start'; + const end = node.end instanceof IntLiteralNode ? Number(node.end.value) : 'end'; + super(node, `Slice indexes (${start}, ${end}) out of bounds for type ${node.element.type}`); } else { super(node, 'Index out of bounds'); } diff --git a/packages/cashc/src/semantic/TypeCheckTraversal.ts b/packages/cashc/src/semantic/TypeCheckTraversal.ts index 44a1cbeb7..41bca3e8b 100644 --- a/packages/cashc/src/semantic/TypeCheckTraversal.ts +++ b/packages/cashc/src/semantic/TypeCheckTraversal.ts @@ -166,7 +166,6 @@ export default class TypeCheckTraversal extends AstTraversal { } node.type = node.index === 0 ? (node.tuple.type as TupleType).leftType : (node.tuple.type as TupleType).rightType; - return node; } @@ -179,9 +178,7 @@ export default class TypeCheckTraversal extends AstTraversal { expectInt(node, node.start.type); expectInt(node, node.end.type); - // TODO: Proper typing - node.type = node.element.type instanceof BytesType ? new BytesType() : PrimitiveType.STRING; - + node.type = inferSliceType(node); return node; } @@ -385,6 +382,10 @@ function expectParameters(node: NodeWithParameters, actual: Type[], expected: Ty // We only call this function for the split operator, so we assume that the node.op is SPLIT function inferTupleType(node: BinaryOpNode): Type { + if (node.right instanceof IntLiteralNode && Number(node.right.value) < 0) { + throw new IndexOutOfBoundsError(node); + } + // string.split() -> string, string if (node.left.type === PrimitiveType.STRING) { return new TupleType(PrimitiveType.STRING, PrimitiveType.STRING); @@ -406,10 +407,6 @@ function inferTupleType(node: BinaryOpNode): Type { return new TupleType(new BytesType(splitIndex), new BytesType()); } - if (splitIndex < 0) { - throw new IndexOutOfBoundsError(node); - } - if (splitIndex > expressionType.bound) { throw new IndexOutOfBoundsError(node); } @@ -420,3 +417,48 @@ function inferTupleType(node: BinaryOpNode): Type { new BytesType(expressionType.bound! - splitIndex), ); } + +function inferSliceType(node: SliceNode): Type { + if (node.start instanceof IntLiteralNode && Number(node.start.value) < 0) { + throw new IndexOutOfBoundsError(node); + } + + if (node.end instanceof IntLiteralNode && Number(node.end.value) < 0) { + throw new IndexOutOfBoundsError(node); + } + + // string.slice() -> string + if (node.element.type === PrimitiveType.STRING) { + return PrimitiveType.STRING; + } + + // If the expression is not a bytes type, then it must be a different compatible type (e.g. sig/pubkey) + const expressionType = node.element.type instanceof BytesType ? node.element.type : new BytesType(); + + if (expressionType.bound !== undefined) { + if (node.start instanceof IntLiteralNode && Number(node.start.value) >= expressionType.bound) { + throw new IndexOutOfBoundsError(node); + } + + if (node.end instanceof IntLiteralNode && Number(node.end.value) > expressionType.bound) { + throw new IndexOutOfBoundsError(node); + } + } + + // bytes.slice(variable, variable) -> bytes + // bytes.slice(NumberLiteral, variable) -> bytes + // bytes.slice(variable, NumberLiteral) -> bytes + if (!(node.start instanceof IntLiteralNode) || !(node.end instanceof IntLiteralNode)) { + return new BytesType(); + } + + const start = Number(node.start.value); + const end = Number(node.end.value); + + if (start > end) { + throw new IndexOutOfBoundsError(node); + } + + // bytes.slice(NumberLiteral start, NumberLiteral end) -> bytes(end - start) + return new BytesType(end - start); +} diff --git a/packages/cashc/test/compiler/AssignTypeError/slice_invalid_bounded_assign_type.cash b/packages/cashc/test/compiler/AssignTypeError/slice_invalid_bounded_assign_type.cash new file mode 100644 index 000000000..4c3295e94 --- /dev/null +++ b/packages/cashc/test/compiler/AssignTypeError/slice_invalid_bounded_assign_type.cash @@ -0,0 +1,6 @@ +contract Test(bytes8 b) { + function spend() { + bytes2 x = b.slice(2, 6); + require(x != b); + } +} diff --git a/packages/cashc/test/compiler/IndexOutOfBoundsError/slice_index_end_out_of_bounds.cash b/packages/cashc/test/compiler/IndexOutOfBoundsError/slice_index_end_out_of_bounds.cash new file mode 100644 index 000000000..b8300e083 --- /dev/null +++ b/packages/cashc/test/compiler/IndexOutOfBoundsError/slice_index_end_out_of_bounds.cash @@ -0,0 +1,6 @@ +contract Test(bytes8 b) { + function spend() { + bytes x = b.slice(6, 12); + require(x != b); + } +} diff --git a/packages/cashc/test/compiler/IndexOutOfBoundsError/slice_index_negative.cash b/packages/cashc/test/compiler/IndexOutOfBoundsError/slice_index_negative.cash new file mode 100644 index 000000000..02288b31a --- /dev/null +++ b/packages/cashc/test/compiler/IndexOutOfBoundsError/slice_index_negative.cash @@ -0,0 +1,6 @@ +contract Test(bytes8 b) { + function spend() { + bytes x = b.slice(4, -4); + require(x != b); + } +} diff --git a/packages/cashc/test/compiler/IndexOutOfBoundsError/slice_index_start_end_reversed.cash b/packages/cashc/test/compiler/IndexOutOfBoundsError/slice_index_start_end_reversed.cash new file mode 100644 index 000000000..bab0c242e --- /dev/null +++ b/packages/cashc/test/compiler/IndexOutOfBoundsError/slice_index_start_end_reversed.cash @@ -0,0 +1,6 @@ +contract Test(bytes8 b) { + function spend() { + bytes x = b.slice(6, 2); + require(x != b); + } +} diff --git a/packages/cashc/test/generation/fixtures.ts b/packages/cashc/test/generation/fixtures.ts index 8c51204a4..899539a53 100644 --- a/packages/cashc/test/generation/fixtures.ts +++ b/packages/cashc/test/generation/fixtures.ts @@ -887,7 +887,7 @@ export const fixtures: Fixture[] = [ bytecode: '14 OP_SPLIT OP_DROP OP_0 14 OP_NUM2BIN OP_EQUAL', debug: { bytecode: '01147f750001148087', - sourceMap: '3:34:3:36;:20::37:1;;4:31:4:32:0;:23::33:1;;:8::35', + sourceMap: '3:36:3:38;:22::39:1;;4:31:4:32:0;:23::33:1;;:8::35', logs: [], requires: [ { diff --git a/packages/cashc/test/valid-contract-files/slice_optimised.cash b/packages/cashc/test/valid-contract-files/slice_optimised.cash index 600be3614..39762828e 100644 --- a/packages/cashc/test/valid-contract-files/slice_optimised.cash +++ b/packages/cashc/test/valid-contract-files/slice_optimised.cash @@ -1,6 +1,6 @@ contract Slice(bytes32 data) { function spend() { - bytes pkh = data.slice(0, 20); + bytes20 pkh = data.slice(0, 20); require(pkh == bytes20(0)); } } From cd9df5ac34098eb4b5b7c1ce608219531a77d4f4 Mon Sep 17 00:00:00 2001 From: Rosco Kalis Date: Wed, 23 Jul 2025 15:44:15 +0200 Subject: [PATCH 13/16] Fix failing TypeScript test --- packages/utils/test/types.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/utils/test/types.test.ts b/packages/utils/test/types.test.ts index aa8ed0821..9489ae947 100644 --- a/packages/utils/test/types.test.ts +++ b/packages/utils/test/types.test.ts @@ -15,9 +15,9 @@ describe('type utilities', () => { }); it('cannot cast tuples', () => { - expect(explicitlyCastable(PrimitiveType.INT, new TupleType(PrimitiveType.INT))) + expect(explicitlyCastable(PrimitiveType.INT, new TupleType(PrimitiveType.INT, PrimitiveType.INT))) .toEqual(false); - expect(explicitlyCastable(new TupleType(PrimitiveType.INT), PrimitiveType.STRING)) + expect(explicitlyCastable(new TupleType(PrimitiveType.INT, PrimitiveType.INT), PrimitiveType.STRING)) .toEqual(false); }); From ce6bbbbc9f3a01f563ede5f658e4f3879e1bd24e Mon Sep 17 00:00:00 2001 From: Rosco Kalis Date: Wed, 23 Jul 2025 15:55:05 +0200 Subject: [PATCH 14/16] Small docs updates + improve 1 test --- .../split_or_slice_signature.cash | 9 +++++++++ .../valid-contract-files/split_signature.cash | 7 ------- website/docs/compiler/grammar.md | 9 +++++++-- website/docs/language/types.md | 10 ++++++---- website/docs/releases/release-notes.md | 18 +++++++++++++----- 5 files changed, 35 insertions(+), 18 deletions(-) create mode 100644 packages/cashc/test/valid-contract-files/split_or_slice_signature.cash delete mode 100644 packages/cashc/test/valid-contract-files/split_signature.cash diff --git a/packages/cashc/test/valid-contract-files/split_or_slice_signature.cash b/packages/cashc/test/valid-contract-files/split_or_slice_signature.cash new file mode 100644 index 000000000..98652eafc --- /dev/null +++ b/packages/cashc/test/valid-contract-files/split_or_slice_signature.cash @@ -0,0 +1,9 @@ +contract Test(sig signature) { + function spend() { + // Assume Schnorr + bytes hashtype1 = signature.split(64)[1]; + bytes1 hashtype2 = signature.slice(64, 65); + require(hashtype1 == 0x01); + require(hashtype2 == 0x01); + } +} diff --git a/packages/cashc/test/valid-contract-files/split_signature.cash b/packages/cashc/test/valid-contract-files/split_signature.cash deleted file mode 100644 index 421120cbe..000000000 --- a/packages/cashc/test/valid-contract-files/split_signature.cash +++ /dev/null @@ -1,7 +0,0 @@ -contract Test(sig signature) { - function spend() { - // Assume Schnorr - bytes hashtype = signature.split(64)[1]; - require(hashtype == 0x01); - } -} diff --git a/website/docs/compiler/grammar.md b/website/docs/compiler/grammar.md index 991e609b9..6f6c0601f 100644 --- a/website/docs/compiler/grammar.md +++ b/website/docs/compiler/grammar.md @@ -74,11 +74,11 @@ assignStatement ; timeOpStatement - : 'require' '(' TxVar '>=' expression (',' StringLiteral)? ')' ';' + : 'require' '(' TxVar '>=' expression (',' requireMessage)? ')' ';' ; requireStatement - : 'require' '(' expression (',' StringLiteral)? ')' ';' + : 'require' '(' expression (',' requireMessage)? ')' ';' ; ifStatement @@ -89,6 +89,10 @@ consoleStatement : 'console.log' consoleParameterList ';' ; +requireMessage + : StringLiteral + ; + consoleParameter : Identifier | literal @@ -116,6 +120,7 @@ expression | scope='tx.inputs' '[' expression ']' op=('.value' | '.lockingBytecode' | '.outpointTransactionHash' | '.outpointIndex' | '.unlockingBytecode' | '.sequenceNumber' | '.tokenCategory' | '.nftCommitment' | '.tokenAmount') # UnaryIntrospectionOp | expression op=('.reverse()' | '.length') # UnaryOp | left=expression op='.split' '(' right=expression ')' # BinaryOp + | element=expression '.slice' '(' start=expression ',' end=expression ')' # Slice | op=('!' | '-') expression # UnaryOp | left=expression op=('*' | '/' | '%') right=expression # BinaryOp | left=expression op=('+' | '-') right=expression # BinaryOp diff --git a/website/docs/language/types.md b/website/docs/language/types.md index 285806258..ddd180ae3 100644 --- a/website/docs/language/types.md +++ b/website/docs/language/types.md @@ -101,6 +101,8 @@ The script will fail if `split()` or `slice()` is called with an index that is o ```solidity bytes mintingCapability = 0x02; bytes noCapability = 0x; + +bytes2 data = 0x12345678.slice(1, 3); // 0x3456 ``` ## Bytes types with semantic meaning @@ -141,8 +143,8 @@ checkMultisig([sig1, sig2], [pk1, pk2, pk3]); Tuples are the type that is returned when calling the `split` member function on a `string` or `bytes` type. Their first or second element can be accessed through an indexing syntax similar to other languages: ```solidity -string question = "What is Bitcoin Cash?"; -string answer = question.split(15)[0].split(8)[1]; // Answer is "Cash" +string bitcoinCash = "Bitcoin Cash"; +string cash = bitcoinCash.split(8)[1]; ``` :::note @@ -152,8 +154,8 @@ It is not supported to use a variable for the tupleIndex. Instead you can assign It is also possible to assign both sides of the tuple at once with a destructuring syntax: ```solidity -string hello, string world = "Hello World".split(5); -require(hello + "world" == "Hello " + world); +string hello, string world = "Hello World".split(6); +require(hello + "World" == "Hello " + world); ``` ## Type Casting diff --git a/website/docs/releases/release-notes.md b/website/docs/releases/release-notes.md index af0632db0..4534bcf29 100644 --- a/website/docs/releases/release-notes.md +++ b/website/docs/releases/release-notes.md @@ -6,17 +6,17 @@ title: Release Notes #### cashc compiler - :sparkles: Add `.slice(start, end)` operator for bytes and strings. -- :sparkles: Add bounded bytes typing and bounds checking for `.split()` (includes checking for negative indices) -- :racehorse: Add optimisation for `.slice(0, x)` and `.slice(x, y.length)` (also applies to `.split(0)[1]`) -- :bug: Disallow incorrect bounded bytes typing when using `.split()` +- :sparkles: Add bounded bytes typing and bounds checking for `.split()` (includes checking for negative indices). +- :racehorse: Add optimisation for `.slice(0, x)` and `.slice(x, y.length)` (also applies to `.split(0)[1]`). +- :bug: Disallow incorrect bounded bytes typing when using `.split()`. #### CashScript SDK -- :bug: Fix bug with where `ElectrumNetworkProvider` would disconnect in browser on visibility change of the page +- :bug: Fix bug with where `ElectrumNetworkProvider` would disconnect in browser on visibility change of the page. ## v0.11.2 #### CashScript SDK -- :bug: Fix bug with new `generateWcTransactionObject()` throwing when using `placeholderP2PKHUnlocker()` +- :bug: Fix bug with new `generateWcTransactionObject()` throwing when using `placeholderP2PKHUnlocker()`. ## v0.11.1 @@ -24,6 +24,10 @@ title: Release Notes - :sparkles: Add `generateWcTransactionObject()` method to `TransactionBuilder` to generate a `WcTransactionObject` that can be used to sign a transaction with a WalletConnect client. - :sparkles: Add `placeholderSignature()`, `placeholderPublicKey()` and `placeholderP2PKHUnlocker()` helper functions to the SDK for WalletConnect usage. +--- + +https://x.com/CashScriptBCH/status/1942513305420968238 + ## v0.11.0 This update adds CashScript support for the new BCH 2025 network upgrade. To read more about the upgrade, see [this blog post](https://blog.bitjson.com/2025-chips/). @@ -55,6 +59,10 @@ This release also contains several breaking changes, please refer to the [migrat - :bug: Fix bug where `JestExtensions` `expect().toLog()` would detect logs from different tests. - :bug: Fix bug where certain edge cases in require statements caused the `FailedRequireError` message to be slightly different from the original error message. +--- + +https://x.com/CashScriptBCH/status/1935662184865890325 + #### @cashscript/utils - :boom: **BREAKING**: Remove `importArtifact` and `exportArtifact` helper functions. If you want to import or export artifacts, use `'fs'` to read and write files directly. From bd1e45da92be3c27bb30f7d0a10ead96d6c8c519 Mon Sep 17 00:00:00 2001 From: Rosco Kalis Date: Wed, 23 Jul 2025 15:56:55 +0200 Subject: [PATCH 15/16] Bump version to 0.11.3 --- examples/package.json | 6 +++--- examples/testing-suite/package.json | 6 +++--- packages/cashc/package.json | 4 ++-- packages/cashc/src/index.ts | 2 +- packages/cashscript/package.json | 4 ++-- packages/utils/package.json | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/package.json b/examples/package.json index 50ea239c0..690e47bb3 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,7 +1,7 @@ { "name": "cashscript-examples", "private": true, - "version": "0.11.2", + "version": "0.11.3", "description": "Usage examples of the CashScript SDK", "main": "p2pkh.js", "type": "module", @@ -13,8 +13,8 @@ "dependencies": { "@bitauth/libauth": "^3.1.0-next.2", "@types/node": "^22.10.7", - "cashc": "^0.11.2", - "cashscript": "^0.11.2", + "cashc": "^0.11.3", + "cashscript": "^0.11.3", "eslint": "^8.56.0", "typescript": "^5.7.3" } diff --git a/examples/testing-suite/package.json b/examples/testing-suite/package.json index a7d40e89e..809c385a8 100644 --- a/examples/testing-suite/package.json +++ b/examples/testing-suite/package.json @@ -1,6 +1,6 @@ { "name": "testing-suite", - "version": "0.11.2", + "version": "0.11.3", "description": "Example project to develop and test CashScript contracts", "main": "index.js", "type": "module", @@ -26,8 +26,8 @@ }, "dependencies": { "@bitauth/libauth": "^3.1.0-next.2", - "cashc": "^0.11.2", - "cashscript": "^0.11.2", + "cashc": "^0.11.3", + "cashscript": "^0.11.3", "url-join": "^5.0.0" }, "devDependencies": { diff --git a/packages/cashc/package.json b/packages/cashc/package.json index e3e8a3402..67f9ee36b 100644 --- a/packages/cashc/package.json +++ b/packages/cashc/package.json @@ -1,6 +1,6 @@ { "name": "cashc", - "version": "0.11.2", + "version": "0.11.3", "description": "Compile Bitcoin Cash contracts to Bitcoin Cash Script or artifacts", "keywords": [ "bitcoin", @@ -52,7 +52,7 @@ }, "dependencies": { "@bitauth/libauth": "^3.1.0-next.2", - "@cashscript/utils": "^0.11.2", + "@cashscript/utils": "^0.11.3", "antlr4": "^4.13.2", "commander": "^13.1.0", "semver": "^7.6.3" diff --git a/packages/cashc/src/index.ts b/packages/cashc/src/index.ts index 191384dce..2ac835a80 100644 --- a/packages/cashc/src/index.ts +++ b/packages/cashc/src/index.ts @@ -2,4 +2,4 @@ export * from './Errors.js'; export * as utils from '@cashscript/utils'; export { compileFile, compileString } from './compiler.js'; -export const version = '0.11.2'; +export const version = '0.11.3'; diff --git a/packages/cashscript/package.json b/packages/cashscript/package.json index 2b627df05..3163e4487 100644 --- a/packages/cashscript/package.json +++ b/packages/cashscript/package.json @@ -1,6 +1,6 @@ { "name": "cashscript", - "version": "0.11.2", + "version": "0.11.3", "description": "Easily write and interact with Bitcoin Cash contracts", "keywords": [ "bitcoin cash", @@ -46,7 +46,7 @@ }, "dependencies": { "@bitauth/libauth": "^3.1.0-next.2", - "@cashscript/utils": "^0.11.2", + "@cashscript/utils": "^0.11.3", "@electrum-cash/network": "^4.1.3", "@mr-zwets/bchn-api-wrapper": "^1.0.1", "delay": "^6.0.0", diff --git a/packages/utils/package.json b/packages/utils/package.json index 1ac61893e..c13689cc0 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@cashscript/utils", - "version": "0.11.2", + "version": "0.11.3", "description": "CashScript utilities and types", "keywords": [ "bitcoin cash", From c8e29b1f0d9ad247c05f0a697181be4a8acd9ab9 Mon Sep 17 00:00:00 2001 From: Rosco Kalis Date: Wed, 23 Jul 2025 15:58:50 +0200 Subject: [PATCH 16/16] Fix spellcheck --- website/docs/sdk/electrum-network-provider.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/sdk/electrum-network-provider.md b/website/docs/sdk/electrum-network-provider.md index 6a5603438..cbff6257f 100644 --- a/website/docs/sdk/electrum-network-provider.md +++ b/website/docs/sdk/electrum-network-provider.md @@ -117,7 +117,7 @@ const provider = new ElectrumNetworkProvider('chipnet', { manualConnectionManage ``` :::tip -If you're providing an `ElectrumClient` and using it to subscribe to address or blockheader events, you need to enable `manualConnectionManagement` to overwrite the default of connecting and disconnecting for each separate request. +If you're providing an `ElectrumClient` and using it to subscribe to address or block header events, you need to enable `manualConnectionManagement` to overwrite the default of connecting and disconnecting for each separate request. ::: #### connect()