From 0ed13f4c5dc6c92c5f2af274958b1ad31de302fe Mon Sep 17 00:00:00 2001 From: ascandone Date: Mon, 3 Nov 2025 19:03:12 +0100 Subject: [PATCH 01/17] draft fix algo --- internal/interpreter/asset_scaling.go | 90 ++++++++++++++++++++++ internal/interpreter/asset_scaling_test.go | 82 ++++++++++++++++++++ 2 files changed, 172 insertions(+) create mode 100644 internal/interpreter/asset_scaling.go create mode 100644 internal/interpreter/asset_scaling_test.go diff --git a/internal/interpreter/asset_scaling.go b/internal/interpreter/asset_scaling.go new file mode 100644 index 00000000..6dad947a --- /dev/null +++ b/internal/interpreter/asset_scaling.go @@ -0,0 +1,90 @@ +package interpreter + +import ( + "math/big" + "slices" + + "github.com/formancehq/numscript/internal/utils" +) + +// e.g. +// +// need=[EUR/2 100], got={EUR/2: 100, EUR: 1} +// => {EUR/2: 100, EUR: 1} +// +// need=[EUR 1], got={EUR/2: 100, EUR: 0} +// => {EUR/2: 100, EUR: 0} +// +// need=[EUR/2 199], got={EUR/2: 100, EUR: 2} +// => {EUR/2: 100, EUR: 1} +func findSolution( + neededAmt *big.Int, + neededAmtScale int64, + scales map[int64]*big.Int, +) map[int64]*big.Int { + // we clone neededAmt so that we can update it + neededAmt = new(big.Int).Set(neededAmt) + + type scalePair struct { + scale int64 + amount *big.Int + } + + var assets []scalePair + for k, v := range scales { + assets = append(assets, scalePair{ + scale: k, + amount: v, + }) + } + + // Sort in ASC order (e.g. EUR, EUR/2, ..) + slices.SortFunc(assets, func(p scalePair, other scalePair) int { + return int(p.scale - other.scale) + }) + + out := map[int64]*big.Int{} + + left := new(big.Int).Set(neededAmt) + + for _, p := range assets { + scaleDiff := neededAmtScale - p.scale + + exp := big.NewInt(scaleDiff) + exp.Abs(exp) + exp.Exp(big.NewInt(10), exp, nil) + + // scalingFactor := 10 ^ (neededAmtScale - p.scale) + // note that 10^0 == 1 and 10^(-n) == 1/(10^n) + scalingFactor := new(big.Rat).SetInt(exp) + if scaleDiff < 0 { + scalingFactor.Inv(scalingFactor) + } + + allowed := new(big.Int).Mul(p.amount, scalingFactor.Num()) + allowed.Div(allowed, scalingFactor.Denom()) + + taken := utils.MinBigInt(allowed, neededAmt) + + intPart := new(big.Int).Mul(taken, scalingFactor.Denom()) + intPart.Div(intPart, scalingFactor.Num()) + + if intPart.Cmp(big.NewInt(0)) == 0 { + continue + } + + neededAmt.Sub(neededAmt, taken) + out[p.scale] = intPart + + // if neededAmt <= 0 + if neededAmt.Cmp(big.NewInt(0)) != 1 { + return out + } + } + + if left.Cmp(big.NewInt(0)) != 0 { + return nil + } + + return out +} diff --git a/internal/interpreter/asset_scaling_test.go b/internal/interpreter/asset_scaling_test.go new file mode 100644 index 00000000..a02d6c11 --- /dev/null +++ b/internal/interpreter/asset_scaling_test.go @@ -0,0 +1,82 @@ +package interpreter + +import ( + "math/big" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestScalingZeroNeeded(t *testing.T) { + t.Skip() + + // need [EUR/2 ] + sol := findSolution( + big.NewInt(0), + 42, + map[int64]*big.Int{ + 2: big.NewInt(100), + 1: big.NewInt(1), + }) + + require.Equal(t, map[int64]*big.Int{ + 42: big.NewInt(0), + }, sol) +} + +func TestScalingSameAsset(t *testing.T) { + sol := findSolution( + // Need [EUR/2 200] + big.NewInt(200), + 2, + + // Have: {EUR/2: 201} + map[int64]*big.Int{ + 2: big.NewInt(201), + }) + + require.Equal(t, map[int64]*big.Int{ + 2: big.NewInt(200), + }, sol) +} + +func TestScalingSolutionLowerScale(t *testing.T) { + sol := findSolution( + big.NewInt(1), + 0, + map[int64]*big.Int{ + 2: big.NewInt(900), + }) + + require.Equal(t, map[int64]*big.Int{ + 2: big.NewInt(100), + }, sol) +} + +func TestScalingSolutionHigherScale(t *testing.T) { + sol := findSolution( + // Need [EUR/2 200] + big.NewInt(200), + 2, + + // Have: {EUR: 4} (eq to EUR/2 400) + map[int64]*big.Int{ + 0: big.NewInt(4), + }) + + require.Equal(t, map[int64]*big.Int{ + 0: big.NewInt(2), + }, sol) +} + +func TestScalingSolutionHigherScaleNoSolution(t *testing.T) { + sol := findSolution( + big.NewInt(1), + 2, + map[int64]*big.Int{ + 0: big.NewInt(100), + 1: big.NewInt(100), + }) + + require.Nil(t, sol) +} From ad85f52ae82dca049636b59447e391f720bf1661 Mon Sep 17 00:00:00 2001 From: ascandone Date: Wed, 5 Nov 2025 17:00:26 +0100 Subject: [PATCH 02/17] implemented parser --- Lexer.g4 | 2 + Numscript.g4 | 8 +- internal/interpreter/interpreter.go | 6 + .../experimental/scaling/scaling.num | 4 + .../scaling/scaling.num.specs.json | 19 + .../parser/__snapshots__/parser_test.snap | 55 ++ internal/parser/antlrParser/Lexer.interp | 8 +- internal/parser/antlrParser/Lexer.tokens | 28 +- internal/parser/antlrParser/Numscript.interp | 6 +- internal/parser/antlrParser/Numscript.tokens | 28 +- internal/parser/antlrParser/lexer.go | 326 ++++++----- .../antlrParser/numscript_base_listener.go | 6 + .../parser/antlrParser/numscript_listener.go | 6 + .../parser/antlrParser/numscript_parser.go | 545 +++++++++++------- internal/parser/ast.go | 19 +- internal/parser/parser.go | 7 + internal/parser/parser_test.go | 9 + 17 files changed, 676 insertions(+), 406 deletions(-) create mode 100644 internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num create mode 100644 internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num.specs.json diff --git a/Lexer.g4 b/Lexer.g4 index a4ab81be..7cbe5b56 100644 --- a/Lexer.g4 +++ b/Lexer.g4 @@ -32,6 +32,8 @@ PLUS: '+'; MINUS: '-'; DIV: '/'; RESTRICT: '\\'; +WITH: 'with'; +SCALING: 'scaling'; PERCENTAGE_PORTION_LITERAL: [0-9]+ ('.' [0-9]+)? '%'; diff --git a/Numscript.g4 b/Numscript.g4 index ae136055..022f7431 100644 --- a/Numscript.g4 +++ b/Numscript.g4 @@ -44,10 +44,10 @@ allotment: colorConstraint: RESTRICT valueExpr; -source: - address = valueExpr colorConstraint? ALLOWING UNBOUNDED OVERDRAFT # srcAccountUnboundedOverdraft - | address = valueExpr colorConstraint? ALLOWING OVERDRAFT UP TO maxOvedraft = valueExpr # - srcAccountBoundedOverdraft +source + : address = valueExpr colorConstraint? ALLOWING UNBOUNDED OVERDRAFT # srcAccountUnboundedOverdraft + | address = valueExpr colorConstraint? ALLOWING OVERDRAFT UP TO maxOvedraft = valueExpr #srcAccountBoundedOverdraft + | address = valueExpr colorConstraint? WITH SCALING # srcAccountWithScaling | valueExpr colorConstraint? # srcAccount | LBRACE allotmentClauseSrc+ RBRACE # srcAllotment | LBRACE source* RBRACE # srcInorder diff --git a/internal/interpreter/interpreter.go b/internal/interpreter/interpreter.go index 6e4390a6..b737ff09 100644 --- a/internal/interpreter/interpreter.go +++ b/internal/interpreter/interpreter.go @@ -556,6 +556,9 @@ func (s *programState) sendAll(source parser.Source) (*big.Int, InterpreterError } return s.sendAllToAccount(source.Address, cap, source.Color) + case *parser.SourceWithScaling: + panic("TODO implement") + case *parser.SourceInorder: totalSent := big.NewInt(0) for _, subSource := range source.Sources { @@ -677,6 +680,9 @@ func (s *programState) trySendingUpTo(source parser.Source, amount *big.Int) (*b } return s.trySendingToAccount(source.Address, amount, cap, source.Color) + case *parser.SourceWithScaling: + panic("TODO implement") + case *parser.SourceInorder: totalLeft := new(big.Int).Set(amount) for _, source := range source.Sources { diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num new file mode 100644 index 00000000..0d9fcccc --- /dev/null +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num @@ -0,0 +1,4 @@ +send [EUR/2 400] ( + source = @src with scaling + destination = @dest +) diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num.specs.json new file mode 100644 index 00000000..ca4c84f3 --- /dev/null +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num.specs.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://raw.githubusercontent.com/formancehq/numscript/main/specs.schema.json", + "testCases": [ + { + "it": "upscales to an higher currency if possible", + "balances": { + "src": { "EUR": 99, "EUR/2": 1 } + }, + "expect.postings": [ + { + "source": "src", + "destination": "dest", + "asset": "EUR", + "amount": 4 + } + ] + } + ] +} diff --git a/internal/parser/__snapshots__/parser_test.snap b/internal/parser/__snapshots__/parser_test.snap index 85eacf76..ad7917e2 100755 --- a/internal/parser/__snapshots__/parser_test.snap +++ b/internal/parser/__snapshots__/parser_test.snap @@ -3413,3 +3413,58 @@ parser.Program{ Comments: nil, } --- + +[TestScalingSyntax - 1] +parser.Program{ + Vars: (*parser.VarDeclarations)(nil), + Statements: { + &parser.SendStatement{ + Range: parser.Range{ + Start: parser.Position{}, + End: parser.Position{Character:1, Line:3}, + }, + SentValue: &parser.SentValueLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:5, Line:0}, + End: parser.Position{Character:10, Line:0}, + }, + Monetary: &parser.Variable{ + Range: parser.Range{ + Start: parser.Position{Character:5, Line:0}, + End: parser.Position{Character:10, Line:0}, + }, + Name: "sent", + }, + }, + Source: &parser.SourceWithScaling{ + Range: parser.Range{ + Start: parser.Position{Character:11, Line:1}, + End: parser.Position{Character:28, Line:1}, + }, + Color: nil, + Address: &parser.AccountInterpLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:11, Line:1}, + End: parser.Position{Character:15, Line:1}, + }, + Parts: { + parser.AccountTextPart{Name:"src"}, + }, + }, + }, + Destination: &parser.DestinationAccount{ + ValueExpr: &parser.AccountInterpLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:16, Line:2}, + End: parser.Position{Character:21, Line:2}, + }, + Parts: { + parser.AccountTextPart{Name:"dest"}, + }, + }, + }, + }, + }, + Comments: nil, +} +--- diff --git a/internal/parser/antlrParser/Lexer.interp b/internal/parser/antlrParser/Lexer.interp index c7f5a72d..78972f7b 100644 --- a/internal/parser/antlrParser/Lexer.interp +++ b/internal/parser/antlrParser/Lexer.interp @@ -32,6 +32,8 @@ null '-' '/' '\\' +'with' +'scaling' null null null @@ -77,6 +79,8 @@ PLUS MINUS DIV RESTRICT +WITH +SCALING PERCENTAGE_PORTION_LITERAL STRING IDENTIFIER @@ -121,6 +125,8 @@ PLUS MINUS DIV RESTRICT +WITH +SCALING PERCENTAGE_PORTION_LITERAL STRING IDENTIFIER @@ -142,4 +148,4 @@ DEFAULT_MODE ACCOUNT_MODE atn: -[4, 0, 42, 354, 6, -1, 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, 1, 0, 4, 0, 90, 8, 0, 11, 0, 12, 0, 91, 1, 0, 1, 0, 1, 1, 4, 1, 97, 8, 1, 11, 1, 12, 1, 98, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 106, 8, 2, 10, 2, 12, 2, 109, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 120, 8, 3, 10, 3, 12, 3, 123, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 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, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 4, 32, 255, 8, 32, 11, 32, 12, 32, 256, 1, 32, 1, 32, 4, 32, 261, 8, 32, 11, 32, 12, 32, 262, 3, 32, 265, 8, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 5, 33, 273, 8, 33, 10, 33, 12, 33, 276, 9, 33, 1, 33, 1, 33, 1, 34, 4, 34, 281, 8, 34, 11, 34, 12, 34, 282, 1, 34, 5, 34, 286, 8, 34, 10, 34, 12, 34, 289, 9, 34, 1, 35, 4, 35, 292, 8, 35, 11, 35, 12, 35, 293, 1, 35, 1, 35, 4, 35, 298, 8, 35, 11, 35, 12, 35, 299, 5, 35, 302, 8, 35, 10, 35, 12, 35, 305, 9, 35, 1, 36, 1, 36, 5, 36, 309, 8, 36, 10, 36, 12, 36, 312, 9, 36, 1, 36, 1, 36, 4, 36, 316, 8, 36, 11, 36, 12, 36, 317, 3, 36, 320, 8, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 4, 39, 332, 8, 39, 11, 39, 12, 39, 333, 1, 39, 5, 39, 337, 8, 39, 10, 39, 12, 39, 340, 9, 39, 1, 40, 4, 40, 343, 8, 40, 11, 40, 12, 40, 344, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 2, 107, 121, 0, 43, 2, 1, 4, 2, 6, 3, 8, 4, 10, 5, 12, 6, 14, 7, 16, 8, 18, 9, 20, 10, 22, 11, 24, 12, 26, 13, 28, 14, 30, 15, 32, 16, 34, 17, 36, 18, 38, 19, 40, 20, 42, 21, 44, 22, 46, 23, 48, 24, 50, 25, 52, 26, 54, 27, 56, 28, 58, 29, 60, 30, 62, 31, 64, 32, 66, 33, 68, 34, 70, 35, 72, 36, 74, 37, 76, 38, 78, 39, 80, 0, 82, 40, 84, 41, 86, 42, 2, 0, 1, 10, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, 57, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, 2, 0, 95, 95, 97, 122, 1, 0, 65, 90, 2, 0, 48, 57, 65, 90, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 372, 0, 2, 1, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 6, 1, 0, 0, 0, 0, 8, 1, 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 14, 1, 0, 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 24, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, 1, 0, 0, 0, 0, 36, 1, 0, 0, 0, 0, 38, 1, 0, 0, 0, 0, 40, 1, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 44, 1, 0, 0, 0, 0, 46, 1, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 50, 1, 0, 0, 0, 0, 52, 1, 0, 0, 0, 0, 54, 1, 0, 0, 0, 0, 56, 1, 0, 0, 0, 0, 58, 1, 0, 0, 0, 0, 60, 1, 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 66, 1, 0, 0, 0, 0, 68, 1, 0, 0, 0, 0, 70, 1, 0, 0, 0, 0, 72, 1, 0, 0, 0, 0, 74, 1, 0, 0, 0, 0, 76, 1, 0, 0, 0, 0, 78, 1, 0, 0, 0, 0, 86, 1, 0, 0, 0, 1, 82, 1, 0, 0, 0, 1, 84, 1, 0, 0, 0, 2, 89, 1, 0, 0, 0, 4, 96, 1, 0, 0, 0, 6, 100, 1, 0, 0, 0, 8, 115, 1, 0, 0, 0, 10, 128, 1, 0, 0, 0, 12, 133, 1, 0, 0, 0, 14, 137, 1, 0, 0, 0, 16, 144, 1, 0, 0, 0, 18, 156, 1, 0, 0, 0, 20, 161, 1, 0, 0, 0, 22, 166, 1, 0, 0, 0, 24, 169, 1, 0, 0, 0, 26, 172, 1, 0, 0, 0, 28, 182, 1, 0, 0, 0, 30, 191, 1, 0, 0, 0, 32, 201, 1, 0, 0, 0, 34, 211, 1, 0, 0, 0, 36, 217, 1, 0, 0, 0, 38, 222, 1, 0, 0, 0, 40, 227, 1, 0, 0, 0, 42, 229, 1, 0, 0, 0, 44, 231, 1, 0, 0, 0, 46, 233, 1, 0, 0, 0, 48, 235, 1, 0, 0, 0, 50, 237, 1, 0, 0, 0, 52, 239, 1, 0, 0, 0, 54, 241, 1, 0, 0, 0, 56, 243, 1, 0, 0, 0, 58, 245, 1, 0, 0, 0, 60, 247, 1, 0, 0, 0, 62, 249, 1, 0, 0, 0, 64, 251, 1, 0, 0, 0, 66, 254, 1, 0, 0, 0, 68, 268, 1, 0, 0, 0, 70, 280, 1, 0, 0, 0, 72, 291, 1, 0, 0, 0, 74, 306, 1, 0, 0, 0, 76, 321, 1, 0, 0, 0, 78, 325, 1, 0, 0, 0, 80, 329, 1, 0, 0, 0, 82, 342, 1, 0, 0, 0, 84, 348, 1, 0, 0, 0, 86, 352, 1, 0, 0, 0, 88, 90, 7, 0, 0, 0, 89, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 89, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 94, 6, 0, 0, 0, 94, 3, 1, 0, 0, 0, 95, 97, 7, 1, 0, 0, 96, 95, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 96, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 5, 1, 0, 0, 0, 100, 101, 5, 47, 0, 0, 101, 102, 5, 42, 0, 0, 102, 107, 1, 0, 0, 0, 103, 106, 3, 6, 2, 0, 104, 106, 9, 0, 0, 0, 105, 103, 1, 0, 0, 0, 105, 104, 1, 0, 0, 0, 106, 109, 1, 0, 0, 0, 107, 108, 1, 0, 0, 0, 107, 105, 1, 0, 0, 0, 108, 110, 1, 0, 0, 0, 109, 107, 1, 0, 0, 0, 110, 111, 5, 42, 0, 0, 111, 112, 5, 47, 0, 0, 112, 113, 1, 0, 0, 0, 113, 114, 6, 2, 0, 0, 114, 7, 1, 0, 0, 0, 115, 116, 5, 47, 0, 0, 116, 117, 5, 47, 0, 0, 117, 121, 1, 0, 0, 0, 118, 120, 9, 0, 0, 0, 119, 118, 1, 0, 0, 0, 120, 123, 1, 0, 0, 0, 121, 122, 1, 0, 0, 0, 121, 119, 1, 0, 0, 0, 122, 124, 1, 0, 0, 0, 123, 121, 1, 0, 0, 0, 124, 125, 3, 4, 1, 0, 125, 126, 1, 0, 0, 0, 126, 127, 6, 3, 1, 0, 127, 9, 1, 0, 0, 0, 128, 129, 5, 118, 0, 0, 129, 130, 5, 97, 0, 0, 130, 131, 5, 114, 0, 0, 131, 132, 5, 115, 0, 0, 132, 11, 1, 0, 0, 0, 133, 134, 5, 109, 0, 0, 134, 135, 5, 97, 0, 0, 135, 136, 5, 120, 0, 0, 136, 13, 1, 0, 0, 0, 137, 138, 5, 115, 0, 0, 138, 139, 5, 111, 0, 0, 139, 140, 5, 117, 0, 0, 140, 141, 5, 114, 0, 0, 141, 142, 5, 99, 0, 0, 142, 143, 5, 101, 0, 0, 143, 15, 1, 0, 0, 0, 144, 145, 5, 100, 0, 0, 145, 146, 5, 101, 0, 0, 146, 147, 5, 115, 0, 0, 147, 148, 5, 116, 0, 0, 148, 149, 5, 105, 0, 0, 149, 150, 5, 110, 0, 0, 150, 151, 5, 97, 0, 0, 151, 152, 5, 116, 0, 0, 152, 153, 5, 105, 0, 0, 153, 154, 5, 111, 0, 0, 154, 155, 5, 110, 0, 0, 155, 17, 1, 0, 0, 0, 156, 157, 5, 115, 0, 0, 157, 158, 5, 101, 0, 0, 158, 159, 5, 110, 0, 0, 159, 160, 5, 100, 0, 0, 160, 19, 1, 0, 0, 0, 161, 162, 5, 102, 0, 0, 162, 163, 5, 114, 0, 0, 163, 164, 5, 111, 0, 0, 164, 165, 5, 109, 0, 0, 165, 21, 1, 0, 0, 0, 166, 167, 5, 117, 0, 0, 167, 168, 5, 112, 0, 0, 168, 23, 1, 0, 0, 0, 169, 170, 5, 116, 0, 0, 170, 171, 5, 111, 0, 0, 171, 25, 1, 0, 0, 0, 172, 173, 5, 114, 0, 0, 173, 174, 5, 101, 0, 0, 174, 175, 5, 109, 0, 0, 175, 176, 5, 97, 0, 0, 176, 177, 5, 105, 0, 0, 177, 178, 5, 110, 0, 0, 178, 179, 5, 105, 0, 0, 179, 180, 5, 110, 0, 0, 180, 181, 5, 103, 0, 0, 181, 27, 1, 0, 0, 0, 182, 183, 5, 97, 0, 0, 183, 184, 5, 108, 0, 0, 184, 185, 5, 108, 0, 0, 185, 186, 5, 111, 0, 0, 186, 187, 5, 119, 0, 0, 187, 188, 5, 105, 0, 0, 188, 189, 5, 110, 0, 0, 189, 190, 5, 103, 0, 0, 190, 29, 1, 0, 0, 0, 191, 192, 5, 117, 0, 0, 192, 193, 5, 110, 0, 0, 193, 194, 5, 98, 0, 0, 194, 195, 5, 111, 0, 0, 195, 196, 5, 117, 0, 0, 196, 197, 5, 110, 0, 0, 197, 198, 5, 100, 0, 0, 198, 199, 5, 101, 0, 0, 199, 200, 5, 100, 0, 0, 200, 31, 1, 0, 0, 0, 201, 202, 5, 111, 0, 0, 202, 203, 5, 118, 0, 0, 203, 204, 5, 101, 0, 0, 204, 205, 5, 114, 0, 0, 205, 206, 5, 100, 0, 0, 206, 207, 5, 114, 0, 0, 207, 208, 5, 97, 0, 0, 208, 209, 5, 102, 0, 0, 209, 210, 5, 116, 0, 0, 210, 33, 1, 0, 0, 0, 211, 212, 5, 111, 0, 0, 212, 213, 5, 110, 0, 0, 213, 214, 5, 101, 0, 0, 214, 215, 5, 111, 0, 0, 215, 216, 5, 102, 0, 0, 216, 35, 1, 0, 0, 0, 217, 218, 5, 107, 0, 0, 218, 219, 5, 101, 0, 0, 219, 220, 5, 112, 0, 0, 220, 221, 5, 116, 0, 0, 221, 37, 1, 0, 0, 0, 222, 223, 5, 115, 0, 0, 223, 224, 5, 97, 0, 0, 224, 225, 5, 118, 0, 0, 225, 226, 5, 101, 0, 0, 226, 39, 1, 0, 0, 0, 227, 228, 5, 40, 0, 0, 228, 41, 1, 0, 0, 0, 229, 230, 5, 41, 0, 0, 230, 43, 1, 0, 0, 0, 231, 232, 5, 91, 0, 0, 232, 45, 1, 0, 0, 0, 233, 234, 5, 93, 0, 0, 234, 47, 1, 0, 0, 0, 235, 236, 5, 123, 0, 0, 236, 49, 1, 0, 0, 0, 237, 238, 5, 125, 0, 0, 238, 51, 1, 0, 0, 0, 239, 240, 5, 44, 0, 0, 240, 53, 1, 0, 0, 0, 241, 242, 5, 61, 0, 0, 242, 55, 1, 0, 0, 0, 243, 244, 5, 42, 0, 0, 244, 57, 1, 0, 0, 0, 245, 246, 5, 43, 0, 0, 246, 59, 1, 0, 0, 0, 247, 248, 5, 45, 0, 0, 248, 61, 1, 0, 0, 0, 249, 250, 5, 47, 0, 0, 250, 63, 1, 0, 0, 0, 251, 252, 5, 92, 0, 0, 252, 65, 1, 0, 0, 0, 253, 255, 7, 2, 0, 0, 254, 253, 1, 0, 0, 0, 255, 256, 1, 0, 0, 0, 256, 254, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 264, 1, 0, 0, 0, 258, 260, 5, 46, 0, 0, 259, 261, 7, 2, 0, 0, 260, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 265, 1, 0, 0, 0, 264, 258, 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 267, 5, 37, 0, 0, 267, 67, 1, 0, 0, 0, 268, 274, 5, 34, 0, 0, 269, 270, 5, 92, 0, 0, 270, 273, 5, 34, 0, 0, 271, 273, 8, 3, 0, 0, 272, 269, 1, 0, 0, 0, 272, 271, 1, 0, 0, 0, 273, 276, 1, 0, 0, 0, 274, 272, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 277, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 277, 278, 5, 34, 0, 0, 278, 69, 1, 0, 0, 0, 279, 281, 7, 4, 0, 0, 280, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 280, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 287, 1, 0, 0, 0, 284, 286, 7, 5, 0, 0, 285, 284, 1, 0, 0, 0, 286, 289, 1, 0, 0, 0, 287, 285, 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 71, 1, 0, 0, 0, 289, 287, 1, 0, 0, 0, 290, 292, 7, 2, 0, 0, 291, 290, 1, 0, 0, 0, 292, 293, 1, 0, 0, 0, 293, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 303, 1, 0, 0, 0, 295, 297, 5, 95, 0, 0, 296, 298, 7, 2, 0, 0, 297, 296, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 302, 1, 0, 0, 0, 301, 295, 1, 0, 0, 0, 302, 305, 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, 303, 304, 1, 0, 0, 0, 304, 73, 1, 0, 0, 0, 305, 303, 1, 0, 0, 0, 306, 310, 7, 6, 0, 0, 307, 309, 7, 7, 0, 0, 308, 307, 1, 0, 0, 0, 309, 312, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 319, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 313, 315, 5, 47, 0, 0, 314, 316, 7, 2, 0, 0, 315, 314, 1, 0, 0, 0, 316, 317, 1, 0, 0, 0, 317, 315, 1, 0, 0, 0, 317, 318, 1, 0, 0, 0, 318, 320, 1, 0, 0, 0, 319, 313, 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, 320, 75, 1, 0, 0, 0, 321, 322, 5, 64, 0, 0, 322, 323, 1, 0, 0, 0, 323, 324, 6, 37, 2, 0, 324, 77, 1, 0, 0, 0, 325, 326, 5, 58, 0, 0, 326, 327, 1, 0, 0, 0, 327, 328, 6, 38, 2, 0, 328, 79, 1, 0, 0, 0, 329, 331, 5, 36, 0, 0, 330, 332, 7, 5, 0, 0, 331, 330, 1, 0, 0, 0, 332, 333, 1, 0, 0, 0, 333, 331, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 338, 1, 0, 0, 0, 335, 337, 7, 8, 0, 0, 336, 335, 1, 0, 0, 0, 337, 340, 1, 0, 0, 0, 338, 336, 1, 0, 0, 0, 338, 339, 1, 0, 0, 0, 339, 81, 1, 0, 0, 0, 340, 338, 1, 0, 0, 0, 341, 343, 7, 9, 0, 0, 342, 341, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 342, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 346, 1, 0, 0, 0, 346, 347, 6, 40, 3, 0, 347, 83, 1, 0, 0, 0, 348, 349, 3, 80, 39, 0, 349, 350, 1, 0, 0, 0, 350, 351, 6, 41, 3, 0, 351, 85, 1, 0, 0, 0, 352, 353, 3, 80, 39, 0, 353, 87, 1, 0, 0, 0, 23, 0, 1, 91, 98, 105, 107, 121, 256, 262, 264, 272, 274, 282, 287, 293, 299, 303, 310, 317, 319, 333, 338, 344, 4, 6, 0, 0, 0, 1, 0, 5, 1, 0, 4, 0, 0] \ No newline at end of file +[4, 0, 44, 371, 6, -1, 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, 1, 0, 4, 0, 94, 8, 0, 11, 0, 12, 0, 95, 1, 0, 1, 0, 1, 1, 4, 1, 101, 8, 1, 11, 1, 12, 1, 102, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 110, 8, 2, 10, 2, 12, 2, 113, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 124, 8, 3, 10, 3, 12, 3, 127, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 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, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 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, 34, 4, 34, 272, 8, 34, 11, 34, 12, 34, 273, 1, 34, 1, 34, 4, 34, 278, 8, 34, 11, 34, 12, 34, 279, 3, 34, 282, 8, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 5, 35, 290, 8, 35, 10, 35, 12, 35, 293, 9, 35, 1, 35, 1, 35, 1, 36, 4, 36, 298, 8, 36, 11, 36, 12, 36, 299, 1, 36, 5, 36, 303, 8, 36, 10, 36, 12, 36, 306, 9, 36, 1, 37, 4, 37, 309, 8, 37, 11, 37, 12, 37, 310, 1, 37, 1, 37, 4, 37, 315, 8, 37, 11, 37, 12, 37, 316, 5, 37, 319, 8, 37, 10, 37, 12, 37, 322, 9, 37, 1, 38, 1, 38, 5, 38, 326, 8, 38, 10, 38, 12, 38, 329, 9, 38, 1, 38, 1, 38, 4, 38, 333, 8, 38, 11, 38, 12, 38, 334, 3, 38, 337, 8, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 4, 41, 349, 8, 41, 11, 41, 12, 41, 350, 1, 41, 5, 41, 354, 8, 41, 10, 41, 12, 41, 357, 9, 41, 1, 42, 4, 42, 360, 8, 42, 11, 42, 12, 42, 361, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 2, 111, 125, 0, 45, 2, 1, 4, 2, 6, 3, 8, 4, 10, 5, 12, 6, 14, 7, 16, 8, 18, 9, 20, 10, 22, 11, 24, 12, 26, 13, 28, 14, 30, 15, 32, 16, 34, 17, 36, 18, 38, 19, 40, 20, 42, 21, 44, 22, 46, 23, 48, 24, 50, 25, 52, 26, 54, 27, 56, 28, 58, 29, 60, 30, 62, 31, 64, 32, 66, 33, 68, 34, 70, 35, 72, 36, 74, 37, 76, 38, 78, 39, 80, 40, 82, 41, 84, 0, 86, 42, 88, 43, 90, 44, 2, 0, 1, 10, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, 57, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, 2, 0, 95, 95, 97, 122, 1, 0, 65, 90, 2, 0, 48, 57, 65, 90, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 389, 0, 2, 1, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 6, 1, 0, 0, 0, 0, 8, 1, 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 14, 1, 0, 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 24, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, 1, 0, 0, 0, 0, 36, 1, 0, 0, 0, 0, 38, 1, 0, 0, 0, 0, 40, 1, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 44, 1, 0, 0, 0, 0, 46, 1, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 50, 1, 0, 0, 0, 0, 52, 1, 0, 0, 0, 0, 54, 1, 0, 0, 0, 0, 56, 1, 0, 0, 0, 0, 58, 1, 0, 0, 0, 0, 60, 1, 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 66, 1, 0, 0, 0, 0, 68, 1, 0, 0, 0, 0, 70, 1, 0, 0, 0, 0, 72, 1, 0, 0, 0, 0, 74, 1, 0, 0, 0, 0, 76, 1, 0, 0, 0, 0, 78, 1, 0, 0, 0, 0, 80, 1, 0, 0, 0, 0, 82, 1, 0, 0, 0, 0, 90, 1, 0, 0, 0, 1, 86, 1, 0, 0, 0, 1, 88, 1, 0, 0, 0, 2, 93, 1, 0, 0, 0, 4, 100, 1, 0, 0, 0, 6, 104, 1, 0, 0, 0, 8, 119, 1, 0, 0, 0, 10, 132, 1, 0, 0, 0, 12, 137, 1, 0, 0, 0, 14, 141, 1, 0, 0, 0, 16, 148, 1, 0, 0, 0, 18, 160, 1, 0, 0, 0, 20, 165, 1, 0, 0, 0, 22, 170, 1, 0, 0, 0, 24, 173, 1, 0, 0, 0, 26, 176, 1, 0, 0, 0, 28, 186, 1, 0, 0, 0, 30, 195, 1, 0, 0, 0, 32, 205, 1, 0, 0, 0, 34, 215, 1, 0, 0, 0, 36, 221, 1, 0, 0, 0, 38, 226, 1, 0, 0, 0, 40, 231, 1, 0, 0, 0, 42, 233, 1, 0, 0, 0, 44, 235, 1, 0, 0, 0, 46, 237, 1, 0, 0, 0, 48, 239, 1, 0, 0, 0, 50, 241, 1, 0, 0, 0, 52, 243, 1, 0, 0, 0, 54, 245, 1, 0, 0, 0, 56, 247, 1, 0, 0, 0, 58, 249, 1, 0, 0, 0, 60, 251, 1, 0, 0, 0, 62, 253, 1, 0, 0, 0, 64, 255, 1, 0, 0, 0, 66, 257, 1, 0, 0, 0, 68, 262, 1, 0, 0, 0, 70, 271, 1, 0, 0, 0, 72, 285, 1, 0, 0, 0, 74, 297, 1, 0, 0, 0, 76, 308, 1, 0, 0, 0, 78, 323, 1, 0, 0, 0, 80, 338, 1, 0, 0, 0, 82, 342, 1, 0, 0, 0, 84, 346, 1, 0, 0, 0, 86, 359, 1, 0, 0, 0, 88, 365, 1, 0, 0, 0, 90, 369, 1, 0, 0, 0, 92, 94, 7, 0, 0, 0, 93, 92, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 6, 0, 0, 0, 98, 3, 1, 0, 0, 0, 99, 101, 7, 1, 0, 0, 100, 99, 1, 0, 0, 0, 101, 102, 1, 0, 0, 0, 102, 100, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 5, 1, 0, 0, 0, 104, 105, 5, 47, 0, 0, 105, 106, 5, 42, 0, 0, 106, 111, 1, 0, 0, 0, 107, 110, 3, 6, 2, 0, 108, 110, 9, 0, 0, 0, 109, 107, 1, 0, 0, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 5, 42, 0, 0, 115, 116, 5, 47, 0, 0, 116, 117, 1, 0, 0, 0, 117, 118, 6, 2, 0, 0, 118, 7, 1, 0, 0, 0, 119, 120, 5, 47, 0, 0, 120, 121, 5, 47, 0, 0, 121, 125, 1, 0, 0, 0, 122, 124, 9, 0, 0, 0, 123, 122, 1, 0, 0, 0, 124, 127, 1, 0, 0, 0, 125, 126, 1, 0, 0, 0, 125, 123, 1, 0, 0, 0, 126, 128, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 128, 129, 3, 4, 1, 0, 129, 130, 1, 0, 0, 0, 130, 131, 6, 3, 1, 0, 131, 9, 1, 0, 0, 0, 132, 133, 5, 118, 0, 0, 133, 134, 5, 97, 0, 0, 134, 135, 5, 114, 0, 0, 135, 136, 5, 115, 0, 0, 136, 11, 1, 0, 0, 0, 137, 138, 5, 109, 0, 0, 138, 139, 5, 97, 0, 0, 139, 140, 5, 120, 0, 0, 140, 13, 1, 0, 0, 0, 141, 142, 5, 115, 0, 0, 142, 143, 5, 111, 0, 0, 143, 144, 5, 117, 0, 0, 144, 145, 5, 114, 0, 0, 145, 146, 5, 99, 0, 0, 146, 147, 5, 101, 0, 0, 147, 15, 1, 0, 0, 0, 148, 149, 5, 100, 0, 0, 149, 150, 5, 101, 0, 0, 150, 151, 5, 115, 0, 0, 151, 152, 5, 116, 0, 0, 152, 153, 5, 105, 0, 0, 153, 154, 5, 110, 0, 0, 154, 155, 5, 97, 0, 0, 155, 156, 5, 116, 0, 0, 156, 157, 5, 105, 0, 0, 157, 158, 5, 111, 0, 0, 158, 159, 5, 110, 0, 0, 159, 17, 1, 0, 0, 0, 160, 161, 5, 115, 0, 0, 161, 162, 5, 101, 0, 0, 162, 163, 5, 110, 0, 0, 163, 164, 5, 100, 0, 0, 164, 19, 1, 0, 0, 0, 165, 166, 5, 102, 0, 0, 166, 167, 5, 114, 0, 0, 167, 168, 5, 111, 0, 0, 168, 169, 5, 109, 0, 0, 169, 21, 1, 0, 0, 0, 170, 171, 5, 117, 0, 0, 171, 172, 5, 112, 0, 0, 172, 23, 1, 0, 0, 0, 173, 174, 5, 116, 0, 0, 174, 175, 5, 111, 0, 0, 175, 25, 1, 0, 0, 0, 176, 177, 5, 114, 0, 0, 177, 178, 5, 101, 0, 0, 178, 179, 5, 109, 0, 0, 179, 180, 5, 97, 0, 0, 180, 181, 5, 105, 0, 0, 181, 182, 5, 110, 0, 0, 182, 183, 5, 105, 0, 0, 183, 184, 5, 110, 0, 0, 184, 185, 5, 103, 0, 0, 185, 27, 1, 0, 0, 0, 186, 187, 5, 97, 0, 0, 187, 188, 5, 108, 0, 0, 188, 189, 5, 108, 0, 0, 189, 190, 5, 111, 0, 0, 190, 191, 5, 119, 0, 0, 191, 192, 5, 105, 0, 0, 192, 193, 5, 110, 0, 0, 193, 194, 5, 103, 0, 0, 194, 29, 1, 0, 0, 0, 195, 196, 5, 117, 0, 0, 196, 197, 5, 110, 0, 0, 197, 198, 5, 98, 0, 0, 198, 199, 5, 111, 0, 0, 199, 200, 5, 117, 0, 0, 200, 201, 5, 110, 0, 0, 201, 202, 5, 100, 0, 0, 202, 203, 5, 101, 0, 0, 203, 204, 5, 100, 0, 0, 204, 31, 1, 0, 0, 0, 205, 206, 5, 111, 0, 0, 206, 207, 5, 118, 0, 0, 207, 208, 5, 101, 0, 0, 208, 209, 5, 114, 0, 0, 209, 210, 5, 100, 0, 0, 210, 211, 5, 114, 0, 0, 211, 212, 5, 97, 0, 0, 212, 213, 5, 102, 0, 0, 213, 214, 5, 116, 0, 0, 214, 33, 1, 0, 0, 0, 215, 216, 5, 111, 0, 0, 216, 217, 5, 110, 0, 0, 217, 218, 5, 101, 0, 0, 218, 219, 5, 111, 0, 0, 219, 220, 5, 102, 0, 0, 220, 35, 1, 0, 0, 0, 221, 222, 5, 107, 0, 0, 222, 223, 5, 101, 0, 0, 223, 224, 5, 112, 0, 0, 224, 225, 5, 116, 0, 0, 225, 37, 1, 0, 0, 0, 226, 227, 5, 115, 0, 0, 227, 228, 5, 97, 0, 0, 228, 229, 5, 118, 0, 0, 229, 230, 5, 101, 0, 0, 230, 39, 1, 0, 0, 0, 231, 232, 5, 40, 0, 0, 232, 41, 1, 0, 0, 0, 233, 234, 5, 41, 0, 0, 234, 43, 1, 0, 0, 0, 235, 236, 5, 91, 0, 0, 236, 45, 1, 0, 0, 0, 237, 238, 5, 93, 0, 0, 238, 47, 1, 0, 0, 0, 239, 240, 5, 123, 0, 0, 240, 49, 1, 0, 0, 0, 241, 242, 5, 125, 0, 0, 242, 51, 1, 0, 0, 0, 243, 244, 5, 44, 0, 0, 244, 53, 1, 0, 0, 0, 245, 246, 5, 61, 0, 0, 246, 55, 1, 0, 0, 0, 247, 248, 5, 42, 0, 0, 248, 57, 1, 0, 0, 0, 249, 250, 5, 43, 0, 0, 250, 59, 1, 0, 0, 0, 251, 252, 5, 45, 0, 0, 252, 61, 1, 0, 0, 0, 253, 254, 5, 47, 0, 0, 254, 63, 1, 0, 0, 0, 255, 256, 5, 92, 0, 0, 256, 65, 1, 0, 0, 0, 257, 258, 5, 119, 0, 0, 258, 259, 5, 105, 0, 0, 259, 260, 5, 116, 0, 0, 260, 261, 5, 104, 0, 0, 261, 67, 1, 0, 0, 0, 262, 263, 5, 115, 0, 0, 263, 264, 5, 99, 0, 0, 264, 265, 5, 97, 0, 0, 265, 266, 5, 108, 0, 0, 266, 267, 5, 105, 0, 0, 267, 268, 5, 110, 0, 0, 268, 269, 5, 103, 0, 0, 269, 69, 1, 0, 0, 0, 270, 272, 7, 2, 0, 0, 271, 270, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 271, 1, 0, 0, 0, 273, 274, 1, 0, 0, 0, 274, 281, 1, 0, 0, 0, 275, 277, 5, 46, 0, 0, 276, 278, 7, 2, 0, 0, 277, 276, 1, 0, 0, 0, 278, 279, 1, 0, 0, 0, 279, 277, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 282, 1, 0, 0, 0, 281, 275, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 284, 5, 37, 0, 0, 284, 71, 1, 0, 0, 0, 285, 291, 5, 34, 0, 0, 286, 287, 5, 92, 0, 0, 287, 290, 5, 34, 0, 0, 288, 290, 8, 3, 0, 0, 289, 286, 1, 0, 0, 0, 289, 288, 1, 0, 0, 0, 290, 293, 1, 0, 0, 0, 291, 289, 1, 0, 0, 0, 291, 292, 1, 0, 0, 0, 292, 294, 1, 0, 0, 0, 293, 291, 1, 0, 0, 0, 294, 295, 5, 34, 0, 0, 295, 73, 1, 0, 0, 0, 296, 298, 7, 4, 0, 0, 297, 296, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 304, 1, 0, 0, 0, 301, 303, 7, 5, 0, 0, 302, 301, 1, 0, 0, 0, 303, 306, 1, 0, 0, 0, 304, 302, 1, 0, 0, 0, 304, 305, 1, 0, 0, 0, 305, 75, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 307, 309, 7, 2, 0, 0, 308, 307, 1, 0, 0, 0, 309, 310, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 320, 1, 0, 0, 0, 312, 314, 5, 95, 0, 0, 313, 315, 7, 2, 0, 0, 314, 313, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 314, 1, 0, 0, 0, 316, 317, 1, 0, 0, 0, 317, 319, 1, 0, 0, 0, 318, 312, 1, 0, 0, 0, 319, 322, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 77, 1, 0, 0, 0, 322, 320, 1, 0, 0, 0, 323, 327, 7, 6, 0, 0, 324, 326, 7, 7, 0, 0, 325, 324, 1, 0, 0, 0, 326, 329, 1, 0, 0, 0, 327, 325, 1, 0, 0, 0, 327, 328, 1, 0, 0, 0, 328, 336, 1, 0, 0, 0, 329, 327, 1, 0, 0, 0, 330, 332, 5, 47, 0, 0, 331, 333, 7, 2, 0, 0, 332, 331, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 332, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 337, 1, 0, 0, 0, 336, 330, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 79, 1, 0, 0, 0, 338, 339, 5, 64, 0, 0, 339, 340, 1, 0, 0, 0, 340, 341, 6, 39, 2, 0, 341, 81, 1, 0, 0, 0, 342, 343, 5, 58, 0, 0, 343, 344, 1, 0, 0, 0, 344, 345, 6, 40, 2, 0, 345, 83, 1, 0, 0, 0, 346, 348, 5, 36, 0, 0, 347, 349, 7, 5, 0, 0, 348, 347, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 348, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 355, 1, 0, 0, 0, 352, 354, 7, 8, 0, 0, 353, 352, 1, 0, 0, 0, 354, 357, 1, 0, 0, 0, 355, 353, 1, 0, 0, 0, 355, 356, 1, 0, 0, 0, 356, 85, 1, 0, 0, 0, 357, 355, 1, 0, 0, 0, 358, 360, 7, 9, 0, 0, 359, 358, 1, 0, 0, 0, 360, 361, 1, 0, 0, 0, 361, 359, 1, 0, 0, 0, 361, 362, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 364, 6, 42, 3, 0, 364, 87, 1, 0, 0, 0, 365, 366, 3, 84, 41, 0, 366, 367, 1, 0, 0, 0, 367, 368, 6, 43, 3, 0, 368, 89, 1, 0, 0, 0, 369, 370, 3, 84, 41, 0, 370, 91, 1, 0, 0, 0, 23, 0, 1, 95, 102, 109, 111, 125, 273, 279, 281, 289, 291, 299, 304, 310, 316, 320, 327, 334, 336, 350, 355, 361, 4, 6, 0, 0, 0, 1, 0, 5, 1, 0, 4, 0, 0] \ No newline at end of file diff --git a/internal/parser/antlrParser/Lexer.tokens b/internal/parser/antlrParser/Lexer.tokens index 5fea9de1..d4aade8c 100644 --- a/internal/parser/antlrParser/Lexer.tokens +++ b/internal/parser/antlrParser/Lexer.tokens @@ -30,16 +30,18 @@ PLUS=29 MINUS=30 DIV=31 RESTRICT=32 -PERCENTAGE_PORTION_LITERAL=33 -STRING=34 -IDENTIFIER=35 -NUMBER=36 -ASSET=37 -ACCOUNT_START=38 -COLON=39 -ACCOUNT_TEXT=40 -VARIABLE_NAME_ACC=41 -VARIABLE_NAME=42 +WITH=33 +SCALING=34 +PERCENTAGE_PORTION_LITERAL=35 +STRING=36 +IDENTIFIER=37 +NUMBER=38 +ASSET=39 +ACCOUNT_START=40 +COLON=41 +ACCOUNT_TEXT=42 +VARIABLE_NAME_ACC=43 +VARIABLE_NAME=44 'vars'=5 'max'=6 'source'=7 @@ -68,5 +70,7 @@ VARIABLE_NAME=42 '-'=30 '/'=31 '\\'=32 -'@'=38 -':'=39 +'with'=33 +'scaling'=34 +'@'=40 +':'=41 diff --git a/internal/parser/antlrParser/Numscript.interp b/internal/parser/antlrParser/Numscript.interp index 36f269a6..b4f8eee5 100644 --- a/internal/parser/antlrParser/Numscript.interp +++ b/internal/parser/antlrParser/Numscript.interp @@ -32,6 +32,8 @@ null '-' '/' '\\' +'with' +'scaling' null null null @@ -77,6 +79,8 @@ PLUS MINUS DIV RESTRICT +WITH +SCALING PERCENTAGE_PORTION_LITERAL STRING IDENTIFIER @@ -112,4 +116,4 @@ statement atn: -[4, 1, 42, 269, 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, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 48, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 58, 8, 2, 10, 2, 12, 2, 61, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 73, 8, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 81, 8, 2, 10, 2, 12, 2, 84, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 89, 8, 3, 10, 3, 12, 3, 92, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 97, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 107, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 112, 8, 7, 10, 7, 12, 7, 115, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 120, 8, 8, 1, 8, 5, 8, 123, 8, 8, 10, 8, 12, 8, 126, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 137, 8, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 144, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 152, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 162, 8, 12, 1, 12, 1, 12, 4, 12, 166, 8, 12, 11, 12, 12, 12, 167, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 174, 8, 12, 10, 12, 12, 12, 177, 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 4, 12, 183, 8, 12, 11, 12, 12, 12, 184, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 194, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 3, 14, 203, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 4, 16, 212, 8, 16, 11, 16, 12, 16, 213, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 220, 8, 16, 10, 16, 12, 16, 223, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 232, 8, 16, 10, 16, 12, 16, 235, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 241, 8, 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, 18, 248, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 267, 8, 19, 1, 19, 0, 1, 4, 20, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 0, 2, 1, 0, 29, 30, 2, 0, 16, 16, 35, 35, 290, 0, 40, 1, 0, 0, 0, 2, 47, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 85, 1, 0, 0, 0, 8, 93, 1, 0, 0, 0, 10, 100, 1, 0, 0, 0, 12, 103, 1, 0, 0, 0, 14, 108, 1, 0, 0, 0, 16, 119, 1, 0, 0, 0, 18, 129, 1, 0, 0, 0, 20, 136, 1, 0, 0, 0, 22, 138, 1, 0, 0, 0, 24, 193, 1, 0, 0, 0, 26, 195, 1, 0, 0, 0, 28, 202, 1, 0, 0, 0, 30, 204, 1, 0, 0, 0, 32, 240, 1, 0, 0, 0, 34, 242, 1, 0, 0, 0, 36, 247, 1, 0, 0, 0, 38, 266, 1, 0, 0, 0, 40, 41, 5, 22, 0, 0, 41, 42, 3, 4, 2, 0, 42, 43, 3, 4, 2, 0, 43, 44, 5, 23, 0, 0, 44, 1, 1, 0, 0, 0, 45, 48, 5, 40, 0, 0, 46, 48, 5, 41, 0, 0, 47, 45, 1, 0, 0, 0, 47, 46, 1, 0, 0, 0, 48, 3, 1, 0, 0, 0, 49, 50, 6, 2, -1, 0, 50, 73, 5, 42, 0, 0, 51, 73, 5, 37, 0, 0, 52, 73, 5, 34, 0, 0, 53, 54, 5, 38, 0, 0, 54, 59, 3, 2, 1, 0, 55, 56, 5, 39, 0, 0, 56, 58, 3, 2, 1, 0, 57, 55, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 73, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 73, 5, 36, 0, 0, 63, 73, 5, 33, 0, 0, 64, 73, 3, 0, 0, 0, 65, 66, 5, 30, 0, 0, 66, 73, 3, 4, 2, 5, 67, 68, 5, 20, 0, 0, 68, 69, 3, 4, 2, 0, 69, 70, 5, 21, 0, 0, 70, 73, 1, 0, 0, 0, 71, 73, 3, 8, 4, 0, 72, 49, 1, 0, 0, 0, 72, 51, 1, 0, 0, 0, 72, 52, 1, 0, 0, 0, 72, 53, 1, 0, 0, 0, 72, 62, 1, 0, 0, 0, 72, 63, 1, 0, 0, 0, 72, 64, 1, 0, 0, 0, 72, 65, 1, 0, 0, 0, 72, 67, 1, 0, 0, 0, 72, 71, 1, 0, 0, 0, 73, 82, 1, 0, 0, 0, 74, 75, 10, 4, 0, 0, 75, 76, 5, 31, 0, 0, 76, 81, 3, 4, 2, 5, 77, 78, 10, 3, 0, 0, 78, 79, 7, 0, 0, 0, 79, 81, 3, 4, 2, 4, 80, 74, 1, 0, 0, 0, 80, 77, 1, 0, 0, 0, 81, 84, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 5, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 85, 90, 3, 4, 2, 0, 86, 87, 5, 26, 0, 0, 87, 89, 3, 4, 2, 0, 88, 86, 1, 0, 0, 0, 89, 92, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 7, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 93, 94, 7, 1, 0, 0, 94, 96, 5, 20, 0, 0, 95, 97, 3, 6, 3, 0, 96, 95, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 99, 5, 21, 0, 0, 99, 9, 1, 0, 0, 0, 100, 101, 5, 27, 0, 0, 101, 102, 3, 4, 2, 0, 102, 11, 1, 0, 0, 0, 103, 104, 5, 35, 0, 0, 104, 106, 5, 42, 0, 0, 105, 107, 3, 10, 5, 0, 106, 105, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 13, 1, 0, 0, 0, 108, 109, 5, 5, 0, 0, 109, 113, 5, 24, 0, 0, 110, 112, 3, 12, 6, 0, 111, 110, 1, 0, 0, 0, 112, 115, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 113, 114, 1, 0, 0, 0, 114, 116, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 116, 117, 5, 25, 0, 0, 117, 15, 1, 0, 0, 0, 118, 120, 3, 14, 7, 0, 119, 118, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 124, 1, 0, 0, 0, 121, 123, 3, 38, 19, 0, 122, 121, 1, 0, 0, 0, 123, 126, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 127, 1, 0, 0, 0, 126, 124, 1, 0, 0, 0, 127, 128, 5, 0, 0, 1, 128, 17, 1, 0, 0, 0, 129, 130, 5, 22, 0, 0, 130, 131, 3, 4, 2, 0, 131, 132, 5, 28, 0, 0, 132, 133, 5, 23, 0, 0, 133, 19, 1, 0, 0, 0, 134, 137, 3, 4, 2, 0, 135, 137, 5, 13, 0, 0, 136, 134, 1, 0, 0, 0, 136, 135, 1, 0, 0, 0, 137, 21, 1, 0, 0, 0, 138, 139, 5, 32, 0, 0, 139, 140, 3, 4, 2, 0, 140, 23, 1, 0, 0, 0, 141, 143, 3, 4, 2, 0, 142, 144, 3, 22, 11, 0, 143, 142, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, 146, 5, 14, 0, 0, 146, 147, 5, 15, 0, 0, 147, 148, 5, 16, 0, 0, 148, 194, 1, 0, 0, 0, 149, 151, 3, 4, 2, 0, 150, 152, 3, 22, 11, 0, 151, 150, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 154, 5, 14, 0, 0, 154, 155, 5, 16, 0, 0, 155, 156, 5, 11, 0, 0, 156, 157, 5, 12, 0, 0, 157, 158, 3, 4, 2, 0, 158, 194, 1, 0, 0, 0, 159, 161, 3, 4, 2, 0, 160, 162, 3, 22, 11, 0, 161, 160, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 194, 1, 0, 0, 0, 163, 165, 5, 24, 0, 0, 164, 166, 3, 26, 13, 0, 165, 164, 1, 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 167, 168, 1, 0, 0, 0, 168, 169, 1, 0, 0, 0, 169, 170, 5, 25, 0, 0, 170, 194, 1, 0, 0, 0, 171, 175, 5, 24, 0, 0, 172, 174, 3, 24, 12, 0, 173, 172, 1, 0, 0, 0, 174, 177, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 178, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 178, 194, 5, 25, 0, 0, 179, 180, 5, 17, 0, 0, 180, 182, 5, 24, 0, 0, 181, 183, 3, 24, 12, 0, 182, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 182, 1, 0, 0, 0, 184, 185, 1, 0, 0, 0, 185, 186, 1, 0, 0, 0, 186, 187, 5, 25, 0, 0, 187, 194, 1, 0, 0, 0, 188, 189, 5, 6, 0, 0, 189, 190, 3, 4, 2, 0, 190, 191, 5, 10, 0, 0, 191, 192, 3, 24, 12, 0, 192, 194, 1, 0, 0, 0, 193, 141, 1, 0, 0, 0, 193, 149, 1, 0, 0, 0, 193, 159, 1, 0, 0, 0, 193, 163, 1, 0, 0, 0, 193, 171, 1, 0, 0, 0, 193, 179, 1, 0, 0, 0, 193, 188, 1, 0, 0, 0, 194, 25, 1, 0, 0, 0, 195, 196, 3, 20, 10, 0, 196, 197, 5, 10, 0, 0, 197, 198, 3, 24, 12, 0, 198, 27, 1, 0, 0, 0, 199, 200, 5, 12, 0, 0, 200, 203, 3, 32, 16, 0, 201, 203, 5, 18, 0, 0, 202, 199, 1, 0, 0, 0, 202, 201, 1, 0, 0, 0, 203, 29, 1, 0, 0, 0, 204, 205, 5, 6, 0, 0, 205, 206, 3, 4, 2, 0, 206, 207, 3, 28, 14, 0, 207, 31, 1, 0, 0, 0, 208, 241, 3, 4, 2, 0, 209, 211, 5, 24, 0, 0, 210, 212, 3, 34, 17, 0, 211, 210, 1, 0, 0, 0, 212, 213, 1, 0, 0, 0, 213, 211, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, 215, 216, 5, 25, 0, 0, 216, 241, 1, 0, 0, 0, 217, 221, 5, 24, 0, 0, 218, 220, 3, 30, 15, 0, 219, 218, 1, 0, 0, 0, 220, 223, 1, 0, 0, 0, 221, 219, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 224, 1, 0, 0, 0, 223, 221, 1, 0, 0, 0, 224, 225, 5, 13, 0, 0, 225, 226, 3, 28, 14, 0, 226, 227, 5, 25, 0, 0, 227, 241, 1, 0, 0, 0, 228, 229, 5, 17, 0, 0, 229, 233, 5, 24, 0, 0, 230, 232, 3, 30, 15, 0, 231, 230, 1, 0, 0, 0, 232, 235, 1, 0, 0, 0, 233, 231, 1, 0, 0, 0, 233, 234, 1, 0, 0, 0, 234, 236, 1, 0, 0, 0, 235, 233, 1, 0, 0, 0, 236, 237, 5, 13, 0, 0, 237, 238, 3, 28, 14, 0, 238, 239, 5, 25, 0, 0, 239, 241, 1, 0, 0, 0, 240, 208, 1, 0, 0, 0, 240, 209, 1, 0, 0, 0, 240, 217, 1, 0, 0, 0, 240, 228, 1, 0, 0, 0, 241, 33, 1, 0, 0, 0, 242, 243, 3, 20, 10, 0, 243, 244, 3, 28, 14, 0, 244, 35, 1, 0, 0, 0, 245, 248, 3, 4, 2, 0, 246, 248, 3, 18, 9, 0, 247, 245, 1, 0, 0, 0, 247, 246, 1, 0, 0, 0, 248, 37, 1, 0, 0, 0, 249, 250, 5, 9, 0, 0, 250, 251, 3, 36, 18, 0, 251, 252, 5, 20, 0, 0, 252, 253, 5, 7, 0, 0, 253, 254, 5, 27, 0, 0, 254, 255, 3, 24, 12, 0, 255, 256, 5, 8, 0, 0, 256, 257, 5, 27, 0, 0, 257, 258, 3, 32, 16, 0, 258, 259, 5, 21, 0, 0, 259, 267, 1, 0, 0, 0, 260, 261, 5, 19, 0, 0, 261, 262, 3, 36, 18, 0, 262, 263, 5, 10, 0, 0, 263, 264, 3, 4, 2, 0, 264, 267, 1, 0, 0, 0, 265, 267, 3, 8, 4, 0, 266, 249, 1, 0, 0, 0, 266, 260, 1, 0, 0, 0, 266, 265, 1, 0, 0, 0, 267, 39, 1, 0, 0, 0, 26, 47, 59, 72, 80, 82, 90, 96, 106, 113, 119, 124, 136, 143, 151, 161, 167, 175, 184, 193, 202, 213, 221, 233, 240, 247, 266] \ No newline at end of file +[4, 1, 44, 276, 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, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 48, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 58, 8, 2, 10, 2, 12, 2, 61, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 73, 8, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 81, 8, 2, 10, 2, 12, 2, 84, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 89, 8, 3, 10, 3, 12, 3, 92, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 97, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 107, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 112, 8, 7, 10, 7, 12, 7, 115, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 120, 8, 8, 1, 8, 5, 8, 123, 8, 8, 10, 8, 12, 8, 126, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 137, 8, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 144, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 152, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 162, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 169, 8, 12, 1, 12, 1, 12, 4, 12, 173, 8, 12, 11, 12, 12, 12, 174, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 181, 8, 12, 10, 12, 12, 12, 184, 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 4, 12, 190, 8, 12, 11, 12, 12, 12, 191, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 201, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 3, 14, 210, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 4, 16, 219, 8, 16, 11, 16, 12, 16, 220, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 227, 8, 16, 10, 16, 12, 16, 230, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 239, 8, 16, 10, 16, 12, 16, 242, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 248, 8, 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, 18, 255, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 274, 8, 19, 1, 19, 0, 1, 4, 20, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 0, 2, 1, 0, 29, 30, 2, 0, 16, 16, 37, 37, 299, 0, 40, 1, 0, 0, 0, 2, 47, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 85, 1, 0, 0, 0, 8, 93, 1, 0, 0, 0, 10, 100, 1, 0, 0, 0, 12, 103, 1, 0, 0, 0, 14, 108, 1, 0, 0, 0, 16, 119, 1, 0, 0, 0, 18, 129, 1, 0, 0, 0, 20, 136, 1, 0, 0, 0, 22, 138, 1, 0, 0, 0, 24, 200, 1, 0, 0, 0, 26, 202, 1, 0, 0, 0, 28, 209, 1, 0, 0, 0, 30, 211, 1, 0, 0, 0, 32, 247, 1, 0, 0, 0, 34, 249, 1, 0, 0, 0, 36, 254, 1, 0, 0, 0, 38, 273, 1, 0, 0, 0, 40, 41, 5, 22, 0, 0, 41, 42, 3, 4, 2, 0, 42, 43, 3, 4, 2, 0, 43, 44, 5, 23, 0, 0, 44, 1, 1, 0, 0, 0, 45, 48, 5, 42, 0, 0, 46, 48, 5, 43, 0, 0, 47, 45, 1, 0, 0, 0, 47, 46, 1, 0, 0, 0, 48, 3, 1, 0, 0, 0, 49, 50, 6, 2, -1, 0, 50, 73, 5, 44, 0, 0, 51, 73, 5, 39, 0, 0, 52, 73, 5, 36, 0, 0, 53, 54, 5, 40, 0, 0, 54, 59, 3, 2, 1, 0, 55, 56, 5, 41, 0, 0, 56, 58, 3, 2, 1, 0, 57, 55, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 73, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 73, 5, 38, 0, 0, 63, 73, 5, 35, 0, 0, 64, 73, 3, 0, 0, 0, 65, 66, 5, 30, 0, 0, 66, 73, 3, 4, 2, 5, 67, 68, 5, 20, 0, 0, 68, 69, 3, 4, 2, 0, 69, 70, 5, 21, 0, 0, 70, 73, 1, 0, 0, 0, 71, 73, 3, 8, 4, 0, 72, 49, 1, 0, 0, 0, 72, 51, 1, 0, 0, 0, 72, 52, 1, 0, 0, 0, 72, 53, 1, 0, 0, 0, 72, 62, 1, 0, 0, 0, 72, 63, 1, 0, 0, 0, 72, 64, 1, 0, 0, 0, 72, 65, 1, 0, 0, 0, 72, 67, 1, 0, 0, 0, 72, 71, 1, 0, 0, 0, 73, 82, 1, 0, 0, 0, 74, 75, 10, 4, 0, 0, 75, 76, 5, 31, 0, 0, 76, 81, 3, 4, 2, 5, 77, 78, 10, 3, 0, 0, 78, 79, 7, 0, 0, 0, 79, 81, 3, 4, 2, 4, 80, 74, 1, 0, 0, 0, 80, 77, 1, 0, 0, 0, 81, 84, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 5, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 85, 90, 3, 4, 2, 0, 86, 87, 5, 26, 0, 0, 87, 89, 3, 4, 2, 0, 88, 86, 1, 0, 0, 0, 89, 92, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 7, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 93, 94, 7, 1, 0, 0, 94, 96, 5, 20, 0, 0, 95, 97, 3, 6, 3, 0, 96, 95, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 99, 5, 21, 0, 0, 99, 9, 1, 0, 0, 0, 100, 101, 5, 27, 0, 0, 101, 102, 3, 4, 2, 0, 102, 11, 1, 0, 0, 0, 103, 104, 5, 37, 0, 0, 104, 106, 5, 44, 0, 0, 105, 107, 3, 10, 5, 0, 106, 105, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 13, 1, 0, 0, 0, 108, 109, 5, 5, 0, 0, 109, 113, 5, 24, 0, 0, 110, 112, 3, 12, 6, 0, 111, 110, 1, 0, 0, 0, 112, 115, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 113, 114, 1, 0, 0, 0, 114, 116, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 116, 117, 5, 25, 0, 0, 117, 15, 1, 0, 0, 0, 118, 120, 3, 14, 7, 0, 119, 118, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 124, 1, 0, 0, 0, 121, 123, 3, 38, 19, 0, 122, 121, 1, 0, 0, 0, 123, 126, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 127, 1, 0, 0, 0, 126, 124, 1, 0, 0, 0, 127, 128, 5, 0, 0, 1, 128, 17, 1, 0, 0, 0, 129, 130, 5, 22, 0, 0, 130, 131, 3, 4, 2, 0, 131, 132, 5, 28, 0, 0, 132, 133, 5, 23, 0, 0, 133, 19, 1, 0, 0, 0, 134, 137, 3, 4, 2, 0, 135, 137, 5, 13, 0, 0, 136, 134, 1, 0, 0, 0, 136, 135, 1, 0, 0, 0, 137, 21, 1, 0, 0, 0, 138, 139, 5, 32, 0, 0, 139, 140, 3, 4, 2, 0, 140, 23, 1, 0, 0, 0, 141, 143, 3, 4, 2, 0, 142, 144, 3, 22, 11, 0, 143, 142, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, 146, 5, 14, 0, 0, 146, 147, 5, 15, 0, 0, 147, 148, 5, 16, 0, 0, 148, 201, 1, 0, 0, 0, 149, 151, 3, 4, 2, 0, 150, 152, 3, 22, 11, 0, 151, 150, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 154, 5, 14, 0, 0, 154, 155, 5, 16, 0, 0, 155, 156, 5, 11, 0, 0, 156, 157, 5, 12, 0, 0, 157, 158, 3, 4, 2, 0, 158, 201, 1, 0, 0, 0, 159, 161, 3, 4, 2, 0, 160, 162, 3, 22, 11, 0, 161, 160, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 164, 5, 33, 0, 0, 164, 165, 5, 34, 0, 0, 165, 201, 1, 0, 0, 0, 166, 168, 3, 4, 2, 0, 167, 169, 3, 22, 11, 0, 168, 167, 1, 0, 0, 0, 168, 169, 1, 0, 0, 0, 169, 201, 1, 0, 0, 0, 170, 172, 5, 24, 0, 0, 171, 173, 3, 26, 13, 0, 172, 171, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 172, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 177, 5, 25, 0, 0, 177, 201, 1, 0, 0, 0, 178, 182, 5, 24, 0, 0, 179, 181, 3, 24, 12, 0, 180, 179, 1, 0, 0, 0, 181, 184, 1, 0, 0, 0, 182, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 185, 1, 0, 0, 0, 184, 182, 1, 0, 0, 0, 185, 201, 5, 25, 0, 0, 186, 187, 5, 17, 0, 0, 187, 189, 5, 24, 0, 0, 188, 190, 3, 24, 12, 0, 189, 188, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 189, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, 194, 5, 25, 0, 0, 194, 201, 1, 0, 0, 0, 195, 196, 5, 6, 0, 0, 196, 197, 3, 4, 2, 0, 197, 198, 5, 10, 0, 0, 198, 199, 3, 24, 12, 0, 199, 201, 1, 0, 0, 0, 200, 141, 1, 0, 0, 0, 200, 149, 1, 0, 0, 0, 200, 159, 1, 0, 0, 0, 200, 166, 1, 0, 0, 0, 200, 170, 1, 0, 0, 0, 200, 178, 1, 0, 0, 0, 200, 186, 1, 0, 0, 0, 200, 195, 1, 0, 0, 0, 201, 25, 1, 0, 0, 0, 202, 203, 3, 20, 10, 0, 203, 204, 5, 10, 0, 0, 204, 205, 3, 24, 12, 0, 205, 27, 1, 0, 0, 0, 206, 207, 5, 12, 0, 0, 207, 210, 3, 32, 16, 0, 208, 210, 5, 18, 0, 0, 209, 206, 1, 0, 0, 0, 209, 208, 1, 0, 0, 0, 210, 29, 1, 0, 0, 0, 211, 212, 5, 6, 0, 0, 212, 213, 3, 4, 2, 0, 213, 214, 3, 28, 14, 0, 214, 31, 1, 0, 0, 0, 215, 248, 3, 4, 2, 0, 216, 218, 5, 24, 0, 0, 217, 219, 3, 34, 17, 0, 218, 217, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 218, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 223, 5, 25, 0, 0, 223, 248, 1, 0, 0, 0, 224, 228, 5, 24, 0, 0, 225, 227, 3, 30, 15, 0, 226, 225, 1, 0, 0, 0, 227, 230, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 231, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 231, 232, 5, 13, 0, 0, 232, 233, 3, 28, 14, 0, 233, 234, 5, 25, 0, 0, 234, 248, 1, 0, 0, 0, 235, 236, 5, 17, 0, 0, 236, 240, 5, 24, 0, 0, 237, 239, 3, 30, 15, 0, 238, 237, 1, 0, 0, 0, 239, 242, 1, 0, 0, 0, 240, 238, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 243, 1, 0, 0, 0, 242, 240, 1, 0, 0, 0, 243, 244, 5, 13, 0, 0, 244, 245, 3, 28, 14, 0, 245, 246, 5, 25, 0, 0, 246, 248, 1, 0, 0, 0, 247, 215, 1, 0, 0, 0, 247, 216, 1, 0, 0, 0, 247, 224, 1, 0, 0, 0, 247, 235, 1, 0, 0, 0, 248, 33, 1, 0, 0, 0, 249, 250, 3, 20, 10, 0, 250, 251, 3, 28, 14, 0, 251, 35, 1, 0, 0, 0, 252, 255, 3, 4, 2, 0, 253, 255, 3, 18, 9, 0, 254, 252, 1, 0, 0, 0, 254, 253, 1, 0, 0, 0, 255, 37, 1, 0, 0, 0, 256, 257, 5, 9, 0, 0, 257, 258, 3, 36, 18, 0, 258, 259, 5, 20, 0, 0, 259, 260, 5, 7, 0, 0, 260, 261, 5, 27, 0, 0, 261, 262, 3, 24, 12, 0, 262, 263, 5, 8, 0, 0, 263, 264, 5, 27, 0, 0, 264, 265, 3, 32, 16, 0, 265, 266, 5, 21, 0, 0, 266, 274, 1, 0, 0, 0, 267, 268, 5, 19, 0, 0, 268, 269, 3, 36, 18, 0, 269, 270, 5, 10, 0, 0, 270, 271, 3, 4, 2, 0, 271, 274, 1, 0, 0, 0, 272, 274, 3, 8, 4, 0, 273, 256, 1, 0, 0, 0, 273, 267, 1, 0, 0, 0, 273, 272, 1, 0, 0, 0, 274, 39, 1, 0, 0, 0, 27, 47, 59, 72, 80, 82, 90, 96, 106, 113, 119, 124, 136, 143, 151, 161, 168, 174, 182, 191, 200, 209, 220, 228, 240, 247, 254, 273] \ No newline at end of file diff --git a/internal/parser/antlrParser/Numscript.tokens b/internal/parser/antlrParser/Numscript.tokens index 5fea9de1..d4aade8c 100644 --- a/internal/parser/antlrParser/Numscript.tokens +++ b/internal/parser/antlrParser/Numscript.tokens @@ -30,16 +30,18 @@ PLUS=29 MINUS=30 DIV=31 RESTRICT=32 -PERCENTAGE_PORTION_LITERAL=33 -STRING=34 -IDENTIFIER=35 -NUMBER=36 -ASSET=37 -ACCOUNT_START=38 -COLON=39 -ACCOUNT_TEXT=40 -VARIABLE_NAME_ACC=41 -VARIABLE_NAME=42 +WITH=33 +SCALING=34 +PERCENTAGE_PORTION_LITERAL=35 +STRING=36 +IDENTIFIER=37 +NUMBER=38 +ASSET=39 +ACCOUNT_START=40 +COLON=41 +ACCOUNT_TEXT=42 +VARIABLE_NAME_ACC=43 +VARIABLE_NAME=44 'vars'=5 'max'=6 'source'=7 @@ -68,5 +70,7 @@ VARIABLE_NAME=42 '-'=30 '/'=31 '\\'=32 -'@'=38 -':'=39 +'with'=33 +'scaling'=34 +'@'=40 +':'=41 diff --git a/internal/parser/antlrParser/lexer.go b/internal/parser/antlrParser/lexer.go index 449fcd65..f67c46bf 100644 --- a/internal/parser/antlrParser/lexer.go +++ b/internal/parser/antlrParser/lexer.go @@ -46,30 +46,30 @@ func lexerLexerInit() { "", "", "", "", "", "'vars'", "'max'", "'source'", "'destination'", "'send'", "'from'", "'up'", "'to'", "'remaining'", "'allowing'", "'unbounded'", "'overdraft'", "'oneof'", "'kept'", "'save'", "'('", "')'", "'['", "']'", - "'{'", "'}'", "','", "'='", "'*'", "'+'", "'-'", "'/'", "'\\'", "", - "", "", "", "", "'@'", "':'", + "'{'", "'}'", "','", "'='", "'*'", "'+'", "'-'", "'/'", "'\\'", "'with'", + "'scaling'", "", "", "", "", "", "'@'", "':'", } staticData.SymbolicNames = []string{ "", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", "ALLOWING", "UNBOUNDED", "OVERDRAFT", "ONEOF", "KEPT", "SAVE", "LPARENS", "RPARENS", "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", "STAR", "PLUS", - "MINUS", "DIV", "RESTRICT", "PERCENTAGE_PORTION_LITERAL", "STRING", - "IDENTIFIER", "NUMBER", "ASSET", "ACCOUNT_START", "COLON", "ACCOUNT_TEXT", - "VARIABLE_NAME_ACC", "VARIABLE_NAME", + "MINUS", "DIV", "RESTRICT", "WITH", "SCALING", "PERCENTAGE_PORTION_LITERAL", + "STRING", "IDENTIFIER", "NUMBER", "ASSET", "ACCOUNT_START", "COLON", + "ACCOUNT_TEXT", "VARIABLE_NAME_ACC", "VARIABLE_NAME", } staticData.RuleNames = []string{ "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", "ALLOWING", "UNBOUNDED", "OVERDRAFT", "ONEOF", "KEPT", "SAVE", "LPARENS", "RPARENS", "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", "STAR", "PLUS", - "MINUS", "DIV", "RESTRICT", "PERCENTAGE_PORTION_LITERAL", "STRING", - "IDENTIFIER", "NUMBER", "ASSET", "ACCOUNT_START", "COLON", "VARIABLE_NAME_FRAGMENT", - "ACCOUNT_TEXT", "VARIABLE_NAME_ACC", "VARIABLE_NAME", + "MINUS", "DIV", "RESTRICT", "WITH", "SCALING", "PERCENTAGE_PORTION_LITERAL", + "STRING", "IDENTIFIER", "NUMBER", "ASSET", "ACCOUNT_START", "COLON", + "VARIABLE_NAME_FRAGMENT", "ACCOUNT_TEXT", "VARIABLE_NAME_ACC", "VARIABLE_NAME", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 42, 354, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, + 4, 0, 44, 371, 6, -1, 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, @@ -77,43 +77,45 @@ func lexerLexerInit() { 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, 1, 0, 4, 0, 90, 8, 0, 11, 0, 12, 0, 91, 1, - 0, 1, 0, 1, 1, 4, 1, 97, 8, 1, 11, 1, 12, 1, 98, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 5, 2, 106, 8, 2, 10, 2, 12, 2, 109, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 120, 8, 3, 10, 3, 12, 3, 123, 9, 3, - 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, - 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, - 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, - 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, - 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 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, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, - 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, - 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, - 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, - 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, - 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 4, 32, - 255, 8, 32, 11, 32, 12, 32, 256, 1, 32, 1, 32, 4, 32, 261, 8, 32, 11, 32, - 12, 32, 262, 3, 32, 265, 8, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, - 5, 33, 273, 8, 33, 10, 33, 12, 33, 276, 9, 33, 1, 33, 1, 33, 1, 34, 4, - 34, 281, 8, 34, 11, 34, 12, 34, 282, 1, 34, 5, 34, 286, 8, 34, 10, 34, - 12, 34, 289, 9, 34, 1, 35, 4, 35, 292, 8, 35, 11, 35, 12, 35, 293, 1, 35, - 1, 35, 4, 35, 298, 8, 35, 11, 35, 12, 35, 299, 5, 35, 302, 8, 35, 10, 35, - 12, 35, 305, 9, 35, 1, 36, 1, 36, 5, 36, 309, 8, 36, 10, 36, 12, 36, 312, - 9, 36, 1, 36, 1, 36, 4, 36, 316, 8, 36, 11, 36, 12, 36, 317, 3, 36, 320, - 8, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, - 39, 4, 39, 332, 8, 39, 11, 39, 12, 39, 333, 1, 39, 5, 39, 337, 8, 39, 10, - 39, 12, 39, 340, 9, 39, 1, 40, 4, 40, 343, 8, 40, 11, 40, 12, 40, 344, - 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 2, 107, 121, 0, - 43, 2, 1, 4, 2, 6, 3, 8, 4, 10, 5, 12, 6, 14, 7, 16, 8, 18, 9, 20, 10, - 22, 11, 24, 12, 26, 13, 28, 14, 30, 15, 32, 16, 34, 17, 36, 18, 38, 19, - 40, 20, 42, 21, 44, 22, 46, 23, 48, 24, 50, 25, 52, 26, 54, 27, 56, 28, - 58, 29, 60, 30, 62, 31, 64, 32, 66, 33, 68, 34, 70, 35, 72, 36, 74, 37, - 76, 38, 78, 39, 80, 0, 82, 40, 84, 41, 86, 42, 2, 0, 1, 10, 3, 0, 9, 10, + 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 1, 0, 4, 0, 94, + 8, 0, 11, 0, 12, 0, 95, 1, 0, 1, 0, 1, 1, 4, 1, 101, 8, 1, 11, 1, 12, 1, + 102, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 110, 8, 2, 10, 2, 12, 2, 113, + 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 124, + 8, 3, 10, 3, 12, 3, 127, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, + 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, + 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, + 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, + 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 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, 14, 1, 14, 1, + 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, + 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, + 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, + 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, + 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, + 1, 31, 1, 31, 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, 34, 4, 34, 272, 8, 34, 11, 34, 12, 34, + 273, 1, 34, 1, 34, 4, 34, 278, 8, 34, 11, 34, 12, 34, 279, 3, 34, 282, + 8, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 5, 35, 290, 8, 35, 10, + 35, 12, 35, 293, 9, 35, 1, 35, 1, 35, 1, 36, 4, 36, 298, 8, 36, 11, 36, + 12, 36, 299, 1, 36, 5, 36, 303, 8, 36, 10, 36, 12, 36, 306, 9, 36, 1, 37, + 4, 37, 309, 8, 37, 11, 37, 12, 37, 310, 1, 37, 1, 37, 4, 37, 315, 8, 37, + 11, 37, 12, 37, 316, 5, 37, 319, 8, 37, 10, 37, 12, 37, 322, 9, 37, 1, + 38, 1, 38, 5, 38, 326, 8, 38, 10, 38, 12, 38, 329, 9, 38, 1, 38, 1, 38, + 4, 38, 333, 8, 38, 11, 38, 12, 38, 334, 3, 38, 337, 8, 38, 1, 39, 1, 39, + 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 4, 41, 349, 8, + 41, 11, 41, 12, 41, 350, 1, 41, 5, 41, 354, 8, 41, 10, 41, 12, 41, 357, + 9, 41, 1, 42, 4, 42, 360, 8, 42, 11, 42, 12, 42, 361, 1, 42, 1, 42, 1, + 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 2, 111, 125, 0, 45, 2, 1, 4, 2, + 6, 3, 8, 4, 10, 5, 12, 6, 14, 7, 16, 8, 18, 9, 20, 10, 22, 11, 24, 12, + 26, 13, 28, 14, 30, 15, 32, 16, 34, 17, 36, 18, 38, 19, 40, 20, 42, 21, + 44, 22, 46, 23, 48, 24, 50, 25, 52, 26, 54, 27, 56, 28, 58, 29, 60, 30, + 62, 31, 64, 32, 66, 33, 68, 34, 70, 35, 72, 36, 74, 37, 76, 38, 78, 39, + 80, 40, 82, 41, 84, 0, 86, 42, 88, 43, 90, 44, 2, 0, 1, 10, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, 57, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, 2, 0, 95, 95, 97, 122, 1, 0, 65, 90, 2, 0, 48, 57, 65, 90, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, - 95, 97, 122, 372, 0, 2, 1, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 6, 1, 0, 0, 0, + 95, 97, 122, 389, 0, 2, 1, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 6, 1, 0, 0, 0, 0, 8, 1, 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 14, 1, 0, 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 24, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, 1, @@ -123,111 +125,117 @@ func lexerLexerInit() { 0, 54, 1, 0, 0, 0, 0, 56, 1, 0, 0, 0, 0, 58, 1, 0, 0, 0, 0, 60, 1, 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 66, 1, 0, 0, 0, 0, 68, 1, 0, 0, 0, 0, 70, 1, 0, 0, 0, 0, 72, 1, 0, 0, 0, 0, 74, 1, 0, 0, 0, 0, 76, 1, - 0, 0, 0, 0, 78, 1, 0, 0, 0, 0, 86, 1, 0, 0, 0, 1, 82, 1, 0, 0, 0, 1, 84, - 1, 0, 0, 0, 2, 89, 1, 0, 0, 0, 4, 96, 1, 0, 0, 0, 6, 100, 1, 0, 0, 0, 8, - 115, 1, 0, 0, 0, 10, 128, 1, 0, 0, 0, 12, 133, 1, 0, 0, 0, 14, 137, 1, - 0, 0, 0, 16, 144, 1, 0, 0, 0, 18, 156, 1, 0, 0, 0, 20, 161, 1, 0, 0, 0, - 22, 166, 1, 0, 0, 0, 24, 169, 1, 0, 0, 0, 26, 172, 1, 0, 0, 0, 28, 182, - 1, 0, 0, 0, 30, 191, 1, 0, 0, 0, 32, 201, 1, 0, 0, 0, 34, 211, 1, 0, 0, - 0, 36, 217, 1, 0, 0, 0, 38, 222, 1, 0, 0, 0, 40, 227, 1, 0, 0, 0, 42, 229, - 1, 0, 0, 0, 44, 231, 1, 0, 0, 0, 46, 233, 1, 0, 0, 0, 48, 235, 1, 0, 0, - 0, 50, 237, 1, 0, 0, 0, 52, 239, 1, 0, 0, 0, 54, 241, 1, 0, 0, 0, 56, 243, - 1, 0, 0, 0, 58, 245, 1, 0, 0, 0, 60, 247, 1, 0, 0, 0, 62, 249, 1, 0, 0, - 0, 64, 251, 1, 0, 0, 0, 66, 254, 1, 0, 0, 0, 68, 268, 1, 0, 0, 0, 70, 280, - 1, 0, 0, 0, 72, 291, 1, 0, 0, 0, 74, 306, 1, 0, 0, 0, 76, 321, 1, 0, 0, - 0, 78, 325, 1, 0, 0, 0, 80, 329, 1, 0, 0, 0, 82, 342, 1, 0, 0, 0, 84, 348, - 1, 0, 0, 0, 86, 352, 1, 0, 0, 0, 88, 90, 7, 0, 0, 0, 89, 88, 1, 0, 0, 0, - 90, 91, 1, 0, 0, 0, 91, 89, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 93, 1, - 0, 0, 0, 93, 94, 6, 0, 0, 0, 94, 3, 1, 0, 0, 0, 95, 97, 7, 1, 0, 0, 96, - 95, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 96, 1, 0, 0, 0, 98, 99, 1, 0, 0, - 0, 99, 5, 1, 0, 0, 0, 100, 101, 5, 47, 0, 0, 101, 102, 5, 42, 0, 0, 102, - 107, 1, 0, 0, 0, 103, 106, 3, 6, 2, 0, 104, 106, 9, 0, 0, 0, 105, 103, - 1, 0, 0, 0, 105, 104, 1, 0, 0, 0, 106, 109, 1, 0, 0, 0, 107, 108, 1, 0, - 0, 0, 107, 105, 1, 0, 0, 0, 108, 110, 1, 0, 0, 0, 109, 107, 1, 0, 0, 0, - 110, 111, 5, 42, 0, 0, 111, 112, 5, 47, 0, 0, 112, 113, 1, 0, 0, 0, 113, - 114, 6, 2, 0, 0, 114, 7, 1, 0, 0, 0, 115, 116, 5, 47, 0, 0, 116, 117, 5, - 47, 0, 0, 117, 121, 1, 0, 0, 0, 118, 120, 9, 0, 0, 0, 119, 118, 1, 0, 0, - 0, 120, 123, 1, 0, 0, 0, 121, 122, 1, 0, 0, 0, 121, 119, 1, 0, 0, 0, 122, - 124, 1, 0, 0, 0, 123, 121, 1, 0, 0, 0, 124, 125, 3, 4, 1, 0, 125, 126, - 1, 0, 0, 0, 126, 127, 6, 3, 1, 0, 127, 9, 1, 0, 0, 0, 128, 129, 5, 118, - 0, 0, 129, 130, 5, 97, 0, 0, 130, 131, 5, 114, 0, 0, 131, 132, 5, 115, - 0, 0, 132, 11, 1, 0, 0, 0, 133, 134, 5, 109, 0, 0, 134, 135, 5, 97, 0, - 0, 135, 136, 5, 120, 0, 0, 136, 13, 1, 0, 0, 0, 137, 138, 5, 115, 0, 0, - 138, 139, 5, 111, 0, 0, 139, 140, 5, 117, 0, 0, 140, 141, 5, 114, 0, 0, - 141, 142, 5, 99, 0, 0, 142, 143, 5, 101, 0, 0, 143, 15, 1, 0, 0, 0, 144, - 145, 5, 100, 0, 0, 145, 146, 5, 101, 0, 0, 146, 147, 5, 115, 0, 0, 147, - 148, 5, 116, 0, 0, 148, 149, 5, 105, 0, 0, 149, 150, 5, 110, 0, 0, 150, - 151, 5, 97, 0, 0, 151, 152, 5, 116, 0, 0, 152, 153, 5, 105, 0, 0, 153, - 154, 5, 111, 0, 0, 154, 155, 5, 110, 0, 0, 155, 17, 1, 0, 0, 0, 156, 157, - 5, 115, 0, 0, 157, 158, 5, 101, 0, 0, 158, 159, 5, 110, 0, 0, 159, 160, - 5, 100, 0, 0, 160, 19, 1, 0, 0, 0, 161, 162, 5, 102, 0, 0, 162, 163, 5, - 114, 0, 0, 163, 164, 5, 111, 0, 0, 164, 165, 5, 109, 0, 0, 165, 21, 1, - 0, 0, 0, 166, 167, 5, 117, 0, 0, 167, 168, 5, 112, 0, 0, 168, 23, 1, 0, - 0, 0, 169, 170, 5, 116, 0, 0, 170, 171, 5, 111, 0, 0, 171, 25, 1, 0, 0, - 0, 172, 173, 5, 114, 0, 0, 173, 174, 5, 101, 0, 0, 174, 175, 5, 109, 0, - 0, 175, 176, 5, 97, 0, 0, 176, 177, 5, 105, 0, 0, 177, 178, 5, 110, 0, - 0, 178, 179, 5, 105, 0, 0, 179, 180, 5, 110, 0, 0, 180, 181, 5, 103, 0, - 0, 181, 27, 1, 0, 0, 0, 182, 183, 5, 97, 0, 0, 183, 184, 5, 108, 0, 0, - 184, 185, 5, 108, 0, 0, 185, 186, 5, 111, 0, 0, 186, 187, 5, 119, 0, 0, - 187, 188, 5, 105, 0, 0, 188, 189, 5, 110, 0, 0, 189, 190, 5, 103, 0, 0, - 190, 29, 1, 0, 0, 0, 191, 192, 5, 117, 0, 0, 192, 193, 5, 110, 0, 0, 193, - 194, 5, 98, 0, 0, 194, 195, 5, 111, 0, 0, 195, 196, 5, 117, 0, 0, 196, - 197, 5, 110, 0, 0, 197, 198, 5, 100, 0, 0, 198, 199, 5, 101, 0, 0, 199, - 200, 5, 100, 0, 0, 200, 31, 1, 0, 0, 0, 201, 202, 5, 111, 0, 0, 202, 203, - 5, 118, 0, 0, 203, 204, 5, 101, 0, 0, 204, 205, 5, 114, 0, 0, 205, 206, - 5, 100, 0, 0, 206, 207, 5, 114, 0, 0, 207, 208, 5, 97, 0, 0, 208, 209, - 5, 102, 0, 0, 209, 210, 5, 116, 0, 0, 210, 33, 1, 0, 0, 0, 211, 212, 5, - 111, 0, 0, 212, 213, 5, 110, 0, 0, 213, 214, 5, 101, 0, 0, 214, 215, 5, - 111, 0, 0, 215, 216, 5, 102, 0, 0, 216, 35, 1, 0, 0, 0, 217, 218, 5, 107, - 0, 0, 218, 219, 5, 101, 0, 0, 219, 220, 5, 112, 0, 0, 220, 221, 5, 116, - 0, 0, 221, 37, 1, 0, 0, 0, 222, 223, 5, 115, 0, 0, 223, 224, 5, 97, 0, - 0, 224, 225, 5, 118, 0, 0, 225, 226, 5, 101, 0, 0, 226, 39, 1, 0, 0, 0, - 227, 228, 5, 40, 0, 0, 228, 41, 1, 0, 0, 0, 229, 230, 5, 41, 0, 0, 230, - 43, 1, 0, 0, 0, 231, 232, 5, 91, 0, 0, 232, 45, 1, 0, 0, 0, 233, 234, 5, - 93, 0, 0, 234, 47, 1, 0, 0, 0, 235, 236, 5, 123, 0, 0, 236, 49, 1, 0, 0, - 0, 237, 238, 5, 125, 0, 0, 238, 51, 1, 0, 0, 0, 239, 240, 5, 44, 0, 0, - 240, 53, 1, 0, 0, 0, 241, 242, 5, 61, 0, 0, 242, 55, 1, 0, 0, 0, 243, 244, - 5, 42, 0, 0, 244, 57, 1, 0, 0, 0, 245, 246, 5, 43, 0, 0, 246, 59, 1, 0, - 0, 0, 247, 248, 5, 45, 0, 0, 248, 61, 1, 0, 0, 0, 249, 250, 5, 47, 0, 0, - 250, 63, 1, 0, 0, 0, 251, 252, 5, 92, 0, 0, 252, 65, 1, 0, 0, 0, 253, 255, - 7, 2, 0, 0, 254, 253, 1, 0, 0, 0, 255, 256, 1, 0, 0, 0, 256, 254, 1, 0, - 0, 0, 256, 257, 1, 0, 0, 0, 257, 264, 1, 0, 0, 0, 258, 260, 5, 46, 0, 0, - 259, 261, 7, 2, 0, 0, 260, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, - 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 265, 1, 0, 0, 0, 264, 258, - 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 267, 5, 37, - 0, 0, 267, 67, 1, 0, 0, 0, 268, 274, 5, 34, 0, 0, 269, 270, 5, 92, 0, 0, - 270, 273, 5, 34, 0, 0, 271, 273, 8, 3, 0, 0, 272, 269, 1, 0, 0, 0, 272, - 271, 1, 0, 0, 0, 273, 276, 1, 0, 0, 0, 274, 272, 1, 0, 0, 0, 274, 275, - 1, 0, 0, 0, 275, 277, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 277, 278, 5, 34, - 0, 0, 278, 69, 1, 0, 0, 0, 279, 281, 7, 4, 0, 0, 280, 279, 1, 0, 0, 0, - 281, 282, 1, 0, 0, 0, 282, 280, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, - 287, 1, 0, 0, 0, 284, 286, 7, 5, 0, 0, 285, 284, 1, 0, 0, 0, 286, 289, - 1, 0, 0, 0, 287, 285, 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 71, 1, 0, - 0, 0, 289, 287, 1, 0, 0, 0, 290, 292, 7, 2, 0, 0, 291, 290, 1, 0, 0, 0, - 292, 293, 1, 0, 0, 0, 293, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, - 303, 1, 0, 0, 0, 295, 297, 5, 95, 0, 0, 296, 298, 7, 2, 0, 0, 297, 296, - 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 297, 1, 0, 0, 0, 299, 300, 1, 0, - 0, 0, 300, 302, 1, 0, 0, 0, 301, 295, 1, 0, 0, 0, 302, 305, 1, 0, 0, 0, - 303, 301, 1, 0, 0, 0, 303, 304, 1, 0, 0, 0, 304, 73, 1, 0, 0, 0, 305, 303, - 1, 0, 0, 0, 306, 310, 7, 6, 0, 0, 307, 309, 7, 7, 0, 0, 308, 307, 1, 0, - 0, 0, 309, 312, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, - 311, 319, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 313, 315, 5, 47, 0, 0, 314, - 316, 7, 2, 0, 0, 315, 314, 1, 0, 0, 0, 316, 317, 1, 0, 0, 0, 317, 315, - 1, 0, 0, 0, 317, 318, 1, 0, 0, 0, 318, 320, 1, 0, 0, 0, 319, 313, 1, 0, - 0, 0, 319, 320, 1, 0, 0, 0, 320, 75, 1, 0, 0, 0, 321, 322, 5, 64, 0, 0, - 322, 323, 1, 0, 0, 0, 323, 324, 6, 37, 2, 0, 324, 77, 1, 0, 0, 0, 325, - 326, 5, 58, 0, 0, 326, 327, 1, 0, 0, 0, 327, 328, 6, 38, 2, 0, 328, 79, - 1, 0, 0, 0, 329, 331, 5, 36, 0, 0, 330, 332, 7, 5, 0, 0, 331, 330, 1, 0, - 0, 0, 332, 333, 1, 0, 0, 0, 333, 331, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, - 334, 338, 1, 0, 0, 0, 335, 337, 7, 8, 0, 0, 336, 335, 1, 0, 0, 0, 337, - 340, 1, 0, 0, 0, 338, 336, 1, 0, 0, 0, 338, 339, 1, 0, 0, 0, 339, 81, 1, - 0, 0, 0, 340, 338, 1, 0, 0, 0, 341, 343, 7, 9, 0, 0, 342, 341, 1, 0, 0, - 0, 343, 344, 1, 0, 0, 0, 344, 342, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, - 346, 1, 0, 0, 0, 346, 347, 6, 40, 3, 0, 347, 83, 1, 0, 0, 0, 348, 349, - 3, 80, 39, 0, 349, 350, 1, 0, 0, 0, 350, 351, 6, 41, 3, 0, 351, 85, 1, - 0, 0, 0, 352, 353, 3, 80, 39, 0, 353, 87, 1, 0, 0, 0, 23, 0, 1, 91, 98, - 105, 107, 121, 256, 262, 264, 272, 274, 282, 287, 293, 299, 303, 310, 317, - 319, 333, 338, 344, 4, 6, 0, 0, 0, 1, 0, 5, 1, 0, 4, 0, 0, + 0, 0, 0, 0, 78, 1, 0, 0, 0, 0, 80, 1, 0, 0, 0, 0, 82, 1, 0, 0, 0, 0, 90, + 1, 0, 0, 0, 1, 86, 1, 0, 0, 0, 1, 88, 1, 0, 0, 0, 2, 93, 1, 0, 0, 0, 4, + 100, 1, 0, 0, 0, 6, 104, 1, 0, 0, 0, 8, 119, 1, 0, 0, 0, 10, 132, 1, 0, + 0, 0, 12, 137, 1, 0, 0, 0, 14, 141, 1, 0, 0, 0, 16, 148, 1, 0, 0, 0, 18, + 160, 1, 0, 0, 0, 20, 165, 1, 0, 0, 0, 22, 170, 1, 0, 0, 0, 24, 173, 1, + 0, 0, 0, 26, 176, 1, 0, 0, 0, 28, 186, 1, 0, 0, 0, 30, 195, 1, 0, 0, 0, + 32, 205, 1, 0, 0, 0, 34, 215, 1, 0, 0, 0, 36, 221, 1, 0, 0, 0, 38, 226, + 1, 0, 0, 0, 40, 231, 1, 0, 0, 0, 42, 233, 1, 0, 0, 0, 44, 235, 1, 0, 0, + 0, 46, 237, 1, 0, 0, 0, 48, 239, 1, 0, 0, 0, 50, 241, 1, 0, 0, 0, 52, 243, + 1, 0, 0, 0, 54, 245, 1, 0, 0, 0, 56, 247, 1, 0, 0, 0, 58, 249, 1, 0, 0, + 0, 60, 251, 1, 0, 0, 0, 62, 253, 1, 0, 0, 0, 64, 255, 1, 0, 0, 0, 66, 257, + 1, 0, 0, 0, 68, 262, 1, 0, 0, 0, 70, 271, 1, 0, 0, 0, 72, 285, 1, 0, 0, + 0, 74, 297, 1, 0, 0, 0, 76, 308, 1, 0, 0, 0, 78, 323, 1, 0, 0, 0, 80, 338, + 1, 0, 0, 0, 82, 342, 1, 0, 0, 0, 84, 346, 1, 0, 0, 0, 86, 359, 1, 0, 0, + 0, 88, 365, 1, 0, 0, 0, 90, 369, 1, 0, 0, 0, 92, 94, 7, 0, 0, 0, 93, 92, + 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, + 96, 97, 1, 0, 0, 0, 97, 98, 6, 0, 0, 0, 98, 3, 1, 0, 0, 0, 99, 101, 7, + 1, 0, 0, 100, 99, 1, 0, 0, 0, 101, 102, 1, 0, 0, 0, 102, 100, 1, 0, 0, + 0, 102, 103, 1, 0, 0, 0, 103, 5, 1, 0, 0, 0, 104, 105, 5, 47, 0, 0, 105, + 106, 5, 42, 0, 0, 106, 111, 1, 0, 0, 0, 107, 110, 3, 6, 2, 0, 108, 110, + 9, 0, 0, 0, 109, 107, 1, 0, 0, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, 0, + 0, 0, 111, 112, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, + 113, 111, 1, 0, 0, 0, 114, 115, 5, 42, 0, 0, 115, 116, 5, 47, 0, 0, 116, + 117, 1, 0, 0, 0, 117, 118, 6, 2, 0, 0, 118, 7, 1, 0, 0, 0, 119, 120, 5, + 47, 0, 0, 120, 121, 5, 47, 0, 0, 121, 125, 1, 0, 0, 0, 122, 124, 9, 0, + 0, 0, 123, 122, 1, 0, 0, 0, 124, 127, 1, 0, 0, 0, 125, 126, 1, 0, 0, 0, + 125, 123, 1, 0, 0, 0, 126, 128, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 128, + 129, 3, 4, 1, 0, 129, 130, 1, 0, 0, 0, 130, 131, 6, 3, 1, 0, 131, 9, 1, + 0, 0, 0, 132, 133, 5, 118, 0, 0, 133, 134, 5, 97, 0, 0, 134, 135, 5, 114, + 0, 0, 135, 136, 5, 115, 0, 0, 136, 11, 1, 0, 0, 0, 137, 138, 5, 109, 0, + 0, 138, 139, 5, 97, 0, 0, 139, 140, 5, 120, 0, 0, 140, 13, 1, 0, 0, 0, + 141, 142, 5, 115, 0, 0, 142, 143, 5, 111, 0, 0, 143, 144, 5, 117, 0, 0, + 144, 145, 5, 114, 0, 0, 145, 146, 5, 99, 0, 0, 146, 147, 5, 101, 0, 0, + 147, 15, 1, 0, 0, 0, 148, 149, 5, 100, 0, 0, 149, 150, 5, 101, 0, 0, 150, + 151, 5, 115, 0, 0, 151, 152, 5, 116, 0, 0, 152, 153, 5, 105, 0, 0, 153, + 154, 5, 110, 0, 0, 154, 155, 5, 97, 0, 0, 155, 156, 5, 116, 0, 0, 156, + 157, 5, 105, 0, 0, 157, 158, 5, 111, 0, 0, 158, 159, 5, 110, 0, 0, 159, + 17, 1, 0, 0, 0, 160, 161, 5, 115, 0, 0, 161, 162, 5, 101, 0, 0, 162, 163, + 5, 110, 0, 0, 163, 164, 5, 100, 0, 0, 164, 19, 1, 0, 0, 0, 165, 166, 5, + 102, 0, 0, 166, 167, 5, 114, 0, 0, 167, 168, 5, 111, 0, 0, 168, 169, 5, + 109, 0, 0, 169, 21, 1, 0, 0, 0, 170, 171, 5, 117, 0, 0, 171, 172, 5, 112, + 0, 0, 172, 23, 1, 0, 0, 0, 173, 174, 5, 116, 0, 0, 174, 175, 5, 111, 0, + 0, 175, 25, 1, 0, 0, 0, 176, 177, 5, 114, 0, 0, 177, 178, 5, 101, 0, 0, + 178, 179, 5, 109, 0, 0, 179, 180, 5, 97, 0, 0, 180, 181, 5, 105, 0, 0, + 181, 182, 5, 110, 0, 0, 182, 183, 5, 105, 0, 0, 183, 184, 5, 110, 0, 0, + 184, 185, 5, 103, 0, 0, 185, 27, 1, 0, 0, 0, 186, 187, 5, 97, 0, 0, 187, + 188, 5, 108, 0, 0, 188, 189, 5, 108, 0, 0, 189, 190, 5, 111, 0, 0, 190, + 191, 5, 119, 0, 0, 191, 192, 5, 105, 0, 0, 192, 193, 5, 110, 0, 0, 193, + 194, 5, 103, 0, 0, 194, 29, 1, 0, 0, 0, 195, 196, 5, 117, 0, 0, 196, 197, + 5, 110, 0, 0, 197, 198, 5, 98, 0, 0, 198, 199, 5, 111, 0, 0, 199, 200, + 5, 117, 0, 0, 200, 201, 5, 110, 0, 0, 201, 202, 5, 100, 0, 0, 202, 203, + 5, 101, 0, 0, 203, 204, 5, 100, 0, 0, 204, 31, 1, 0, 0, 0, 205, 206, 5, + 111, 0, 0, 206, 207, 5, 118, 0, 0, 207, 208, 5, 101, 0, 0, 208, 209, 5, + 114, 0, 0, 209, 210, 5, 100, 0, 0, 210, 211, 5, 114, 0, 0, 211, 212, 5, + 97, 0, 0, 212, 213, 5, 102, 0, 0, 213, 214, 5, 116, 0, 0, 214, 33, 1, 0, + 0, 0, 215, 216, 5, 111, 0, 0, 216, 217, 5, 110, 0, 0, 217, 218, 5, 101, + 0, 0, 218, 219, 5, 111, 0, 0, 219, 220, 5, 102, 0, 0, 220, 35, 1, 0, 0, + 0, 221, 222, 5, 107, 0, 0, 222, 223, 5, 101, 0, 0, 223, 224, 5, 112, 0, + 0, 224, 225, 5, 116, 0, 0, 225, 37, 1, 0, 0, 0, 226, 227, 5, 115, 0, 0, + 227, 228, 5, 97, 0, 0, 228, 229, 5, 118, 0, 0, 229, 230, 5, 101, 0, 0, + 230, 39, 1, 0, 0, 0, 231, 232, 5, 40, 0, 0, 232, 41, 1, 0, 0, 0, 233, 234, + 5, 41, 0, 0, 234, 43, 1, 0, 0, 0, 235, 236, 5, 91, 0, 0, 236, 45, 1, 0, + 0, 0, 237, 238, 5, 93, 0, 0, 238, 47, 1, 0, 0, 0, 239, 240, 5, 123, 0, + 0, 240, 49, 1, 0, 0, 0, 241, 242, 5, 125, 0, 0, 242, 51, 1, 0, 0, 0, 243, + 244, 5, 44, 0, 0, 244, 53, 1, 0, 0, 0, 245, 246, 5, 61, 0, 0, 246, 55, + 1, 0, 0, 0, 247, 248, 5, 42, 0, 0, 248, 57, 1, 0, 0, 0, 249, 250, 5, 43, + 0, 0, 250, 59, 1, 0, 0, 0, 251, 252, 5, 45, 0, 0, 252, 61, 1, 0, 0, 0, + 253, 254, 5, 47, 0, 0, 254, 63, 1, 0, 0, 0, 255, 256, 5, 92, 0, 0, 256, + 65, 1, 0, 0, 0, 257, 258, 5, 119, 0, 0, 258, 259, 5, 105, 0, 0, 259, 260, + 5, 116, 0, 0, 260, 261, 5, 104, 0, 0, 261, 67, 1, 0, 0, 0, 262, 263, 5, + 115, 0, 0, 263, 264, 5, 99, 0, 0, 264, 265, 5, 97, 0, 0, 265, 266, 5, 108, + 0, 0, 266, 267, 5, 105, 0, 0, 267, 268, 5, 110, 0, 0, 268, 269, 5, 103, + 0, 0, 269, 69, 1, 0, 0, 0, 270, 272, 7, 2, 0, 0, 271, 270, 1, 0, 0, 0, + 272, 273, 1, 0, 0, 0, 273, 271, 1, 0, 0, 0, 273, 274, 1, 0, 0, 0, 274, + 281, 1, 0, 0, 0, 275, 277, 5, 46, 0, 0, 276, 278, 7, 2, 0, 0, 277, 276, + 1, 0, 0, 0, 278, 279, 1, 0, 0, 0, 279, 277, 1, 0, 0, 0, 279, 280, 1, 0, + 0, 0, 280, 282, 1, 0, 0, 0, 281, 275, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, + 282, 283, 1, 0, 0, 0, 283, 284, 5, 37, 0, 0, 284, 71, 1, 0, 0, 0, 285, + 291, 5, 34, 0, 0, 286, 287, 5, 92, 0, 0, 287, 290, 5, 34, 0, 0, 288, 290, + 8, 3, 0, 0, 289, 286, 1, 0, 0, 0, 289, 288, 1, 0, 0, 0, 290, 293, 1, 0, + 0, 0, 291, 289, 1, 0, 0, 0, 291, 292, 1, 0, 0, 0, 292, 294, 1, 0, 0, 0, + 293, 291, 1, 0, 0, 0, 294, 295, 5, 34, 0, 0, 295, 73, 1, 0, 0, 0, 296, + 298, 7, 4, 0, 0, 297, 296, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 297, + 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 304, 1, 0, 0, 0, 301, 303, 7, 5, + 0, 0, 302, 301, 1, 0, 0, 0, 303, 306, 1, 0, 0, 0, 304, 302, 1, 0, 0, 0, + 304, 305, 1, 0, 0, 0, 305, 75, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 307, 309, + 7, 2, 0, 0, 308, 307, 1, 0, 0, 0, 309, 310, 1, 0, 0, 0, 310, 308, 1, 0, + 0, 0, 310, 311, 1, 0, 0, 0, 311, 320, 1, 0, 0, 0, 312, 314, 5, 95, 0, 0, + 313, 315, 7, 2, 0, 0, 314, 313, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, + 314, 1, 0, 0, 0, 316, 317, 1, 0, 0, 0, 317, 319, 1, 0, 0, 0, 318, 312, + 1, 0, 0, 0, 319, 322, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, + 0, 0, 321, 77, 1, 0, 0, 0, 322, 320, 1, 0, 0, 0, 323, 327, 7, 6, 0, 0, + 324, 326, 7, 7, 0, 0, 325, 324, 1, 0, 0, 0, 326, 329, 1, 0, 0, 0, 327, + 325, 1, 0, 0, 0, 327, 328, 1, 0, 0, 0, 328, 336, 1, 0, 0, 0, 329, 327, + 1, 0, 0, 0, 330, 332, 5, 47, 0, 0, 331, 333, 7, 2, 0, 0, 332, 331, 1, 0, + 0, 0, 333, 334, 1, 0, 0, 0, 334, 332, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, + 335, 337, 1, 0, 0, 0, 336, 330, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, + 79, 1, 0, 0, 0, 338, 339, 5, 64, 0, 0, 339, 340, 1, 0, 0, 0, 340, 341, + 6, 39, 2, 0, 341, 81, 1, 0, 0, 0, 342, 343, 5, 58, 0, 0, 343, 344, 1, 0, + 0, 0, 344, 345, 6, 40, 2, 0, 345, 83, 1, 0, 0, 0, 346, 348, 5, 36, 0, 0, + 347, 349, 7, 5, 0, 0, 348, 347, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, + 348, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 355, 1, 0, 0, 0, 352, 354, + 7, 8, 0, 0, 353, 352, 1, 0, 0, 0, 354, 357, 1, 0, 0, 0, 355, 353, 1, 0, + 0, 0, 355, 356, 1, 0, 0, 0, 356, 85, 1, 0, 0, 0, 357, 355, 1, 0, 0, 0, + 358, 360, 7, 9, 0, 0, 359, 358, 1, 0, 0, 0, 360, 361, 1, 0, 0, 0, 361, + 359, 1, 0, 0, 0, 361, 362, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 364, + 6, 42, 3, 0, 364, 87, 1, 0, 0, 0, 365, 366, 3, 84, 41, 0, 366, 367, 1, + 0, 0, 0, 367, 368, 6, 43, 3, 0, 368, 89, 1, 0, 0, 0, 369, 370, 3, 84, 41, + 0, 370, 91, 1, 0, 0, 0, 23, 0, 1, 95, 102, 109, 111, 125, 273, 279, 281, + 289, 291, 299, 304, 310, 316, 320, 327, 334, 336, 350, 355, 361, 4, 6, + 0, 0, 0, 1, 0, 5, 1, 0, 4, 0, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -300,16 +308,18 @@ const ( LexerMINUS = 30 LexerDIV = 31 LexerRESTRICT = 32 - LexerPERCENTAGE_PORTION_LITERAL = 33 - LexerSTRING = 34 - LexerIDENTIFIER = 35 - LexerNUMBER = 36 - LexerASSET = 37 - LexerACCOUNT_START = 38 - LexerCOLON = 39 - LexerACCOUNT_TEXT = 40 - LexerVARIABLE_NAME_ACC = 41 - LexerVARIABLE_NAME = 42 + LexerWITH = 33 + LexerSCALING = 34 + LexerPERCENTAGE_PORTION_LITERAL = 35 + LexerSTRING = 36 + LexerIDENTIFIER = 37 + LexerNUMBER = 38 + LexerASSET = 39 + LexerACCOUNT_START = 40 + LexerCOLON = 41 + LexerACCOUNT_TEXT = 42 + LexerVARIABLE_NAME_ACC = 43 + LexerVARIABLE_NAME = 44 ) // LexerACCOUNT_MODE is the Lexer mode. diff --git a/internal/parser/antlrParser/numscript_base_listener.go b/internal/parser/antlrParser/numscript_base_listener.go index 47339927..63d12446 100644 --- a/internal/parser/antlrParser/numscript_base_listener.go +++ b/internal/parser/antlrParser/numscript_base_listener.go @@ -180,6 +180,12 @@ func (s *BaseNumscriptListener) EnterSrcAccountBoundedOverdraft(ctx *SrcAccountB func (s *BaseNumscriptListener) ExitSrcAccountBoundedOverdraft(ctx *SrcAccountBoundedOverdraftContext) { } +// EnterSrcAccountWithScaling is called when production srcAccountWithScaling is entered. +func (s *BaseNumscriptListener) EnterSrcAccountWithScaling(ctx *SrcAccountWithScalingContext) {} + +// ExitSrcAccountWithScaling is called when production srcAccountWithScaling is exited. +func (s *BaseNumscriptListener) ExitSrcAccountWithScaling(ctx *SrcAccountWithScalingContext) {} + // EnterSrcAccount is called when production srcAccount is entered. func (s *BaseNumscriptListener) EnterSrcAccount(ctx *SrcAccountContext) {} diff --git a/internal/parser/antlrParser/numscript_listener.go b/internal/parser/antlrParser/numscript_listener.go index 36a1fc48..d11eb3d0 100644 --- a/internal/parser/antlrParser/numscript_listener.go +++ b/internal/parser/antlrParser/numscript_listener.go @@ -85,6 +85,9 @@ type NumscriptListener interface { // EnterSrcAccountBoundedOverdraft is called when entering the srcAccountBoundedOverdraft production. EnterSrcAccountBoundedOverdraft(c *SrcAccountBoundedOverdraftContext) + // EnterSrcAccountWithScaling is called when entering the srcAccountWithScaling production. + EnterSrcAccountWithScaling(c *SrcAccountWithScalingContext) + // EnterSrcAccount is called when entering the srcAccount production. EnterSrcAccount(c *SrcAccountContext) @@ -220,6 +223,9 @@ type NumscriptListener interface { // ExitSrcAccountBoundedOverdraft is called when exiting the srcAccountBoundedOverdraft production. ExitSrcAccountBoundedOverdraft(c *SrcAccountBoundedOverdraftContext) + // ExitSrcAccountWithScaling is called when exiting the srcAccountWithScaling production. + ExitSrcAccountWithScaling(c *SrcAccountWithScalingContext) + // ExitSrcAccount is called when exiting the srcAccount production. ExitSrcAccount(c *SrcAccountContext) diff --git a/internal/parser/antlrParser/numscript_parser.go b/internal/parser/antlrParser/numscript_parser.go index 68477afd..11b5d3cc 100644 --- a/internal/parser/antlrParser/numscript_parser.go +++ b/internal/parser/antlrParser/numscript_parser.go @@ -35,17 +35,17 @@ func numscriptParserInit() { "", "", "", "", "", "'vars'", "'max'", "'source'", "'destination'", "'send'", "'from'", "'up'", "'to'", "'remaining'", "'allowing'", "'unbounded'", "'overdraft'", "'oneof'", "'kept'", "'save'", "'('", "')'", "'['", "']'", - "'{'", "'}'", "','", "'='", "'*'", "'+'", "'-'", "'/'", "'\\'", "", - "", "", "", "", "'@'", "':'", + "'{'", "'}'", "','", "'='", "'*'", "'+'", "'-'", "'/'", "'\\'", "'with'", + "'scaling'", "", "", "", "", "", "'@'", "':'", } staticData.SymbolicNames = []string{ "", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", "ALLOWING", "UNBOUNDED", "OVERDRAFT", "ONEOF", "KEPT", "SAVE", "LPARENS", "RPARENS", "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", "STAR", "PLUS", - "MINUS", "DIV", "RESTRICT", "PERCENTAGE_PORTION_LITERAL", "STRING", - "IDENTIFIER", "NUMBER", "ASSET", "ACCOUNT_START", "COLON", "ACCOUNT_TEXT", - "VARIABLE_NAME_ACC", "VARIABLE_NAME", + "MINUS", "DIV", "RESTRICT", "WITH", "SCALING", "PERCENTAGE_PORTION_LITERAL", + "STRING", "IDENTIFIER", "NUMBER", "ASSET", "ACCOUNT_START", "COLON", + "ACCOUNT_TEXT", "VARIABLE_NAME_ACC", "VARIABLE_NAME", } staticData.RuleNames = []string{ "monetaryLit", "accountLiteralPart", "valueExpr", "functionCallArgs", @@ -56,7 +56,7 @@ func numscriptParserInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 42, 269, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 44, 276, 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, 1, 0, 1, 0, 1, @@ -71,110 +71,113 @@ func numscriptParserInit() { 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 137, 8, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 144, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 152, 8, 12, 1, 12, 1, 12, 1, 12, - 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 162, 8, 12, 1, 12, 1, 12, 4, - 12, 166, 8, 12, 11, 12, 12, 12, 167, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, - 174, 8, 12, 10, 12, 12, 12, 177, 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 4, - 12, 183, 8, 12, 11, 12, 12, 12, 184, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, - 1, 12, 1, 12, 3, 12, 194, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, - 14, 1, 14, 3, 14, 203, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, - 1, 16, 4, 16, 212, 8, 16, 11, 16, 12, 16, 213, 1, 16, 1, 16, 1, 16, 1, - 16, 5, 16, 220, 8, 16, 10, 16, 12, 16, 223, 9, 16, 1, 16, 1, 16, 1, 16, - 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 232, 8, 16, 10, 16, 12, 16, 235, 9, - 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 241, 8, 16, 1, 17, 1, 17, 1, 17, - 1, 18, 1, 18, 3, 18, 248, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, - 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, - 1, 19, 3, 19, 267, 8, 19, 1, 19, 0, 1, 4, 20, 0, 2, 4, 6, 8, 10, 12, 14, - 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 0, 2, 1, 0, 29, 30, 2, - 0, 16, 16, 35, 35, 290, 0, 40, 1, 0, 0, 0, 2, 47, 1, 0, 0, 0, 4, 72, 1, - 0, 0, 0, 6, 85, 1, 0, 0, 0, 8, 93, 1, 0, 0, 0, 10, 100, 1, 0, 0, 0, 12, - 103, 1, 0, 0, 0, 14, 108, 1, 0, 0, 0, 16, 119, 1, 0, 0, 0, 18, 129, 1, - 0, 0, 0, 20, 136, 1, 0, 0, 0, 22, 138, 1, 0, 0, 0, 24, 193, 1, 0, 0, 0, - 26, 195, 1, 0, 0, 0, 28, 202, 1, 0, 0, 0, 30, 204, 1, 0, 0, 0, 32, 240, - 1, 0, 0, 0, 34, 242, 1, 0, 0, 0, 36, 247, 1, 0, 0, 0, 38, 266, 1, 0, 0, - 0, 40, 41, 5, 22, 0, 0, 41, 42, 3, 4, 2, 0, 42, 43, 3, 4, 2, 0, 43, 44, - 5, 23, 0, 0, 44, 1, 1, 0, 0, 0, 45, 48, 5, 40, 0, 0, 46, 48, 5, 41, 0, - 0, 47, 45, 1, 0, 0, 0, 47, 46, 1, 0, 0, 0, 48, 3, 1, 0, 0, 0, 49, 50, 6, - 2, -1, 0, 50, 73, 5, 42, 0, 0, 51, 73, 5, 37, 0, 0, 52, 73, 5, 34, 0, 0, - 53, 54, 5, 38, 0, 0, 54, 59, 3, 2, 1, 0, 55, 56, 5, 39, 0, 0, 56, 58, 3, - 2, 1, 0, 57, 55, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, - 60, 1, 0, 0, 0, 60, 73, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 73, 5, 36, - 0, 0, 63, 73, 5, 33, 0, 0, 64, 73, 3, 0, 0, 0, 65, 66, 5, 30, 0, 0, 66, - 73, 3, 4, 2, 5, 67, 68, 5, 20, 0, 0, 68, 69, 3, 4, 2, 0, 69, 70, 5, 21, - 0, 0, 70, 73, 1, 0, 0, 0, 71, 73, 3, 8, 4, 0, 72, 49, 1, 0, 0, 0, 72, 51, - 1, 0, 0, 0, 72, 52, 1, 0, 0, 0, 72, 53, 1, 0, 0, 0, 72, 62, 1, 0, 0, 0, - 72, 63, 1, 0, 0, 0, 72, 64, 1, 0, 0, 0, 72, 65, 1, 0, 0, 0, 72, 67, 1, - 0, 0, 0, 72, 71, 1, 0, 0, 0, 73, 82, 1, 0, 0, 0, 74, 75, 10, 4, 0, 0, 75, - 76, 5, 31, 0, 0, 76, 81, 3, 4, 2, 5, 77, 78, 10, 3, 0, 0, 78, 79, 7, 0, - 0, 0, 79, 81, 3, 4, 2, 4, 80, 74, 1, 0, 0, 0, 80, 77, 1, 0, 0, 0, 81, 84, - 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 5, 1, 0, 0, 0, - 84, 82, 1, 0, 0, 0, 85, 90, 3, 4, 2, 0, 86, 87, 5, 26, 0, 0, 87, 89, 3, - 4, 2, 0, 88, 86, 1, 0, 0, 0, 89, 92, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 90, - 91, 1, 0, 0, 0, 91, 7, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 93, 94, 7, 1, 0, - 0, 94, 96, 5, 20, 0, 0, 95, 97, 3, 6, 3, 0, 96, 95, 1, 0, 0, 0, 96, 97, - 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 99, 5, 21, 0, 0, 99, 9, 1, 0, 0, 0, - 100, 101, 5, 27, 0, 0, 101, 102, 3, 4, 2, 0, 102, 11, 1, 0, 0, 0, 103, - 104, 5, 35, 0, 0, 104, 106, 5, 42, 0, 0, 105, 107, 3, 10, 5, 0, 106, 105, - 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 13, 1, 0, 0, 0, 108, 109, 5, 5, - 0, 0, 109, 113, 5, 24, 0, 0, 110, 112, 3, 12, 6, 0, 111, 110, 1, 0, 0, - 0, 112, 115, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 113, 114, 1, 0, 0, 0, 114, - 116, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 116, 117, 5, 25, 0, 0, 117, 15, - 1, 0, 0, 0, 118, 120, 3, 14, 7, 0, 119, 118, 1, 0, 0, 0, 119, 120, 1, 0, - 0, 0, 120, 124, 1, 0, 0, 0, 121, 123, 3, 38, 19, 0, 122, 121, 1, 0, 0, - 0, 123, 126, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, - 127, 1, 0, 0, 0, 126, 124, 1, 0, 0, 0, 127, 128, 5, 0, 0, 1, 128, 17, 1, - 0, 0, 0, 129, 130, 5, 22, 0, 0, 130, 131, 3, 4, 2, 0, 131, 132, 5, 28, - 0, 0, 132, 133, 5, 23, 0, 0, 133, 19, 1, 0, 0, 0, 134, 137, 3, 4, 2, 0, - 135, 137, 5, 13, 0, 0, 136, 134, 1, 0, 0, 0, 136, 135, 1, 0, 0, 0, 137, - 21, 1, 0, 0, 0, 138, 139, 5, 32, 0, 0, 139, 140, 3, 4, 2, 0, 140, 23, 1, - 0, 0, 0, 141, 143, 3, 4, 2, 0, 142, 144, 3, 22, 11, 0, 143, 142, 1, 0, - 0, 0, 143, 144, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, 146, 5, 14, 0, 0, - 146, 147, 5, 15, 0, 0, 147, 148, 5, 16, 0, 0, 148, 194, 1, 0, 0, 0, 149, - 151, 3, 4, 2, 0, 150, 152, 3, 22, 11, 0, 151, 150, 1, 0, 0, 0, 151, 152, - 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 154, 5, 14, 0, 0, 154, 155, 5, 16, - 0, 0, 155, 156, 5, 11, 0, 0, 156, 157, 5, 12, 0, 0, 157, 158, 3, 4, 2, - 0, 158, 194, 1, 0, 0, 0, 159, 161, 3, 4, 2, 0, 160, 162, 3, 22, 11, 0, - 161, 160, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 194, 1, 0, 0, 0, 163, - 165, 5, 24, 0, 0, 164, 166, 3, 26, 13, 0, 165, 164, 1, 0, 0, 0, 166, 167, - 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 167, 168, 1, 0, 0, 0, 168, 169, 1, 0, - 0, 0, 169, 170, 5, 25, 0, 0, 170, 194, 1, 0, 0, 0, 171, 175, 5, 24, 0, - 0, 172, 174, 3, 24, 12, 0, 173, 172, 1, 0, 0, 0, 174, 177, 1, 0, 0, 0, - 175, 173, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 178, 1, 0, 0, 0, 177, - 175, 1, 0, 0, 0, 178, 194, 5, 25, 0, 0, 179, 180, 5, 17, 0, 0, 180, 182, - 5, 24, 0, 0, 181, 183, 3, 24, 12, 0, 182, 181, 1, 0, 0, 0, 183, 184, 1, - 0, 0, 0, 184, 182, 1, 0, 0, 0, 184, 185, 1, 0, 0, 0, 185, 186, 1, 0, 0, - 0, 186, 187, 5, 25, 0, 0, 187, 194, 1, 0, 0, 0, 188, 189, 5, 6, 0, 0, 189, - 190, 3, 4, 2, 0, 190, 191, 5, 10, 0, 0, 191, 192, 3, 24, 12, 0, 192, 194, - 1, 0, 0, 0, 193, 141, 1, 0, 0, 0, 193, 149, 1, 0, 0, 0, 193, 159, 1, 0, - 0, 0, 193, 163, 1, 0, 0, 0, 193, 171, 1, 0, 0, 0, 193, 179, 1, 0, 0, 0, - 193, 188, 1, 0, 0, 0, 194, 25, 1, 0, 0, 0, 195, 196, 3, 20, 10, 0, 196, - 197, 5, 10, 0, 0, 197, 198, 3, 24, 12, 0, 198, 27, 1, 0, 0, 0, 199, 200, - 5, 12, 0, 0, 200, 203, 3, 32, 16, 0, 201, 203, 5, 18, 0, 0, 202, 199, 1, - 0, 0, 0, 202, 201, 1, 0, 0, 0, 203, 29, 1, 0, 0, 0, 204, 205, 5, 6, 0, - 0, 205, 206, 3, 4, 2, 0, 206, 207, 3, 28, 14, 0, 207, 31, 1, 0, 0, 0, 208, - 241, 3, 4, 2, 0, 209, 211, 5, 24, 0, 0, 210, 212, 3, 34, 17, 0, 211, 210, - 1, 0, 0, 0, 212, 213, 1, 0, 0, 0, 213, 211, 1, 0, 0, 0, 213, 214, 1, 0, - 0, 0, 214, 215, 1, 0, 0, 0, 215, 216, 5, 25, 0, 0, 216, 241, 1, 0, 0, 0, - 217, 221, 5, 24, 0, 0, 218, 220, 3, 30, 15, 0, 219, 218, 1, 0, 0, 0, 220, - 223, 1, 0, 0, 0, 221, 219, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 224, - 1, 0, 0, 0, 223, 221, 1, 0, 0, 0, 224, 225, 5, 13, 0, 0, 225, 226, 3, 28, - 14, 0, 226, 227, 5, 25, 0, 0, 227, 241, 1, 0, 0, 0, 228, 229, 5, 17, 0, - 0, 229, 233, 5, 24, 0, 0, 230, 232, 3, 30, 15, 0, 231, 230, 1, 0, 0, 0, - 232, 235, 1, 0, 0, 0, 233, 231, 1, 0, 0, 0, 233, 234, 1, 0, 0, 0, 234, - 236, 1, 0, 0, 0, 235, 233, 1, 0, 0, 0, 236, 237, 5, 13, 0, 0, 237, 238, - 3, 28, 14, 0, 238, 239, 5, 25, 0, 0, 239, 241, 1, 0, 0, 0, 240, 208, 1, - 0, 0, 0, 240, 209, 1, 0, 0, 0, 240, 217, 1, 0, 0, 0, 240, 228, 1, 0, 0, - 0, 241, 33, 1, 0, 0, 0, 242, 243, 3, 20, 10, 0, 243, 244, 3, 28, 14, 0, - 244, 35, 1, 0, 0, 0, 245, 248, 3, 4, 2, 0, 246, 248, 3, 18, 9, 0, 247, - 245, 1, 0, 0, 0, 247, 246, 1, 0, 0, 0, 248, 37, 1, 0, 0, 0, 249, 250, 5, - 9, 0, 0, 250, 251, 3, 36, 18, 0, 251, 252, 5, 20, 0, 0, 252, 253, 5, 7, - 0, 0, 253, 254, 5, 27, 0, 0, 254, 255, 3, 24, 12, 0, 255, 256, 5, 8, 0, - 0, 256, 257, 5, 27, 0, 0, 257, 258, 3, 32, 16, 0, 258, 259, 5, 21, 0, 0, - 259, 267, 1, 0, 0, 0, 260, 261, 5, 19, 0, 0, 261, 262, 3, 36, 18, 0, 262, - 263, 5, 10, 0, 0, 263, 264, 3, 4, 2, 0, 264, 267, 1, 0, 0, 0, 265, 267, - 3, 8, 4, 0, 266, 249, 1, 0, 0, 0, 266, 260, 1, 0, 0, 0, 266, 265, 1, 0, - 0, 0, 267, 39, 1, 0, 0, 0, 26, 47, 59, 72, 80, 82, 90, 96, 106, 113, 119, - 124, 136, 143, 151, 161, 167, 175, 184, 193, 202, 213, 221, 233, 240, 247, - 266, + 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 162, 8, 12, 1, 12, 1, 12, 1, + 12, 1, 12, 1, 12, 3, 12, 169, 8, 12, 1, 12, 1, 12, 4, 12, 173, 8, 12, 11, + 12, 12, 12, 174, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 181, 8, 12, 10, 12, + 12, 12, 184, 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 4, 12, 190, 8, 12, 11, + 12, 12, 12, 191, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, + 201, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 3, 14, 210, + 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 4, 16, 219, 8, + 16, 11, 16, 12, 16, 220, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 227, 8, 16, + 10, 16, 12, 16, 230, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, + 16, 5, 16, 239, 8, 16, 10, 16, 12, 16, 242, 9, 16, 1, 16, 1, 16, 1, 16, + 1, 16, 3, 16, 248, 8, 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, 18, 255, + 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, + 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 274, 8, 19, + 1, 19, 0, 1, 4, 20, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, + 28, 30, 32, 34, 36, 38, 0, 2, 1, 0, 29, 30, 2, 0, 16, 16, 37, 37, 299, + 0, 40, 1, 0, 0, 0, 2, 47, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 85, 1, 0, 0, + 0, 8, 93, 1, 0, 0, 0, 10, 100, 1, 0, 0, 0, 12, 103, 1, 0, 0, 0, 14, 108, + 1, 0, 0, 0, 16, 119, 1, 0, 0, 0, 18, 129, 1, 0, 0, 0, 20, 136, 1, 0, 0, + 0, 22, 138, 1, 0, 0, 0, 24, 200, 1, 0, 0, 0, 26, 202, 1, 0, 0, 0, 28, 209, + 1, 0, 0, 0, 30, 211, 1, 0, 0, 0, 32, 247, 1, 0, 0, 0, 34, 249, 1, 0, 0, + 0, 36, 254, 1, 0, 0, 0, 38, 273, 1, 0, 0, 0, 40, 41, 5, 22, 0, 0, 41, 42, + 3, 4, 2, 0, 42, 43, 3, 4, 2, 0, 43, 44, 5, 23, 0, 0, 44, 1, 1, 0, 0, 0, + 45, 48, 5, 42, 0, 0, 46, 48, 5, 43, 0, 0, 47, 45, 1, 0, 0, 0, 47, 46, 1, + 0, 0, 0, 48, 3, 1, 0, 0, 0, 49, 50, 6, 2, -1, 0, 50, 73, 5, 44, 0, 0, 51, + 73, 5, 39, 0, 0, 52, 73, 5, 36, 0, 0, 53, 54, 5, 40, 0, 0, 54, 59, 3, 2, + 1, 0, 55, 56, 5, 41, 0, 0, 56, 58, 3, 2, 1, 0, 57, 55, 1, 0, 0, 0, 58, + 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 73, 1, 0, 0, + 0, 61, 59, 1, 0, 0, 0, 62, 73, 5, 38, 0, 0, 63, 73, 5, 35, 0, 0, 64, 73, + 3, 0, 0, 0, 65, 66, 5, 30, 0, 0, 66, 73, 3, 4, 2, 5, 67, 68, 5, 20, 0, + 0, 68, 69, 3, 4, 2, 0, 69, 70, 5, 21, 0, 0, 70, 73, 1, 0, 0, 0, 71, 73, + 3, 8, 4, 0, 72, 49, 1, 0, 0, 0, 72, 51, 1, 0, 0, 0, 72, 52, 1, 0, 0, 0, + 72, 53, 1, 0, 0, 0, 72, 62, 1, 0, 0, 0, 72, 63, 1, 0, 0, 0, 72, 64, 1, + 0, 0, 0, 72, 65, 1, 0, 0, 0, 72, 67, 1, 0, 0, 0, 72, 71, 1, 0, 0, 0, 73, + 82, 1, 0, 0, 0, 74, 75, 10, 4, 0, 0, 75, 76, 5, 31, 0, 0, 76, 81, 3, 4, + 2, 5, 77, 78, 10, 3, 0, 0, 78, 79, 7, 0, 0, 0, 79, 81, 3, 4, 2, 4, 80, + 74, 1, 0, 0, 0, 80, 77, 1, 0, 0, 0, 81, 84, 1, 0, 0, 0, 82, 80, 1, 0, 0, + 0, 82, 83, 1, 0, 0, 0, 83, 5, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 85, 90, 3, + 4, 2, 0, 86, 87, 5, 26, 0, 0, 87, 89, 3, 4, 2, 0, 88, 86, 1, 0, 0, 0, 89, + 92, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 7, 1, 0, 0, + 0, 92, 90, 1, 0, 0, 0, 93, 94, 7, 1, 0, 0, 94, 96, 5, 20, 0, 0, 95, 97, + 3, 6, 3, 0, 96, 95, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, + 98, 99, 5, 21, 0, 0, 99, 9, 1, 0, 0, 0, 100, 101, 5, 27, 0, 0, 101, 102, + 3, 4, 2, 0, 102, 11, 1, 0, 0, 0, 103, 104, 5, 37, 0, 0, 104, 106, 5, 44, + 0, 0, 105, 107, 3, 10, 5, 0, 106, 105, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, + 107, 13, 1, 0, 0, 0, 108, 109, 5, 5, 0, 0, 109, 113, 5, 24, 0, 0, 110, + 112, 3, 12, 6, 0, 111, 110, 1, 0, 0, 0, 112, 115, 1, 0, 0, 0, 113, 111, + 1, 0, 0, 0, 113, 114, 1, 0, 0, 0, 114, 116, 1, 0, 0, 0, 115, 113, 1, 0, + 0, 0, 116, 117, 5, 25, 0, 0, 117, 15, 1, 0, 0, 0, 118, 120, 3, 14, 7, 0, + 119, 118, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 124, 1, 0, 0, 0, 121, + 123, 3, 38, 19, 0, 122, 121, 1, 0, 0, 0, 123, 126, 1, 0, 0, 0, 124, 122, + 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 127, 1, 0, 0, 0, 126, 124, 1, 0, + 0, 0, 127, 128, 5, 0, 0, 1, 128, 17, 1, 0, 0, 0, 129, 130, 5, 22, 0, 0, + 130, 131, 3, 4, 2, 0, 131, 132, 5, 28, 0, 0, 132, 133, 5, 23, 0, 0, 133, + 19, 1, 0, 0, 0, 134, 137, 3, 4, 2, 0, 135, 137, 5, 13, 0, 0, 136, 134, + 1, 0, 0, 0, 136, 135, 1, 0, 0, 0, 137, 21, 1, 0, 0, 0, 138, 139, 5, 32, + 0, 0, 139, 140, 3, 4, 2, 0, 140, 23, 1, 0, 0, 0, 141, 143, 3, 4, 2, 0, + 142, 144, 3, 22, 11, 0, 143, 142, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, + 145, 1, 0, 0, 0, 145, 146, 5, 14, 0, 0, 146, 147, 5, 15, 0, 0, 147, 148, + 5, 16, 0, 0, 148, 201, 1, 0, 0, 0, 149, 151, 3, 4, 2, 0, 150, 152, 3, 22, + 11, 0, 151, 150, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, + 153, 154, 5, 14, 0, 0, 154, 155, 5, 16, 0, 0, 155, 156, 5, 11, 0, 0, 156, + 157, 5, 12, 0, 0, 157, 158, 3, 4, 2, 0, 158, 201, 1, 0, 0, 0, 159, 161, + 3, 4, 2, 0, 160, 162, 3, 22, 11, 0, 161, 160, 1, 0, 0, 0, 161, 162, 1, + 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 164, 5, 33, 0, 0, 164, 165, 5, 34, + 0, 0, 165, 201, 1, 0, 0, 0, 166, 168, 3, 4, 2, 0, 167, 169, 3, 22, 11, + 0, 168, 167, 1, 0, 0, 0, 168, 169, 1, 0, 0, 0, 169, 201, 1, 0, 0, 0, 170, + 172, 5, 24, 0, 0, 171, 173, 3, 26, 13, 0, 172, 171, 1, 0, 0, 0, 173, 174, + 1, 0, 0, 0, 174, 172, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 176, 1, 0, + 0, 0, 176, 177, 5, 25, 0, 0, 177, 201, 1, 0, 0, 0, 178, 182, 5, 24, 0, + 0, 179, 181, 3, 24, 12, 0, 180, 179, 1, 0, 0, 0, 181, 184, 1, 0, 0, 0, + 182, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 185, 1, 0, 0, 0, 184, + 182, 1, 0, 0, 0, 185, 201, 5, 25, 0, 0, 186, 187, 5, 17, 0, 0, 187, 189, + 5, 24, 0, 0, 188, 190, 3, 24, 12, 0, 189, 188, 1, 0, 0, 0, 190, 191, 1, + 0, 0, 0, 191, 189, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 1, 0, 0, + 0, 193, 194, 5, 25, 0, 0, 194, 201, 1, 0, 0, 0, 195, 196, 5, 6, 0, 0, 196, + 197, 3, 4, 2, 0, 197, 198, 5, 10, 0, 0, 198, 199, 3, 24, 12, 0, 199, 201, + 1, 0, 0, 0, 200, 141, 1, 0, 0, 0, 200, 149, 1, 0, 0, 0, 200, 159, 1, 0, + 0, 0, 200, 166, 1, 0, 0, 0, 200, 170, 1, 0, 0, 0, 200, 178, 1, 0, 0, 0, + 200, 186, 1, 0, 0, 0, 200, 195, 1, 0, 0, 0, 201, 25, 1, 0, 0, 0, 202, 203, + 3, 20, 10, 0, 203, 204, 5, 10, 0, 0, 204, 205, 3, 24, 12, 0, 205, 27, 1, + 0, 0, 0, 206, 207, 5, 12, 0, 0, 207, 210, 3, 32, 16, 0, 208, 210, 5, 18, + 0, 0, 209, 206, 1, 0, 0, 0, 209, 208, 1, 0, 0, 0, 210, 29, 1, 0, 0, 0, + 211, 212, 5, 6, 0, 0, 212, 213, 3, 4, 2, 0, 213, 214, 3, 28, 14, 0, 214, + 31, 1, 0, 0, 0, 215, 248, 3, 4, 2, 0, 216, 218, 5, 24, 0, 0, 217, 219, + 3, 34, 17, 0, 218, 217, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 218, 1, + 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 223, 5, 25, 0, + 0, 223, 248, 1, 0, 0, 0, 224, 228, 5, 24, 0, 0, 225, 227, 3, 30, 15, 0, + 226, 225, 1, 0, 0, 0, 227, 230, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 228, + 229, 1, 0, 0, 0, 229, 231, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 231, 232, + 5, 13, 0, 0, 232, 233, 3, 28, 14, 0, 233, 234, 5, 25, 0, 0, 234, 248, 1, + 0, 0, 0, 235, 236, 5, 17, 0, 0, 236, 240, 5, 24, 0, 0, 237, 239, 3, 30, + 15, 0, 238, 237, 1, 0, 0, 0, 239, 242, 1, 0, 0, 0, 240, 238, 1, 0, 0, 0, + 240, 241, 1, 0, 0, 0, 241, 243, 1, 0, 0, 0, 242, 240, 1, 0, 0, 0, 243, + 244, 5, 13, 0, 0, 244, 245, 3, 28, 14, 0, 245, 246, 5, 25, 0, 0, 246, 248, + 1, 0, 0, 0, 247, 215, 1, 0, 0, 0, 247, 216, 1, 0, 0, 0, 247, 224, 1, 0, + 0, 0, 247, 235, 1, 0, 0, 0, 248, 33, 1, 0, 0, 0, 249, 250, 3, 20, 10, 0, + 250, 251, 3, 28, 14, 0, 251, 35, 1, 0, 0, 0, 252, 255, 3, 4, 2, 0, 253, + 255, 3, 18, 9, 0, 254, 252, 1, 0, 0, 0, 254, 253, 1, 0, 0, 0, 255, 37, + 1, 0, 0, 0, 256, 257, 5, 9, 0, 0, 257, 258, 3, 36, 18, 0, 258, 259, 5, + 20, 0, 0, 259, 260, 5, 7, 0, 0, 260, 261, 5, 27, 0, 0, 261, 262, 3, 24, + 12, 0, 262, 263, 5, 8, 0, 0, 263, 264, 5, 27, 0, 0, 264, 265, 3, 32, 16, + 0, 265, 266, 5, 21, 0, 0, 266, 274, 1, 0, 0, 0, 267, 268, 5, 19, 0, 0, + 268, 269, 3, 36, 18, 0, 269, 270, 5, 10, 0, 0, 270, 271, 3, 4, 2, 0, 271, + 274, 1, 0, 0, 0, 272, 274, 3, 8, 4, 0, 273, 256, 1, 0, 0, 0, 273, 267, + 1, 0, 0, 0, 273, 272, 1, 0, 0, 0, 274, 39, 1, 0, 0, 0, 27, 47, 59, 72, + 80, 82, 90, 96, 106, 113, 119, 124, 136, 143, 151, 161, 168, 174, 182, + 191, 200, 209, 220, 228, 240, 247, 254, 273, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -245,16 +248,18 @@ const ( NumscriptParserMINUS = 30 NumscriptParserDIV = 31 NumscriptParserRESTRICT = 32 - NumscriptParserPERCENTAGE_PORTION_LITERAL = 33 - NumscriptParserSTRING = 34 - NumscriptParserIDENTIFIER = 35 - NumscriptParserNUMBER = 36 - NumscriptParserASSET = 37 - NumscriptParserACCOUNT_START = 38 - NumscriptParserCOLON = 39 - NumscriptParserACCOUNT_TEXT = 40 - NumscriptParserVARIABLE_NAME_ACC = 41 - NumscriptParserVARIABLE_NAME = 42 + NumscriptParserWITH = 33 + NumscriptParserSCALING = 34 + NumscriptParserPERCENTAGE_PORTION_LITERAL = 35 + NumscriptParserSTRING = 36 + NumscriptParserIDENTIFIER = 37 + NumscriptParserNUMBER = 38 + NumscriptParserASSET = 39 + NumscriptParserACCOUNT_START = 40 + NumscriptParserCOLON = 41 + NumscriptParserACCOUNT_TEXT = 42 + NumscriptParserVARIABLE_NAME_ACC = 43 + NumscriptParserVARIABLE_NAME = 44 ) // NumscriptParser rules. @@ -1903,7 +1908,7 @@ func (p *NumscriptParser) FunctionCall() (localctx IFunctionCallContext) { } _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&4940291440640) != 0 { + if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&19757928611840) != 0 { { p.SetState(95) p.FunctionCallArgs() @@ -2563,7 +2568,7 @@ func (p *NumscriptParser) Program() (localctx IProgramContext) { } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&34360328704) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&137439543808) != 0 { { p.SetState(121) p.Statement() @@ -3385,6 +3390,81 @@ func (s *SrcAccountUnboundedOverdraftContext) ExitRule(listener antlr.ParseTreeL } } +type SrcAccountWithScalingContext struct { + SourceContext + address IValueExprContext +} + +func NewSrcAccountWithScalingContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SrcAccountWithScalingContext { + var p = new(SrcAccountWithScalingContext) + + InitEmptySourceContext(&p.SourceContext) + p.parser = parser + p.CopyAll(ctx.(*SourceContext)) + + return p +} + +func (s *SrcAccountWithScalingContext) GetAddress() IValueExprContext { return s.address } + +func (s *SrcAccountWithScalingContext) SetAddress(v IValueExprContext) { s.address = v } + +func (s *SrcAccountWithScalingContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SrcAccountWithScalingContext) WITH() antlr.TerminalNode { + return s.GetToken(NumscriptParserWITH, 0) +} + +func (s *SrcAccountWithScalingContext) SCALING() antlr.TerminalNode { + return s.GetToken(NumscriptParserSCALING, 0) +} + +func (s *SrcAccountWithScalingContext) ValueExpr() IValueExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IValueExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IValueExprContext) +} + +func (s *SrcAccountWithScalingContext) ColorConstraint() IColorConstraintContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IColorConstraintContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IColorConstraintContext) +} + +func (s *SrcAccountWithScalingContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.EnterSrcAccountWithScaling(s) + } +} + +func (s *SrcAccountWithScalingContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(NumscriptListener); ok { + listenerT.ExitSrcAccountWithScaling(s) + } +} + type SrcAllotmentContext struct { SourceContext } @@ -3685,13 +3765,13 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { p.EnterRule(localctx, 24, NumscriptParserRULE_source) var _la int - p.SetState(193) + p.SetState(200) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) { case 1: localctx = NewSrcAccountUnboundedOverdraftContext(p, localctx) p.EnterOuterAlt(localctx, 1) @@ -3806,11 +3886,14 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } case 3: - localctx = NewSrcAccountContext(p, localctx) + localctx = NewSrcAccountWithScalingContext(p, localctx) p.EnterOuterAlt(localctx, 3) { p.SetState(159) - p.valueExpr(0) + + var _x = p.valueExpr(0) + + localctx.(*SrcAccountWithScalingContext).address = _x } p.SetState(161) p.GetErrorHandler().Sync(p) @@ -3826,32 +3909,70 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } + { + p.SetState(163) + p.Match(NumscriptParserWITH) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(164) + p.Match(NumscriptParserSCALING) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } case 4: - localctx = NewSrcAllotmentContext(p, localctx) + localctx = NewSrcAccountContext(p, localctx) p.EnterOuterAlt(localctx, 4) { - p.SetState(163) + p.SetState(166) + p.valueExpr(0) + } + p.SetState(168) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == NumscriptParserRESTRICT { + { + p.SetState(167) + p.ColorConstraint() + } + + } + + case 5: + localctx = NewSrcAllotmentContext(p, localctx) + p.EnterOuterAlt(localctx, 5) + { + p.SetState(170) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(165) + p.SetState(172) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&4940291448832) != 0) { + for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&19757928620032) != 0) { { - p.SetState(164) + p.SetState(171) p.AllotmentClauseSrc() } - p.SetState(167) + p.SetState(174) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3859,7 +3980,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(169) + p.SetState(176) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -3867,31 +3988,31 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } - case 5: + case 6: localctx = NewSrcInorderContext(p, localctx) - p.EnterOuterAlt(localctx, 5) + p.EnterOuterAlt(localctx, 6) { - p.SetState(171) + p.SetState(178) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(175) + p.SetState(182) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&4940308348992) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&19757945520192) != 0 { { - p.SetState(172) + p.SetState(179) p.Source() } - p.SetState(177) + p.SetState(184) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3899,7 +4020,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(178) + p.SetState(185) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -3907,11 +4028,11 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } - case 6: + case 7: localctx = NewSrcOneofContext(p, localctx) - p.EnterOuterAlt(localctx, 6) + p.EnterOuterAlt(localctx, 7) { - p.SetState(179) + p.SetState(186) p.Match(NumscriptParserONEOF) if p.HasError() { // Recognition error - abort rule @@ -3919,27 +4040,27 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(180) + p.SetState(187) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(182) + p.SetState(189) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&4940308348992) != 0) { + for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&19757945520192) != 0) { { - p.SetState(181) + p.SetState(188) p.Source() } - p.SetState(184) + p.SetState(191) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3947,7 +4068,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(186) + p.SetState(193) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -3955,11 +4076,11 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } - case 7: + case 8: localctx = NewSrcCappedContext(p, localctx) - p.EnterOuterAlt(localctx, 7) + p.EnterOuterAlt(localctx, 8) { - p.SetState(188) + p.SetState(195) p.Match(NumscriptParserMAX) if p.HasError() { // Recognition error - abort rule @@ -3967,14 +4088,14 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(189) + p.SetState(196) var _x = p.valueExpr(0) localctx.(*SrcCappedContext).cap_ = _x } { - p.SetState(190) + p.SetState(197) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -3982,7 +4103,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(191) + p.SetState(198) p.Source() } @@ -4112,11 +4233,11 @@ func (p *NumscriptParser) AllotmentClauseSrc() (localctx IAllotmentClauseSrcCont p.EnterRule(localctx, 26, NumscriptParserRULE_allotmentClauseSrc) p.EnterOuterAlt(localctx, 1) { - p.SetState(195) + p.SetState(202) p.Allotment() } { - p.SetState(196) + p.SetState(203) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -4124,7 +4245,7 @@ func (p *NumscriptParser) AllotmentClauseSrc() (localctx IAllotmentClauseSrcCont } } { - p.SetState(197) + p.SetState(204) p.Source() } @@ -4282,7 +4403,7 @@ func (s *DestinationToContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContext) { localctx = NewKeptOrDestinationContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 28, NumscriptParserRULE_keptOrDestination) - p.SetState(202) + p.SetState(209) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4293,7 +4414,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex localctx = NewDestinationToContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(199) + p.SetState(206) p.Match(NumscriptParserTO) if p.HasError() { // Recognition error - abort rule @@ -4301,7 +4422,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex } } { - p.SetState(200) + p.SetState(207) p.Destination() } @@ -4309,7 +4430,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex localctx = NewDestinationKeptContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(201) + p.SetState(208) p.Match(NumscriptParserKEPT) if p.HasError() { // Recognition error - abort rule @@ -4444,7 +4565,7 @@ func (p *NumscriptParser) DestinationInOrderClause() (localctx IDestinationInOrd p.EnterRule(localctx, 30, NumscriptParserRULE_destinationInOrderClause) p.EnterOuterAlt(localctx, 1) { - p.SetState(204) + p.SetState(211) p.Match(NumscriptParserMAX) if p.HasError() { // Recognition error - abort rule @@ -4452,11 +4573,11 @@ func (p *NumscriptParser) DestinationInOrderClause() (localctx IDestinationInOrd } } { - p.SetState(205) + p.SetState(212) p.valueExpr(0) } { - p.SetState(206) + p.SetState(213) p.KeptOrDestination() } @@ -4859,18 +4980,18 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { p.EnterRule(localctx, 32, NumscriptParserRULE_destination) var _la int - p.SetState(240) + p.SetState(247) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 23, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 24, p.GetParserRuleContext()) { case 1: localctx = NewDestAccountContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(208) + p.SetState(215) p.valueExpr(0) } @@ -4878,27 +4999,27 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { localctx = NewDestAllotmentContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(209) + p.SetState(216) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(211) + p.SetState(218) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&4940291448832) != 0) { + for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&19757928620032) != 0) { { - p.SetState(210) + p.SetState(217) p.AllotmentClauseDest() } - p.SetState(213) + p.SetState(220) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4906,7 +5027,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(215) + p.SetState(222) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4918,14 +5039,14 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { localctx = NewDestInorderContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(217) + p.SetState(224) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(221) + p.SetState(228) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4934,11 +5055,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { for _la == NumscriptParserMAX { { - p.SetState(218) + p.SetState(225) p.DestinationInOrderClause() } - p.SetState(223) + p.SetState(230) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4946,7 +5067,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(224) + p.SetState(231) p.Match(NumscriptParserREMAINING) if p.HasError() { // Recognition error - abort rule @@ -4954,11 +5075,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { } } { - p.SetState(225) + p.SetState(232) p.KeptOrDestination() } { - p.SetState(226) + p.SetState(233) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4970,7 +5091,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { localctx = NewDestOneofContext(p, localctx) p.EnterOuterAlt(localctx, 4) { - p.SetState(228) + p.SetState(235) p.Match(NumscriptParserONEOF) if p.HasError() { // Recognition error - abort rule @@ -4978,14 +5099,14 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { } } { - p.SetState(229) + p.SetState(236) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(233) + p.SetState(240) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4994,11 +5115,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { for _la == NumscriptParserMAX { { - p.SetState(230) + p.SetState(237) p.DestinationInOrderClause() } - p.SetState(235) + p.SetState(242) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5006,7 +5127,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(236) + p.SetState(243) p.Match(NumscriptParserREMAINING) if p.HasError() { // Recognition error - abort rule @@ -5014,11 +5135,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { } } { - p.SetState(237) + p.SetState(244) p.KeptOrDestination() } { - p.SetState(238) + p.SetState(245) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -5147,11 +5268,11 @@ func (p *NumscriptParser) AllotmentClauseDest() (localctx IAllotmentClauseDestCo p.EnterRule(localctx, 34, NumscriptParserRULE_allotmentClauseDest) p.EnterOuterAlt(localctx, 1) { - p.SetState(242) + p.SetState(249) p.Allotment() } { - p.SetState(243) + p.SetState(250) p.KeptOrDestination() } @@ -5317,18 +5438,18 @@ func (s *SentLiteralContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentValueContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 36, NumscriptParserRULE_sentValue) - p.SetState(247) + p.SetState(254) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 24, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 25, p.GetParserRuleContext()) { case 1: localctx = NewSentLiteralContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(245) + p.SetState(252) p.valueExpr(0) } @@ -5336,7 +5457,7 @@ func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentAllContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(246) + p.SetState(253) p.SentAllLit() } @@ -5636,7 +5757,7 @@ func (s *FnCallStatementContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewStatementContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 38, NumscriptParserRULE_statement) - p.SetState(266) + p.SetState(273) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5647,7 +5768,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewSendStatementContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(249) + p.SetState(256) p.Match(NumscriptParserSEND) if p.HasError() { // Recognition error - abort rule @@ -5655,11 +5776,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(250) + p.SetState(257) p.SentValue() } { - p.SetState(251) + p.SetState(258) p.Match(NumscriptParserLPARENS) if p.HasError() { // Recognition error - abort rule @@ -5667,7 +5788,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(252) + p.SetState(259) p.Match(NumscriptParserSOURCE) if p.HasError() { // Recognition error - abort rule @@ -5675,7 +5796,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(253) + p.SetState(260) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -5683,11 +5804,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(254) + p.SetState(261) p.Source() } { - p.SetState(255) + p.SetState(262) p.Match(NumscriptParserDESTINATION) if p.HasError() { // Recognition error - abort rule @@ -5695,7 +5816,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(256) + p.SetState(263) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -5703,11 +5824,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(257) + p.SetState(264) p.Destination() } { - p.SetState(258) + p.SetState(265) p.Match(NumscriptParserRPARENS) if p.HasError() { // Recognition error - abort rule @@ -5719,7 +5840,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewSaveStatementContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(260) + p.SetState(267) p.Match(NumscriptParserSAVE) if p.HasError() { // Recognition error - abort rule @@ -5727,11 +5848,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(261) + p.SetState(268) p.SentValue() } { - p.SetState(262) + p.SetState(269) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -5739,7 +5860,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(263) + p.SetState(270) p.valueExpr(0) } @@ -5747,7 +5868,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewFnCallStatementContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(265) + p.SetState(272) p.FunctionCall() } diff --git a/internal/parser/ast.go b/internal/parser/ast.go index 8ce0911c..52002ff5 100644 --- a/internal/parser/ast.go +++ b/internal/parser/ast.go @@ -137,12 +137,13 @@ type Source interface { GetRange() Range } -func (*SourceInorder) source() {} -func (*SourceOneof) source() {} -func (*SourceAllotment) source() {} -func (*SourceAccount) source() {} -func (*SourceCapped) source() {} -func (*SourceOverdraft) source() {} +func (*SourceInorder) source() {} +func (*SourceOneof) source() {} +func (*SourceAllotment) source() {} +func (*SourceAccount) source() {} +func (*SourceCapped) source() {} +func (*SourceOverdraft) source() {} +func (*SourceWithScaling) source() {} type ( SourceAccount struct { @@ -183,6 +184,12 @@ type ( Address ValueExpr Bounded *ValueExpr } + + SourceWithScaling struct { + Range + Color ValueExpr + Address ValueExpr + } ) type AllotmentValue interface{ allotmentValue() } diff --git a/internal/parser/parser.go b/internal/parser/parser.go index 0b165004..2bc90396 100644 --- a/internal/parser/parser.go +++ b/internal/parser/parser.go @@ -237,6 +237,13 @@ func parseSource(sourceCtx antlrParser.ISourceContext) Source { Address: parseValueExpr(sourceCtx.GetAddress()), } + case *antlrParser.SrcAccountWithScalingContext: + return &SourceWithScaling{ + Range: ctxToRange(sourceCtx), + Color: parseColorConstraint(sourceCtx.ColorConstraint()), + Address: parseValueExpr(sourceCtx.GetAddress()), + } + case *antlrParser.SrcAccountBoundedOverdraftContext: varMon := parseValueExpr(sourceCtx.GetMaxOvedraft()) diff --git a/internal/parser/parser_test.go b/internal/parser/parser_test.go index 3b70400e..7736cc23 100644 --- a/internal/parser/parser_test.go +++ b/internal/parser/parser_test.go @@ -501,3 +501,12 @@ func TestColorRestrictionUnboundedOverdraft(t *testing.T) { snaps.MatchSnapshot(t, p.Value) assert.Empty(t, p.Errors) } + +func TestScalingSyntax(t *testing.T) { + p := parser.Parse(`send $sent ( + source = @src with scaling + destination = @dest +)`) + snaps.MatchSnapshot(t, p.Value) + assert.Empty(t, p.Errors) +} From 5d9225136887164cc54d41e615fc06b59d0e0f37 Mon Sep 17 00:00:00 2001 From: ascandone Date: Wed, 5 Nov 2025 17:22:06 +0100 Subject: [PATCH 03/17] impl static store with catchall --- internal/interpreter/interpreter.go | 24 ++++++-- internal/interpreter/interpreter_test.go | 70 +++++++++++++++++------- 2 files changed, 68 insertions(+), 26 deletions(-) diff --git a/internal/interpreter/interpreter.go b/internal/interpreter/interpreter.go index b737ff09..956409da 100644 --- a/internal/interpreter/interpreter.go +++ b/internal/interpreter/interpreter.go @@ -51,12 +51,26 @@ func (s StaticStore) GetBalances(_ context.Context, q BalanceQuery) (Balances, e }) for _, curr := range queriedCurrencies { - n := new(big.Int) - outputAccountBalance[curr] = n - - if i, ok := accountBalanceLookup[curr]; ok { - n.Set(i) + baseAsset, isCatchAll := strings.CutSuffix(curr, "/*") + if isCatchAll { + + for k, v := range accountBalanceLookup { + matchesAsset := k == baseAsset || strings.HasPrefix(k, baseAsset+"/") + if !matchesAsset { + continue + } + outputAccountBalance[k] = new(big.Int).Set(v) + } + + } else { + n := new(big.Int) + outputAccountBalance[curr] = n + + if i, ok := accountBalanceLookup[curr]; ok { + n.Set(i) + } } + } } diff --git a/internal/interpreter/interpreter_test.go b/internal/interpreter/interpreter_test.go index 719bb10f..0e5221ac 100644 --- a/internal/interpreter/interpreter_test.go +++ b/internal/interpreter/interpreter_test.go @@ -154,37 +154,65 @@ func testWithFeatureFlag(t *testing.T, testCase TestCase, flagName string) { } func TestStaticStore(t *testing.T) { - store := machine.StaticStore{ - Balances: machine.Balances{ + t.Run("request currencies", func(t *testing.T) { + store := machine.StaticStore{ + Balances: machine.Balances{ + "a": machine.AccountBalance{ + "USD/2": big.NewInt(10), + "EUR/2": big.NewInt(1), + }, + "b": machine.AccountBalance{ + "USD/2": big.NewInt(10), + "COIN": big.NewInt(11), + }, + }, + } + + q1, _ := store.GetBalances(context.TODO(), machine.BalanceQuery{ + "a": []string{"USD/2"}, + }) + require.Equal(t, machine.Balances{ "a": machine.AccountBalance{ "USD/2": big.NewInt(10), - "EUR/2": big.NewInt(1), }, + }, q1) + + q2, _ := store.GetBalances(context.TODO(), machine.BalanceQuery{ + "b": []string{"USD/2", "COIN"}, + }) + require.Equal(t, machine.Balances{ "b": machine.AccountBalance{ "USD/2": big.NewInt(10), "COIN": big.NewInt(11), }, - }, - } - - q1, _ := store.GetBalances(context.TODO(), machine.BalanceQuery{ - "a": []string{"USD/2"}, + }, q2) }) - require.Equal(t, machine.Balances{ - "a": machine.AccountBalance{ - "USD/2": big.NewInt(10), - }, - }, q1) - q2, _ := store.GetBalances(context.TODO(), machine.BalanceQuery{ - "b": []string{"USD/2", "COIN"}, + t.Run("assets catchall", func(t *testing.T) { + store := machine.StaticStore{ + Balances: machine.Balances{ + "a": machine.AccountBalance{ + "USD": big.NewInt(1), + "USD/2": big.NewInt(2), + "USD/3": big.NewInt(3), + }, + }, + } + + balances, err := store.GetBalances(context.Background(), machine.BalanceQuery{ + "a": []string{"USD/*"}, + }) + require.Nil(t, err) + require.Equal(t, machine.Balances{ + "a": machine.AccountBalance{ + "USD": big.NewInt(1), + "USD/2": big.NewInt(2), + "USD/3": big.NewInt(3), + }, + }, balances) + }) - require.Equal(t, machine.Balances{ - "b": machine.AccountBalance{ - "USD/2": big.NewInt(10), - "COIN": big.NewInt(11), - }, - }, q2) + } type CaseResult struct { From 2e7ee44f5b323fa327fafce2f1b2b00e926d6a62 Mon Sep 17 00:00:00 2001 From: ascandone Date: Fri, 7 Nov 2025 18:43:03 +0100 Subject: [PATCH 04/17] Added static analysis and unbounded impl --- internal/analysis/check.go | 4 + internal/interpreter/asset_scaling.go | 117 ++++++++++++++++-- internal/interpreter/asset_scaling_test.go | 68 ++++++++-- internal/interpreter/batch_balances_query.go | 14 +++ internal/interpreter/interpreter.go | 102 ++++++++++++++- .../scaling/scaling-allotment.num | 7 ++ .../scaling/scaling-allotment.num.specs.json | 44 +++++++ .../experimental/scaling/scaling-send-all.num | 5 + .../scaling/scaling-send-all.num.specs.json | 75 +++++++++++ .../scaling/scaling.num.specs.json | 79 +++++++++++- 10 files changed, 493 insertions(+), 22 deletions(-) create mode 100644 internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num create mode 100644 internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num.specs.json create mode 100644 internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num create mode 100644 internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num.specs.json diff --git a/internal/analysis/check.go b/internal/analysis/check.go index 567e65fb..f3804bc0 100644 --- a/internal/analysis/check.go +++ b/internal/analysis/check.go @@ -673,6 +673,10 @@ func (res *CheckResult) checkSource(source parser.Source) { res.unifyNodeWith(*source.Bounded, res.stmtType) } + case *parser.SourceWithScaling: + res.checkExpression(source.Address, TypeAccount) + res.checkExpression(source.Color, TypeString) + case *parser.SourceInorder: for _, source := range source.Sources { res.checkSource(source) diff --git a/internal/interpreter/asset_scaling.go b/internal/interpreter/asset_scaling.go index 6dad947a..f685db83 100644 --- a/internal/interpreter/asset_scaling.go +++ b/internal/interpreter/asset_scaling.go @@ -1,12 +1,59 @@ package interpreter import ( + "fmt" "math/big" "slices" + "strconv" + "strings" "github.com/formancehq/numscript/internal/utils" ) +func assetToScaledAsset(asset string) string { + parts := strings.Split(asset, "/") + if len(parts) == 1 { + return asset + "/*" + } + return parts[0] + "/*" +} + +func buildScaledAsset(baseAsset string, scale int64) string { + if scale == 0 { + return baseAsset + } + return fmt.Sprintf("%s/%d", baseAsset, scale) +} + +func getAssetScale(asset string) (string, int64) { + parts := strings.Split(asset, "/") + if len(parts) == 2 { + scale, err := strconv.ParseInt(parts[1], 10, 64) + if err == nil { + return parts[0], scale + } + // fallback if parsing fails + return parts[0], 0 + } + return asset, 0 +} + +func getAssets(balance AccountBalance, baseAsset string) map[int64]*big.Int { + result := make(map[int64]*big.Int) + for asset, amount := range balance { + if strings.HasPrefix(asset, baseAsset) { + _, scale := getAssetScale(asset) + result[scale] = amount + } + } + return result +} + +type scalePair struct { + scale int64 + amount *big.Int +} + // e.g. // // need=[EUR/2 100], got={EUR/2: 100, EUR: 1} @@ -21,15 +68,10 @@ func findSolution( neededAmt *big.Int, neededAmtScale int64, scales map[int64]*big.Int, -) map[int64]*big.Int { +) []scalePair { // we clone neededAmt so that we can update it neededAmt = new(big.Int).Set(neededAmt) - type scalePair struct { - scale int64 - amount *big.Int - } - var assets []scalePair for k, v := range scales { assets = append(assets, scalePair{ @@ -43,8 +85,7 @@ func findSolution( return int(p.scale - other.scale) }) - out := map[int64]*big.Int{} - + var out []scalePair left := new(big.Int).Set(neededAmt) for _, p := range assets { @@ -74,7 +115,10 @@ func findSolution( } neededAmt.Sub(neededAmt, taken) - out[p.scale] = intPart + out = append(out, scalePair{ + scale: p.scale, + amount: intPart, + }) // if neededAmt <= 0 if neededAmt.Cmp(big.NewInt(0)) != 1 { @@ -88,3 +132,58 @@ func findSolution( return out } + +func findSolutionUnbounded( + neededAmtScale int64, + scales map[int64]*big.Int, +) ([]scalePair, *big.Int) { + + var assets []scalePair + for k, v := range scales { + assets = append(assets, scalePair{ + scale: k, + amount: v, + }) + } + + // Sort in ASC order (e.g. EUR, EUR/2, ..) + slices.SortFunc(assets, func(p scalePair, other scalePair) int { + return int(p.scale - other.scale) + }) + + var out []scalePair + + tot := big.NewInt(0) + for _, p := range assets { + scaleDiff := neededAmtScale - p.scale + + exp := big.NewInt(scaleDiff) + exp.Abs(exp) + exp.Exp(big.NewInt(10), exp, nil) + + // scalingFactor := 10 ^ (neededAmtScale - p.scale) + // note that 10^0 == 1 and 10^(-n) == 1/(10^n) + scalingFactor := new(big.Rat).SetInt(exp) + if scaleDiff < 0 { + scalingFactor.Inv(scalingFactor) + } + + allowed := new(big.Int).Mul(p.amount, scalingFactor.Num()) + allowed.Div(allowed, scalingFactor.Denom()) + + intPart := new(big.Int).Mul(allowed, scalingFactor.Denom()) + intPart.Div(intPart, scalingFactor.Num()) + + if intPart.Cmp(big.NewInt(0)) == 0 { + continue + } + + tot.Add(tot, allowed) + out = append(out, scalePair{ + scale: p.scale, + amount: intPart, + }) + } + + return out, tot +} diff --git a/internal/interpreter/asset_scaling_test.go b/internal/interpreter/asset_scaling_test.go index a02d6c11..ad74bea5 100644 --- a/internal/interpreter/asset_scaling_test.go +++ b/internal/interpreter/asset_scaling_test.go @@ -19,8 +19,8 @@ func TestScalingZeroNeeded(t *testing.T) { 1: big.NewInt(1), }) - require.Equal(t, map[int64]*big.Int{ - 42: big.NewInt(0), + require.Equal(t, []scalePair{ + {42, big.NewInt(0)}, }, sol) } @@ -35,8 +35,8 @@ func TestScalingSameAsset(t *testing.T) { 2: big.NewInt(201), }) - require.Equal(t, map[int64]*big.Int{ - 2: big.NewInt(200), + require.Equal(t, []scalePair{ + {2, big.NewInt(200)}, }, sol) } @@ -48,8 +48,8 @@ func TestScalingSolutionLowerScale(t *testing.T) { 2: big.NewInt(900), }) - require.Equal(t, map[int64]*big.Int{ - 2: big.NewInt(100), + require.Equal(t, []scalePair{ + {2, big.NewInt(100)}, }, sol) } @@ -64,8 +64,8 @@ func TestScalingSolutionHigherScale(t *testing.T) { 0: big.NewInt(4), }) - require.Equal(t, map[int64]*big.Int{ - 0: big.NewInt(2), + require.Equal(t, []scalePair{ + {0, big.NewInt(2)}, }, sol) } @@ -80,3 +80,55 @@ func TestScalingSolutionHigherScaleNoSolution(t *testing.T) { require.Nil(t, sol) } + +func TestUnboundedScalingSameAsset(t *testing.T) { + sol, _ := findSolutionUnbounded( + // Need USD/2 + 2, + // Have: {EUR/2: 201} + map[int64]*big.Int{ + 2: big.NewInt(123), + }) + + require.Equal(t, []scalePair{ + {2, big.NewInt(123)}, + }, sol) +} + +func TestUnboundedScalingLowerAsset(t *testing.T) { + sol, _ := findSolutionUnbounded( + 2, + map[int64]*big.Int{ + 0: big.NewInt(1), + }) + + require.Equal(t, []scalePair{ + {0, big.NewInt(1)}, + }, sol) +} + +func TestUnboundedScalinHigherAsset(t *testing.T) { + sol, _ := findSolutionUnbounded( + 2, + map[int64]*big.Int{ + 3: big.NewInt(10), + }) + + require.Equal(t, + []scalePair{ + {3, big.NewInt(10)}, + }, + sol) +} + +func TestUnboundedScalinHigherAssetTrimRemainder(t *testing.T) { + sol, _ := findSolutionUnbounded( + 2, + map[int64]*big.Int{ + 3: big.NewInt(15), + }) + + require.Equal(t, []scalePair{ + {3, big.NewInt(10)}, + }, sol) +} diff --git a/internal/interpreter/batch_balances_query.go b/internal/interpreter/batch_balances_query.go index cedd25ec..d9ad17ce 100644 --- a/internal/interpreter/batch_balances_query.go +++ b/internal/interpreter/batch_balances_query.go @@ -98,6 +98,20 @@ func (st *programState) findBalancesQueries(source parser.Source) InterpreterErr st.batchQuery(*account, st.CurrentAsset, color) return nil + case *parser.SourceWithScaling: + account, err := evaluateExprAs(st, source.Address, expectAccount) + if err != nil { + return err + } + + color, err := evaluateOptExprAs(st, source.Color, expectString) + if err != nil { + return err + } + + st.batchQuery(*account, assetToScaledAsset(st.CurrentAsset), color) + return nil + case *parser.SourceOverdraft: // Skip balance tracking when balance is overdraft if source.Bounded == nil { diff --git a/internal/interpreter/interpreter.go b/internal/interpreter/interpreter.go index 956409da..51cc134b 100644 --- a/internal/interpreter/interpreter.go +++ b/internal/interpreter/interpreter.go @@ -2,6 +2,7 @@ package interpreter import ( "context" + "fmt" "math/big" "regexp" "strings" @@ -571,7 +572,50 @@ func (s *programState) sendAll(source parser.Source) (*big.Int, InterpreterError return s.sendAllToAccount(source.Address, cap, source.Color) case *parser.SourceWithScaling: - panic("TODO implement") + account, err := evaluateExprAs(s, source.Address, expectAccount) + if err != nil { + return nil, err + } + + baseAsset, assetScale := getAssetScale(s.CurrentAsset) + acc, ok := s.CachedBalances[*account] + if !ok { + panic("TODO accountBal not found") + } + + sol, totSent := findSolutionUnbounded( + assetScale, + getAssets(acc, baseAsset), + ) + + for _, convAmt := range sol { + scale := convAmt.scale + convAmt := convAmt.amount + + // here we manually emit postings based on the known solution, + // and update balances accordingly + asset := buildScaledAsset(baseAsset, scale) + s.Postings = append(s.Postings, Posting{ + Source: *account, + Destination: fmt.Sprintf("%s:scaling", *account), + Amount: new(big.Int).Set(convAmt), + Asset: asset, + }) + acc[asset].Sub(acc[asset], convAmt) + } + + s.Postings = append(s.Postings, Posting{ + Source: fmt.Sprintf("%s:scaling", *account), + Destination: *account, + Amount: new(big.Int).Set(totSent), + Asset: s.CurrentAsset, + }) + accBalance := utils.MapGetOrPutDefault(acc, s.CurrentAsset, func() *big.Int { + return big.NewInt(0) + }) + accBalance.Add(accBalance, totSent) + + return s.trySendingToAccount(source.Address, totSent, big.NewInt(0), source.Color) case *parser.SourceInorder: totalSent := big.NewInt(0) @@ -683,6 +727,59 @@ func (s *programState) trySendingUpTo(source parser.Source, amount *big.Int) (*b case *parser.SourceAccount: return s.trySendingToAccount(source.ValueExpr, amount, big.NewInt(0), source.Color) + case *parser.SourceWithScaling: + account, err := evaluateExprAs(s, source.Address, expectAccount) + if err != nil { + return nil, err + } + + baseAsset, assetScale := getAssetScale(s.CurrentAsset) + acc, ok := s.CachedBalances[*account] + if !ok { + panic("TODO accountBal not found") + } + + sol := findSolution( + amount, + assetScale, + getAssets(acc, baseAsset), + ) + + if sol == nil { + // we already know we are failing, but we're delegating to the "standard" (non-scaled) mode + // so that we get a somewhat helpful (although limited) error message + return s.trySendingToAccount(source.Address, amount, big.NewInt(0), source.Color) + } + + for _, pair := range sol { + scale := pair.scale + sending := pair.amount + // here we manually emit postings based on the known solution, + // and update balances accordingly + asset := buildScaledAsset(baseAsset, scale) + s.Postings = append(s.Postings, Posting{ + Source: *account, + Destination: fmt.Sprintf("%s:scaling", *account), + Amount: new(big.Int).Set(sending), + Asset: asset, + }) + acc[asset].Sub(acc[asset], sending) + } + + s.Postings = append(s.Postings, Posting{ + Source: fmt.Sprintf("%s:scaling", *account), + Destination: *account, + Amount: new(big.Int).Set(amount), + Asset: s.CurrentAsset, + }) + + accBalance := utils.MapGetOrPutDefault(acc, s.CurrentAsset, func() *big.Int { + return big.NewInt(0) + }) + accBalance.Add(accBalance, amount) + + return s.trySendingToAccount(source.Address, amount, big.NewInt(0), source.Color) + case *parser.SourceOverdraft: var cap *big.Int if source.Bounded != nil { @@ -694,9 +791,6 @@ func (s *programState) trySendingUpTo(source parser.Source, amount *big.Int) (*b } return s.trySendingToAccount(source.Address, amount, cap, source.Color) - case *parser.SourceWithScaling: - panic("TODO implement") - case *parser.SourceInorder: totalLeft := new(big.Int).Set(amount) for _, source := range source.Sources { diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num new file mode 100644 index 00000000..849747a2 --- /dev/null +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num @@ -0,0 +1,7 @@ +send [EUR/2 100] ( + source = { + @acc1 + @acc2 with scaling + } + destination = @dest +) diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num.specs.json new file mode 100644 index 00000000..9a4174b0 --- /dev/null +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num.specs.json @@ -0,0 +1,44 @@ +{ + "$schema": "https://raw.githubusercontent.com/formancehq/numscript/main/specs.schema.json", + "balances": { + "acc1": { + "EUR/2": 50 + } + }, + "testCases": [ + { + "it": "casts all the avlb", + "balances": { + "acc2": { + "EUR/3": 500 + } + }, + "expect.postings": [ + { + "source": "acc2", + "destination": "acc2:scaling", + "amount": 500, + "asset": "EUR/3" + }, + { + "source": "acc2:scaling", + "destination": "acc2", + "amount": 50, + "asset": "EUR/2" + }, + { + "source": "acc1", + "destination": "dest", + "amount": 50, + "asset": "EUR/2" + }, + { + "source": "acc2", + "destination": "dest", + "amount": 50, + "asset": "EUR/2" + } + ] + } + ] +} \ No newline at end of file diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num new file mode 100644 index 00000000..9cbb7fb2 --- /dev/null +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num @@ -0,0 +1,5 @@ +send [EUR/2 *] ( + source = @src with scaling + destination = @dest +) + diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num.specs.json new file mode 100644 index 00000000..a96b9aae --- /dev/null +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num.specs.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://raw.githubusercontent.com/formancehq/numscript/main/specs.schema.json", + "testCases": [ + { + "it": "sends all the available assets that can be cast", + "balances": { + "src": { + "EUR": 2, + "EUR/2": 1, + "EUR/3": 30 + } + }, + "expect.postings": [ + { + "source": "src", + "destination": "src:scaling", + "amount": 2, + "asset": "EUR" + }, + { + "source": "src", + "destination": "src:scaling", + "amount": 1, + "asset": "EUR/2" + }, + { + "source": "src", + "destination": "src:scaling", + "amount": 30, + "asset": "EUR/3" + }, + { + "source": "src:scaling", + "destination": "src", + "amount": 204, + "asset": "EUR/2" + }, + { + "source": "src", + "destination": "dest", + "amount": 204, + "asset": "EUR/2" + } + ] + }, + { + "it": "avoids casting the remainder", + "balances": { + "src": { + "EUR/3": 21 + } + }, + "expect.postings": [ + { + "source": "src", + "destination": "src:scaling", + "amount": 20, + "asset": "EUR/3" + }, + { + "source": "src:scaling", + "destination": "src", + "amount": 2, + "asset": "EUR/2" + }, + { + "source": "src", + "destination": "dest", + "amount": 2, + "asset": "EUR/2" + } + ] + } + ] +} \ No newline at end of file diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num.specs.json index ca4c84f3..e7992ef2 100644 --- a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num.specs.json +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num.specs.json @@ -9,11 +9,88 @@ "expect.postings": [ { "source": "src", - "destination": "dest", + "destination": "src:scaling", "asset": "EUR", "amount": 4 + }, + { + "source": "src:scaling", + "destination": "src", + "asset": "EUR/2", + "amount": 400 + }, + { + "source": "src", + "destination": "dest", + "asset": "EUR/2", + "amount": 400 + } + ] + }, + { + "it": "downscales to an smaller currency if possible", + "balances": { + "src": { "EUR/3": 4000 } + }, + "expect.postings": [ + { + "source": "src", + "destination": "src:scaling", + "asset": "EUR/3", + "amount": 4000 + }, + { + "source": "src:scaling", + "destination": "src", + "asset": "EUR/2", + "amount": 400 + }, + { + "source": "src", + "destination": "dest", + "asset": "EUR/2", + "amount": 400 } ] + }, + { + "it": "mix", + "balances": { + "src": { "EUR": 2, "EUR/2": 200 } + }, + "expect.postings": [ + { + "source": "src", + "destination": "src:scaling", + "asset": "EUR", + "amount": 2 + }, + { + "source": "src", + "destination": "src:scaling", + "asset": "EUR/2", + "amount": 200 + }, + { + "source": "src:scaling", + "destination": "src", + "asset": "EUR/2", + "amount": 400 + }, + { + "source": "src", + "destination": "dest", + "asset": "EUR/2", + "amount": 400 + } + ] + }, + { + "it": "fails when there aren't enough funds", + "balances": { + "src": { "EUR": 1, "EUR/2": 200, "EUR/3": 10 } + }, + "expect.error.missingFunds": true } ] } From 7bcf3ccf5ec27241c2e02c1668213668163efd5c Mon Sep 17 00:00:00 2001 From: ascandone Date: Tue, 30 Dec 2025 09:26:23 +0100 Subject: [PATCH 05/17] added tests --- .../scaling/scaling-all-allotment.num | 7 +++ .../scaling-all-allotment.num.specs.json | 44 +++++++++++++++++++ .../scaling/scaling-allotment.num.specs.json | 34 ++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num create mode 100644 internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num.specs.json diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num new file mode 100644 index 00000000..59441253 --- /dev/null +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num @@ -0,0 +1,7 @@ +send [EUR/2 *] ( + source = { + @acc1 + @acc2 with scaling + } + destination = @dest +) diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num.specs.json new file mode 100644 index 00000000..9a4174b0 --- /dev/null +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num.specs.json @@ -0,0 +1,44 @@ +{ + "$schema": "https://raw.githubusercontent.com/formancehq/numscript/main/specs.schema.json", + "balances": { + "acc1": { + "EUR/2": 50 + } + }, + "testCases": [ + { + "it": "casts all the avlb", + "balances": { + "acc2": { + "EUR/3": 500 + } + }, + "expect.postings": [ + { + "source": "acc2", + "destination": "acc2:scaling", + "amount": 500, + "asset": "EUR/3" + }, + { + "source": "acc2:scaling", + "destination": "acc2", + "amount": 50, + "asset": "EUR/2" + }, + { + "source": "acc1", + "destination": "dest", + "amount": 50, + "asset": "EUR/2" + }, + { + "source": "acc2", + "destination": "dest", + "amount": 50, + "asset": "EUR/2" + } + ] + } + ] +} \ No newline at end of file diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num.specs.json index 9a4174b0..0b8d12d2 100644 --- a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num.specs.json +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num.specs.json @@ -39,6 +39,40 @@ "asset": "EUR/2" } ] + }, + { + "it": "doesn't send more than needed", + "balances": { + "acc2": { + "EUR/2": 999999 + } + }, + "expect.postings": [ + { + "source": "acc2", + "destination": "acc2:scaling", + "amount": 50, + "asset": "EUR/2" + }, + { + "source": "acc2:scaling", + "destination": "acc2", + "amount": 50, + "asset": "EUR/2" + }, + { + "source": "acc1", + "destination": "dest", + "amount": 50, + "asset": "EUR/2" + }, + { + "source": "acc2", + "destination": "dest", + "amount": 50, + "asset": "EUR/2" + } + ] } ] } \ No newline at end of file From 2ec6835f512b1f5d64d968f793408d55430e7998 Mon Sep 17 00:00:00 2001 From: ascandone Date: Tue, 30 Dec 2025 19:33:06 +0100 Subject: [PATCH 06/17] dedup bounded and unbounded functions --- internal/interpreter/asset_scaling.go | 88 +++++----------------- internal/interpreter/asset_scaling_test.go | 37 ++++++--- internal/interpreter/interpreter.go | 7 +- 3 files changed, 49 insertions(+), 83 deletions(-) diff --git a/internal/interpreter/asset_scaling.go b/internal/interpreter/asset_scaling.go index f685db83..3cbb1755 100644 --- a/internal/interpreter/asset_scaling.go +++ b/internal/interpreter/asset_scaling.go @@ -65,13 +65,10 @@ type scalePair struct { // need=[EUR/2 199], got={EUR/2: 100, EUR: 2} // => {EUR/2: 100, EUR: 1} func findSolution( - neededAmt *big.Int, + neededAmt *big.Int, // <- can be nil neededAmtScale int64, scales map[int64]*big.Int, -) []scalePair { - // we clone neededAmt so that we can update it - neededAmt = new(big.Int).Set(neededAmt) - +) ([]scalePair, *big.Int) { var assets []scalePair for k, v := range scales { assets = append(assets, scalePair{ @@ -86,7 +83,8 @@ func findSolution( }) var out []scalePair - left := new(big.Int).Set(neededAmt) + + totalSent := big.NewInt(0) for _, p := range assets { scaleDiff := neededAmtScale - p.scale @@ -105,7 +103,16 @@ func findSolution( allowed := new(big.Int).Mul(p.amount, scalingFactor.Num()) allowed.Div(allowed, scalingFactor.Denom()) - taken := utils.MinBigInt(allowed, neededAmt) + var leftAmt *big.Int + var taken *big.Int + if neededAmt == nil { + taken = new(big.Int).Set(allowed) + } else { + leftAmt = new(big.Int).Sub(neededAmt, totalSent) + taken = utils.MinBigInt(allowed, leftAmt) + } + + totalSent.Add(totalSent, taken) intPart := new(big.Int).Mul(taken, scalingFactor.Denom()) intPart.Div(intPart, scalingFactor.Num()) @@ -114,76 +121,15 @@ func findSolution( continue } - neededAmt.Sub(neededAmt, taken) out = append(out, scalePair{ scale: p.scale, amount: intPart, }) - // if neededAmt <= 0 - if neededAmt.Cmp(big.NewInt(0)) != 1 { - return out + if leftAmt != nil && leftAmt.Cmp(big.NewInt(0)) != 1 { + break } } - if left.Cmp(big.NewInt(0)) != 0 { - return nil - } - - return out -} - -func findSolutionUnbounded( - neededAmtScale int64, - scales map[int64]*big.Int, -) ([]scalePair, *big.Int) { - - var assets []scalePair - for k, v := range scales { - assets = append(assets, scalePair{ - scale: k, - amount: v, - }) - } - - // Sort in ASC order (e.g. EUR, EUR/2, ..) - slices.SortFunc(assets, func(p scalePair, other scalePair) int { - return int(p.scale - other.scale) - }) - - var out []scalePair - - tot := big.NewInt(0) - for _, p := range assets { - scaleDiff := neededAmtScale - p.scale - - exp := big.NewInt(scaleDiff) - exp.Abs(exp) - exp.Exp(big.NewInt(10), exp, nil) - - // scalingFactor := 10 ^ (neededAmtScale - p.scale) - // note that 10^0 == 1 and 10^(-n) == 1/(10^n) - scalingFactor := new(big.Rat).SetInt(exp) - if scaleDiff < 0 { - scalingFactor.Inv(scalingFactor) - } - - allowed := new(big.Int).Mul(p.amount, scalingFactor.Num()) - allowed.Div(allowed, scalingFactor.Denom()) - - intPart := new(big.Int).Mul(allowed, scalingFactor.Denom()) - intPart.Div(intPart, scalingFactor.Num()) - - if intPart.Cmp(big.NewInt(0)) == 0 { - continue - } - - tot.Add(tot, allowed) - out = append(out, scalePair{ - scale: p.scale, - amount: intPart, - }) - } - - return out, tot + return out, totalSent } diff --git a/internal/interpreter/asset_scaling_test.go b/internal/interpreter/asset_scaling_test.go index ad74bea5..69bca1b0 100644 --- a/internal/interpreter/asset_scaling_test.go +++ b/internal/interpreter/asset_scaling_test.go @@ -11,7 +11,7 @@ func TestScalingZeroNeeded(t *testing.T) { t.Skip() // need [EUR/2 ] - sol := findSolution( + sol, _ := findSolution( big.NewInt(0), 42, map[int64]*big.Int{ @@ -25,7 +25,7 @@ func TestScalingZeroNeeded(t *testing.T) { } func TestScalingSameAsset(t *testing.T) { - sol := findSolution( + sol, _ := findSolution( // Need [EUR/2 200] big.NewInt(200), 2, @@ -41,7 +41,7 @@ func TestScalingSameAsset(t *testing.T) { } func TestScalingSolutionLowerScale(t *testing.T) { - sol := findSolution( + sol, _ := findSolution( big.NewInt(1), 0, map[int64]*big.Int{ @@ -54,7 +54,7 @@ func TestScalingSolutionLowerScale(t *testing.T) { } func TestScalingSolutionHigherScale(t *testing.T) { - sol := findSolution( + sol, _ := findSolution( // Need [EUR/2 200] big.NewInt(200), 2, @@ -70,7 +70,7 @@ func TestScalingSolutionHigherScale(t *testing.T) { } func TestScalingSolutionHigherScaleNoSolution(t *testing.T) { - sol := findSolution( + sol, _ := findSolution( big.NewInt(1), 2, map[int64]*big.Int{ @@ -81,8 +81,24 @@ func TestScalingSolutionHigherScaleNoSolution(t *testing.T) { require.Nil(t, sol) } +func TestMixedFail(t *testing.T) { + t.Skip() + + sol, _ := findSolution( + big.NewInt(400), + 2, + map[int64]*big.Int{ + 0: big.NewInt(1), + 2: big.NewInt(200), + 3: big.NewInt(10), + }) + + require.Nil(t, sol) +} + func TestUnboundedScalingSameAsset(t *testing.T) { - sol, _ := findSolutionUnbounded( + sol, _ := findSolution( + nil, // Need USD/2 2, // Have: {EUR/2: 201} @@ -96,7 +112,8 @@ func TestUnboundedScalingSameAsset(t *testing.T) { } func TestUnboundedScalingLowerAsset(t *testing.T) { - sol, _ := findSolutionUnbounded( + sol, _ := findSolution( + nil, 2, map[int64]*big.Int{ 0: big.NewInt(1), @@ -108,7 +125,8 @@ func TestUnboundedScalingLowerAsset(t *testing.T) { } func TestUnboundedScalinHigherAsset(t *testing.T) { - sol, _ := findSolutionUnbounded( + sol, _ := findSolution( + nil, 2, map[int64]*big.Int{ 3: big.NewInt(10), @@ -122,7 +140,8 @@ func TestUnboundedScalinHigherAsset(t *testing.T) { } func TestUnboundedScalinHigherAssetTrimRemainder(t *testing.T) { - sol, _ := findSolutionUnbounded( + sol, _ := findSolution( + nil, 2, map[int64]*big.Int{ 3: big.NewInt(15), diff --git a/internal/interpreter/interpreter.go b/internal/interpreter/interpreter.go index 51cc134b..bc355876 100644 --- a/internal/interpreter/interpreter.go +++ b/internal/interpreter/interpreter.go @@ -583,7 +583,8 @@ func (s *programState) sendAll(source parser.Source) (*big.Int, InterpreterError panic("TODO accountBal not found") } - sol, totSent := findSolutionUnbounded( + sol, totSent := findSolution( + nil, assetScale, getAssets(acc, baseAsset), ) @@ -739,13 +740,13 @@ func (s *programState) trySendingUpTo(source parser.Source, amount *big.Int) (*b panic("TODO accountBal not found") } - sol := findSolution( + sol, total := findSolution( amount, assetScale, getAssets(acc, baseAsset), ) - if sol == nil { + if amount.Cmp(total) == 1 { // we already know we are failing, but we're delegating to the "standard" (non-scaled) mode // so that we get a somewhat helpful (although limited) error message return s.trySendingToAccount(source.Address, amount, big.NewInt(0), source.Color) From 437d975db50582bc1c58de851ebe4c6486eb37c2 Mon Sep 17 00:00:00 2001 From: ascandone Date: Wed, 7 Jan 2026 19:07:44 +0100 Subject: [PATCH 07/17] add test --- .../experimental/scaling/scaling-kept.num | 6 ++++ .../scaling/scaling-kept.num.specs.json | 34 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num create mode 100644 internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num.specs.json diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num new file mode 100644 index 00000000..0af2006d --- /dev/null +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num @@ -0,0 +1,6 @@ +send [BTC/2 *] ( + source = @acc with scaling + destination = { + remaining kept + } +) diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num.specs.json new file mode 100644 index 00000000..08d442cd --- /dev/null +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num.specs.json @@ -0,0 +1,34 @@ +{ + "$schema": "https://raw.githubusercontent.com/formancehq/numscript/main/specs.schema.json", + "balances": { + "acc": { + "BTC/2": 2, + "BTC/8": 1000000 + } + }, + "testCases": [ + { + "it": "example spec", + "expect.postings": [ + { + "source": "acc", + "destination": "acc:scaling", + "amount": 2, + "asset": "BTC/2" + }, + { + "source": "acc", + "destination": "acc:scaling", + "amount": 1000000, + "asset": "BTC/8" + }, + { + "source": "acc:scaling", + "destination": "acc", + "amount": 3, + "asset": "BTC/2" + } + ] + } + ] +} \ No newline at end of file From 8c0629653ecfd688f65d5bd76b276d0cea9f1ff3 Mon Sep 17 00:00:00 2001 From: ascandone Date: Fri, 9 Jan 2026 11:07:17 +0100 Subject: [PATCH 08/17] feat: handle err --- internal/interpreter/interpreter.go | 4 ++-- internal/interpreter/interpreter_error.go | 8 ++++++++ internal/interpreter/interpreter_test.go | 17 +++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/internal/interpreter/interpreter.go b/internal/interpreter/interpreter.go index bc355876..547a8879 100644 --- a/internal/interpreter/interpreter.go +++ b/internal/interpreter/interpreter.go @@ -580,7 +580,7 @@ func (s *programState) sendAll(source parser.Source) (*big.Int, InterpreterError baseAsset, assetScale := getAssetScale(s.CurrentAsset) acc, ok := s.CachedBalances[*account] if !ok { - panic("TODO accountBal not found") + return nil, InvalidUnboundedAddressInScalingAddress{} } sol, totSent := findSolution( @@ -737,7 +737,7 @@ func (s *programState) trySendingUpTo(source parser.Source, amount *big.Int) (*b baseAsset, assetScale := getAssetScale(s.CurrentAsset) acc, ok := s.CachedBalances[*account] if !ok { - panic("TODO accountBal not found") + return nil, InvalidUnboundedAddressInScalingAddress{} } sol, total := findSolution( diff --git a/internal/interpreter/interpreter_error.go b/internal/interpreter/interpreter_error.go index 1d5bc415..d6ee11dd 100644 --- a/internal/interpreter/interpreter_error.go +++ b/internal/interpreter/interpreter_error.go @@ -255,3 +255,11 @@ type InvalidColor struct { func (e InvalidColor) Error() string { return fmt.Sprintf("Invalid color name: '%s'. Only uppercase letters are allowed.", e.Color) } + +type InvalidUnboundedAddressInScalingAddress struct { + parser.Range +} + +func (InvalidUnboundedAddressInScalingAddress) Error() string { + return "Invalid usage or @world account in scaling context" +} diff --git a/internal/interpreter/interpreter_test.go b/internal/interpreter/interpreter_test.go index 0e5221ac..c2bd5488 100644 --- a/internal/interpreter/interpreter_test.go +++ b/internal/interpreter/interpreter_test.go @@ -1140,3 +1140,20 @@ func TestSafeWithdraft(t *testing.T) { }) } + +func TestInvalidScalingWorld(t *testing.T) { + script := ` +send [EUR/2 *] ( + source = @world with scaling + destination = @dest +) + ` + + tc := NewTestCase() + tc.compile(t, script) + + tc.expected = CaseResult{ + Error: machine.InvalidUnboundedAddressInScalingAddress{}, + } + test(t, tc) +} From 75f9409fd6d804441a4795a92a4c813e4497d030 Mon Sep 17 00:00:00 2001 From: ascandone Date: Fri, 9 Jan 2026 18:10:38 +0100 Subject: [PATCH 09/17] check feature flag --- internal/flags/flags.go | 2 ++ internal/interpreter/interpreter.go | 10 ++++++++ internal/interpreter/interpreter_test.go | 2 +- .../scaling-all-allotment.num.specs.json | 3 +++ .../scaling/scaling-allotment.num.specs.json | 3 +++ .../scaling/scaling-kept.num.specs.json | 3 +++ .../scaling/scaling-send-all.num.specs.json | 3 +++ .../scaling/scaling.num.specs.json | 25 +++++++++++++++---- 8 files changed, 45 insertions(+), 6 deletions(-) diff --git a/internal/flags/flags.go b/internal/flags/flags.go index 0cc593d4..efbe6516 100644 --- a/internal/flags/flags.go +++ b/internal/flags/flags.go @@ -10,6 +10,7 @@ const ( ExperimentalAccountInterpolationFlag FeatureFlag = "experimental-account-interpolation" ExperimentalMidScriptFunctionCall FeatureFlag = "experimental-mid-script-function-call" ExperimentalAssetColors FeatureFlag = "experimental-asset-colors" + AssetScaling FeatureFlag = "experimental-asset-scaling" ) var AllFlags []string = []string{ @@ -20,4 +21,5 @@ var AllFlags []string = []string{ ExperimentalAccountInterpolationFlag, ExperimentalMidScriptFunctionCall, ExperimentalAssetColors, + AssetScaling, } diff --git a/internal/interpreter/interpreter.go b/internal/interpreter/interpreter.go index 547a8879..b57418cd 100644 --- a/internal/interpreter/interpreter.go +++ b/internal/interpreter/interpreter.go @@ -572,6 +572,11 @@ func (s *programState) sendAll(source parser.Source) (*big.Int, InterpreterError return s.sendAllToAccount(source.Address, cap, source.Color) case *parser.SourceWithScaling: + err := s.checkFeatureFlag(flags.AssetScaling) + if err != nil { + return nil, err + } + account, err := evaluateExprAs(s, source.Address, expectAccount) if err != nil { return nil, err @@ -729,6 +734,11 @@ func (s *programState) trySendingUpTo(source parser.Source, amount *big.Int) (*b return s.trySendingToAccount(source.ValueExpr, amount, big.NewInt(0), source.Color) case *parser.SourceWithScaling: + err := s.checkFeatureFlag(flags.AssetScaling) + if err != nil { + return nil, err + } + account, err := evaluateExprAs(s, source.Address, expectAccount) if err != nil { return nil, err diff --git a/internal/interpreter/interpreter_test.go b/internal/interpreter/interpreter_test.go index c2bd5488..ebf9aa3c 100644 --- a/internal/interpreter/interpreter_test.go +++ b/internal/interpreter/interpreter_test.go @@ -1155,5 +1155,5 @@ send [EUR/2 *] ( tc.expected = CaseResult{ Error: machine.InvalidUnboundedAddressInScalingAddress{}, } - test(t, tc) + testWithFeatureFlag(t, tc, flags.AssetScaling) } diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num.specs.json index 9a4174b0..b1806802 100644 --- a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num.specs.json +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num.specs.json @@ -1,5 +1,8 @@ { "$schema": "https://raw.githubusercontent.com/formancehq/numscript/main/specs.schema.json", + "featureFlags": [ + "experimental-asset-scaling" + ], "balances": { "acc1": { "EUR/2": 50 diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num.specs.json index 0b8d12d2..04e7699f 100644 --- a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num.specs.json +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num.specs.json @@ -1,5 +1,8 @@ { "$schema": "https://raw.githubusercontent.com/formancehq/numscript/main/specs.schema.json", + "featureFlags": [ + "experimental-asset-scaling" + ], "balances": { "acc1": { "EUR/2": 50 diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num.specs.json index 08d442cd..04a2b7fc 100644 --- a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num.specs.json +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num.specs.json @@ -1,5 +1,8 @@ { "$schema": "https://raw.githubusercontent.com/formancehq/numscript/main/specs.schema.json", + "featureFlags": [ + "experimental-asset-scaling" + ], "balances": { "acc": { "BTC/2": 2, diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num.specs.json index a96b9aae..d40f9ca4 100644 --- a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num.specs.json +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num.specs.json @@ -1,5 +1,8 @@ { "$schema": "https://raw.githubusercontent.com/formancehq/numscript/main/specs.schema.json", + "featureFlags": [ + "experimental-asset-scaling" + ], "testCases": [ { "it": "sends all the available assets that can be cast", diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num.specs.json index e7992ef2..e0b0eb79 100644 --- a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num.specs.json +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num.specs.json @@ -1,10 +1,16 @@ { "$schema": "https://raw.githubusercontent.com/formancehq/numscript/main/specs.schema.json", + "featureFlags": [ + "experimental-asset-scaling" + ], "testCases": [ { "it": "upscales to an higher currency if possible", "balances": { - "src": { "EUR": 99, "EUR/2": 1 } + "src": { + "EUR": 99, + "EUR/2": 1 + } }, "expect.postings": [ { @@ -30,7 +36,9 @@ { "it": "downscales to an smaller currency if possible", "balances": { - "src": { "EUR/3": 4000 } + "src": { + "EUR/3": 4000 + } }, "expect.postings": [ { @@ -56,7 +64,10 @@ { "it": "mix", "balances": { - "src": { "EUR": 2, "EUR/2": 200 } + "src": { + "EUR": 2, + "EUR/2": 200 + } }, "expect.postings": [ { @@ -88,9 +99,13 @@ { "it": "fails when there aren't enough funds", "balances": { - "src": { "EUR": 1, "EUR/2": 200, "EUR/3": 10 } + "src": { + "EUR": 1, + "EUR/2": 200, + "EUR/3": 10 + } }, "expect.error.missingFunds": true } ] -} +} \ No newline at end of file From 1d4302f260e108138435dcc9b1981cf9a26c2b37 Mon Sep 17 00:00:00 2001 From: ascandone Date: Mon, 12 Jan 2026 15:26:04 +0100 Subject: [PATCH 10/17] edit syntax --- Lexer.g4 | 1 + Numscript.g4 | 2 +- internal/analysis/check.go | 1 + internal/interpreter/batch_balances_query.go | 1 + internal/interpreter/interpreter.go | 17 +- internal/interpreter/interpreter_test.go | 2 +- .../scaling/scaling-all-allotment.num | 2 +- .../scaling-all-allotment.num.specs.json | 4 +- .../scaling/scaling-allotment.num | 2 +- .../scaling/scaling-allotment.num.specs.json | 8 +- .../experimental/scaling/scaling-kept.num | 2 +- .../scaling/scaling-kept.num.specs.json | 6 +- .../experimental/scaling/scaling-send-all.num | 2 +- .../scaling/scaling-send-all.num.specs.json | 12 +- .../experimental/scaling/scaling.num | 2 +- .../scaling/scaling.num.specs.json | 14 +- .../parser/__snapshots__/parser_test.snap | 11 +- internal/parser/antlrParser/Lexer.interp | 5 +- internal/parser/antlrParser/Lexer.tokens | 26 +- internal/parser/antlrParser/Numscript.interp | 4 +- internal/parser/antlrParser/Numscript.tokens | 26 +- internal/parser/antlrParser/lexer.go | 351 ++++++------- .../parser/antlrParser/numscript_parser.go | 461 ++++++++++-------- internal/parser/ast.go | 1 + internal/parser/parser.go | 1 + internal/parser/parser_test.go | 2 +- 26 files changed, 527 insertions(+), 439 deletions(-) diff --git a/Lexer.g4 b/Lexer.g4 index 7cbe5b56..17e0ce72 100644 --- a/Lexer.g4 +++ b/Lexer.g4 @@ -34,6 +34,7 @@ DIV: '/'; RESTRICT: '\\'; WITH: 'with'; SCALING: 'scaling'; +THROUGH: 'through'; PERCENTAGE_PORTION_LITERAL: [0-9]+ ('.' [0-9]+)? '%'; diff --git a/Numscript.g4 b/Numscript.g4 index 022f7431..19521f9c 100644 --- a/Numscript.g4 +++ b/Numscript.g4 @@ -47,7 +47,7 @@ colorConstraint: RESTRICT valueExpr; source : address = valueExpr colorConstraint? ALLOWING UNBOUNDED OVERDRAFT # srcAccountUnboundedOverdraft | address = valueExpr colorConstraint? ALLOWING OVERDRAFT UP TO maxOvedraft = valueExpr #srcAccountBoundedOverdraft - | address = valueExpr colorConstraint? WITH SCALING # srcAccountWithScaling + | address = valueExpr colorConstraint? WITH SCALING THROUGH swap=valueExpr # srcAccountWithScaling | valueExpr colorConstraint? # srcAccount | LBRACE allotmentClauseSrc+ RBRACE # srcAllotment | LBRACE source* RBRACE # srcInorder diff --git a/internal/analysis/check.go b/internal/analysis/check.go index f3804bc0..641dd066 100644 --- a/internal/analysis/check.go +++ b/internal/analysis/check.go @@ -675,6 +675,7 @@ func (res *CheckResult) checkSource(source parser.Source) { case *parser.SourceWithScaling: res.checkExpression(source.Address, TypeAccount) + res.checkExpression(source.Through, TypeAccount) res.checkExpression(source.Color, TypeString) case *parser.SourceInorder: diff --git a/internal/interpreter/batch_balances_query.go b/internal/interpreter/batch_balances_query.go index d9ad17ce..6d95df4a 100644 --- a/internal/interpreter/batch_balances_query.go +++ b/internal/interpreter/batch_balances_query.go @@ -103,6 +103,7 @@ func (st *programState) findBalancesQueries(source parser.Source) InterpreterErr if err != nil { return err } + // NOTE we don't query the swap account's balance color, err := evaluateOptExprAs(st, source.Color, expectString) if err != nil { diff --git a/internal/interpreter/interpreter.go b/internal/interpreter/interpreter.go index b57418cd..de9e680a 100644 --- a/internal/interpreter/interpreter.go +++ b/internal/interpreter/interpreter.go @@ -582,6 +582,11 @@ func (s *programState) sendAll(source parser.Source) (*big.Int, InterpreterError return nil, err } + scalingAccount, err := evaluateExprAs(s, source.Through, expectAccount) + if err != nil { + return nil, err + } + baseAsset, assetScale := getAssetScale(s.CurrentAsset) acc, ok := s.CachedBalances[*account] if !ok { @@ -603,7 +608,7 @@ func (s *programState) sendAll(source parser.Source) (*big.Int, InterpreterError asset := buildScaledAsset(baseAsset, scale) s.Postings = append(s.Postings, Posting{ Source: *account, - Destination: fmt.Sprintf("%s:scaling", *account), + Destination: fmt.Sprintf("%s:%s", *account, *scalingAccount), Amount: new(big.Int).Set(convAmt), Asset: asset, }) @@ -611,7 +616,7 @@ func (s *programState) sendAll(source parser.Source) (*big.Int, InterpreterError } s.Postings = append(s.Postings, Posting{ - Source: fmt.Sprintf("%s:scaling", *account), + Source: fmt.Sprintf("%s:%s", *account, *scalingAccount), Destination: *account, Amount: new(big.Int).Set(totSent), Asset: s.CurrentAsset, @@ -743,6 +748,10 @@ func (s *programState) trySendingUpTo(source parser.Source, amount *big.Int) (*b if err != nil { return nil, err } + scalingAccount, err := evaluateExprAs(s, source.Through, expectAccount) + if err != nil { + return nil, err + } baseAsset, assetScale := getAssetScale(s.CurrentAsset) acc, ok := s.CachedBalances[*account] @@ -770,7 +779,7 @@ func (s *programState) trySendingUpTo(source parser.Source, amount *big.Int) (*b asset := buildScaledAsset(baseAsset, scale) s.Postings = append(s.Postings, Posting{ Source: *account, - Destination: fmt.Sprintf("%s:scaling", *account), + Destination: fmt.Sprintf("%s:%s", *account, *scalingAccount), Amount: new(big.Int).Set(sending), Asset: asset, }) @@ -778,7 +787,7 @@ func (s *programState) trySendingUpTo(source parser.Source, amount *big.Int) (*b } s.Postings = append(s.Postings, Posting{ - Source: fmt.Sprintf("%s:scaling", *account), + Source: fmt.Sprintf("%s:%s", *account, *scalingAccount), Destination: *account, Amount: new(big.Int).Set(amount), Asset: s.CurrentAsset, diff --git a/internal/interpreter/interpreter_test.go b/internal/interpreter/interpreter_test.go index ebf9aa3c..d64b7007 100644 --- a/internal/interpreter/interpreter_test.go +++ b/internal/interpreter/interpreter_test.go @@ -1144,7 +1144,7 @@ func TestSafeWithdraft(t *testing.T) { func TestInvalidScalingWorld(t *testing.T) { script := ` send [EUR/2 *] ( - source = @world with scaling + source = @world with scaling through @swap destination = @dest ) ` diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num index 59441253..4f5e190c 100644 --- a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num @@ -1,7 +1,7 @@ send [EUR/2 *] ( source = { @acc1 - @acc2 with scaling + @acc2 with scaling through @swap } destination = @dest ) diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num.specs.json index b1806802..c305ee82 100644 --- a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num.specs.json +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num.specs.json @@ -19,12 +19,12 @@ "expect.postings": [ { "source": "acc2", - "destination": "acc2:scaling", + "destination": "acc2:swap", "amount": 500, "asset": "EUR/3" }, { - "source": "acc2:scaling", + "source": "acc2:swap", "destination": "acc2", "amount": 50, "asset": "EUR/2" diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num index 849747a2..325dd87c 100644 --- a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num @@ -1,7 +1,7 @@ send [EUR/2 100] ( source = { @acc1 - @acc2 with scaling + @acc2 with scaling through @swap } destination = @dest ) diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num.specs.json index 04e7699f..d57a865c 100644 --- a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num.specs.json +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num.specs.json @@ -19,12 +19,12 @@ "expect.postings": [ { "source": "acc2", - "destination": "acc2:scaling", + "destination": "acc2:swap", "amount": 500, "asset": "EUR/3" }, { - "source": "acc2:scaling", + "source": "acc2:swap", "destination": "acc2", "amount": 50, "asset": "EUR/2" @@ -53,12 +53,12 @@ "expect.postings": [ { "source": "acc2", - "destination": "acc2:scaling", + "destination": "acc2:swap", "amount": 50, "asset": "EUR/2" }, { - "source": "acc2:scaling", + "source": "acc2:swap", "destination": "acc2", "amount": 50, "asset": "EUR/2" diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num index 0af2006d..c3e85df4 100644 --- a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num @@ -1,5 +1,5 @@ send [BTC/2 *] ( - source = @acc with scaling + source = @acc with scaling through @swap destination = { remaining kept } diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num.specs.json index 04a2b7fc..61798405 100644 --- a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num.specs.json +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num.specs.json @@ -15,18 +15,18 @@ "expect.postings": [ { "source": "acc", - "destination": "acc:scaling", + "destination": "acc:swap", "amount": 2, "asset": "BTC/2" }, { "source": "acc", - "destination": "acc:scaling", + "destination": "acc:swap", "amount": 1000000, "asset": "BTC/8" }, { - "source": "acc:scaling", + "source": "acc:swap", "destination": "acc", "amount": 3, "asset": "BTC/2" diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num index 9cbb7fb2..d62b3abd 100644 --- a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num @@ -1,5 +1,5 @@ send [EUR/2 *] ( - source = @src with scaling + source = @src with scaling through @swap destination = @dest ) diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num.specs.json index d40f9ca4..6db50d23 100644 --- a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num.specs.json +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num.specs.json @@ -16,24 +16,24 @@ "expect.postings": [ { "source": "src", - "destination": "src:scaling", + "destination": "src:swap", "amount": 2, "asset": "EUR" }, { "source": "src", - "destination": "src:scaling", + "destination": "src:swap", "amount": 1, "asset": "EUR/2" }, { "source": "src", - "destination": "src:scaling", + "destination": "src:swap", "amount": 30, "asset": "EUR/3" }, { - "source": "src:scaling", + "source": "src:swap", "destination": "src", "amount": 204, "asset": "EUR/2" @@ -56,12 +56,12 @@ "expect.postings": [ { "source": "src", - "destination": "src:scaling", + "destination": "src:swap", "amount": 20, "asset": "EUR/3" }, { - "source": "src:scaling", + "source": "src:swap", "destination": "src", "amount": 2, "asset": "EUR/2" diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num index 0d9fcccc..a88683f9 100644 --- a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num @@ -1,4 +1,4 @@ send [EUR/2 400] ( - source = @src with scaling + source = @src with scaling through @swap destination = @dest ) diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num.specs.json index e0b0eb79..7d81637c 100644 --- a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num.specs.json +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num.specs.json @@ -15,12 +15,12 @@ "expect.postings": [ { "source": "src", - "destination": "src:scaling", + "destination": "src:swap", "asset": "EUR", "amount": 4 }, { - "source": "src:scaling", + "source": "src:swap", "destination": "src", "asset": "EUR/2", "amount": 400 @@ -43,12 +43,12 @@ "expect.postings": [ { "source": "src", - "destination": "src:scaling", + "destination": "src:swap", "asset": "EUR/3", "amount": 4000 }, { - "source": "src:scaling", + "source": "src:swap", "destination": "src", "asset": "EUR/2", "amount": 400 @@ -72,18 +72,18 @@ "expect.postings": [ { "source": "src", - "destination": "src:scaling", + "destination": "src:swap", "asset": "EUR", "amount": 2 }, { "source": "src", - "destination": "src:scaling", + "destination": "src:swap", "asset": "EUR/2", "amount": 200 }, { - "source": "src:scaling", + "source": "src:swap", "destination": "src", "asset": "EUR/2", "amount": 400 diff --git a/internal/parser/__snapshots__/parser_test.snap b/internal/parser/__snapshots__/parser_test.snap index ad7917e2..6da35fbf 100755 --- a/internal/parser/__snapshots__/parser_test.snap +++ b/internal/parser/__snapshots__/parser_test.snap @@ -3439,7 +3439,7 @@ parser.Program{ Source: &parser.SourceWithScaling{ Range: parser.Range{ Start: parser.Position{Character:11, Line:1}, - End: parser.Position{Character:28, Line:1}, + End: parser.Position{Character:42, Line:1}, }, Color: nil, Address: &parser.AccountInterpLiteral{ @@ -3451,6 +3451,15 @@ parser.Program{ parser.AccountTextPart{Name:"src"}, }, }, + Through: &parser.AccountInterpLiteral{ + Range: parser.Range{ + Start: parser.Position{Character:37, Line:1}, + End: parser.Position{Character:42, Line:1}, + }, + Parts: { + parser.AccountTextPart{Name:"swap"}, + }, + }, }, Destination: &parser.DestinationAccount{ ValueExpr: &parser.AccountInterpLiteral{ diff --git a/internal/parser/antlrParser/Lexer.interp b/internal/parser/antlrParser/Lexer.interp index 78972f7b..15366d9e 100644 --- a/internal/parser/antlrParser/Lexer.interp +++ b/internal/parser/antlrParser/Lexer.interp @@ -34,6 +34,7 @@ null '\\' 'with' 'scaling' +'through' null null null @@ -81,6 +82,7 @@ DIV RESTRICT WITH SCALING +THROUGH PERCENTAGE_PORTION_LITERAL STRING IDENTIFIER @@ -127,6 +129,7 @@ DIV RESTRICT WITH SCALING +THROUGH PERCENTAGE_PORTION_LITERAL STRING IDENTIFIER @@ -148,4 +151,4 @@ DEFAULT_MODE ACCOUNT_MODE atn: -[4, 0, 44, 371, 6, -1, 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, 1, 0, 4, 0, 94, 8, 0, 11, 0, 12, 0, 95, 1, 0, 1, 0, 1, 1, 4, 1, 101, 8, 1, 11, 1, 12, 1, 102, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 110, 8, 2, 10, 2, 12, 2, 113, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 124, 8, 3, 10, 3, 12, 3, 127, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 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, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 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, 34, 4, 34, 272, 8, 34, 11, 34, 12, 34, 273, 1, 34, 1, 34, 4, 34, 278, 8, 34, 11, 34, 12, 34, 279, 3, 34, 282, 8, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 5, 35, 290, 8, 35, 10, 35, 12, 35, 293, 9, 35, 1, 35, 1, 35, 1, 36, 4, 36, 298, 8, 36, 11, 36, 12, 36, 299, 1, 36, 5, 36, 303, 8, 36, 10, 36, 12, 36, 306, 9, 36, 1, 37, 4, 37, 309, 8, 37, 11, 37, 12, 37, 310, 1, 37, 1, 37, 4, 37, 315, 8, 37, 11, 37, 12, 37, 316, 5, 37, 319, 8, 37, 10, 37, 12, 37, 322, 9, 37, 1, 38, 1, 38, 5, 38, 326, 8, 38, 10, 38, 12, 38, 329, 9, 38, 1, 38, 1, 38, 4, 38, 333, 8, 38, 11, 38, 12, 38, 334, 3, 38, 337, 8, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 4, 41, 349, 8, 41, 11, 41, 12, 41, 350, 1, 41, 5, 41, 354, 8, 41, 10, 41, 12, 41, 357, 9, 41, 1, 42, 4, 42, 360, 8, 42, 11, 42, 12, 42, 361, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 2, 111, 125, 0, 45, 2, 1, 4, 2, 6, 3, 8, 4, 10, 5, 12, 6, 14, 7, 16, 8, 18, 9, 20, 10, 22, 11, 24, 12, 26, 13, 28, 14, 30, 15, 32, 16, 34, 17, 36, 18, 38, 19, 40, 20, 42, 21, 44, 22, 46, 23, 48, 24, 50, 25, 52, 26, 54, 27, 56, 28, 58, 29, 60, 30, 62, 31, 64, 32, 66, 33, 68, 34, 70, 35, 72, 36, 74, 37, 76, 38, 78, 39, 80, 40, 82, 41, 84, 0, 86, 42, 88, 43, 90, 44, 2, 0, 1, 10, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, 57, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, 2, 0, 95, 95, 97, 122, 1, 0, 65, 90, 2, 0, 48, 57, 65, 90, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 389, 0, 2, 1, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 6, 1, 0, 0, 0, 0, 8, 1, 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 14, 1, 0, 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 24, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, 1, 0, 0, 0, 0, 36, 1, 0, 0, 0, 0, 38, 1, 0, 0, 0, 0, 40, 1, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 44, 1, 0, 0, 0, 0, 46, 1, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 50, 1, 0, 0, 0, 0, 52, 1, 0, 0, 0, 0, 54, 1, 0, 0, 0, 0, 56, 1, 0, 0, 0, 0, 58, 1, 0, 0, 0, 0, 60, 1, 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 66, 1, 0, 0, 0, 0, 68, 1, 0, 0, 0, 0, 70, 1, 0, 0, 0, 0, 72, 1, 0, 0, 0, 0, 74, 1, 0, 0, 0, 0, 76, 1, 0, 0, 0, 0, 78, 1, 0, 0, 0, 0, 80, 1, 0, 0, 0, 0, 82, 1, 0, 0, 0, 0, 90, 1, 0, 0, 0, 1, 86, 1, 0, 0, 0, 1, 88, 1, 0, 0, 0, 2, 93, 1, 0, 0, 0, 4, 100, 1, 0, 0, 0, 6, 104, 1, 0, 0, 0, 8, 119, 1, 0, 0, 0, 10, 132, 1, 0, 0, 0, 12, 137, 1, 0, 0, 0, 14, 141, 1, 0, 0, 0, 16, 148, 1, 0, 0, 0, 18, 160, 1, 0, 0, 0, 20, 165, 1, 0, 0, 0, 22, 170, 1, 0, 0, 0, 24, 173, 1, 0, 0, 0, 26, 176, 1, 0, 0, 0, 28, 186, 1, 0, 0, 0, 30, 195, 1, 0, 0, 0, 32, 205, 1, 0, 0, 0, 34, 215, 1, 0, 0, 0, 36, 221, 1, 0, 0, 0, 38, 226, 1, 0, 0, 0, 40, 231, 1, 0, 0, 0, 42, 233, 1, 0, 0, 0, 44, 235, 1, 0, 0, 0, 46, 237, 1, 0, 0, 0, 48, 239, 1, 0, 0, 0, 50, 241, 1, 0, 0, 0, 52, 243, 1, 0, 0, 0, 54, 245, 1, 0, 0, 0, 56, 247, 1, 0, 0, 0, 58, 249, 1, 0, 0, 0, 60, 251, 1, 0, 0, 0, 62, 253, 1, 0, 0, 0, 64, 255, 1, 0, 0, 0, 66, 257, 1, 0, 0, 0, 68, 262, 1, 0, 0, 0, 70, 271, 1, 0, 0, 0, 72, 285, 1, 0, 0, 0, 74, 297, 1, 0, 0, 0, 76, 308, 1, 0, 0, 0, 78, 323, 1, 0, 0, 0, 80, 338, 1, 0, 0, 0, 82, 342, 1, 0, 0, 0, 84, 346, 1, 0, 0, 0, 86, 359, 1, 0, 0, 0, 88, 365, 1, 0, 0, 0, 90, 369, 1, 0, 0, 0, 92, 94, 7, 0, 0, 0, 93, 92, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 6, 0, 0, 0, 98, 3, 1, 0, 0, 0, 99, 101, 7, 1, 0, 0, 100, 99, 1, 0, 0, 0, 101, 102, 1, 0, 0, 0, 102, 100, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 5, 1, 0, 0, 0, 104, 105, 5, 47, 0, 0, 105, 106, 5, 42, 0, 0, 106, 111, 1, 0, 0, 0, 107, 110, 3, 6, 2, 0, 108, 110, 9, 0, 0, 0, 109, 107, 1, 0, 0, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 115, 5, 42, 0, 0, 115, 116, 5, 47, 0, 0, 116, 117, 1, 0, 0, 0, 117, 118, 6, 2, 0, 0, 118, 7, 1, 0, 0, 0, 119, 120, 5, 47, 0, 0, 120, 121, 5, 47, 0, 0, 121, 125, 1, 0, 0, 0, 122, 124, 9, 0, 0, 0, 123, 122, 1, 0, 0, 0, 124, 127, 1, 0, 0, 0, 125, 126, 1, 0, 0, 0, 125, 123, 1, 0, 0, 0, 126, 128, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 128, 129, 3, 4, 1, 0, 129, 130, 1, 0, 0, 0, 130, 131, 6, 3, 1, 0, 131, 9, 1, 0, 0, 0, 132, 133, 5, 118, 0, 0, 133, 134, 5, 97, 0, 0, 134, 135, 5, 114, 0, 0, 135, 136, 5, 115, 0, 0, 136, 11, 1, 0, 0, 0, 137, 138, 5, 109, 0, 0, 138, 139, 5, 97, 0, 0, 139, 140, 5, 120, 0, 0, 140, 13, 1, 0, 0, 0, 141, 142, 5, 115, 0, 0, 142, 143, 5, 111, 0, 0, 143, 144, 5, 117, 0, 0, 144, 145, 5, 114, 0, 0, 145, 146, 5, 99, 0, 0, 146, 147, 5, 101, 0, 0, 147, 15, 1, 0, 0, 0, 148, 149, 5, 100, 0, 0, 149, 150, 5, 101, 0, 0, 150, 151, 5, 115, 0, 0, 151, 152, 5, 116, 0, 0, 152, 153, 5, 105, 0, 0, 153, 154, 5, 110, 0, 0, 154, 155, 5, 97, 0, 0, 155, 156, 5, 116, 0, 0, 156, 157, 5, 105, 0, 0, 157, 158, 5, 111, 0, 0, 158, 159, 5, 110, 0, 0, 159, 17, 1, 0, 0, 0, 160, 161, 5, 115, 0, 0, 161, 162, 5, 101, 0, 0, 162, 163, 5, 110, 0, 0, 163, 164, 5, 100, 0, 0, 164, 19, 1, 0, 0, 0, 165, 166, 5, 102, 0, 0, 166, 167, 5, 114, 0, 0, 167, 168, 5, 111, 0, 0, 168, 169, 5, 109, 0, 0, 169, 21, 1, 0, 0, 0, 170, 171, 5, 117, 0, 0, 171, 172, 5, 112, 0, 0, 172, 23, 1, 0, 0, 0, 173, 174, 5, 116, 0, 0, 174, 175, 5, 111, 0, 0, 175, 25, 1, 0, 0, 0, 176, 177, 5, 114, 0, 0, 177, 178, 5, 101, 0, 0, 178, 179, 5, 109, 0, 0, 179, 180, 5, 97, 0, 0, 180, 181, 5, 105, 0, 0, 181, 182, 5, 110, 0, 0, 182, 183, 5, 105, 0, 0, 183, 184, 5, 110, 0, 0, 184, 185, 5, 103, 0, 0, 185, 27, 1, 0, 0, 0, 186, 187, 5, 97, 0, 0, 187, 188, 5, 108, 0, 0, 188, 189, 5, 108, 0, 0, 189, 190, 5, 111, 0, 0, 190, 191, 5, 119, 0, 0, 191, 192, 5, 105, 0, 0, 192, 193, 5, 110, 0, 0, 193, 194, 5, 103, 0, 0, 194, 29, 1, 0, 0, 0, 195, 196, 5, 117, 0, 0, 196, 197, 5, 110, 0, 0, 197, 198, 5, 98, 0, 0, 198, 199, 5, 111, 0, 0, 199, 200, 5, 117, 0, 0, 200, 201, 5, 110, 0, 0, 201, 202, 5, 100, 0, 0, 202, 203, 5, 101, 0, 0, 203, 204, 5, 100, 0, 0, 204, 31, 1, 0, 0, 0, 205, 206, 5, 111, 0, 0, 206, 207, 5, 118, 0, 0, 207, 208, 5, 101, 0, 0, 208, 209, 5, 114, 0, 0, 209, 210, 5, 100, 0, 0, 210, 211, 5, 114, 0, 0, 211, 212, 5, 97, 0, 0, 212, 213, 5, 102, 0, 0, 213, 214, 5, 116, 0, 0, 214, 33, 1, 0, 0, 0, 215, 216, 5, 111, 0, 0, 216, 217, 5, 110, 0, 0, 217, 218, 5, 101, 0, 0, 218, 219, 5, 111, 0, 0, 219, 220, 5, 102, 0, 0, 220, 35, 1, 0, 0, 0, 221, 222, 5, 107, 0, 0, 222, 223, 5, 101, 0, 0, 223, 224, 5, 112, 0, 0, 224, 225, 5, 116, 0, 0, 225, 37, 1, 0, 0, 0, 226, 227, 5, 115, 0, 0, 227, 228, 5, 97, 0, 0, 228, 229, 5, 118, 0, 0, 229, 230, 5, 101, 0, 0, 230, 39, 1, 0, 0, 0, 231, 232, 5, 40, 0, 0, 232, 41, 1, 0, 0, 0, 233, 234, 5, 41, 0, 0, 234, 43, 1, 0, 0, 0, 235, 236, 5, 91, 0, 0, 236, 45, 1, 0, 0, 0, 237, 238, 5, 93, 0, 0, 238, 47, 1, 0, 0, 0, 239, 240, 5, 123, 0, 0, 240, 49, 1, 0, 0, 0, 241, 242, 5, 125, 0, 0, 242, 51, 1, 0, 0, 0, 243, 244, 5, 44, 0, 0, 244, 53, 1, 0, 0, 0, 245, 246, 5, 61, 0, 0, 246, 55, 1, 0, 0, 0, 247, 248, 5, 42, 0, 0, 248, 57, 1, 0, 0, 0, 249, 250, 5, 43, 0, 0, 250, 59, 1, 0, 0, 0, 251, 252, 5, 45, 0, 0, 252, 61, 1, 0, 0, 0, 253, 254, 5, 47, 0, 0, 254, 63, 1, 0, 0, 0, 255, 256, 5, 92, 0, 0, 256, 65, 1, 0, 0, 0, 257, 258, 5, 119, 0, 0, 258, 259, 5, 105, 0, 0, 259, 260, 5, 116, 0, 0, 260, 261, 5, 104, 0, 0, 261, 67, 1, 0, 0, 0, 262, 263, 5, 115, 0, 0, 263, 264, 5, 99, 0, 0, 264, 265, 5, 97, 0, 0, 265, 266, 5, 108, 0, 0, 266, 267, 5, 105, 0, 0, 267, 268, 5, 110, 0, 0, 268, 269, 5, 103, 0, 0, 269, 69, 1, 0, 0, 0, 270, 272, 7, 2, 0, 0, 271, 270, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 271, 1, 0, 0, 0, 273, 274, 1, 0, 0, 0, 274, 281, 1, 0, 0, 0, 275, 277, 5, 46, 0, 0, 276, 278, 7, 2, 0, 0, 277, 276, 1, 0, 0, 0, 278, 279, 1, 0, 0, 0, 279, 277, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 282, 1, 0, 0, 0, 281, 275, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 284, 5, 37, 0, 0, 284, 71, 1, 0, 0, 0, 285, 291, 5, 34, 0, 0, 286, 287, 5, 92, 0, 0, 287, 290, 5, 34, 0, 0, 288, 290, 8, 3, 0, 0, 289, 286, 1, 0, 0, 0, 289, 288, 1, 0, 0, 0, 290, 293, 1, 0, 0, 0, 291, 289, 1, 0, 0, 0, 291, 292, 1, 0, 0, 0, 292, 294, 1, 0, 0, 0, 293, 291, 1, 0, 0, 0, 294, 295, 5, 34, 0, 0, 295, 73, 1, 0, 0, 0, 296, 298, 7, 4, 0, 0, 297, 296, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 297, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 304, 1, 0, 0, 0, 301, 303, 7, 5, 0, 0, 302, 301, 1, 0, 0, 0, 303, 306, 1, 0, 0, 0, 304, 302, 1, 0, 0, 0, 304, 305, 1, 0, 0, 0, 305, 75, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 307, 309, 7, 2, 0, 0, 308, 307, 1, 0, 0, 0, 309, 310, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 320, 1, 0, 0, 0, 312, 314, 5, 95, 0, 0, 313, 315, 7, 2, 0, 0, 314, 313, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 314, 1, 0, 0, 0, 316, 317, 1, 0, 0, 0, 317, 319, 1, 0, 0, 0, 318, 312, 1, 0, 0, 0, 319, 322, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 77, 1, 0, 0, 0, 322, 320, 1, 0, 0, 0, 323, 327, 7, 6, 0, 0, 324, 326, 7, 7, 0, 0, 325, 324, 1, 0, 0, 0, 326, 329, 1, 0, 0, 0, 327, 325, 1, 0, 0, 0, 327, 328, 1, 0, 0, 0, 328, 336, 1, 0, 0, 0, 329, 327, 1, 0, 0, 0, 330, 332, 5, 47, 0, 0, 331, 333, 7, 2, 0, 0, 332, 331, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 332, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 337, 1, 0, 0, 0, 336, 330, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 79, 1, 0, 0, 0, 338, 339, 5, 64, 0, 0, 339, 340, 1, 0, 0, 0, 340, 341, 6, 39, 2, 0, 341, 81, 1, 0, 0, 0, 342, 343, 5, 58, 0, 0, 343, 344, 1, 0, 0, 0, 344, 345, 6, 40, 2, 0, 345, 83, 1, 0, 0, 0, 346, 348, 5, 36, 0, 0, 347, 349, 7, 5, 0, 0, 348, 347, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 348, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 355, 1, 0, 0, 0, 352, 354, 7, 8, 0, 0, 353, 352, 1, 0, 0, 0, 354, 357, 1, 0, 0, 0, 355, 353, 1, 0, 0, 0, 355, 356, 1, 0, 0, 0, 356, 85, 1, 0, 0, 0, 357, 355, 1, 0, 0, 0, 358, 360, 7, 9, 0, 0, 359, 358, 1, 0, 0, 0, 360, 361, 1, 0, 0, 0, 361, 359, 1, 0, 0, 0, 361, 362, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 364, 6, 42, 3, 0, 364, 87, 1, 0, 0, 0, 365, 366, 3, 84, 41, 0, 366, 367, 1, 0, 0, 0, 367, 368, 6, 43, 3, 0, 368, 89, 1, 0, 0, 0, 369, 370, 3, 84, 41, 0, 370, 91, 1, 0, 0, 0, 23, 0, 1, 95, 102, 109, 111, 125, 273, 279, 281, 289, 291, 299, 304, 310, 316, 320, 327, 334, 336, 350, 355, 361, 4, 6, 0, 0, 0, 1, 0, 5, 1, 0, 4, 0, 0] \ No newline at end of file +[4, 0, 45, 381, 6, -1, 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, 1, 0, 4, 0, 96, 8, 0, 11, 0, 12, 0, 97, 1, 0, 1, 0, 1, 1, 4, 1, 103, 8, 1, 11, 1, 12, 1, 104, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 112, 8, 2, 10, 2, 12, 2, 115, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 126, 8, 3, 10, 3, 12, 3, 129, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 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, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 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, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 4, 35, 282, 8, 35, 11, 35, 12, 35, 283, 1, 35, 1, 35, 4, 35, 288, 8, 35, 11, 35, 12, 35, 289, 3, 35, 292, 8, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 5, 36, 300, 8, 36, 10, 36, 12, 36, 303, 9, 36, 1, 36, 1, 36, 1, 37, 4, 37, 308, 8, 37, 11, 37, 12, 37, 309, 1, 37, 5, 37, 313, 8, 37, 10, 37, 12, 37, 316, 9, 37, 1, 38, 4, 38, 319, 8, 38, 11, 38, 12, 38, 320, 1, 38, 1, 38, 4, 38, 325, 8, 38, 11, 38, 12, 38, 326, 5, 38, 329, 8, 38, 10, 38, 12, 38, 332, 9, 38, 1, 39, 1, 39, 5, 39, 336, 8, 39, 10, 39, 12, 39, 339, 9, 39, 1, 39, 1, 39, 4, 39, 343, 8, 39, 11, 39, 12, 39, 344, 3, 39, 347, 8, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 4, 42, 359, 8, 42, 11, 42, 12, 42, 360, 1, 42, 5, 42, 364, 8, 42, 10, 42, 12, 42, 367, 9, 42, 1, 43, 4, 43, 370, 8, 43, 11, 43, 12, 43, 371, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 2, 113, 127, 0, 46, 2, 1, 4, 2, 6, 3, 8, 4, 10, 5, 12, 6, 14, 7, 16, 8, 18, 9, 20, 10, 22, 11, 24, 12, 26, 13, 28, 14, 30, 15, 32, 16, 34, 17, 36, 18, 38, 19, 40, 20, 42, 21, 44, 22, 46, 23, 48, 24, 50, 25, 52, 26, 54, 27, 56, 28, 58, 29, 60, 30, 62, 31, 64, 32, 66, 33, 68, 34, 70, 35, 72, 36, 74, 37, 76, 38, 78, 39, 80, 40, 82, 41, 84, 42, 86, 0, 88, 43, 90, 44, 92, 45, 2, 0, 1, 10, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, 57, 3, 0, 10, 10, 13, 13, 34, 34, 1, 0, 97, 122, 2, 0, 95, 95, 97, 122, 1, 0, 65, 90, 2, 0, 48, 57, 65, 90, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 399, 0, 2, 1, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 6, 1, 0, 0, 0, 0, 8, 1, 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 14, 1, 0, 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 24, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, 1, 0, 0, 0, 0, 36, 1, 0, 0, 0, 0, 38, 1, 0, 0, 0, 0, 40, 1, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 44, 1, 0, 0, 0, 0, 46, 1, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 50, 1, 0, 0, 0, 0, 52, 1, 0, 0, 0, 0, 54, 1, 0, 0, 0, 0, 56, 1, 0, 0, 0, 0, 58, 1, 0, 0, 0, 0, 60, 1, 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 66, 1, 0, 0, 0, 0, 68, 1, 0, 0, 0, 0, 70, 1, 0, 0, 0, 0, 72, 1, 0, 0, 0, 0, 74, 1, 0, 0, 0, 0, 76, 1, 0, 0, 0, 0, 78, 1, 0, 0, 0, 0, 80, 1, 0, 0, 0, 0, 82, 1, 0, 0, 0, 0, 84, 1, 0, 0, 0, 0, 92, 1, 0, 0, 0, 1, 88, 1, 0, 0, 0, 1, 90, 1, 0, 0, 0, 2, 95, 1, 0, 0, 0, 4, 102, 1, 0, 0, 0, 6, 106, 1, 0, 0, 0, 8, 121, 1, 0, 0, 0, 10, 134, 1, 0, 0, 0, 12, 139, 1, 0, 0, 0, 14, 143, 1, 0, 0, 0, 16, 150, 1, 0, 0, 0, 18, 162, 1, 0, 0, 0, 20, 167, 1, 0, 0, 0, 22, 172, 1, 0, 0, 0, 24, 175, 1, 0, 0, 0, 26, 178, 1, 0, 0, 0, 28, 188, 1, 0, 0, 0, 30, 197, 1, 0, 0, 0, 32, 207, 1, 0, 0, 0, 34, 217, 1, 0, 0, 0, 36, 223, 1, 0, 0, 0, 38, 228, 1, 0, 0, 0, 40, 233, 1, 0, 0, 0, 42, 235, 1, 0, 0, 0, 44, 237, 1, 0, 0, 0, 46, 239, 1, 0, 0, 0, 48, 241, 1, 0, 0, 0, 50, 243, 1, 0, 0, 0, 52, 245, 1, 0, 0, 0, 54, 247, 1, 0, 0, 0, 56, 249, 1, 0, 0, 0, 58, 251, 1, 0, 0, 0, 60, 253, 1, 0, 0, 0, 62, 255, 1, 0, 0, 0, 64, 257, 1, 0, 0, 0, 66, 259, 1, 0, 0, 0, 68, 264, 1, 0, 0, 0, 70, 272, 1, 0, 0, 0, 72, 281, 1, 0, 0, 0, 74, 295, 1, 0, 0, 0, 76, 307, 1, 0, 0, 0, 78, 318, 1, 0, 0, 0, 80, 333, 1, 0, 0, 0, 82, 348, 1, 0, 0, 0, 84, 352, 1, 0, 0, 0, 86, 356, 1, 0, 0, 0, 88, 369, 1, 0, 0, 0, 90, 375, 1, 0, 0, 0, 92, 379, 1, 0, 0, 0, 94, 96, 7, 0, 0, 0, 95, 94, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 100, 6, 0, 0, 0, 100, 3, 1, 0, 0, 0, 101, 103, 7, 1, 0, 0, 102, 101, 1, 0, 0, 0, 103, 104, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 5, 1, 0, 0, 0, 106, 107, 5, 47, 0, 0, 107, 108, 5, 42, 0, 0, 108, 113, 1, 0, 0, 0, 109, 112, 3, 6, 2, 0, 110, 112, 9, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 110, 1, 0, 0, 0, 112, 115, 1, 0, 0, 0, 113, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 116, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 116, 117, 5, 42, 0, 0, 117, 118, 5, 47, 0, 0, 118, 119, 1, 0, 0, 0, 119, 120, 6, 2, 0, 0, 120, 7, 1, 0, 0, 0, 121, 122, 5, 47, 0, 0, 122, 123, 5, 47, 0, 0, 123, 127, 1, 0, 0, 0, 124, 126, 9, 0, 0, 0, 125, 124, 1, 0, 0, 0, 126, 129, 1, 0, 0, 0, 127, 128, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 128, 130, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 130, 131, 3, 4, 1, 0, 131, 132, 1, 0, 0, 0, 132, 133, 6, 3, 1, 0, 133, 9, 1, 0, 0, 0, 134, 135, 5, 118, 0, 0, 135, 136, 5, 97, 0, 0, 136, 137, 5, 114, 0, 0, 137, 138, 5, 115, 0, 0, 138, 11, 1, 0, 0, 0, 139, 140, 5, 109, 0, 0, 140, 141, 5, 97, 0, 0, 141, 142, 5, 120, 0, 0, 142, 13, 1, 0, 0, 0, 143, 144, 5, 115, 0, 0, 144, 145, 5, 111, 0, 0, 145, 146, 5, 117, 0, 0, 146, 147, 5, 114, 0, 0, 147, 148, 5, 99, 0, 0, 148, 149, 5, 101, 0, 0, 149, 15, 1, 0, 0, 0, 150, 151, 5, 100, 0, 0, 151, 152, 5, 101, 0, 0, 152, 153, 5, 115, 0, 0, 153, 154, 5, 116, 0, 0, 154, 155, 5, 105, 0, 0, 155, 156, 5, 110, 0, 0, 156, 157, 5, 97, 0, 0, 157, 158, 5, 116, 0, 0, 158, 159, 5, 105, 0, 0, 159, 160, 5, 111, 0, 0, 160, 161, 5, 110, 0, 0, 161, 17, 1, 0, 0, 0, 162, 163, 5, 115, 0, 0, 163, 164, 5, 101, 0, 0, 164, 165, 5, 110, 0, 0, 165, 166, 5, 100, 0, 0, 166, 19, 1, 0, 0, 0, 167, 168, 5, 102, 0, 0, 168, 169, 5, 114, 0, 0, 169, 170, 5, 111, 0, 0, 170, 171, 5, 109, 0, 0, 171, 21, 1, 0, 0, 0, 172, 173, 5, 117, 0, 0, 173, 174, 5, 112, 0, 0, 174, 23, 1, 0, 0, 0, 175, 176, 5, 116, 0, 0, 176, 177, 5, 111, 0, 0, 177, 25, 1, 0, 0, 0, 178, 179, 5, 114, 0, 0, 179, 180, 5, 101, 0, 0, 180, 181, 5, 109, 0, 0, 181, 182, 5, 97, 0, 0, 182, 183, 5, 105, 0, 0, 183, 184, 5, 110, 0, 0, 184, 185, 5, 105, 0, 0, 185, 186, 5, 110, 0, 0, 186, 187, 5, 103, 0, 0, 187, 27, 1, 0, 0, 0, 188, 189, 5, 97, 0, 0, 189, 190, 5, 108, 0, 0, 190, 191, 5, 108, 0, 0, 191, 192, 5, 111, 0, 0, 192, 193, 5, 119, 0, 0, 193, 194, 5, 105, 0, 0, 194, 195, 5, 110, 0, 0, 195, 196, 5, 103, 0, 0, 196, 29, 1, 0, 0, 0, 197, 198, 5, 117, 0, 0, 198, 199, 5, 110, 0, 0, 199, 200, 5, 98, 0, 0, 200, 201, 5, 111, 0, 0, 201, 202, 5, 117, 0, 0, 202, 203, 5, 110, 0, 0, 203, 204, 5, 100, 0, 0, 204, 205, 5, 101, 0, 0, 205, 206, 5, 100, 0, 0, 206, 31, 1, 0, 0, 0, 207, 208, 5, 111, 0, 0, 208, 209, 5, 118, 0, 0, 209, 210, 5, 101, 0, 0, 210, 211, 5, 114, 0, 0, 211, 212, 5, 100, 0, 0, 212, 213, 5, 114, 0, 0, 213, 214, 5, 97, 0, 0, 214, 215, 5, 102, 0, 0, 215, 216, 5, 116, 0, 0, 216, 33, 1, 0, 0, 0, 217, 218, 5, 111, 0, 0, 218, 219, 5, 110, 0, 0, 219, 220, 5, 101, 0, 0, 220, 221, 5, 111, 0, 0, 221, 222, 5, 102, 0, 0, 222, 35, 1, 0, 0, 0, 223, 224, 5, 107, 0, 0, 224, 225, 5, 101, 0, 0, 225, 226, 5, 112, 0, 0, 226, 227, 5, 116, 0, 0, 227, 37, 1, 0, 0, 0, 228, 229, 5, 115, 0, 0, 229, 230, 5, 97, 0, 0, 230, 231, 5, 118, 0, 0, 231, 232, 5, 101, 0, 0, 232, 39, 1, 0, 0, 0, 233, 234, 5, 40, 0, 0, 234, 41, 1, 0, 0, 0, 235, 236, 5, 41, 0, 0, 236, 43, 1, 0, 0, 0, 237, 238, 5, 91, 0, 0, 238, 45, 1, 0, 0, 0, 239, 240, 5, 93, 0, 0, 240, 47, 1, 0, 0, 0, 241, 242, 5, 123, 0, 0, 242, 49, 1, 0, 0, 0, 243, 244, 5, 125, 0, 0, 244, 51, 1, 0, 0, 0, 245, 246, 5, 44, 0, 0, 246, 53, 1, 0, 0, 0, 247, 248, 5, 61, 0, 0, 248, 55, 1, 0, 0, 0, 249, 250, 5, 42, 0, 0, 250, 57, 1, 0, 0, 0, 251, 252, 5, 43, 0, 0, 252, 59, 1, 0, 0, 0, 253, 254, 5, 45, 0, 0, 254, 61, 1, 0, 0, 0, 255, 256, 5, 47, 0, 0, 256, 63, 1, 0, 0, 0, 257, 258, 5, 92, 0, 0, 258, 65, 1, 0, 0, 0, 259, 260, 5, 119, 0, 0, 260, 261, 5, 105, 0, 0, 261, 262, 5, 116, 0, 0, 262, 263, 5, 104, 0, 0, 263, 67, 1, 0, 0, 0, 264, 265, 5, 115, 0, 0, 265, 266, 5, 99, 0, 0, 266, 267, 5, 97, 0, 0, 267, 268, 5, 108, 0, 0, 268, 269, 5, 105, 0, 0, 269, 270, 5, 110, 0, 0, 270, 271, 5, 103, 0, 0, 271, 69, 1, 0, 0, 0, 272, 273, 5, 116, 0, 0, 273, 274, 5, 104, 0, 0, 274, 275, 5, 114, 0, 0, 275, 276, 5, 111, 0, 0, 276, 277, 5, 117, 0, 0, 277, 278, 5, 103, 0, 0, 278, 279, 5, 104, 0, 0, 279, 71, 1, 0, 0, 0, 280, 282, 7, 2, 0, 0, 281, 280, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 291, 1, 0, 0, 0, 285, 287, 5, 46, 0, 0, 286, 288, 7, 2, 0, 0, 287, 286, 1, 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, 287, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, 290, 292, 1, 0, 0, 0, 291, 285, 1, 0, 0, 0, 291, 292, 1, 0, 0, 0, 292, 293, 1, 0, 0, 0, 293, 294, 5, 37, 0, 0, 294, 73, 1, 0, 0, 0, 295, 301, 5, 34, 0, 0, 296, 297, 5, 92, 0, 0, 297, 300, 5, 34, 0, 0, 298, 300, 8, 3, 0, 0, 299, 296, 1, 0, 0, 0, 299, 298, 1, 0, 0, 0, 300, 303, 1, 0, 0, 0, 301, 299, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 304, 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, 304, 305, 5, 34, 0, 0, 305, 75, 1, 0, 0, 0, 306, 308, 7, 4, 0, 0, 307, 306, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 307, 1, 0, 0, 0, 309, 310, 1, 0, 0, 0, 310, 314, 1, 0, 0, 0, 311, 313, 7, 5, 0, 0, 312, 311, 1, 0, 0, 0, 313, 316, 1, 0, 0, 0, 314, 312, 1, 0, 0, 0, 314, 315, 1, 0, 0, 0, 315, 77, 1, 0, 0, 0, 316, 314, 1, 0, 0, 0, 317, 319, 7, 2, 0, 0, 318, 317, 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 330, 1, 0, 0, 0, 322, 324, 5, 95, 0, 0, 323, 325, 7, 2, 0, 0, 324, 323, 1, 0, 0, 0, 325, 326, 1, 0, 0, 0, 326, 324, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, 327, 329, 1, 0, 0, 0, 328, 322, 1, 0, 0, 0, 329, 332, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 79, 1, 0, 0, 0, 332, 330, 1, 0, 0, 0, 333, 337, 7, 6, 0, 0, 334, 336, 7, 7, 0, 0, 335, 334, 1, 0, 0, 0, 336, 339, 1, 0, 0, 0, 337, 335, 1, 0, 0, 0, 337, 338, 1, 0, 0, 0, 338, 346, 1, 0, 0, 0, 339, 337, 1, 0, 0, 0, 340, 342, 5, 47, 0, 0, 341, 343, 7, 2, 0, 0, 342, 341, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 342, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 347, 1, 0, 0, 0, 346, 340, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 81, 1, 0, 0, 0, 348, 349, 5, 64, 0, 0, 349, 350, 1, 0, 0, 0, 350, 351, 6, 40, 2, 0, 351, 83, 1, 0, 0, 0, 352, 353, 5, 58, 0, 0, 353, 354, 1, 0, 0, 0, 354, 355, 6, 41, 2, 0, 355, 85, 1, 0, 0, 0, 356, 358, 5, 36, 0, 0, 357, 359, 7, 5, 0, 0, 358, 357, 1, 0, 0, 0, 359, 360, 1, 0, 0, 0, 360, 358, 1, 0, 0, 0, 360, 361, 1, 0, 0, 0, 361, 365, 1, 0, 0, 0, 362, 364, 7, 8, 0, 0, 363, 362, 1, 0, 0, 0, 364, 367, 1, 0, 0, 0, 365, 363, 1, 0, 0, 0, 365, 366, 1, 0, 0, 0, 366, 87, 1, 0, 0, 0, 367, 365, 1, 0, 0, 0, 368, 370, 7, 9, 0, 0, 369, 368, 1, 0, 0, 0, 370, 371, 1, 0, 0, 0, 371, 369, 1, 0, 0, 0, 371, 372, 1, 0, 0, 0, 372, 373, 1, 0, 0, 0, 373, 374, 6, 43, 3, 0, 374, 89, 1, 0, 0, 0, 375, 376, 3, 86, 42, 0, 376, 377, 1, 0, 0, 0, 377, 378, 6, 44, 3, 0, 378, 91, 1, 0, 0, 0, 379, 380, 3, 86, 42, 0, 380, 93, 1, 0, 0, 0, 23, 0, 1, 97, 104, 111, 113, 127, 283, 289, 291, 299, 301, 309, 314, 320, 326, 330, 337, 344, 346, 360, 365, 371, 4, 6, 0, 0, 0, 1, 0, 5, 1, 0, 4, 0, 0] \ No newline at end of file diff --git a/internal/parser/antlrParser/Lexer.tokens b/internal/parser/antlrParser/Lexer.tokens index d4aade8c..8e7eb0ea 100644 --- a/internal/parser/antlrParser/Lexer.tokens +++ b/internal/parser/antlrParser/Lexer.tokens @@ -32,16 +32,17 @@ DIV=31 RESTRICT=32 WITH=33 SCALING=34 -PERCENTAGE_PORTION_LITERAL=35 -STRING=36 -IDENTIFIER=37 -NUMBER=38 -ASSET=39 -ACCOUNT_START=40 -COLON=41 -ACCOUNT_TEXT=42 -VARIABLE_NAME_ACC=43 -VARIABLE_NAME=44 +THROUGH=35 +PERCENTAGE_PORTION_LITERAL=36 +STRING=37 +IDENTIFIER=38 +NUMBER=39 +ASSET=40 +ACCOUNT_START=41 +COLON=42 +ACCOUNT_TEXT=43 +VARIABLE_NAME_ACC=44 +VARIABLE_NAME=45 'vars'=5 'max'=6 'source'=7 @@ -72,5 +73,6 @@ VARIABLE_NAME=44 '\\'=32 'with'=33 'scaling'=34 -'@'=40 -':'=41 +'through'=35 +'@'=41 +':'=42 diff --git a/internal/parser/antlrParser/Numscript.interp b/internal/parser/antlrParser/Numscript.interp index b4f8eee5..b61f65e9 100644 --- a/internal/parser/antlrParser/Numscript.interp +++ b/internal/parser/antlrParser/Numscript.interp @@ -34,6 +34,7 @@ null '\\' 'with' 'scaling' +'through' null null null @@ -81,6 +82,7 @@ DIV RESTRICT WITH SCALING +THROUGH PERCENTAGE_PORTION_LITERAL STRING IDENTIFIER @@ -116,4 +118,4 @@ statement atn: -[4, 1, 44, 276, 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, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 48, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 58, 8, 2, 10, 2, 12, 2, 61, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 73, 8, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 81, 8, 2, 10, 2, 12, 2, 84, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 89, 8, 3, 10, 3, 12, 3, 92, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 97, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 107, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 112, 8, 7, 10, 7, 12, 7, 115, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 120, 8, 8, 1, 8, 5, 8, 123, 8, 8, 10, 8, 12, 8, 126, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 137, 8, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 144, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 152, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 162, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 169, 8, 12, 1, 12, 1, 12, 4, 12, 173, 8, 12, 11, 12, 12, 12, 174, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 181, 8, 12, 10, 12, 12, 12, 184, 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 4, 12, 190, 8, 12, 11, 12, 12, 12, 191, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 201, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 3, 14, 210, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 4, 16, 219, 8, 16, 11, 16, 12, 16, 220, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 227, 8, 16, 10, 16, 12, 16, 230, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 239, 8, 16, 10, 16, 12, 16, 242, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 248, 8, 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, 18, 255, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 274, 8, 19, 1, 19, 0, 1, 4, 20, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 0, 2, 1, 0, 29, 30, 2, 0, 16, 16, 37, 37, 299, 0, 40, 1, 0, 0, 0, 2, 47, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 85, 1, 0, 0, 0, 8, 93, 1, 0, 0, 0, 10, 100, 1, 0, 0, 0, 12, 103, 1, 0, 0, 0, 14, 108, 1, 0, 0, 0, 16, 119, 1, 0, 0, 0, 18, 129, 1, 0, 0, 0, 20, 136, 1, 0, 0, 0, 22, 138, 1, 0, 0, 0, 24, 200, 1, 0, 0, 0, 26, 202, 1, 0, 0, 0, 28, 209, 1, 0, 0, 0, 30, 211, 1, 0, 0, 0, 32, 247, 1, 0, 0, 0, 34, 249, 1, 0, 0, 0, 36, 254, 1, 0, 0, 0, 38, 273, 1, 0, 0, 0, 40, 41, 5, 22, 0, 0, 41, 42, 3, 4, 2, 0, 42, 43, 3, 4, 2, 0, 43, 44, 5, 23, 0, 0, 44, 1, 1, 0, 0, 0, 45, 48, 5, 42, 0, 0, 46, 48, 5, 43, 0, 0, 47, 45, 1, 0, 0, 0, 47, 46, 1, 0, 0, 0, 48, 3, 1, 0, 0, 0, 49, 50, 6, 2, -1, 0, 50, 73, 5, 44, 0, 0, 51, 73, 5, 39, 0, 0, 52, 73, 5, 36, 0, 0, 53, 54, 5, 40, 0, 0, 54, 59, 3, 2, 1, 0, 55, 56, 5, 41, 0, 0, 56, 58, 3, 2, 1, 0, 57, 55, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 73, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 73, 5, 38, 0, 0, 63, 73, 5, 35, 0, 0, 64, 73, 3, 0, 0, 0, 65, 66, 5, 30, 0, 0, 66, 73, 3, 4, 2, 5, 67, 68, 5, 20, 0, 0, 68, 69, 3, 4, 2, 0, 69, 70, 5, 21, 0, 0, 70, 73, 1, 0, 0, 0, 71, 73, 3, 8, 4, 0, 72, 49, 1, 0, 0, 0, 72, 51, 1, 0, 0, 0, 72, 52, 1, 0, 0, 0, 72, 53, 1, 0, 0, 0, 72, 62, 1, 0, 0, 0, 72, 63, 1, 0, 0, 0, 72, 64, 1, 0, 0, 0, 72, 65, 1, 0, 0, 0, 72, 67, 1, 0, 0, 0, 72, 71, 1, 0, 0, 0, 73, 82, 1, 0, 0, 0, 74, 75, 10, 4, 0, 0, 75, 76, 5, 31, 0, 0, 76, 81, 3, 4, 2, 5, 77, 78, 10, 3, 0, 0, 78, 79, 7, 0, 0, 0, 79, 81, 3, 4, 2, 4, 80, 74, 1, 0, 0, 0, 80, 77, 1, 0, 0, 0, 81, 84, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 5, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 85, 90, 3, 4, 2, 0, 86, 87, 5, 26, 0, 0, 87, 89, 3, 4, 2, 0, 88, 86, 1, 0, 0, 0, 89, 92, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 7, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 93, 94, 7, 1, 0, 0, 94, 96, 5, 20, 0, 0, 95, 97, 3, 6, 3, 0, 96, 95, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 99, 5, 21, 0, 0, 99, 9, 1, 0, 0, 0, 100, 101, 5, 27, 0, 0, 101, 102, 3, 4, 2, 0, 102, 11, 1, 0, 0, 0, 103, 104, 5, 37, 0, 0, 104, 106, 5, 44, 0, 0, 105, 107, 3, 10, 5, 0, 106, 105, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 13, 1, 0, 0, 0, 108, 109, 5, 5, 0, 0, 109, 113, 5, 24, 0, 0, 110, 112, 3, 12, 6, 0, 111, 110, 1, 0, 0, 0, 112, 115, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 113, 114, 1, 0, 0, 0, 114, 116, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 116, 117, 5, 25, 0, 0, 117, 15, 1, 0, 0, 0, 118, 120, 3, 14, 7, 0, 119, 118, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 124, 1, 0, 0, 0, 121, 123, 3, 38, 19, 0, 122, 121, 1, 0, 0, 0, 123, 126, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 127, 1, 0, 0, 0, 126, 124, 1, 0, 0, 0, 127, 128, 5, 0, 0, 1, 128, 17, 1, 0, 0, 0, 129, 130, 5, 22, 0, 0, 130, 131, 3, 4, 2, 0, 131, 132, 5, 28, 0, 0, 132, 133, 5, 23, 0, 0, 133, 19, 1, 0, 0, 0, 134, 137, 3, 4, 2, 0, 135, 137, 5, 13, 0, 0, 136, 134, 1, 0, 0, 0, 136, 135, 1, 0, 0, 0, 137, 21, 1, 0, 0, 0, 138, 139, 5, 32, 0, 0, 139, 140, 3, 4, 2, 0, 140, 23, 1, 0, 0, 0, 141, 143, 3, 4, 2, 0, 142, 144, 3, 22, 11, 0, 143, 142, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, 146, 5, 14, 0, 0, 146, 147, 5, 15, 0, 0, 147, 148, 5, 16, 0, 0, 148, 201, 1, 0, 0, 0, 149, 151, 3, 4, 2, 0, 150, 152, 3, 22, 11, 0, 151, 150, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 154, 5, 14, 0, 0, 154, 155, 5, 16, 0, 0, 155, 156, 5, 11, 0, 0, 156, 157, 5, 12, 0, 0, 157, 158, 3, 4, 2, 0, 158, 201, 1, 0, 0, 0, 159, 161, 3, 4, 2, 0, 160, 162, 3, 22, 11, 0, 161, 160, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 164, 5, 33, 0, 0, 164, 165, 5, 34, 0, 0, 165, 201, 1, 0, 0, 0, 166, 168, 3, 4, 2, 0, 167, 169, 3, 22, 11, 0, 168, 167, 1, 0, 0, 0, 168, 169, 1, 0, 0, 0, 169, 201, 1, 0, 0, 0, 170, 172, 5, 24, 0, 0, 171, 173, 3, 26, 13, 0, 172, 171, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 172, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 177, 5, 25, 0, 0, 177, 201, 1, 0, 0, 0, 178, 182, 5, 24, 0, 0, 179, 181, 3, 24, 12, 0, 180, 179, 1, 0, 0, 0, 181, 184, 1, 0, 0, 0, 182, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 185, 1, 0, 0, 0, 184, 182, 1, 0, 0, 0, 185, 201, 5, 25, 0, 0, 186, 187, 5, 17, 0, 0, 187, 189, 5, 24, 0, 0, 188, 190, 3, 24, 12, 0, 189, 188, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 189, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, 194, 5, 25, 0, 0, 194, 201, 1, 0, 0, 0, 195, 196, 5, 6, 0, 0, 196, 197, 3, 4, 2, 0, 197, 198, 5, 10, 0, 0, 198, 199, 3, 24, 12, 0, 199, 201, 1, 0, 0, 0, 200, 141, 1, 0, 0, 0, 200, 149, 1, 0, 0, 0, 200, 159, 1, 0, 0, 0, 200, 166, 1, 0, 0, 0, 200, 170, 1, 0, 0, 0, 200, 178, 1, 0, 0, 0, 200, 186, 1, 0, 0, 0, 200, 195, 1, 0, 0, 0, 201, 25, 1, 0, 0, 0, 202, 203, 3, 20, 10, 0, 203, 204, 5, 10, 0, 0, 204, 205, 3, 24, 12, 0, 205, 27, 1, 0, 0, 0, 206, 207, 5, 12, 0, 0, 207, 210, 3, 32, 16, 0, 208, 210, 5, 18, 0, 0, 209, 206, 1, 0, 0, 0, 209, 208, 1, 0, 0, 0, 210, 29, 1, 0, 0, 0, 211, 212, 5, 6, 0, 0, 212, 213, 3, 4, 2, 0, 213, 214, 3, 28, 14, 0, 214, 31, 1, 0, 0, 0, 215, 248, 3, 4, 2, 0, 216, 218, 5, 24, 0, 0, 217, 219, 3, 34, 17, 0, 218, 217, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 218, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 223, 5, 25, 0, 0, 223, 248, 1, 0, 0, 0, 224, 228, 5, 24, 0, 0, 225, 227, 3, 30, 15, 0, 226, 225, 1, 0, 0, 0, 227, 230, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 231, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 231, 232, 5, 13, 0, 0, 232, 233, 3, 28, 14, 0, 233, 234, 5, 25, 0, 0, 234, 248, 1, 0, 0, 0, 235, 236, 5, 17, 0, 0, 236, 240, 5, 24, 0, 0, 237, 239, 3, 30, 15, 0, 238, 237, 1, 0, 0, 0, 239, 242, 1, 0, 0, 0, 240, 238, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 243, 1, 0, 0, 0, 242, 240, 1, 0, 0, 0, 243, 244, 5, 13, 0, 0, 244, 245, 3, 28, 14, 0, 245, 246, 5, 25, 0, 0, 246, 248, 1, 0, 0, 0, 247, 215, 1, 0, 0, 0, 247, 216, 1, 0, 0, 0, 247, 224, 1, 0, 0, 0, 247, 235, 1, 0, 0, 0, 248, 33, 1, 0, 0, 0, 249, 250, 3, 20, 10, 0, 250, 251, 3, 28, 14, 0, 251, 35, 1, 0, 0, 0, 252, 255, 3, 4, 2, 0, 253, 255, 3, 18, 9, 0, 254, 252, 1, 0, 0, 0, 254, 253, 1, 0, 0, 0, 255, 37, 1, 0, 0, 0, 256, 257, 5, 9, 0, 0, 257, 258, 3, 36, 18, 0, 258, 259, 5, 20, 0, 0, 259, 260, 5, 7, 0, 0, 260, 261, 5, 27, 0, 0, 261, 262, 3, 24, 12, 0, 262, 263, 5, 8, 0, 0, 263, 264, 5, 27, 0, 0, 264, 265, 3, 32, 16, 0, 265, 266, 5, 21, 0, 0, 266, 274, 1, 0, 0, 0, 267, 268, 5, 19, 0, 0, 268, 269, 3, 36, 18, 0, 269, 270, 5, 10, 0, 0, 270, 271, 3, 4, 2, 0, 271, 274, 1, 0, 0, 0, 272, 274, 3, 8, 4, 0, 273, 256, 1, 0, 0, 0, 273, 267, 1, 0, 0, 0, 273, 272, 1, 0, 0, 0, 274, 39, 1, 0, 0, 0, 27, 47, 59, 72, 80, 82, 90, 96, 106, 113, 119, 124, 136, 143, 151, 161, 168, 174, 182, 191, 200, 209, 220, 228, 240, 247, 254, 273] \ No newline at end of file +[4, 1, 45, 278, 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, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 48, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 58, 8, 2, 10, 2, 12, 2, 61, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 73, 8, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 81, 8, 2, 10, 2, 12, 2, 84, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 89, 8, 3, 10, 3, 12, 3, 92, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 97, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 107, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 112, 8, 7, 10, 7, 12, 7, 115, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 120, 8, 8, 1, 8, 5, 8, 123, 8, 8, 10, 8, 12, 8, 126, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 137, 8, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 144, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 152, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 162, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 171, 8, 12, 1, 12, 1, 12, 4, 12, 175, 8, 12, 11, 12, 12, 12, 176, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 183, 8, 12, 10, 12, 12, 12, 186, 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 4, 12, 192, 8, 12, 11, 12, 12, 12, 193, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 203, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 3, 14, 212, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 4, 16, 221, 8, 16, 11, 16, 12, 16, 222, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 229, 8, 16, 10, 16, 12, 16, 232, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 241, 8, 16, 10, 16, 12, 16, 244, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 250, 8, 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, 18, 257, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 276, 8, 19, 1, 19, 0, 1, 4, 20, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 0, 2, 1, 0, 29, 30, 2, 0, 16, 16, 38, 38, 301, 0, 40, 1, 0, 0, 0, 2, 47, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 85, 1, 0, 0, 0, 8, 93, 1, 0, 0, 0, 10, 100, 1, 0, 0, 0, 12, 103, 1, 0, 0, 0, 14, 108, 1, 0, 0, 0, 16, 119, 1, 0, 0, 0, 18, 129, 1, 0, 0, 0, 20, 136, 1, 0, 0, 0, 22, 138, 1, 0, 0, 0, 24, 202, 1, 0, 0, 0, 26, 204, 1, 0, 0, 0, 28, 211, 1, 0, 0, 0, 30, 213, 1, 0, 0, 0, 32, 249, 1, 0, 0, 0, 34, 251, 1, 0, 0, 0, 36, 256, 1, 0, 0, 0, 38, 275, 1, 0, 0, 0, 40, 41, 5, 22, 0, 0, 41, 42, 3, 4, 2, 0, 42, 43, 3, 4, 2, 0, 43, 44, 5, 23, 0, 0, 44, 1, 1, 0, 0, 0, 45, 48, 5, 43, 0, 0, 46, 48, 5, 44, 0, 0, 47, 45, 1, 0, 0, 0, 47, 46, 1, 0, 0, 0, 48, 3, 1, 0, 0, 0, 49, 50, 6, 2, -1, 0, 50, 73, 5, 45, 0, 0, 51, 73, 5, 40, 0, 0, 52, 73, 5, 37, 0, 0, 53, 54, 5, 41, 0, 0, 54, 59, 3, 2, 1, 0, 55, 56, 5, 42, 0, 0, 56, 58, 3, 2, 1, 0, 57, 55, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 73, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 73, 5, 39, 0, 0, 63, 73, 5, 36, 0, 0, 64, 73, 3, 0, 0, 0, 65, 66, 5, 30, 0, 0, 66, 73, 3, 4, 2, 5, 67, 68, 5, 20, 0, 0, 68, 69, 3, 4, 2, 0, 69, 70, 5, 21, 0, 0, 70, 73, 1, 0, 0, 0, 71, 73, 3, 8, 4, 0, 72, 49, 1, 0, 0, 0, 72, 51, 1, 0, 0, 0, 72, 52, 1, 0, 0, 0, 72, 53, 1, 0, 0, 0, 72, 62, 1, 0, 0, 0, 72, 63, 1, 0, 0, 0, 72, 64, 1, 0, 0, 0, 72, 65, 1, 0, 0, 0, 72, 67, 1, 0, 0, 0, 72, 71, 1, 0, 0, 0, 73, 82, 1, 0, 0, 0, 74, 75, 10, 4, 0, 0, 75, 76, 5, 31, 0, 0, 76, 81, 3, 4, 2, 5, 77, 78, 10, 3, 0, 0, 78, 79, 7, 0, 0, 0, 79, 81, 3, 4, 2, 4, 80, 74, 1, 0, 0, 0, 80, 77, 1, 0, 0, 0, 81, 84, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 5, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 85, 90, 3, 4, 2, 0, 86, 87, 5, 26, 0, 0, 87, 89, 3, 4, 2, 0, 88, 86, 1, 0, 0, 0, 89, 92, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 7, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 93, 94, 7, 1, 0, 0, 94, 96, 5, 20, 0, 0, 95, 97, 3, 6, 3, 0, 96, 95, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 99, 5, 21, 0, 0, 99, 9, 1, 0, 0, 0, 100, 101, 5, 27, 0, 0, 101, 102, 3, 4, 2, 0, 102, 11, 1, 0, 0, 0, 103, 104, 5, 38, 0, 0, 104, 106, 5, 45, 0, 0, 105, 107, 3, 10, 5, 0, 106, 105, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 13, 1, 0, 0, 0, 108, 109, 5, 5, 0, 0, 109, 113, 5, 24, 0, 0, 110, 112, 3, 12, 6, 0, 111, 110, 1, 0, 0, 0, 112, 115, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 113, 114, 1, 0, 0, 0, 114, 116, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 116, 117, 5, 25, 0, 0, 117, 15, 1, 0, 0, 0, 118, 120, 3, 14, 7, 0, 119, 118, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 124, 1, 0, 0, 0, 121, 123, 3, 38, 19, 0, 122, 121, 1, 0, 0, 0, 123, 126, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 127, 1, 0, 0, 0, 126, 124, 1, 0, 0, 0, 127, 128, 5, 0, 0, 1, 128, 17, 1, 0, 0, 0, 129, 130, 5, 22, 0, 0, 130, 131, 3, 4, 2, 0, 131, 132, 5, 28, 0, 0, 132, 133, 5, 23, 0, 0, 133, 19, 1, 0, 0, 0, 134, 137, 3, 4, 2, 0, 135, 137, 5, 13, 0, 0, 136, 134, 1, 0, 0, 0, 136, 135, 1, 0, 0, 0, 137, 21, 1, 0, 0, 0, 138, 139, 5, 32, 0, 0, 139, 140, 3, 4, 2, 0, 140, 23, 1, 0, 0, 0, 141, 143, 3, 4, 2, 0, 142, 144, 3, 22, 11, 0, 143, 142, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, 146, 5, 14, 0, 0, 146, 147, 5, 15, 0, 0, 147, 148, 5, 16, 0, 0, 148, 203, 1, 0, 0, 0, 149, 151, 3, 4, 2, 0, 150, 152, 3, 22, 11, 0, 151, 150, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 154, 5, 14, 0, 0, 154, 155, 5, 16, 0, 0, 155, 156, 5, 11, 0, 0, 156, 157, 5, 12, 0, 0, 157, 158, 3, 4, 2, 0, 158, 203, 1, 0, 0, 0, 159, 161, 3, 4, 2, 0, 160, 162, 3, 22, 11, 0, 161, 160, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 164, 5, 33, 0, 0, 164, 165, 5, 34, 0, 0, 165, 166, 5, 35, 0, 0, 166, 167, 3, 4, 2, 0, 167, 203, 1, 0, 0, 0, 168, 170, 3, 4, 2, 0, 169, 171, 3, 22, 11, 0, 170, 169, 1, 0, 0, 0, 170, 171, 1, 0, 0, 0, 171, 203, 1, 0, 0, 0, 172, 174, 5, 24, 0, 0, 173, 175, 3, 26, 13, 0, 174, 173, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 179, 5, 25, 0, 0, 179, 203, 1, 0, 0, 0, 180, 184, 5, 24, 0, 0, 181, 183, 3, 24, 12, 0, 182, 181, 1, 0, 0, 0, 183, 186, 1, 0, 0, 0, 184, 182, 1, 0, 0, 0, 184, 185, 1, 0, 0, 0, 185, 187, 1, 0, 0, 0, 186, 184, 1, 0, 0, 0, 187, 203, 5, 25, 0, 0, 188, 189, 5, 17, 0, 0, 189, 191, 5, 24, 0, 0, 190, 192, 3, 24, 12, 0, 191, 190, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, 191, 1, 0, 0, 0, 193, 194, 1, 0, 0, 0, 194, 195, 1, 0, 0, 0, 195, 196, 5, 25, 0, 0, 196, 203, 1, 0, 0, 0, 197, 198, 5, 6, 0, 0, 198, 199, 3, 4, 2, 0, 199, 200, 5, 10, 0, 0, 200, 201, 3, 24, 12, 0, 201, 203, 1, 0, 0, 0, 202, 141, 1, 0, 0, 0, 202, 149, 1, 0, 0, 0, 202, 159, 1, 0, 0, 0, 202, 168, 1, 0, 0, 0, 202, 172, 1, 0, 0, 0, 202, 180, 1, 0, 0, 0, 202, 188, 1, 0, 0, 0, 202, 197, 1, 0, 0, 0, 203, 25, 1, 0, 0, 0, 204, 205, 3, 20, 10, 0, 205, 206, 5, 10, 0, 0, 206, 207, 3, 24, 12, 0, 207, 27, 1, 0, 0, 0, 208, 209, 5, 12, 0, 0, 209, 212, 3, 32, 16, 0, 210, 212, 5, 18, 0, 0, 211, 208, 1, 0, 0, 0, 211, 210, 1, 0, 0, 0, 212, 29, 1, 0, 0, 0, 213, 214, 5, 6, 0, 0, 214, 215, 3, 4, 2, 0, 215, 216, 3, 28, 14, 0, 216, 31, 1, 0, 0, 0, 217, 250, 3, 4, 2, 0, 218, 220, 5, 24, 0, 0, 219, 221, 3, 34, 17, 0, 220, 219, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 220, 1, 0, 0, 0, 222, 223, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, 224, 225, 5, 25, 0, 0, 225, 250, 1, 0, 0, 0, 226, 230, 5, 24, 0, 0, 227, 229, 3, 30, 15, 0, 228, 227, 1, 0, 0, 0, 229, 232, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 233, 1, 0, 0, 0, 232, 230, 1, 0, 0, 0, 233, 234, 5, 13, 0, 0, 234, 235, 3, 28, 14, 0, 235, 236, 5, 25, 0, 0, 236, 250, 1, 0, 0, 0, 237, 238, 5, 17, 0, 0, 238, 242, 5, 24, 0, 0, 239, 241, 3, 30, 15, 0, 240, 239, 1, 0, 0, 0, 241, 244, 1, 0, 0, 0, 242, 240, 1, 0, 0, 0, 242, 243, 1, 0, 0, 0, 243, 245, 1, 0, 0, 0, 244, 242, 1, 0, 0, 0, 245, 246, 5, 13, 0, 0, 246, 247, 3, 28, 14, 0, 247, 248, 5, 25, 0, 0, 248, 250, 1, 0, 0, 0, 249, 217, 1, 0, 0, 0, 249, 218, 1, 0, 0, 0, 249, 226, 1, 0, 0, 0, 249, 237, 1, 0, 0, 0, 250, 33, 1, 0, 0, 0, 251, 252, 3, 20, 10, 0, 252, 253, 3, 28, 14, 0, 253, 35, 1, 0, 0, 0, 254, 257, 3, 4, 2, 0, 255, 257, 3, 18, 9, 0, 256, 254, 1, 0, 0, 0, 256, 255, 1, 0, 0, 0, 257, 37, 1, 0, 0, 0, 258, 259, 5, 9, 0, 0, 259, 260, 3, 36, 18, 0, 260, 261, 5, 20, 0, 0, 261, 262, 5, 7, 0, 0, 262, 263, 5, 27, 0, 0, 263, 264, 3, 24, 12, 0, 264, 265, 5, 8, 0, 0, 265, 266, 5, 27, 0, 0, 266, 267, 3, 32, 16, 0, 267, 268, 5, 21, 0, 0, 268, 276, 1, 0, 0, 0, 269, 270, 5, 19, 0, 0, 270, 271, 3, 36, 18, 0, 271, 272, 5, 10, 0, 0, 272, 273, 3, 4, 2, 0, 273, 276, 1, 0, 0, 0, 274, 276, 3, 8, 4, 0, 275, 258, 1, 0, 0, 0, 275, 269, 1, 0, 0, 0, 275, 274, 1, 0, 0, 0, 276, 39, 1, 0, 0, 0, 27, 47, 59, 72, 80, 82, 90, 96, 106, 113, 119, 124, 136, 143, 151, 161, 170, 176, 184, 193, 202, 211, 222, 230, 242, 249, 256, 275] \ No newline at end of file diff --git a/internal/parser/antlrParser/Numscript.tokens b/internal/parser/antlrParser/Numscript.tokens index d4aade8c..8e7eb0ea 100644 --- a/internal/parser/antlrParser/Numscript.tokens +++ b/internal/parser/antlrParser/Numscript.tokens @@ -32,16 +32,17 @@ DIV=31 RESTRICT=32 WITH=33 SCALING=34 -PERCENTAGE_PORTION_LITERAL=35 -STRING=36 -IDENTIFIER=37 -NUMBER=38 -ASSET=39 -ACCOUNT_START=40 -COLON=41 -ACCOUNT_TEXT=42 -VARIABLE_NAME_ACC=43 -VARIABLE_NAME=44 +THROUGH=35 +PERCENTAGE_PORTION_LITERAL=36 +STRING=37 +IDENTIFIER=38 +NUMBER=39 +ASSET=40 +ACCOUNT_START=41 +COLON=42 +ACCOUNT_TEXT=43 +VARIABLE_NAME_ACC=44 +VARIABLE_NAME=45 'vars'=5 'max'=6 'source'=7 @@ -72,5 +73,6 @@ VARIABLE_NAME=44 '\\'=32 'with'=33 'scaling'=34 -'@'=40 -':'=41 +'through'=35 +'@'=41 +':'=42 diff --git a/internal/parser/antlrParser/lexer.go b/internal/parser/antlrParser/lexer.go index f67c46bf..950cbb6c 100644 --- a/internal/parser/antlrParser/lexer.go +++ b/internal/parser/antlrParser/lexer.go @@ -47,14 +47,14 @@ func lexerLexerInit() { "'send'", "'from'", "'up'", "'to'", "'remaining'", "'allowing'", "'unbounded'", "'overdraft'", "'oneof'", "'kept'", "'save'", "'('", "')'", "'['", "']'", "'{'", "'}'", "','", "'='", "'*'", "'+'", "'-'", "'/'", "'\\'", "'with'", - "'scaling'", "", "", "", "", "", "'@'", "':'", + "'scaling'", "'through'", "", "", "", "", "", "'@'", "':'", } staticData.SymbolicNames = []string{ "", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", "ALLOWING", "UNBOUNDED", "OVERDRAFT", "ONEOF", "KEPT", "SAVE", "LPARENS", "RPARENS", "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", "STAR", "PLUS", - "MINUS", "DIV", "RESTRICT", "WITH", "SCALING", "PERCENTAGE_PORTION_LITERAL", + "MINUS", "DIV", "RESTRICT", "WITH", "SCALING", "THROUGH", "PERCENTAGE_PORTION_LITERAL", "STRING", "IDENTIFIER", "NUMBER", "ASSET", "ACCOUNT_START", "COLON", "ACCOUNT_TEXT", "VARIABLE_NAME_ACC", "VARIABLE_NAME", } @@ -63,13 +63,13 @@ func lexerLexerInit() { "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", "ALLOWING", "UNBOUNDED", "OVERDRAFT", "ONEOF", "KEPT", "SAVE", "LPARENS", "RPARENS", "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", "STAR", "PLUS", - "MINUS", "DIV", "RESTRICT", "WITH", "SCALING", "PERCENTAGE_PORTION_LITERAL", + "MINUS", "DIV", "RESTRICT", "WITH", "SCALING", "THROUGH", "PERCENTAGE_PORTION_LITERAL", "STRING", "IDENTIFIER", "NUMBER", "ASSET", "ACCOUNT_START", "COLON", "VARIABLE_NAME_FRAGMENT", "ACCOUNT_TEXT", "VARIABLE_NAME_ACC", "VARIABLE_NAME", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 44, 371, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, + 4, 0, 45, 381, 6, -1, 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, @@ -77,165 +77,169 @@ func lexerLexerInit() { 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, 1, 0, 4, 0, 94, - 8, 0, 11, 0, 12, 0, 95, 1, 0, 1, 0, 1, 1, 4, 1, 101, 8, 1, 11, 1, 12, 1, - 102, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 110, 8, 2, 10, 2, 12, 2, 113, - 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 124, - 8, 3, 10, 3, 12, 3, 127, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, - 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, - 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, - 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, - 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 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, 14, 1, 14, 1, - 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, - 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, - 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, - 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, - 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, - 1, 31, 1, 31, 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, 34, 4, 34, 272, 8, 34, 11, 34, 12, 34, - 273, 1, 34, 1, 34, 4, 34, 278, 8, 34, 11, 34, 12, 34, 279, 3, 34, 282, - 8, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 5, 35, 290, 8, 35, 10, - 35, 12, 35, 293, 9, 35, 1, 35, 1, 35, 1, 36, 4, 36, 298, 8, 36, 11, 36, - 12, 36, 299, 1, 36, 5, 36, 303, 8, 36, 10, 36, 12, 36, 306, 9, 36, 1, 37, - 4, 37, 309, 8, 37, 11, 37, 12, 37, 310, 1, 37, 1, 37, 4, 37, 315, 8, 37, - 11, 37, 12, 37, 316, 5, 37, 319, 8, 37, 10, 37, 12, 37, 322, 9, 37, 1, - 38, 1, 38, 5, 38, 326, 8, 38, 10, 38, 12, 38, 329, 9, 38, 1, 38, 1, 38, - 4, 38, 333, 8, 38, 11, 38, 12, 38, 334, 3, 38, 337, 8, 38, 1, 39, 1, 39, - 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 4, 41, 349, 8, - 41, 11, 41, 12, 41, 350, 1, 41, 5, 41, 354, 8, 41, 10, 41, 12, 41, 357, - 9, 41, 1, 42, 4, 42, 360, 8, 42, 11, 42, 12, 42, 361, 1, 42, 1, 42, 1, - 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 2, 111, 125, 0, 45, 2, 1, 4, 2, - 6, 3, 8, 4, 10, 5, 12, 6, 14, 7, 16, 8, 18, 9, 20, 10, 22, 11, 24, 12, - 26, 13, 28, 14, 30, 15, 32, 16, 34, 17, 36, 18, 38, 19, 40, 20, 42, 21, - 44, 22, 46, 23, 48, 24, 50, 25, 52, 26, 54, 27, 56, 28, 58, 29, 60, 30, - 62, 31, 64, 32, 66, 33, 68, 34, 70, 35, 72, 36, 74, 37, 76, 38, 78, 39, - 80, 40, 82, 41, 84, 0, 86, 42, 88, 43, 90, 44, 2, 0, 1, 10, 3, 0, 9, 10, - 13, 13, 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, 57, 3, 0, 10, 10, 13, 13, - 34, 34, 1, 0, 97, 122, 2, 0, 95, 95, 97, 122, 1, 0, 65, 90, 2, 0, 48, 57, - 65, 90, 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, - 95, 97, 122, 389, 0, 2, 1, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 6, 1, 0, 0, 0, - 0, 8, 1, 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 14, 1, 0, 0, - 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 22, 1, 0, - 0, 0, 0, 24, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, 1, - 0, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, 1, 0, 0, 0, 0, 36, 1, 0, 0, 0, 0, 38, - 1, 0, 0, 0, 0, 40, 1, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 44, 1, 0, 0, 0, 0, - 46, 1, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 50, 1, 0, 0, 0, 0, 52, 1, 0, 0, 0, - 0, 54, 1, 0, 0, 0, 0, 56, 1, 0, 0, 0, 0, 58, 1, 0, 0, 0, 0, 60, 1, 0, 0, - 0, 0, 62, 1, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 66, 1, 0, 0, 0, 0, 68, 1, 0, - 0, 0, 0, 70, 1, 0, 0, 0, 0, 72, 1, 0, 0, 0, 0, 74, 1, 0, 0, 0, 0, 76, 1, - 0, 0, 0, 0, 78, 1, 0, 0, 0, 0, 80, 1, 0, 0, 0, 0, 82, 1, 0, 0, 0, 0, 90, - 1, 0, 0, 0, 1, 86, 1, 0, 0, 0, 1, 88, 1, 0, 0, 0, 2, 93, 1, 0, 0, 0, 4, - 100, 1, 0, 0, 0, 6, 104, 1, 0, 0, 0, 8, 119, 1, 0, 0, 0, 10, 132, 1, 0, - 0, 0, 12, 137, 1, 0, 0, 0, 14, 141, 1, 0, 0, 0, 16, 148, 1, 0, 0, 0, 18, - 160, 1, 0, 0, 0, 20, 165, 1, 0, 0, 0, 22, 170, 1, 0, 0, 0, 24, 173, 1, - 0, 0, 0, 26, 176, 1, 0, 0, 0, 28, 186, 1, 0, 0, 0, 30, 195, 1, 0, 0, 0, - 32, 205, 1, 0, 0, 0, 34, 215, 1, 0, 0, 0, 36, 221, 1, 0, 0, 0, 38, 226, - 1, 0, 0, 0, 40, 231, 1, 0, 0, 0, 42, 233, 1, 0, 0, 0, 44, 235, 1, 0, 0, - 0, 46, 237, 1, 0, 0, 0, 48, 239, 1, 0, 0, 0, 50, 241, 1, 0, 0, 0, 52, 243, - 1, 0, 0, 0, 54, 245, 1, 0, 0, 0, 56, 247, 1, 0, 0, 0, 58, 249, 1, 0, 0, - 0, 60, 251, 1, 0, 0, 0, 62, 253, 1, 0, 0, 0, 64, 255, 1, 0, 0, 0, 66, 257, - 1, 0, 0, 0, 68, 262, 1, 0, 0, 0, 70, 271, 1, 0, 0, 0, 72, 285, 1, 0, 0, - 0, 74, 297, 1, 0, 0, 0, 76, 308, 1, 0, 0, 0, 78, 323, 1, 0, 0, 0, 80, 338, - 1, 0, 0, 0, 82, 342, 1, 0, 0, 0, 84, 346, 1, 0, 0, 0, 86, 359, 1, 0, 0, - 0, 88, 365, 1, 0, 0, 0, 90, 369, 1, 0, 0, 0, 92, 94, 7, 0, 0, 0, 93, 92, - 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, - 96, 97, 1, 0, 0, 0, 97, 98, 6, 0, 0, 0, 98, 3, 1, 0, 0, 0, 99, 101, 7, - 1, 0, 0, 100, 99, 1, 0, 0, 0, 101, 102, 1, 0, 0, 0, 102, 100, 1, 0, 0, - 0, 102, 103, 1, 0, 0, 0, 103, 5, 1, 0, 0, 0, 104, 105, 5, 47, 0, 0, 105, - 106, 5, 42, 0, 0, 106, 111, 1, 0, 0, 0, 107, 110, 3, 6, 2, 0, 108, 110, - 9, 0, 0, 0, 109, 107, 1, 0, 0, 0, 109, 108, 1, 0, 0, 0, 110, 113, 1, 0, - 0, 0, 111, 112, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 112, 114, 1, 0, 0, 0, - 113, 111, 1, 0, 0, 0, 114, 115, 5, 42, 0, 0, 115, 116, 5, 47, 0, 0, 116, - 117, 1, 0, 0, 0, 117, 118, 6, 2, 0, 0, 118, 7, 1, 0, 0, 0, 119, 120, 5, - 47, 0, 0, 120, 121, 5, 47, 0, 0, 121, 125, 1, 0, 0, 0, 122, 124, 9, 0, - 0, 0, 123, 122, 1, 0, 0, 0, 124, 127, 1, 0, 0, 0, 125, 126, 1, 0, 0, 0, - 125, 123, 1, 0, 0, 0, 126, 128, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 128, - 129, 3, 4, 1, 0, 129, 130, 1, 0, 0, 0, 130, 131, 6, 3, 1, 0, 131, 9, 1, - 0, 0, 0, 132, 133, 5, 118, 0, 0, 133, 134, 5, 97, 0, 0, 134, 135, 5, 114, - 0, 0, 135, 136, 5, 115, 0, 0, 136, 11, 1, 0, 0, 0, 137, 138, 5, 109, 0, - 0, 138, 139, 5, 97, 0, 0, 139, 140, 5, 120, 0, 0, 140, 13, 1, 0, 0, 0, - 141, 142, 5, 115, 0, 0, 142, 143, 5, 111, 0, 0, 143, 144, 5, 117, 0, 0, - 144, 145, 5, 114, 0, 0, 145, 146, 5, 99, 0, 0, 146, 147, 5, 101, 0, 0, - 147, 15, 1, 0, 0, 0, 148, 149, 5, 100, 0, 0, 149, 150, 5, 101, 0, 0, 150, - 151, 5, 115, 0, 0, 151, 152, 5, 116, 0, 0, 152, 153, 5, 105, 0, 0, 153, - 154, 5, 110, 0, 0, 154, 155, 5, 97, 0, 0, 155, 156, 5, 116, 0, 0, 156, - 157, 5, 105, 0, 0, 157, 158, 5, 111, 0, 0, 158, 159, 5, 110, 0, 0, 159, - 17, 1, 0, 0, 0, 160, 161, 5, 115, 0, 0, 161, 162, 5, 101, 0, 0, 162, 163, - 5, 110, 0, 0, 163, 164, 5, 100, 0, 0, 164, 19, 1, 0, 0, 0, 165, 166, 5, - 102, 0, 0, 166, 167, 5, 114, 0, 0, 167, 168, 5, 111, 0, 0, 168, 169, 5, - 109, 0, 0, 169, 21, 1, 0, 0, 0, 170, 171, 5, 117, 0, 0, 171, 172, 5, 112, - 0, 0, 172, 23, 1, 0, 0, 0, 173, 174, 5, 116, 0, 0, 174, 175, 5, 111, 0, - 0, 175, 25, 1, 0, 0, 0, 176, 177, 5, 114, 0, 0, 177, 178, 5, 101, 0, 0, - 178, 179, 5, 109, 0, 0, 179, 180, 5, 97, 0, 0, 180, 181, 5, 105, 0, 0, - 181, 182, 5, 110, 0, 0, 182, 183, 5, 105, 0, 0, 183, 184, 5, 110, 0, 0, - 184, 185, 5, 103, 0, 0, 185, 27, 1, 0, 0, 0, 186, 187, 5, 97, 0, 0, 187, - 188, 5, 108, 0, 0, 188, 189, 5, 108, 0, 0, 189, 190, 5, 111, 0, 0, 190, - 191, 5, 119, 0, 0, 191, 192, 5, 105, 0, 0, 192, 193, 5, 110, 0, 0, 193, - 194, 5, 103, 0, 0, 194, 29, 1, 0, 0, 0, 195, 196, 5, 117, 0, 0, 196, 197, - 5, 110, 0, 0, 197, 198, 5, 98, 0, 0, 198, 199, 5, 111, 0, 0, 199, 200, - 5, 117, 0, 0, 200, 201, 5, 110, 0, 0, 201, 202, 5, 100, 0, 0, 202, 203, - 5, 101, 0, 0, 203, 204, 5, 100, 0, 0, 204, 31, 1, 0, 0, 0, 205, 206, 5, - 111, 0, 0, 206, 207, 5, 118, 0, 0, 207, 208, 5, 101, 0, 0, 208, 209, 5, - 114, 0, 0, 209, 210, 5, 100, 0, 0, 210, 211, 5, 114, 0, 0, 211, 212, 5, - 97, 0, 0, 212, 213, 5, 102, 0, 0, 213, 214, 5, 116, 0, 0, 214, 33, 1, 0, - 0, 0, 215, 216, 5, 111, 0, 0, 216, 217, 5, 110, 0, 0, 217, 218, 5, 101, - 0, 0, 218, 219, 5, 111, 0, 0, 219, 220, 5, 102, 0, 0, 220, 35, 1, 0, 0, - 0, 221, 222, 5, 107, 0, 0, 222, 223, 5, 101, 0, 0, 223, 224, 5, 112, 0, - 0, 224, 225, 5, 116, 0, 0, 225, 37, 1, 0, 0, 0, 226, 227, 5, 115, 0, 0, - 227, 228, 5, 97, 0, 0, 228, 229, 5, 118, 0, 0, 229, 230, 5, 101, 0, 0, - 230, 39, 1, 0, 0, 0, 231, 232, 5, 40, 0, 0, 232, 41, 1, 0, 0, 0, 233, 234, - 5, 41, 0, 0, 234, 43, 1, 0, 0, 0, 235, 236, 5, 91, 0, 0, 236, 45, 1, 0, - 0, 0, 237, 238, 5, 93, 0, 0, 238, 47, 1, 0, 0, 0, 239, 240, 5, 123, 0, - 0, 240, 49, 1, 0, 0, 0, 241, 242, 5, 125, 0, 0, 242, 51, 1, 0, 0, 0, 243, - 244, 5, 44, 0, 0, 244, 53, 1, 0, 0, 0, 245, 246, 5, 61, 0, 0, 246, 55, - 1, 0, 0, 0, 247, 248, 5, 42, 0, 0, 248, 57, 1, 0, 0, 0, 249, 250, 5, 43, - 0, 0, 250, 59, 1, 0, 0, 0, 251, 252, 5, 45, 0, 0, 252, 61, 1, 0, 0, 0, - 253, 254, 5, 47, 0, 0, 254, 63, 1, 0, 0, 0, 255, 256, 5, 92, 0, 0, 256, - 65, 1, 0, 0, 0, 257, 258, 5, 119, 0, 0, 258, 259, 5, 105, 0, 0, 259, 260, - 5, 116, 0, 0, 260, 261, 5, 104, 0, 0, 261, 67, 1, 0, 0, 0, 262, 263, 5, - 115, 0, 0, 263, 264, 5, 99, 0, 0, 264, 265, 5, 97, 0, 0, 265, 266, 5, 108, - 0, 0, 266, 267, 5, 105, 0, 0, 267, 268, 5, 110, 0, 0, 268, 269, 5, 103, - 0, 0, 269, 69, 1, 0, 0, 0, 270, 272, 7, 2, 0, 0, 271, 270, 1, 0, 0, 0, - 272, 273, 1, 0, 0, 0, 273, 271, 1, 0, 0, 0, 273, 274, 1, 0, 0, 0, 274, - 281, 1, 0, 0, 0, 275, 277, 5, 46, 0, 0, 276, 278, 7, 2, 0, 0, 277, 276, - 1, 0, 0, 0, 278, 279, 1, 0, 0, 0, 279, 277, 1, 0, 0, 0, 279, 280, 1, 0, - 0, 0, 280, 282, 1, 0, 0, 0, 281, 275, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, - 282, 283, 1, 0, 0, 0, 283, 284, 5, 37, 0, 0, 284, 71, 1, 0, 0, 0, 285, - 291, 5, 34, 0, 0, 286, 287, 5, 92, 0, 0, 287, 290, 5, 34, 0, 0, 288, 290, - 8, 3, 0, 0, 289, 286, 1, 0, 0, 0, 289, 288, 1, 0, 0, 0, 290, 293, 1, 0, - 0, 0, 291, 289, 1, 0, 0, 0, 291, 292, 1, 0, 0, 0, 292, 294, 1, 0, 0, 0, - 293, 291, 1, 0, 0, 0, 294, 295, 5, 34, 0, 0, 295, 73, 1, 0, 0, 0, 296, - 298, 7, 4, 0, 0, 297, 296, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 297, - 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 304, 1, 0, 0, 0, 301, 303, 7, 5, - 0, 0, 302, 301, 1, 0, 0, 0, 303, 306, 1, 0, 0, 0, 304, 302, 1, 0, 0, 0, - 304, 305, 1, 0, 0, 0, 305, 75, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 307, 309, - 7, 2, 0, 0, 308, 307, 1, 0, 0, 0, 309, 310, 1, 0, 0, 0, 310, 308, 1, 0, - 0, 0, 310, 311, 1, 0, 0, 0, 311, 320, 1, 0, 0, 0, 312, 314, 5, 95, 0, 0, - 313, 315, 7, 2, 0, 0, 314, 313, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, - 314, 1, 0, 0, 0, 316, 317, 1, 0, 0, 0, 317, 319, 1, 0, 0, 0, 318, 312, - 1, 0, 0, 0, 319, 322, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, - 0, 0, 321, 77, 1, 0, 0, 0, 322, 320, 1, 0, 0, 0, 323, 327, 7, 6, 0, 0, - 324, 326, 7, 7, 0, 0, 325, 324, 1, 0, 0, 0, 326, 329, 1, 0, 0, 0, 327, - 325, 1, 0, 0, 0, 327, 328, 1, 0, 0, 0, 328, 336, 1, 0, 0, 0, 329, 327, - 1, 0, 0, 0, 330, 332, 5, 47, 0, 0, 331, 333, 7, 2, 0, 0, 332, 331, 1, 0, - 0, 0, 333, 334, 1, 0, 0, 0, 334, 332, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, - 335, 337, 1, 0, 0, 0, 336, 330, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, - 79, 1, 0, 0, 0, 338, 339, 5, 64, 0, 0, 339, 340, 1, 0, 0, 0, 340, 341, - 6, 39, 2, 0, 341, 81, 1, 0, 0, 0, 342, 343, 5, 58, 0, 0, 343, 344, 1, 0, - 0, 0, 344, 345, 6, 40, 2, 0, 345, 83, 1, 0, 0, 0, 346, 348, 5, 36, 0, 0, - 347, 349, 7, 5, 0, 0, 348, 347, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, - 348, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 355, 1, 0, 0, 0, 352, 354, - 7, 8, 0, 0, 353, 352, 1, 0, 0, 0, 354, 357, 1, 0, 0, 0, 355, 353, 1, 0, - 0, 0, 355, 356, 1, 0, 0, 0, 356, 85, 1, 0, 0, 0, 357, 355, 1, 0, 0, 0, - 358, 360, 7, 9, 0, 0, 359, 358, 1, 0, 0, 0, 360, 361, 1, 0, 0, 0, 361, - 359, 1, 0, 0, 0, 361, 362, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 364, - 6, 42, 3, 0, 364, 87, 1, 0, 0, 0, 365, 366, 3, 84, 41, 0, 366, 367, 1, - 0, 0, 0, 367, 368, 6, 43, 3, 0, 368, 89, 1, 0, 0, 0, 369, 370, 3, 84, 41, - 0, 370, 91, 1, 0, 0, 0, 23, 0, 1, 95, 102, 109, 111, 125, 273, 279, 281, - 289, 291, 299, 304, 310, 316, 320, 327, 334, 336, 350, 355, 361, 4, 6, - 0, 0, 0, 1, 0, 5, 1, 0, 4, 0, 0, + 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 1, + 0, 4, 0, 96, 8, 0, 11, 0, 12, 0, 97, 1, 0, 1, 0, 1, 1, 4, 1, 103, 8, 1, + 11, 1, 12, 1, 104, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 112, 8, 2, 10, 2, + 12, 2, 115, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, + 5, 3, 126, 8, 3, 10, 3, 12, 3, 129, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, + 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, + 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, + 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, + 1, 9, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, + 12, 1, 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, + 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, + 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, + 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, + 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, + 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, + 1, 30, 1, 30, 1, 31, 1, 31, 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, 34, 1, 34, 1, 34, 1, 34, + 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 4, 35, 282, 8, 35, 11, 35, 12, 35, 283, + 1, 35, 1, 35, 4, 35, 288, 8, 35, 11, 35, 12, 35, 289, 3, 35, 292, 8, 35, + 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 5, 36, 300, 8, 36, 10, 36, 12, + 36, 303, 9, 36, 1, 36, 1, 36, 1, 37, 4, 37, 308, 8, 37, 11, 37, 12, 37, + 309, 1, 37, 5, 37, 313, 8, 37, 10, 37, 12, 37, 316, 9, 37, 1, 38, 4, 38, + 319, 8, 38, 11, 38, 12, 38, 320, 1, 38, 1, 38, 4, 38, 325, 8, 38, 11, 38, + 12, 38, 326, 5, 38, 329, 8, 38, 10, 38, 12, 38, 332, 9, 38, 1, 39, 1, 39, + 5, 39, 336, 8, 39, 10, 39, 12, 39, 339, 9, 39, 1, 39, 1, 39, 4, 39, 343, + 8, 39, 11, 39, 12, 39, 344, 3, 39, 347, 8, 39, 1, 40, 1, 40, 1, 40, 1, + 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 4, 42, 359, 8, 42, 11, 42, + 12, 42, 360, 1, 42, 5, 42, 364, 8, 42, 10, 42, 12, 42, 367, 9, 42, 1, 43, + 4, 43, 370, 8, 43, 11, 43, 12, 43, 371, 1, 43, 1, 43, 1, 44, 1, 44, 1, + 44, 1, 44, 1, 45, 1, 45, 2, 113, 127, 0, 46, 2, 1, 4, 2, 6, 3, 8, 4, 10, + 5, 12, 6, 14, 7, 16, 8, 18, 9, 20, 10, 22, 11, 24, 12, 26, 13, 28, 14, + 30, 15, 32, 16, 34, 17, 36, 18, 38, 19, 40, 20, 42, 21, 44, 22, 46, 23, + 48, 24, 50, 25, 52, 26, 54, 27, 56, 28, 58, 29, 60, 30, 62, 31, 64, 32, + 66, 33, 68, 34, 70, 35, 72, 36, 74, 37, 76, 38, 78, 39, 80, 40, 82, 41, + 84, 42, 86, 0, 88, 43, 90, 44, 92, 45, 2, 0, 1, 10, 3, 0, 9, 10, 13, 13, + 32, 32, 2, 0, 10, 10, 13, 13, 1, 0, 48, 57, 3, 0, 10, 10, 13, 13, 34, 34, + 1, 0, 97, 122, 2, 0, 95, 95, 97, 122, 1, 0, 65, 90, 2, 0, 48, 57, 65, 90, + 3, 0, 48, 57, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, + 122, 399, 0, 2, 1, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 6, 1, 0, 0, 0, 0, 8, 1, + 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 14, 1, 0, 0, 0, 0, 16, + 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, + 24, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, + 0, 32, 1, 0, 0, 0, 0, 34, 1, 0, 0, 0, 0, 36, 1, 0, 0, 0, 0, 38, 1, 0, 0, + 0, 0, 40, 1, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 44, 1, 0, 0, 0, 0, 46, 1, 0, + 0, 0, 0, 48, 1, 0, 0, 0, 0, 50, 1, 0, 0, 0, 0, 52, 1, 0, 0, 0, 0, 54, 1, + 0, 0, 0, 0, 56, 1, 0, 0, 0, 0, 58, 1, 0, 0, 0, 0, 60, 1, 0, 0, 0, 0, 62, + 1, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 66, 1, 0, 0, 0, 0, 68, 1, 0, 0, 0, 0, + 70, 1, 0, 0, 0, 0, 72, 1, 0, 0, 0, 0, 74, 1, 0, 0, 0, 0, 76, 1, 0, 0, 0, + 0, 78, 1, 0, 0, 0, 0, 80, 1, 0, 0, 0, 0, 82, 1, 0, 0, 0, 0, 84, 1, 0, 0, + 0, 0, 92, 1, 0, 0, 0, 1, 88, 1, 0, 0, 0, 1, 90, 1, 0, 0, 0, 2, 95, 1, 0, + 0, 0, 4, 102, 1, 0, 0, 0, 6, 106, 1, 0, 0, 0, 8, 121, 1, 0, 0, 0, 10, 134, + 1, 0, 0, 0, 12, 139, 1, 0, 0, 0, 14, 143, 1, 0, 0, 0, 16, 150, 1, 0, 0, + 0, 18, 162, 1, 0, 0, 0, 20, 167, 1, 0, 0, 0, 22, 172, 1, 0, 0, 0, 24, 175, + 1, 0, 0, 0, 26, 178, 1, 0, 0, 0, 28, 188, 1, 0, 0, 0, 30, 197, 1, 0, 0, + 0, 32, 207, 1, 0, 0, 0, 34, 217, 1, 0, 0, 0, 36, 223, 1, 0, 0, 0, 38, 228, + 1, 0, 0, 0, 40, 233, 1, 0, 0, 0, 42, 235, 1, 0, 0, 0, 44, 237, 1, 0, 0, + 0, 46, 239, 1, 0, 0, 0, 48, 241, 1, 0, 0, 0, 50, 243, 1, 0, 0, 0, 52, 245, + 1, 0, 0, 0, 54, 247, 1, 0, 0, 0, 56, 249, 1, 0, 0, 0, 58, 251, 1, 0, 0, + 0, 60, 253, 1, 0, 0, 0, 62, 255, 1, 0, 0, 0, 64, 257, 1, 0, 0, 0, 66, 259, + 1, 0, 0, 0, 68, 264, 1, 0, 0, 0, 70, 272, 1, 0, 0, 0, 72, 281, 1, 0, 0, + 0, 74, 295, 1, 0, 0, 0, 76, 307, 1, 0, 0, 0, 78, 318, 1, 0, 0, 0, 80, 333, + 1, 0, 0, 0, 82, 348, 1, 0, 0, 0, 84, 352, 1, 0, 0, 0, 86, 356, 1, 0, 0, + 0, 88, 369, 1, 0, 0, 0, 90, 375, 1, 0, 0, 0, 92, 379, 1, 0, 0, 0, 94, 96, + 7, 0, 0, 0, 95, 94, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, + 97, 98, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 100, 6, 0, 0, 0, 100, 3, 1, + 0, 0, 0, 101, 103, 7, 1, 0, 0, 102, 101, 1, 0, 0, 0, 103, 104, 1, 0, 0, + 0, 104, 102, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 5, 1, 0, 0, 0, 106, + 107, 5, 47, 0, 0, 107, 108, 5, 42, 0, 0, 108, 113, 1, 0, 0, 0, 109, 112, + 3, 6, 2, 0, 110, 112, 9, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 110, 1, 0, + 0, 0, 112, 115, 1, 0, 0, 0, 113, 114, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, + 114, 116, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 116, 117, 5, 42, 0, 0, 117, + 118, 5, 47, 0, 0, 118, 119, 1, 0, 0, 0, 119, 120, 6, 2, 0, 0, 120, 7, 1, + 0, 0, 0, 121, 122, 5, 47, 0, 0, 122, 123, 5, 47, 0, 0, 123, 127, 1, 0, + 0, 0, 124, 126, 9, 0, 0, 0, 125, 124, 1, 0, 0, 0, 126, 129, 1, 0, 0, 0, + 127, 128, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 128, 130, 1, 0, 0, 0, 129, + 127, 1, 0, 0, 0, 130, 131, 3, 4, 1, 0, 131, 132, 1, 0, 0, 0, 132, 133, + 6, 3, 1, 0, 133, 9, 1, 0, 0, 0, 134, 135, 5, 118, 0, 0, 135, 136, 5, 97, + 0, 0, 136, 137, 5, 114, 0, 0, 137, 138, 5, 115, 0, 0, 138, 11, 1, 0, 0, + 0, 139, 140, 5, 109, 0, 0, 140, 141, 5, 97, 0, 0, 141, 142, 5, 120, 0, + 0, 142, 13, 1, 0, 0, 0, 143, 144, 5, 115, 0, 0, 144, 145, 5, 111, 0, 0, + 145, 146, 5, 117, 0, 0, 146, 147, 5, 114, 0, 0, 147, 148, 5, 99, 0, 0, + 148, 149, 5, 101, 0, 0, 149, 15, 1, 0, 0, 0, 150, 151, 5, 100, 0, 0, 151, + 152, 5, 101, 0, 0, 152, 153, 5, 115, 0, 0, 153, 154, 5, 116, 0, 0, 154, + 155, 5, 105, 0, 0, 155, 156, 5, 110, 0, 0, 156, 157, 5, 97, 0, 0, 157, + 158, 5, 116, 0, 0, 158, 159, 5, 105, 0, 0, 159, 160, 5, 111, 0, 0, 160, + 161, 5, 110, 0, 0, 161, 17, 1, 0, 0, 0, 162, 163, 5, 115, 0, 0, 163, 164, + 5, 101, 0, 0, 164, 165, 5, 110, 0, 0, 165, 166, 5, 100, 0, 0, 166, 19, + 1, 0, 0, 0, 167, 168, 5, 102, 0, 0, 168, 169, 5, 114, 0, 0, 169, 170, 5, + 111, 0, 0, 170, 171, 5, 109, 0, 0, 171, 21, 1, 0, 0, 0, 172, 173, 5, 117, + 0, 0, 173, 174, 5, 112, 0, 0, 174, 23, 1, 0, 0, 0, 175, 176, 5, 116, 0, + 0, 176, 177, 5, 111, 0, 0, 177, 25, 1, 0, 0, 0, 178, 179, 5, 114, 0, 0, + 179, 180, 5, 101, 0, 0, 180, 181, 5, 109, 0, 0, 181, 182, 5, 97, 0, 0, + 182, 183, 5, 105, 0, 0, 183, 184, 5, 110, 0, 0, 184, 185, 5, 105, 0, 0, + 185, 186, 5, 110, 0, 0, 186, 187, 5, 103, 0, 0, 187, 27, 1, 0, 0, 0, 188, + 189, 5, 97, 0, 0, 189, 190, 5, 108, 0, 0, 190, 191, 5, 108, 0, 0, 191, + 192, 5, 111, 0, 0, 192, 193, 5, 119, 0, 0, 193, 194, 5, 105, 0, 0, 194, + 195, 5, 110, 0, 0, 195, 196, 5, 103, 0, 0, 196, 29, 1, 0, 0, 0, 197, 198, + 5, 117, 0, 0, 198, 199, 5, 110, 0, 0, 199, 200, 5, 98, 0, 0, 200, 201, + 5, 111, 0, 0, 201, 202, 5, 117, 0, 0, 202, 203, 5, 110, 0, 0, 203, 204, + 5, 100, 0, 0, 204, 205, 5, 101, 0, 0, 205, 206, 5, 100, 0, 0, 206, 31, + 1, 0, 0, 0, 207, 208, 5, 111, 0, 0, 208, 209, 5, 118, 0, 0, 209, 210, 5, + 101, 0, 0, 210, 211, 5, 114, 0, 0, 211, 212, 5, 100, 0, 0, 212, 213, 5, + 114, 0, 0, 213, 214, 5, 97, 0, 0, 214, 215, 5, 102, 0, 0, 215, 216, 5, + 116, 0, 0, 216, 33, 1, 0, 0, 0, 217, 218, 5, 111, 0, 0, 218, 219, 5, 110, + 0, 0, 219, 220, 5, 101, 0, 0, 220, 221, 5, 111, 0, 0, 221, 222, 5, 102, + 0, 0, 222, 35, 1, 0, 0, 0, 223, 224, 5, 107, 0, 0, 224, 225, 5, 101, 0, + 0, 225, 226, 5, 112, 0, 0, 226, 227, 5, 116, 0, 0, 227, 37, 1, 0, 0, 0, + 228, 229, 5, 115, 0, 0, 229, 230, 5, 97, 0, 0, 230, 231, 5, 118, 0, 0, + 231, 232, 5, 101, 0, 0, 232, 39, 1, 0, 0, 0, 233, 234, 5, 40, 0, 0, 234, + 41, 1, 0, 0, 0, 235, 236, 5, 41, 0, 0, 236, 43, 1, 0, 0, 0, 237, 238, 5, + 91, 0, 0, 238, 45, 1, 0, 0, 0, 239, 240, 5, 93, 0, 0, 240, 47, 1, 0, 0, + 0, 241, 242, 5, 123, 0, 0, 242, 49, 1, 0, 0, 0, 243, 244, 5, 125, 0, 0, + 244, 51, 1, 0, 0, 0, 245, 246, 5, 44, 0, 0, 246, 53, 1, 0, 0, 0, 247, 248, + 5, 61, 0, 0, 248, 55, 1, 0, 0, 0, 249, 250, 5, 42, 0, 0, 250, 57, 1, 0, + 0, 0, 251, 252, 5, 43, 0, 0, 252, 59, 1, 0, 0, 0, 253, 254, 5, 45, 0, 0, + 254, 61, 1, 0, 0, 0, 255, 256, 5, 47, 0, 0, 256, 63, 1, 0, 0, 0, 257, 258, + 5, 92, 0, 0, 258, 65, 1, 0, 0, 0, 259, 260, 5, 119, 0, 0, 260, 261, 5, + 105, 0, 0, 261, 262, 5, 116, 0, 0, 262, 263, 5, 104, 0, 0, 263, 67, 1, + 0, 0, 0, 264, 265, 5, 115, 0, 0, 265, 266, 5, 99, 0, 0, 266, 267, 5, 97, + 0, 0, 267, 268, 5, 108, 0, 0, 268, 269, 5, 105, 0, 0, 269, 270, 5, 110, + 0, 0, 270, 271, 5, 103, 0, 0, 271, 69, 1, 0, 0, 0, 272, 273, 5, 116, 0, + 0, 273, 274, 5, 104, 0, 0, 274, 275, 5, 114, 0, 0, 275, 276, 5, 111, 0, + 0, 276, 277, 5, 117, 0, 0, 277, 278, 5, 103, 0, 0, 278, 279, 5, 104, 0, + 0, 279, 71, 1, 0, 0, 0, 280, 282, 7, 2, 0, 0, 281, 280, 1, 0, 0, 0, 282, + 283, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 291, + 1, 0, 0, 0, 285, 287, 5, 46, 0, 0, 286, 288, 7, 2, 0, 0, 287, 286, 1, 0, + 0, 0, 288, 289, 1, 0, 0, 0, 289, 287, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, + 290, 292, 1, 0, 0, 0, 291, 285, 1, 0, 0, 0, 291, 292, 1, 0, 0, 0, 292, + 293, 1, 0, 0, 0, 293, 294, 5, 37, 0, 0, 294, 73, 1, 0, 0, 0, 295, 301, + 5, 34, 0, 0, 296, 297, 5, 92, 0, 0, 297, 300, 5, 34, 0, 0, 298, 300, 8, + 3, 0, 0, 299, 296, 1, 0, 0, 0, 299, 298, 1, 0, 0, 0, 300, 303, 1, 0, 0, + 0, 301, 299, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 304, 1, 0, 0, 0, 303, + 301, 1, 0, 0, 0, 304, 305, 5, 34, 0, 0, 305, 75, 1, 0, 0, 0, 306, 308, + 7, 4, 0, 0, 307, 306, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 307, 1, 0, + 0, 0, 309, 310, 1, 0, 0, 0, 310, 314, 1, 0, 0, 0, 311, 313, 7, 5, 0, 0, + 312, 311, 1, 0, 0, 0, 313, 316, 1, 0, 0, 0, 314, 312, 1, 0, 0, 0, 314, + 315, 1, 0, 0, 0, 315, 77, 1, 0, 0, 0, 316, 314, 1, 0, 0, 0, 317, 319, 7, + 2, 0, 0, 318, 317, 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, 320, 318, 1, 0, 0, + 0, 320, 321, 1, 0, 0, 0, 321, 330, 1, 0, 0, 0, 322, 324, 5, 95, 0, 0, 323, + 325, 7, 2, 0, 0, 324, 323, 1, 0, 0, 0, 325, 326, 1, 0, 0, 0, 326, 324, + 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, 327, 329, 1, 0, 0, 0, 328, 322, 1, 0, + 0, 0, 329, 332, 1, 0, 0, 0, 330, 328, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, + 331, 79, 1, 0, 0, 0, 332, 330, 1, 0, 0, 0, 333, 337, 7, 6, 0, 0, 334, 336, + 7, 7, 0, 0, 335, 334, 1, 0, 0, 0, 336, 339, 1, 0, 0, 0, 337, 335, 1, 0, + 0, 0, 337, 338, 1, 0, 0, 0, 338, 346, 1, 0, 0, 0, 339, 337, 1, 0, 0, 0, + 340, 342, 5, 47, 0, 0, 341, 343, 7, 2, 0, 0, 342, 341, 1, 0, 0, 0, 343, + 344, 1, 0, 0, 0, 344, 342, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 347, + 1, 0, 0, 0, 346, 340, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 81, 1, 0, + 0, 0, 348, 349, 5, 64, 0, 0, 349, 350, 1, 0, 0, 0, 350, 351, 6, 40, 2, + 0, 351, 83, 1, 0, 0, 0, 352, 353, 5, 58, 0, 0, 353, 354, 1, 0, 0, 0, 354, + 355, 6, 41, 2, 0, 355, 85, 1, 0, 0, 0, 356, 358, 5, 36, 0, 0, 357, 359, + 7, 5, 0, 0, 358, 357, 1, 0, 0, 0, 359, 360, 1, 0, 0, 0, 360, 358, 1, 0, + 0, 0, 360, 361, 1, 0, 0, 0, 361, 365, 1, 0, 0, 0, 362, 364, 7, 8, 0, 0, + 363, 362, 1, 0, 0, 0, 364, 367, 1, 0, 0, 0, 365, 363, 1, 0, 0, 0, 365, + 366, 1, 0, 0, 0, 366, 87, 1, 0, 0, 0, 367, 365, 1, 0, 0, 0, 368, 370, 7, + 9, 0, 0, 369, 368, 1, 0, 0, 0, 370, 371, 1, 0, 0, 0, 371, 369, 1, 0, 0, + 0, 371, 372, 1, 0, 0, 0, 372, 373, 1, 0, 0, 0, 373, 374, 6, 43, 3, 0, 374, + 89, 1, 0, 0, 0, 375, 376, 3, 86, 42, 0, 376, 377, 1, 0, 0, 0, 377, 378, + 6, 44, 3, 0, 378, 91, 1, 0, 0, 0, 379, 380, 3, 86, 42, 0, 380, 93, 1, 0, + 0, 0, 23, 0, 1, 97, 104, 111, 113, 127, 283, 289, 291, 299, 301, 309, 314, + 320, 326, 330, 337, 344, 346, 360, 365, 371, 4, 6, 0, 0, 0, 1, 0, 5, 1, + 0, 4, 0, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -310,16 +314,17 @@ const ( LexerRESTRICT = 32 LexerWITH = 33 LexerSCALING = 34 - LexerPERCENTAGE_PORTION_LITERAL = 35 - LexerSTRING = 36 - LexerIDENTIFIER = 37 - LexerNUMBER = 38 - LexerASSET = 39 - LexerACCOUNT_START = 40 - LexerCOLON = 41 - LexerACCOUNT_TEXT = 42 - LexerVARIABLE_NAME_ACC = 43 - LexerVARIABLE_NAME = 44 + LexerTHROUGH = 35 + LexerPERCENTAGE_PORTION_LITERAL = 36 + LexerSTRING = 37 + LexerIDENTIFIER = 38 + LexerNUMBER = 39 + LexerASSET = 40 + LexerACCOUNT_START = 41 + LexerCOLON = 42 + LexerACCOUNT_TEXT = 43 + LexerVARIABLE_NAME_ACC = 44 + LexerVARIABLE_NAME = 45 ) // LexerACCOUNT_MODE is the Lexer mode. diff --git a/internal/parser/antlrParser/numscript_parser.go b/internal/parser/antlrParser/numscript_parser.go index 11b5d3cc..d3f16599 100644 --- a/internal/parser/antlrParser/numscript_parser.go +++ b/internal/parser/antlrParser/numscript_parser.go @@ -36,14 +36,14 @@ func numscriptParserInit() { "'send'", "'from'", "'up'", "'to'", "'remaining'", "'allowing'", "'unbounded'", "'overdraft'", "'oneof'", "'kept'", "'save'", "'('", "')'", "'['", "']'", "'{'", "'}'", "','", "'='", "'*'", "'+'", "'-'", "'/'", "'\\'", "'with'", - "'scaling'", "", "", "", "", "", "'@'", "':'", + "'scaling'", "'through'", "", "", "", "", "", "'@'", "':'", } staticData.SymbolicNames = []string{ "", "WS", "NEWLINE", "MULTILINE_COMMENT", "LINE_COMMENT", "VARS", "MAX", "SOURCE", "DESTINATION", "SEND", "FROM", "UP", "TO", "REMAINING", "ALLOWING", "UNBOUNDED", "OVERDRAFT", "ONEOF", "KEPT", "SAVE", "LPARENS", "RPARENS", "LBRACKET", "RBRACKET", "LBRACE", "RBRACE", "COMMA", "EQ", "STAR", "PLUS", - "MINUS", "DIV", "RESTRICT", "WITH", "SCALING", "PERCENTAGE_PORTION_LITERAL", + "MINUS", "DIV", "RESTRICT", "WITH", "SCALING", "THROUGH", "PERCENTAGE_PORTION_LITERAL", "STRING", "IDENTIFIER", "NUMBER", "ASSET", "ACCOUNT_START", "COLON", "ACCOUNT_TEXT", "VARIABLE_NAME_ACC", "VARIABLE_NAME", } @@ -56,7 +56,7 @@ func numscriptParserInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 44, 276, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 45, 278, 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, 1, 0, 1, 0, 1, @@ -72,112 +72,113 @@ func numscriptParserInit() { 8, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 144, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 152, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 162, 8, 12, 1, 12, 1, 12, 1, - 12, 1, 12, 1, 12, 3, 12, 169, 8, 12, 1, 12, 1, 12, 4, 12, 173, 8, 12, 11, - 12, 12, 12, 174, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 181, 8, 12, 10, 12, - 12, 12, 184, 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 4, 12, 190, 8, 12, 11, - 12, 12, 12, 191, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, - 201, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 3, 14, 210, - 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 4, 16, 219, 8, - 16, 11, 16, 12, 16, 220, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 227, 8, 16, - 10, 16, 12, 16, 230, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, - 16, 5, 16, 239, 8, 16, 10, 16, 12, 16, 242, 9, 16, 1, 16, 1, 16, 1, 16, - 1, 16, 3, 16, 248, 8, 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, 18, 255, - 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, - 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 274, 8, 19, - 1, 19, 0, 1, 4, 20, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, - 28, 30, 32, 34, 36, 38, 0, 2, 1, 0, 29, 30, 2, 0, 16, 16, 37, 37, 299, - 0, 40, 1, 0, 0, 0, 2, 47, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 85, 1, 0, 0, - 0, 8, 93, 1, 0, 0, 0, 10, 100, 1, 0, 0, 0, 12, 103, 1, 0, 0, 0, 14, 108, - 1, 0, 0, 0, 16, 119, 1, 0, 0, 0, 18, 129, 1, 0, 0, 0, 20, 136, 1, 0, 0, - 0, 22, 138, 1, 0, 0, 0, 24, 200, 1, 0, 0, 0, 26, 202, 1, 0, 0, 0, 28, 209, - 1, 0, 0, 0, 30, 211, 1, 0, 0, 0, 32, 247, 1, 0, 0, 0, 34, 249, 1, 0, 0, - 0, 36, 254, 1, 0, 0, 0, 38, 273, 1, 0, 0, 0, 40, 41, 5, 22, 0, 0, 41, 42, - 3, 4, 2, 0, 42, 43, 3, 4, 2, 0, 43, 44, 5, 23, 0, 0, 44, 1, 1, 0, 0, 0, - 45, 48, 5, 42, 0, 0, 46, 48, 5, 43, 0, 0, 47, 45, 1, 0, 0, 0, 47, 46, 1, - 0, 0, 0, 48, 3, 1, 0, 0, 0, 49, 50, 6, 2, -1, 0, 50, 73, 5, 44, 0, 0, 51, - 73, 5, 39, 0, 0, 52, 73, 5, 36, 0, 0, 53, 54, 5, 40, 0, 0, 54, 59, 3, 2, - 1, 0, 55, 56, 5, 41, 0, 0, 56, 58, 3, 2, 1, 0, 57, 55, 1, 0, 0, 0, 58, - 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 73, 1, 0, 0, - 0, 61, 59, 1, 0, 0, 0, 62, 73, 5, 38, 0, 0, 63, 73, 5, 35, 0, 0, 64, 73, - 3, 0, 0, 0, 65, 66, 5, 30, 0, 0, 66, 73, 3, 4, 2, 5, 67, 68, 5, 20, 0, - 0, 68, 69, 3, 4, 2, 0, 69, 70, 5, 21, 0, 0, 70, 73, 1, 0, 0, 0, 71, 73, - 3, 8, 4, 0, 72, 49, 1, 0, 0, 0, 72, 51, 1, 0, 0, 0, 72, 52, 1, 0, 0, 0, - 72, 53, 1, 0, 0, 0, 72, 62, 1, 0, 0, 0, 72, 63, 1, 0, 0, 0, 72, 64, 1, - 0, 0, 0, 72, 65, 1, 0, 0, 0, 72, 67, 1, 0, 0, 0, 72, 71, 1, 0, 0, 0, 73, - 82, 1, 0, 0, 0, 74, 75, 10, 4, 0, 0, 75, 76, 5, 31, 0, 0, 76, 81, 3, 4, - 2, 5, 77, 78, 10, 3, 0, 0, 78, 79, 7, 0, 0, 0, 79, 81, 3, 4, 2, 4, 80, - 74, 1, 0, 0, 0, 80, 77, 1, 0, 0, 0, 81, 84, 1, 0, 0, 0, 82, 80, 1, 0, 0, - 0, 82, 83, 1, 0, 0, 0, 83, 5, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 85, 90, 3, - 4, 2, 0, 86, 87, 5, 26, 0, 0, 87, 89, 3, 4, 2, 0, 88, 86, 1, 0, 0, 0, 89, - 92, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 7, 1, 0, 0, - 0, 92, 90, 1, 0, 0, 0, 93, 94, 7, 1, 0, 0, 94, 96, 5, 20, 0, 0, 95, 97, - 3, 6, 3, 0, 96, 95, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, - 98, 99, 5, 21, 0, 0, 99, 9, 1, 0, 0, 0, 100, 101, 5, 27, 0, 0, 101, 102, - 3, 4, 2, 0, 102, 11, 1, 0, 0, 0, 103, 104, 5, 37, 0, 0, 104, 106, 5, 44, - 0, 0, 105, 107, 3, 10, 5, 0, 106, 105, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, - 107, 13, 1, 0, 0, 0, 108, 109, 5, 5, 0, 0, 109, 113, 5, 24, 0, 0, 110, - 112, 3, 12, 6, 0, 111, 110, 1, 0, 0, 0, 112, 115, 1, 0, 0, 0, 113, 111, - 1, 0, 0, 0, 113, 114, 1, 0, 0, 0, 114, 116, 1, 0, 0, 0, 115, 113, 1, 0, - 0, 0, 116, 117, 5, 25, 0, 0, 117, 15, 1, 0, 0, 0, 118, 120, 3, 14, 7, 0, - 119, 118, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 124, 1, 0, 0, 0, 121, - 123, 3, 38, 19, 0, 122, 121, 1, 0, 0, 0, 123, 126, 1, 0, 0, 0, 124, 122, - 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 127, 1, 0, 0, 0, 126, 124, 1, 0, - 0, 0, 127, 128, 5, 0, 0, 1, 128, 17, 1, 0, 0, 0, 129, 130, 5, 22, 0, 0, - 130, 131, 3, 4, 2, 0, 131, 132, 5, 28, 0, 0, 132, 133, 5, 23, 0, 0, 133, - 19, 1, 0, 0, 0, 134, 137, 3, 4, 2, 0, 135, 137, 5, 13, 0, 0, 136, 134, - 1, 0, 0, 0, 136, 135, 1, 0, 0, 0, 137, 21, 1, 0, 0, 0, 138, 139, 5, 32, - 0, 0, 139, 140, 3, 4, 2, 0, 140, 23, 1, 0, 0, 0, 141, 143, 3, 4, 2, 0, - 142, 144, 3, 22, 11, 0, 143, 142, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, - 145, 1, 0, 0, 0, 145, 146, 5, 14, 0, 0, 146, 147, 5, 15, 0, 0, 147, 148, - 5, 16, 0, 0, 148, 201, 1, 0, 0, 0, 149, 151, 3, 4, 2, 0, 150, 152, 3, 22, - 11, 0, 151, 150, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, - 153, 154, 5, 14, 0, 0, 154, 155, 5, 16, 0, 0, 155, 156, 5, 11, 0, 0, 156, - 157, 5, 12, 0, 0, 157, 158, 3, 4, 2, 0, 158, 201, 1, 0, 0, 0, 159, 161, - 3, 4, 2, 0, 160, 162, 3, 22, 11, 0, 161, 160, 1, 0, 0, 0, 161, 162, 1, - 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 164, 5, 33, 0, 0, 164, 165, 5, 34, - 0, 0, 165, 201, 1, 0, 0, 0, 166, 168, 3, 4, 2, 0, 167, 169, 3, 22, 11, - 0, 168, 167, 1, 0, 0, 0, 168, 169, 1, 0, 0, 0, 169, 201, 1, 0, 0, 0, 170, - 172, 5, 24, 0, 0, 171, 173, 3, 26, 13, 0, 172, 171, 1, 0, 0, 0, 173, 174, - 1, 0, 0, 0, 174, 172, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 176, 1, 0, - 0, 0, 176, 177, 5, 25, 0, 0, 177, 201, 1, 0, 0, 0, 178, 182, 5, 24, 0, - 0, 179, 181, 3, 24, 12, 0, 180, 179, 1, 0, 0, 0, 181, 184, 1, 0, 0, 0, - 182, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 185, 1, 0, 0, 0, 184, - 182, 1, 0, 0, 0, 185, 201, 5, 25, 0, 0, 186, 187, 5, 17, 0, 0, 187, 189, - 5, 24, 0, 0, 188, 190, 3, 24, 12, 0, 189, 188, 1, 0, 0, 0, 190, 191, 1, - 0, 0, 0, 191, 189, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 1, 0, 0, - 0, 193, 194, 5, 25, 0, 0, 194, 201, 1, 0, 0, 0, 195, 196, 5, 6, 0, 0, 196, - 197, 3, 4, 2, 0, 197, 198, 5, 10, 0, 0, 198, 199, 3, 24, 12, 0, 199, 201, - 1, 0, 0, 0, 200, 141, 1, 0, 0, 0, 200, 149, 1, 0, 0, 0, 200, 159, 1, 0, - 0, 0, 200, 166, 1, 0, 0, 0, 200, 170, 1, 0, 0, 0, 200, 178, 1, 0, 0, 0, - 200, 186, 1, 0, 0, 0, 200, 195, 1, 0, 0, 0, 201, 25, 1, 0, 0, 0, 202, 203, - 3, 20, 10, 0, 203, 204, 5, 10, 0, 0, 204, 205, 3, 24, 12, 0, 205, 27, 1, - 0, 0, 0, 206, 207, 5, 12, 0, 0, 207, 210, 3, 32, 16, 0, 208, 210, 5, 18, - 0, 0, 209, 206, 1, 0, 0, 0, 209, 208, 1, 0, 0, 0, 210, 29, 1, 0, 0, 0, - 211, 212, 5, 6, 0, 0, 212, 213, 3, 4, 2, 0, 213, 214, 3, 28, 14, 0, 214, - 31, 1, 0, 0, 0, 215, 248, 3, 4, 2, 0, 216, 218, 5, 24, 0, 0, 217, 219, - 3, 34, 17, 0, 218, 217, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 218, 1, - 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 223, 5, 25, 0, - 0, 223, 248, 1, 0, 0, 0, 224, 228, 5, 24, 0, 0, 225, 227, 3, 30, 15, 0, - 226, 225, 1, 0, 0, 0, 227, 230, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 228, - 229, 1, 0, 0, 0, 229, 231, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 231, 232, - 5, 13, 0, 0, 232, 233, 3, 28, 14, 0, 233, 234, 5, 25, 0, 0, 234, 248, 1, - 0, 0, 0, 235, 236, 5, 17, 0, 0, 236, 240, 5, 24, 0, 0, 237, 239, 3, 30, - 15, 0, 238, 237, 1, 0, 0, 0, 239, 242, 1, 0, 0, 0, 240, 238, 1, 0, 0, 0, - 240, 241, 1, 0, 0, 0, 241, 243, 1, 0, 0, 0, 242, 240, 1, 0, 0, 0, 243, - 244, 5, 13, 0, 0, 244, 245, 3, 28, 14, 0, 245, 246, 5, 25, 0, 0, 246, 248, - 1, 0, 0, 0, 247, 215, 1, 0, 0, 0, 247, 216, 1, 0, 0, 0, 247, 224, 1, 0, - 0, 0, 247, 235, 1, 0, 0, 0, 248, 33, 1, 0, 0, 0, 249, 250, 3, 20, 10, 0, - 250, 251, 3, 28, 14, 0, 251, 35, 1, 0, 0, 0, 252, 255, 3, 4, 2, 0, 253, - 255, 3, 18, 9, 0, 254, 252, 1, 0, 0, 0, 254, 253, 1, 0, 0, 0, 255, 37, - 1, 0, 0, 0, 256, 257, 5, 9, 0, 0, 257, 258, 3, 36, 18, 0, 258, 259, 5, - 20, 0, 0, 259, 260, 5, 7, 0, 0, 260, 261, 5, 27, 0, 0, 261, 262, 3, 24, - 12, 0, 262, 263, 5, 8, 0, 0, 263, 264, 5, 27, 0, 0, 264, 265, 3, 32, 16, - 0, 265, 266, 5, 21, 0, 0, 266, 274, 1, 0, 0, 0, 267, 268, 5, 19, 0, 0, - 268, 269, 3, 36, 18, 0, 269, 270, 5, 10, 0, 0, 270, 271, 3, 4, 2, 0, 271, - 274, 1, 0, 0, 0, 272, 274, 3, 8, 4, 0, 273, 256, 1, 0, 0, 0, 273, 267, - 1, 0, 0, 0, 273, 272, 1, 0, 0, 0, 274, 39, 1, 0, 0, 0, 27, 47, 59, 72, - 80, 82, 90, 96, 106, 113, 119, 124, 136, 143, 151, 161, 168, 174, 182, - 191, 200, 209, 220, 228, 240, 247, 254, 273, + 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 171, 8, 12, 1, 12, 1, 12, 4, 12, + 175, 8, 12, 11, 12, 12, 12, 176, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 183, + 8, 12, 10, 12, 12, 12, 186, 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 4, 12, 192, + 8, 12, 11, 12, 12, 12, 193, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, + 12, 3, 12, 203, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, + 3, 14, 212, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 4, + 16, 221, 8, 16, 11, 16, 12, 16, 222, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, + 229, 8, 16, 10, 16, 12, 16, 232, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, + 16, 1, 16, 1, 16, 5, 16, 241, 8, 16, 10, 16, 12, 16, 244, 9, 16, 1, 16, + 1, 16, 1, 16, 1, 16, 3, 16, 250, 8, 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, + 18, 3, 18, 257, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, + 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, + 19, 276, 8, 19, 1, 19, 0, 1, 4, 20, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, + 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 0, 2, 1, 0, 29, 30, 2, 0, 16, 16, + 38, 38, 301, 0, 40, 1, 0, 0, 0, 2, 47, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, + 85, 1, 0, 0, 0, 8, 93, 1, 0, 0, 0, 10, 100, 1, 0, 0, 0, 12, 103, 1, 0, + 0, 0, 14, 108, 1, 0, 0, 0, 16, 119, 1, 0, 0, 0, 18, 129, 1, 0, 0, 0, 20, + 136, 1, 0, 0, 0, 22, 138, 1, 0, 0, 0, 24, 202, 1, 0, 0, 0, 26, 204, 1, + 0, 0, 0, 28, 211, 1, 0, 0, 0, 30, 213, 1, 0, 0, 0, 32, 249, 1, 0, 0, 0, + 34, 251, 1, 0, 0, 0, 36, 256, 1, 0, 0, 0, 38, 275, 1, 0, 0, 0, 40, 41, + 5, 22, 0, 0, 41, 42, 3, 4, 2, 0, 42, 43, 3, 4, 2, 0, 43, 44, 5, 23, 0, + 0, 44, 1, 1, 0, 0, 0, 45, 48, 5, 43, 0, 0, 46, 48, 5, 44, 0, 0, 47, 45, + 1, 0, 0, 0, 47, 46, 1, 0, 0, 0, 48, 3, 1, 0, 0, 0, 49, 50, 6, 2, -1, 0, + 50, 73, 5, 45, 0, 0, 51, 73, 5, 40, 0, 0, 52, 73, 5, 37, 0, 0, 53, 54, + 5, 41, 0, 0, 54, 59, 3, 2, 1, 0, 55, 56, 5, 42, 0, 0, 56, 58, 3, 2, 1, + 0, 57, 55, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, + 1, 0, 0, 0, 60, 73, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 73, 5, 39, 0, 0, + 63, 73, 5, 36, 0, 0, 64, 73, 3, 0, 0, 0, 65, 66, 5, 30, 0, 0, 66, 73, 3, + 4, 2, 5, 67, 68, 5, 20, 0, 0, 68, 69, 3, 4, 2, 0, 69, 70, 5, 21, 0, 0, + 70, 73, 1, 0, 0, 0, 71, 73, 3, 8, 4, 0, 72, 49, 1, 0, 0, 0, 72, 51, 1, + 0, 0, 0, 72, 52, 1, 0, 0, 0, 72, 53, 1, 0, 0, 0, 72, 62, 1, 0, 0, 0, 72, + 63, 1, 0, 0, 0, 72, 64, 1, 0, 0, 0, 72, 65, 1, 0, 0, 0, 72, 67, 1, 0, 0, + 0, 72, 71, 1, 0, 0, 0, 73, 82, 1, 0, 0, 0, 74, 75, 10, 4, 0, 0, 75, 76, + 5, 31, 0, 0, 76, 81, 3, 4, 2, 5, 77, 78, 10, 3, 0, 0, 78, 79, 7, 0, 0, + 0, 79, 81, 3, 4, 2, 4, 80, 74, 1, 0, 0, 0, 80, 77, 1, 0, 0, 0, 81, 84, + 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 5, 1, 0, 0, 0, + 84, 82, 1, 0, 0, 0, 85, 90, 3, 4, 2, 0, 86, 87, 5, 26, 0, 0, 87, 89, 3, + 4, 2, 0, 88, 86, 1, 0, 0, 0, 89, 92, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 90, + 91, 1, 0, 0, 0, 91, 7, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 93, 94, 7, 1, 0, + 0, 94, 96, 5, 20, 0, 0, 95, 97, 3, 6, 3, 0, 96, 95, 1, 0, 0, 0, 96, 97, + 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 99, 5, 21, 0, 0, 99, 9, 1, 0, 0, 0, + 100, 101, 5, 27, 0, 0, 101, 102, 3, 4, 2, 0, 102, 11, 1, 0, 0, 0, 103, + 104, 5, 38, 0, 0, 104, 106, 5, 45, 0, 0, 105, 107, 3, 10, 5, 0, 106, 105, + 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 13, 1, 0, 0, 0, 108, 109, 5, 5, + 0, 0, 109, 113, 5, 24, 0, 0, 110, 112, 3, 12, 6, 0, 111, 110, 1, 0, 0, + 0, 112, 115, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 113, 114, 1, 0, 0, 0, 114, + 116, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 116, 117, 5, 25, 0, 0, 117, 15, + 1, 0, 0, 0, 118, 120, 3, 14, 7, 0, 119, 118, 1, 0, 0, 0, 119, 120, 1, 0, + 0, 0, 120, 124, 1, 0, 0, 0, 121, 123, 3, 38, 19, 0, 122, 121, 1, 0, 0, + 0, 123, 126, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, + 127, 1, 0, 0, 0, 126, 124, 1, 0, 0, 0, 127, 128, 5, 0, 0, 1, 128, 17, 1, + 0, 0, 0, 129, 130, 5, 22, 0, 0, 130, 131, 3, 4, 2, 0, 131, 132, 5, 28, + 0, 0, 132, 133, 5, 23, 0, 0, 133, 19, 1, 0, 0, 0, 134, 137, 3, 4, 2, 0, + 135, 137, 5, 13, 0, 0, 136, 134, 1, 0, 0, 0, 136, 135, 1, 0, 0, 0, 137, + 21, 1, 0, 0, 0, 138, 139, 5, 32, 0, 0, 139, 140, 3, 4, 2, 0, 140, 23, 1, + 0, 0, 0, 141, 143, 3, 4, 2, 0, 142, 144, 3, 22, 11, 0, 143, 142, 1, 0, + 0, 0, 143, 144, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, 146, 5, 14, 0, 0, + 146, 147, 5, 15, 0, 0, 147, 148, 5, 16, 0, 0, 148, 203, 1, 0, 0, 0, 149, + 151, 3, 4, 2, 0, 150, 152, 3, 22, 11, 0, 151, 150, 1, 0, 0, 0, 151, 152, + 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 154, 5, 14, 0, 0, 154, 155, 5, 16, + 0, 0, 155, 156, 5, 11, 0, 0, 156, 157, 5, 12, 0, 0, 157, 158, 3, 4, 2, + 0, 158, 203, 1, 0, 0, 0, 159, 161, 3, 4, 2, 0, 160, 162, 3, 22, 11, 0, + 161, 160, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, + 164, 5, 33, 0, 0, 164, 165, 5, 34, 0, 0, 165, 166, 5, 35, 0, 0, 166, 167, + 3, 4, 2, 0, 167, 203, 1, 0, 0, 0, 168, 170, 3, 4, 2, 0, 169, 171, 3, 22, + 11, 0, 170, 169, 1, 0, 0, 0, 170, 171, 1, 0, 0, 0, 171, 203, 1, 0, 0, 0, + 172, 174, 5, 24, 0, 0, 173, 175, 3, 26, 13, 0, 174, 173, 1, 0, 0, 0, 175, + 176, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 178, + 1, 0, 0, 0, 178, 179, 5, 25, 0, 0, 179, 203, 1, 0, 0, 0, 180, 184, 5, 24, + 0, 0, 181, 183, 3, 24, 12, 0, 182, 181, 1, 0, 0, 0, 183, 186, 1, 0, 0, + 0, 184, 182, 1, 0, 0, 0, 184, 185, 1, 0, 0, 0, 185, 187, 1, 0, 0, 0, 186, + 184, 1, 0, 0, 0, 187, 203, 5, 25, 0, 0, 188, 189, 5, 17, 0, 0, 189, 191, + 5, 24, 0, 0, 190, 192, 3, 24, 12, 0, 191, 190, 1, 0, 0, 0, 192, 193, 1, + 0, 0, 0, 193, 191, 1, 0, 0, 0, 193, 194, 1, 0, 0, 0, 194, 195, 1, 0, 0, + 0, 195, 196, 5, 25, 0, 0, 196, 203, 1, 0, 0, 0, 197, 198, 5, 6, 0, 0, 198, + 199, 3, 4, 2, 0, 199, 200, 5, 10, 0, 0, 200, 201, 3, 24, 12, 0, 201, 203, + 1, 0, 0, 0, 202, 141, 1, 0, 0, 0, 202, 149, 1, 0, 0, 0, 202, 159, 1, 0, + 0, 0, 202, 168, 1, 0, 0, 0, 202, 172, 1, 0, 0, 0, 202, 180, 1, 0, 0, 0, + 202, 188, 1, 0, 0, 0, 202, 197, 1, 0, 0, 0, 203, 25, 1, 0, 0, 0, 204, 205, + 3, 20, 10, 0, 205, 206, 5, 10, 0, 0, 206, 207, 3, 24, 12, 0, 207, 27, 1, + 0, 0, 0, 208, 209, 5, 12, 0, 0, 209, 212, 3, 32, 16, 0, 210, 212, 5, 18, + 0, 0, 211, 208, 1, 0, 0, 0, 211, 210, 1, 0, 0, 0, 212, 29, 1, 0, 0, 0, + 213, 214, 5, 6, 0, 0, 214, 215, 3, 4, 2, 0, 215, 216, 3, 28, 14, 0, 216, + 31, 1, 0, 0, 0, 217, 250, 3, 4, 2, 0, 218, 220, 5, 24, 0, 0, 219, 221, + 3, 34, 17, 0, 220, 219, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 220, 1, + 0, 0, 0, 222, 223, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, 224, 225, 5, 25, 0, + 0, 225, 250, 1, 0, 0, 0, 226, 230, 5, 24, 0, 0, 227, 229, 3, 30, 15, 0, + 228, 227, 1, 0, 0, 0, 229, 232, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 230, + 231, 1, 0, 0, 0, 231, 233, 1, 0, 0, 0, 232, 230, 1, 0, 0, 0, 233, 234, + 5, 13, 0, 0, 234, 235, 3, 28, 14, 0, 235, 236, 5, 25, 0, 0, 236, 250, 1, + 0, 0, 0, 237, 238, 5, 17, 0, 0, 238, 242, 5, 24, 0, 0, 239, 241, 3, 30, + 15, 0, 240, 239, 1, 0, 0, 0, 241, 244, 1, 0, 0, 0, 242, 240, 1, 0, 0, 0, + 242, 243, 1, 0, 0, 0, 243, 245, 1, 0, 0, 0, 244, 242, 1, 0, 0, 0, 245, + 246, 5, 13, 0, 0, 246, 247, 3, 28, 14, 0, 247, 248, 5, 25, 0, 0, 248, 250, + 1, 0, 0, 0, 249, 217, 1, 0, 0, 0, 249, 218, 1, 0, 0, 0, 249, 226, 1, 0, + 0, 0, 249, 237, 1, 0, 0, 0, 250, 33, 1, 0, 0, 0, 251, 252, 3, 20, 10, 0, + 252, 253, 3, 28, 14, 0, 253, 35, 1, 0, 0, 0, 254, 257, 3, 4, 2, 0, 255, + 257, 3, 18, 9, 0, 256, 254, 1, 0, 0, 0, 256, 255, 1, 0, 0, 0, 257, 37, + 1, 0, 0, 0, 258, 259, 5, 9, 0, 0, 259, 260, 3, 36, 18, 0, 260, 261, 5, + 20, 0, 0, 261, 262, 5, 7, 0, 0, 262, 263, 5, 27, 0, 0, 263, 264, 3, 24, + 12, 0, 264, 265, 5, 8, 0, 0, 265, 266, 5, 27, 0, 0, 266, 267, 3, 32, 16, + 0, 267, 268, 5, 21, 0, 0, 268, 276, 1, 0, 0, 0, 269, 270, 5, 19, 0, 0, + 270, 271, 3, 36, 18, 0, 271, 272, 5, 10, 0, 0, 272, 273, 3, 4, 2, 0, 273, + 276, 1, 0, 0, 0, 274, 276, 3, 8, 4, 0, 275, 258, 1, 0, 0, 0, 275, 269, + 1, 0, 0, 0, 275, 274, 1, 0, 0, 0, 276, 39, 1, 0, 0, 0, 27, 47, 59, 72, + 80, 82, 90, 96, 106, 113, 119, 124, 136, 143, 151, 161, 170, 176, 184, + 193, 202, 211, 222, 230, 242, 249, 256, 275, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -250,16 +251,17 @@ const ( NumscriptParserRESTRICT = 32 NumscriptParserWITH = 33 NumscriptParserSCALING = 34 - NumscriptParserPERCENTAGE_PORTION_LITERAL = 35 - NumscriptParserSTRING = 36 - NumscriptParserIDENTIFIER = 37 - NumscriptParserNUMBER = 38 - NumscriptParserASSET = 39 - NumscriptParserACCOUNT_START = 40 - NumscriptParserCOLON = 41 - NumscriptParserACCOUNT_TEXT = 42 - NumscriptParserVARIABLE_NAME_ACC = 43 - NumscriptParserVARIABLE_NAME = 44 + NumscriptParserTHROUGH = 35 + NumscriptParserPERCENTAGE_PORTION_LITERAL = 36 + NumscriptParserSTRING = 37 + NumscriptParserIDENTIFIER = 38 + NumscriptParserNUMBER = 39 + NumscriptParserASSET = 40 + NumscriptParserACCOUNT_START = 41 + NumscriptParserCOLON = 42 + NumscriptParserACCOUNT_TEXT = 43 + NumscriptParserVARIABLE_NAME_ACC = 44 + NumscriptParserVARIABLE_NAME = 45 ) // NumscriptParser rules. @@ -1908,7 +1910,7 @@ func (p *NumscriptParser) FunctionCall() (localctx IFunctionCallContext) { } _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&19757928611840) != 0 { + if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&39514778173440) != 0 { { p.SetState(95) p.FunctionCallArgs() @@ -2568,7 +2570,7 @@ func (p *NumscriptParser) Program() (localctx IProgramContext) { } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&137439543808) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&274878497280) != 0 { { p.SetState(121) p.Statement() @@ -3393,6 +3395,7 @@ func (s *SrcAccountUnboundedOverdraftContext) ExitRule(listener antlr.ParseTreeL type SrcAccountWithScalingContext struct { SourceContext address IValueExprContext + swap IValueExprContext } func NewSrcAccountWithScalingContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SrcAccountWithScalingContext { @@ -3407,8 +3410,12 @@ func NewSrcAccountWithScalingContext(parser antlr.Parser, ctx antlr.ParserRuleCo func (s *SrcAccountWithScalingContext) GetAddress() IValueExprContext { return s.address } +func (s *SrcAccountWithScalingContext) GetSwap() IValueExprContext { return s.swap } + func (s *SrcAccountWithScalingContext) SetAddress(v IValueExprContext) { s.address = v } +func (s *SrcAccountWithScalingContext) SetSwap(v IValueExprContext) { s.swap = v } + func (s *SrcAccountWithScalingContext) GetRuleContext() antlr.RuleContext { return s } @@ -3421,12 +3428,41 @@ func (s *SrcAccountWithScalingContext) SCALING() antlr.TerminalNode { return s.GetToken(NumscriptParserSCALING, 0) } -func (s *SrcAccountWithScalingContext) ValueExpr() IValueExprContext { +func (s *SrcAccountWithScalingContext) THROUGH() antlr.TerminalNode { + return s.GetToken(NumscriptParserTHROUGH, 0) +} + +func (s *SrcAccountWithScalingContext) AllValueExpr() []IValueExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IValueExprContext); ok { + len++ + } + } + + tst := make([]IValueExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IValueExprContext); ok { + tst[i] = t.(IValueExprContext) + i++ + } + } + + return tst +} + +func (s *SrcAccountWithScalingContext) ValueExpr(i int) IValueExprContext { var t antlr.RuleContext + j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IValueExprContext); ok { - t = ctx.(antlr.RuleContext) - break + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ } } @@ -3765,7 +3801,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { p.EnterRule(localctx, 24, NumscriptParserRULE_source) var _la int - p.SetState(200) + p.SetState(202) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3925,15 +3961,30 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { goto errorExit } } + { + p.SetState(165) + p.Match(NumscriptParserTHROUGH) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(166) + + var _x = p.valueExpr(0) + + localctx.(*SrcAccountWithScalingContext).swap = _x + } case 4: localctx = NewSrcAccountContext(p, localctx) p.EnterOuterAlt(localctx, 4) { - p.SetState(166) + p.SetState(168) p.valueExpr(0) } - p.SetState(168) + p.SetState(170) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3942,7 +3993,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { if _la == NumscriptParserRESTRICT { { - p.SetState(167) + p.SetState(169) p.ColorConstraint() } @@ -3952,27 +4003,27 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcAllotmentContext(p, localctx) p.EnterOuterAlt(localctx, 5) { - p.SetState(170) + p.SetState(172) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(172) + p.SetState(174) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&19757928620032) != 0) { + for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&39514778181632) != 0) { { - p.SetState(171) + p.SetState(173) p.AllotmentClauseSrc() } - p.SetState(174) + p.SetState(176) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3980,7 +4031,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(176) + p.SetState(178) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -3992,27 +4043,27 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcInorderContext(p, localctx) p.EnterOuterAlt(localctx, 6) { - p.SetState(178) + p.SetState(180) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(182) + p.SetState(184) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&19757945520192) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&39514795081792) != 0 { { - p.SetState(179) + p.SetState(181) p.Source() } - p.SetState(184) + p.SetState(186) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4020,7 +4071,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(185) + p.SetState(187) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4032,7 +4083,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcOneofContext(p, localctx) p.EnterOuterAlt(localctx, 7) { - p.SetState(186) + p.SetState(188) p.Match(NumscriptParserONEOF) if p.HasError() { // Recognition error - abort rule @@ -4040,27 +4091,27 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(187) + p.SetState(189) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(189) + p.SetState(191) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&19757945520192) != 0) { + for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&39514795081792) != 0) { { - p.SetState(188) + p.SetState(190) p.Source() } - p.SetState(191) + p.SetState(193) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4068,7 +4119,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(193) + p.SetState(195) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4080,7 +4131,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcCappedContext(p, localctx) p.EnterOuterAlt(localctx, 8) { - p.SetState(195) + p.SetState(197) p.Match(NumscriptParserMAX) if p.HasError() { // Recognition error - abort rule @@ -4088,14 +4139,14 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(196) + p.SetState(198) var _x = p.valueExpr(0) localctx.(*SrcCappedContext).cap_ = _x } { - p.SetState(197) + p.SetState(199) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -4103,7 +4154,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(198) + p.SetState(200) p.Source() } @@ -4233,11 +4284,11 @@ func (p *NumscriptParser) AllotmentClauseSrc() (localctx IAllotmentClauseSrcCont p.EnterRule(localctx, 26, NumscriptParserRULE_allotmentClauseSrc) p.EnterOuterAlt(localctx, 1) { - p.SetState(202) + p.SetState(204) p.Allotment() } { - p.SetState(203) + p.SetState(205) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -4245,7 +4296,7 @@ func (p *NumscriptParser) AllotmentClauseSrc() (localctx IAllotmentClauseSrcCont } } { - p.SetState(204) + p.SetState(206) p.Source() } @@ -4403,7 +4454,7 @@ func (s *DestinationToContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContext) { localctx = NewKeptOrDestinationContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 28, NumscriptParserRULE_keptOrDestination) - p.SetState(209) + p.SetState(211) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4414,7 +4465,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex localctx = NewDestinationToContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(206) + p.SetState(208) p.Match(NumscriptParserTO) if p.HasError() { // Recognition error - abort rule @@ -4422,7 +4473,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex } } { - p.SetState(207) + p.SetState(209) p.Destination() } @@ -4430,7 +4481,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex localctx = NewDestinationKeptContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(208) + p.SetState(210) p.Match(NumscriptParserKEPT) if p.HasError() { // Recognition error - abort rule @@ -4565,7 +4616,7 @@ func (p *NumscriptParser) DestinationInOrderClause() (localctx IDestinationInOrd p.EnterRule(localctx, 30, NumscriptParserRULE_destinationInOrderClause) p.EnterOuterAlt(localctx, 1) { - p.SetState(211) + p.SetState(213) p.Match(NumscriptParserMAX) if p.HasError() { // Recognition error - abort rule @@ -4573,11 +4624,11 @@ func (p *NumscriptParser) DestinationInOrderClause() (localctx IDestinationInOrd } } { - p.SetState(212) + p.SetState(214) p.valueExpr(0) } { - p.SetState(213) + p.SetState(215) p.KeptOrDestination() } @@ -4980,7 +5031,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { p.EnterRule(localctx, 32, NumscriptParserRULE_destination) var _la int - p.SetState(247) + p.SetState(249) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4991,7 +5042,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { localctx = NewDestAccountContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(215) + p.SetState(217) p.valueExpr(0) } @@ -4999,27 +5050,27 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { localctx = NewDestAllotmentContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(216) + p.SetState(218) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(218) + p.SetState(220) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&19757928620032) != 0) { + for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&39514778181632) != 0) { { - p.SetState(217) + p.SetState(219) p.AllotmentClauseDest() } - p.SetState(220) + p.SetState(222) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5027,7 +5078,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(222) + p.SetState(224) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -5039,14 +5090,14 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { localctx = NewDestInorderContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(224) + p.SetState(226) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(228) + p.SetState(230) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5055,11 +5106,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { for _la == NumscriptParserMAX { { - p.SetState(225) + p.SetState(227) p.DestinationInOrderClause() } - p.SetState(230) + p.SetState(232) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5067,7 +5118,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(231) + p.SetState(233) p.Match(NumscriptParserREMAINING) if p.HasError() { // Recognition error - abort rule @@ -5075,11 +5126,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { } } { - p.SetState(232) + p.SetState(234) p.KeptOrDestination() } { - p.SetState(233) + p.SetState(235) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -5091,7 +5142,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { localctx = NewDestOneofContext(p, localctx) p.EnterOuterAlt(localctx, 4) { - p.SetState(235) + p.SetState(237) p.Match(NumscriptParserONEOF) if p.HasError() { // Recognition error - abort rule @@ -5099,14 +5150,14 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { } } { - p.SetState(236) + p.SetState(238) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(240) + p.SetState(242) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5115,11 +5166,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { for _la == NumscriptParserMAX { { - p.SetState(237) + p.SetState(239) p.DestinationInOrderClause() } - p.SetState(242) + p.SetState(244) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5127,7 +5178,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(243) + p.SetState(245) p.Match(NumscriptParserREMAINING) if p.HasError() { // Recognition error - abort rule @@ -5135,11 +5186,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { } } { - p.SetState(244) + p.SetState(246) p.KeptOrDestination() } { - p.SetState(245) + p.SetState(247) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -5268,11 +5319,11 @@ func (p *NumscriptParser) AllotmentClauseDest() (localctx IAllotmentClauseDestCo p.EnterRule(localctx, 34, NumscriptParserRULE_allotmentClauseDest) p.EnterOuterAlt(localctx, 1) { - p.SetState(249) + p.SetState(251) p.Allotment() } { - p.SetState(250) + p.SetState(252) p.KeptOrDestination() } @@ -5438,7 +5489,7 @@ func (s *SentLiteralContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentValueContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 36, NumscriptParserRULE_sentValue) - p.SetState(254) + p.SetState(256) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5449,7 +5500,7 @@ func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentLiteralContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(252) + p.SetState(254) p.valueExpr(0) } @@ -5457,7 +5508,7 @@ func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentAllContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(253) + p.SetState(255) p.SentAllLit() } @@ -5757,7 +5808,7 @@ func (s *FnCallStatementContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewStatementContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 38, NumscriptParserRULE_statement) - p.SetState(273) + p.SetState(275) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5768,7 +5819,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewSendStatementContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(256) + p.SetState(258) p.Match(NumscriptParserSEND) if p.HasError() { // Recognition error - abort rule @@ -5776,11 +5827,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(257) + p.SetState(259) p.SentValue() } { - p.SetState(258) + p.SetState(260) p.Match(NumscriptParserLPARENS) if p.HasError() { // Recognition error - abort rule @@ -5788,7 +5839,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(259) + p.SetState(261) p.Match(NumscriptParserSOURCE) if p.HasError() { // Recognition error - abort rule @@ -5796,7 +5847,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(260) + p.SetState(262) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -5804,11 +5855,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(261) + p.SetState(263) p.Source() } { - p.SetState(262) + p.SetState(264) p.Match(NumscriptParserDESTINATION) if p.HasError() { // Recognition error - abort rule @@ -5816,7 +5867,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(263) + p.SetState(265) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -5824,11 +5875,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(264) + p.SetState(266) p.Destination() } { - p.SetState(265) + p.SetState(267) p.Match(NumscriptParserRPARENS) if p.HasError() { // Recognition error - abort rule @@ -5840,7 +5891,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewSaveStatementContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(267) + p.SetState(269) p.Match(NumscriptParserSAVE) if p.HasError() { // Recognition error - abort rule @@ -5848,11 +5899,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(268) + p.SetState(270) p.SentValue() } { - p.SetState(269) + p.SetState(271) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -5860,7 +5911,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(270) + p.SetState(272) p.valueExpr(0) } @@ -5868,7 +5919,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewFnCallStatementContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(272) + p.SetState(274) p.FunctionCall() } diff --git a/internal/parser/ast.go b/internal/parser/ast.go index 52002ff5..79923fb7 100644 --- a/internal/parser/ast.go +++ b/internal/parser/ast.go @@ -189,6 +189,7 @@ type ( Range Color ValueExpr Address ValueExpr + Through ValueExpr } ) diff --git a/internal/parser/parser.go b/internal/parser/parser.go index 2bc90396..f6ee2a0a 100644 --- a/internal/parser/parser.go +++ b/internal/parser/parser.go @@ -242,6 +242,7 @@ func parseSource(sourceCtx antlrParser.ISourceContext) Source { Range: ctxToRange(sourceCtx), Color: parseColorConstraint(sourceCtx.ColorConstraint()), Address: parseValueExpr(sourceCtx.GetAddress()), + Through: parseValueExpr(sourceCtx.GetSwap()), } case *antlrParser.SrcAccountBoundedOverdraftContext: diff --git a/internal/parser/parser_test.go b/internal/parser/parser_test.go index 7736cc23..97d67161 100644 --- a/internal/parser/parser_test.go +++ b/internal/parser/parser_test.go @@ -504,7 +504,7 @@ func TestColorRestrictionUnboundedOverdraft(t *testing.T) { func TestScalingSyntax(t *testing.T) { p := parser.Parse(`send $sent ( - source = @src with scaling + source = @src with scaling through @swap destination = @dest )`) snaps.MatchSnapshot(t, p.Value) From 5e73a3b9039daa19681c9351a9353bd207b2b94f Mon Sep 17 00:00:00 2001 From: ascandone Date: Mon, 12 Jan 2026 15:32:29 +0100 Subject: [PATCH 11/17] remove colors from scaling for now --- Numscript.g4 | 2 +- internal/analysis/hover.go | 12 + internal/parser/antlrParser/Numscript.interp | 2 +- .../parser/antlrParser/numscript_parser.go | 414 ++++++++---------- internal/parser/parser.go | 1 - 5 files changed, 205 insertions(+), 226 deletions(-) diff --git a/Numscript.g4 b/Numscript.g4 index 19521f9c..6c931c0a 100644 --- a/Numscript.g4 +++ b/Numscript.g4 @@ -47,7 +47,7 @@ colorConstraint: RESTRICT valueExpr; source : address = valueExpr colorConstraint? ALLOWING UNBOUNDED OVERDRAFT # srcAccountUnboundedOverdraft | address = valueExpr colorConstraint? ALLOWING OVERDRAFT UP TO maxOvedraft = valueExpr #srcAccountBoundedOverdraft - | address = valueExpr colorConstraint? WITH SCALING THROUGH swap=valueExpr # srcAccountWithScaling + | address = valueExpr WITH SCALING THROUGH swap=valueExpr # srcAccountWithScaling | valueExpr colorConstraint? # srcAccount | LBRACE allotmentClauseSrc+ RBRACE # srcAllotment | LBRACE source* RBRACE # srcInorder diff --git a/internal/analysis/hover.go b/internal/analysis/hover.go index 15b43035..3b7bb626 100644 --- a/internal/analysis/hover.go +++ b/internal/analysis/hover.go @@ -237,6 +237,18 @@ func hoverOnSource(source parser.Source, position parser.Position) Hover { return hover } } + case *parser.SourceWithScaling: + hover := hoverOnExpression(source.Address, position) + if hover != nil { + return hover + } + + hover = hoverOnExpression(source.Through, position) + if hover != nil { + return hover + } + + return nil case *parser.SourceAllotment: for _, item := range source.Items { diff --git a/internal/parser/antlrParser/Numscript.interp b/internal/parser/antlrParser/Numscript.interp index b61f65e9..700f6da0 100644 --- a/internal/parser/antlrParser/Numscript.interp +++ b/internal/parser/antlrParser/Numscript.interp @@ -118,4 +118,4 @@ statement atn: -[4, 1, 45, 278, 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, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 48, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 58, 8, 2, 10, 2, 12, 2, 61, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 73, 8, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 81, 8, 2, 10, 2, 12, 2, 84, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 89, 8, 3, 10, 3, 12, 3, 92, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 97, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 107, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 112, 8, 7, 10, 7, 12, 7, 115, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 120, 8, 8, 1, 8, 5, 8, 123, 8, 8, 10, 8, 12, 8, 126, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 137, 8, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 144, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 152, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 162, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 171, 8, 12, 1, 12, 1, 12, 4, 12, 175, 8, 12, 11, 12, 12, 12, 176, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 183, 8, 12, 10, 12, 12, 12, 186, 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 4, 12, 192, 8, 12, 11, 12, 12, 12, 193, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 203, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 3, 14, 212, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 4, 16, 221, 8, 16, 11, 16, 12, 16, 222, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 229, 8, 16, 10, 16, 12, 16, 232, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 241, 8, 16, 10, 16, 12, 16, 244, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 250, 8, 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, 18, 257, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 276, 8, 19, 1, 19, 0, 1, 4, 20, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 0, 2, 1, 0, 29, 30, 2, 0, 16, 16, 38, 38, 301, 0, 40, 1, 0, 0, 0, 2, 47, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 85, 1, 0, 0, 0, 8, 93, 1, 0, 0, 0, 10, 100, 1, 0, 0, 0, 12, 103, 1, 0, 0, 0, 14, 108, 1, 0, 0, 0, 16, 119, 1, 0, 0, 0, 18, 129, 1, 0, 0, 0, 20, 136, 1, 0, 0, 0, 22, 138, 1, 0, 0, 0, 24, 202, 1, 0, 0, 0, 26, 204, 1, 0, 0, 0, 28, 211, 1, 0, 0, 0, 30, 213, 1, 0, 0, 0, 32, 249, 1, 0, 0, 0, 34, 251, 1, 0, 0, 0, 36, 256, 1, 0, 0, 0, 38, 275, 1, 0, 0, 0, 40, 41, 5, 22, 0, 0, 41, 42, 3, 4, 2, 0, 42, 43, 3, 4, 2, 0, 43, 44, 5, 23, 0, 0, 44, 1, 1, 0, 0, 0, 45, 48, 5, 43, 0, 0, 46, 48, 5, 44, 0, 0, 47, 45, 1, 0, 0, 0, 47, 46, 1, 0, 0, 0, 48, 3, 1, 0, 0, 0, 49, 50, 6, 2, -1, 0, 50, 73, 5, 45, 0, 0, 51, 73, 5, 40, 0, 0, 52, 73, 5, 37, 0, 0, 53, 54, 5, 41, 0, 0, 54, 59, 3, 2, 1, 0, 55, 56, 5, 42, 0, 0, 56, 58, 3, 2, 1, 0, 57, 55, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 73, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 73, 5, 39, 0, 0, 63, 73, 5, 36, 0, 0, 64, 73, 3, 0, 0, 0, 65, 66, 5, 30, 0, 0, 66, 73, 3, 4, 2, 5, 67, 68, 5, 20, 0, 0, 68, 69, 3, 4, 2, 0, 69, 70, 5, 21, 0, 0, 70, 73, 1, 0, 0, 0, 71, 73, 3, 8, 4, 0, 72, 49, 1, 0, 0, 0, 72, 51, 1, 0, 0, 0, 72, 52, 1, 0, 0, 0, 72, 53, 1, 0, 0, 0, 72, 62, 1, 0, 0, 0, 72, 63, 1, 0, 0, 0, 72, 64, 1, 0, 0, 0, 72, 65, 1, 0, 0, 0, 72, 67, 1, 0, 0, 0, 72, 71, 1, 0, 0, 0, 73, 82, 1, 0, 0, 0, 74, 75, 10, 4, 0, 0, 75, 76, 5, 31, 0, 0, 76, 81, 3, 4, 2, 5, 77, 78, 10, 3, 0, 0, 78, 79, 7, 0, 0, 0, 79, 81, 3, 4, 2, 4, 80, 74, 1, 0, 0, 0, 80, 77, 1, 0, 0, 0, 81, 84, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 5, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 85, 90, 3, 4, 2, 0, 86, 87, 5, 26, 0, 0, 87, 89, 3, 4, 2, 0, 88, 86, 1, 0, 0, 0, 89, 92, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 7, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 93, 94, 7, 1, 0, 0, 94, 96, 5, 20, 0, 0, 95, 97, 3, 6, 3, 0, 96, 95, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 99, 5, 21, 0, 0, 99, 9, 1, 0, 0, 0, 100, 101, 5, 27, 0, 0, 101, 102, 3, 4, 2, 0, 102, 11, 1, 0, 0, 0, 103, 104, 5, 38, 0, 0, 104, 106, 5, 45, 0, 0, 105, 107, 3, 10, 5, 0, 106, 105, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 13, 1, 0, 0, 0, 108, 109, 5, 5, 0, 0, 109, 113, 5, 24, 0, 0, 110, 112, 3, 12, 6, 0, 111, 110, 1, 0, 0, 0, 112, 115, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 113, 114, 1, 0, 0, 0, 114, 116, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 116, 117, 5, 25, 0, 0, 117, 15, 1, 0, 0, 0, 118, 120, 3, 14, 7, 0, 119, 118, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 124, 1, 0, 0, 0, 121, 123, 3, 38, 19, 0, 122, 121, 1, 0, 0, 0, 123, 126, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 127, 1, 0, 0, 0, 126, 124, 1, 0, 0, 0, 127, 128, 5, 0, 0, 1, 128, 17, 1, 0, 0, 0, 129, 130, 5, 22, 0, 0, 130, 131, 3, 4, 2, 0, 131, 132, 5, 28, 0, 0, 132, 133, 5, 23, 0, 0, 133, 19, 1, 0, 0, 0, 134, 137, 3, 4, 2, 0, 135, 137, 5, 13, 0, 0, 136, 134, 1, 0, 0, 0, 136, 135, 1, 0, 0, 0, 137, 21, 1, 0, 0, 0, 138, 139, 5, 32, 0, 0, 139, 140, 3, 4, 2, 0, 140, 23, 1, 0, 0, 0, 141, 143, 3, 4, 2, 0, 142, 144, 3, 22, 11, 0, 143, 142, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, 146, 5, 14, 0, 0, 146, 147, 5, 15, 0, 0, 147, 148, 5, 16, 0, 0, 148, 203, 1, 0, 0, 0, 149, 151, 3, 4, 2, 0, 150, 152, 3, 22, 11, 0, 151, 150, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 154, 5, 14, 0, 0, 154, 155, 5, 16, 0, 0, 155, 156, 5, 11, 0, 0, 156, 157, 5, 12, 0, 0, 157, 158, 3, 4, 2, 0, 158, 203, 1, 0, 0, 0, 159, 161, 3, 4, 2, 0, 160, 162, 3, 22, 11, 0, 161, 160, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 164, 5, 33, 0, 0, 164, 165, 5, 34, 0, 0, 165, 166, 5, 35, 0, 0, 166, 167, 3, 4, 2, 0, 167, 203, 1, 0, 0, 0, 168, 170, 3, 4, 2, 0, 169, 171, 3, 22, 11, 0, 170, 169, 1, 0, 0, 0, 170, 171, 1, 0, 0, 0, 171, 203, 1, 0, 0, 0, 172, 174, 5, 24, 0, 0, 173, 175, 3, 26, 13, 0, 174, 173, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 179, 5, 25, 0, 0, 179, 203, 1, 0, 0, 0, 180, 184, 5, 24, 0, 0, 181, 183, 3, 24, 12, 0, 182, 181, 1, 0, 0, 0, 183, 186, 1, 0, 0, 0, 184, 182, 1, 0, 0, 0, 184, 185, 1, 0, 0, 0, 185, 187, 1, 0, 0, 0, 186, 184, 1, 0, 0, 0, 187, 203, 5, 25, 0, 0, 188, 189, 5, 17, 0, 0, 189, 191, 5, 24, 0, 0, 190, 192, 3, 24, 12, 0, 191, 190, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, 191, 1, 0, 0, 0, 193, 194, 1, 0, 0, 0, 194, 195, 1, 0, 0, 0, 195, 196, 5, 25, 0, 0, 196, 203, 1, 0, 0, 0, 197, 198, 5, 6, 0, 0, 198, 199, 3, 4, 2, 0, 199, 200, 5, 10, 0, 0, 200, 201, 3, 24, 12, 0, 201, 203, 1, 0, 0, 0, 202, 141, 1, 0, 0, 0, 202, 149, 1, 0, 0, 0, 202, 159, 1, 0, 0, 0, 202, 168, 1, 0, 0, 0, 202, 172, 1, 0, 0, 0, 202, 180, 1, 0, 0, 0, 202, 188, 1, 0, 0, 0, 202, 197, 1, 0, 0, 0, 203, 25, 1, 0, 0, 0, 204, 205, 3, 20, 10, 0, 205, 206, 5, 10, 0, 0, 206, 207, 3, 24, 12, 0, 207, 27, 1, 0, 0, 0, 208, 209, 5, 12, 0, 0, 209, 212, 3, 32, 16, 0, 210, 212, 5, 18, 0, 0, 211, 208, 1, 0, 0, 0, 211, 210, 1, 0, 0, 0, 212, 29, 1, 0, 0, 0, 213, 214, 5, 6, 0, 0, 214, 215, 3, 4, 2, 0, 215, 216, 3, 28, 14, 0, 216, 31, 1, 0, 0, 0, 217, 250, 3, 4, 2, 0, 218, 220, 5, 24, 0, 0, 219, 221, 3, 34, 17, 0, 220, 219, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 220, 1, 0, 0, 0, 222, 223, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, 224, 225, 5, 25, 0, 0, 225, 250, 1, 0, 0, 0, 226, 230, 5, 24, 0, 0, 227, 229, 3, 30, 15, 0, 228, 227, 1, 0, 0, 0, 229, 232, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 233, 1, 0, 0, 0, 232, 230, 1, 0, 0, 0, 233, 234, 5, 13, 0, 0, 234, 235, 3, 28, 14, 0, 235, 236, 5, 25, 0, 0, 236, 250, 1, 0, 0, 0, 237, 238, 5, 17, 0, 0, 238, 242, 5, 24, 0, 0, 239, 241, 3, 30, 15, 0, 240, 239, 1, 0, 0, 0, 241, 244, 1, 0, 0, 0, 242, 240, 1, 0, 0, 0, 242, 243, 1, 0, 0, 0, 243, 245, 1, 0, 0, 0, 244, 242, 1, 0, 0, 0, 245, 246, 5, 13, 0, 0, 246, 247, 3, 28, 14, 0, 247, 248, 5, 25, 0, 0, 248, 250, 1, 0, 0, 0, 249, 217, 1, 0, 0, 0, 249, 218, 1, 0, 0, 0, 249, 226, 1, 0, 0, 0, 249, 237, 1, 0, 0, 0, 250, 33, 1, 0, 0, 0, 251, 252, 3, 20, 10, 0, 252, 253, 3, 28, 14, 0, 253, 35, 1, 0, 0, 0, 254, 257, 3, 4, 2, 0, 255, 257, 3, 18, 9, 0, 256, 254, 1, 0, 0, 0, 256, 255, 1, 0, 0, 0, 257, 37, 1, 0, 0, 0, 258, 259, 5, 9, 0, 0, 259, 260, 3, 36, 18, 0, 260, 261, 5, 20, 0, 0, 261, 262, 5, 7, 0, 0, 262, 263, 5, 27, 0, 0, 263, 264, 3, 24, 12, 0, 264, 265, 5, 8, 0, 0, 265, 266, 5, 27, 0, 0, 266, 267, 3, 32, 16, 0, 267, 268, 5, 21, 0, 0, 268, 276, 1, 0, 0, 0, 269, 270, 5, 19, 0, 0, 270, 271, 3, 36, 18, 0, 271, 272, 5, 10, 0, 0, 272, 273, 3, 4, 2, 0, 273, 276, 1, 0, 0, 0, 274, 276, 3, 8, 4, 0, 275, 258, 1, 0, 0, 0, 275, 269, 1, 0, 0, 0, 275, 274, 1, 0, 0, 0, 276, 39, 1, 0, 0, 0, 27, 47, 59, 72, 80, 82, 90, 96, 106, 113, 119, 124, 136, 143, 151, 161, 170, 176, 184, 193, 202, 211, 222, 230, 242, 249, 256, 275] \ No newline at end of file +[4, 1, 45, 275, 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, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 48, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 58, 8, 2, 10, 2, 12, 2, 61, 9, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 73, 8, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 81, 8, 2, 10, 2, 12, 2, 84, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 89, 8, 3, 10, 3, 12, 3, 92, 9, 3, 1, 4, 1, 4, 1, 4, 3, 4, 97, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 3, 6, 107, 8, 6, 1, 7, 1, 7, 1, 7, 5, 7, 112, 8, 7, 10, 7, 12, 7, 115, 9, 7, 1, 7, 1, 7, 1, 8, 3, 8, 120, 8, 8, 1, 8, 5, 8, 123, 8, 8, 10, 8, 12, 8, 126, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 137, 8, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 144, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 152, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 168, 8, 12, 1, 12, 1, 12, 4, 12, 172, 8, 12, 11, 12, 12, 12, 173, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 180, 8, 12, 10, 12, 12, 12, 183, 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 4, 12, 189, 8, 12, 11, 12, 12, 12, 190, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 200, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 3, 14, 209, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 4, 16, 218, 8, 16, 11, 16, 12, 16, 219, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 226, 8, 16, 10, 16, 12, 16, 229, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 238, 8, 16, 10, 16, 12, 16, 241, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 247, 8, 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, 18, 254, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 273, 8, 19, 1, 19, 0, 1, 4, 20, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 0, 2, 1, 0, 29, 30, 2, 0, 16, 16, 38, 38, 297, 0, 40, 1, 0, 0, 0, 2, 47, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 85, 1, 0, 0, 0, 8, 93, 1, 0, 0, 0, 10, 100, 1, 0, 0, 0, 12, 103, 1, 0, 0, 0, 14, 108, 1, 0, 0, 0, 16, 119, 1, 0, 0, 0, 18, 129, 1, 0, 0, 0, 20, 136, 1, 0, 0, 0, 22, 138, 1, 0, 0, 0, 24, 199, 1, 0, 0, 0, 26, 201, 1, 0, 0, 0, 28, 208, 1, 0, 0, 0, 30, 210, 1, 0, 0, 0, 32, 246, 1, 0, 0, 0, 34, 248, 1, 0, 0, 0, 36, 253, 1, 0, 0, 0, 38, 272, 1, 0, 0, 0, 40, 41, 5, 22, 0, 0, 41, 42, 3, 4, 2, 0, 42, 43, 3, 4, 2, 0, 43, 44, 5, 23, 0, 0, 44, 1, 1, 0, 0, 0, 45, 48, 5, 43, 0, 0, 46, 48, 5, 44, 0, 0, 47, 45, 1, 0, 0, 0, 47, 46, 1, 0, 0, 0, 48, 3, 1, 0, 0, 0, 49, 50, 6, 2, -1, 0, 50, 73, 5, 45, 0, 0, 51, 73, 5, 40, 0, 0, 52, 73, 5, 37, 0, 0, 53, 54, 5, 41, 0, 0, 54, 59, 3, 2, 1, 0, 55, 56, 5, 42, 0, 0, 56, 58, 3, 2, 1, 0, 57, 55, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 73, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 73, 5, 39, 0, 0, 63, 73, 5, 36, 0, 0, 64, 73, 3, 0, 0, 0, 65, 66, 5, 30, 0, 0, 66, 73, 3, 4, 2, 5, 67, 68, 5, 20, 0, 0, 68, 69, 3, 4, 2, 0, 69, 70, 5, 21, 0, 0, 70, 73, 1, 0, 0, 0, 71, 73, 3, 8, 4, 0, 72, 49, 1, 0, 0, 0, 72, 51, 1, 0, 0, 0, 72, 52, 1, 0, 0, 0, 72, 53, 1, 0, 0, 0, 72, 62, 1, 0, 0, 0, 72, 63, 1, 0, 0, 0, 72, 64, 1, 0, 0, 0, 72, 65, 1, 0, 0, 0, 72, 67, 1, 0, 0, 0, 72, 71, 1, 0, 0, 0, 73, 82, 1, 0, 0, 0, 74, 75, 10, 4, 0, 0, 75, 76, 5, 31, 0, 0, 76, 81, 3, 4, 2, 5, 77, 78, 10, 3, 0, 0, 78, 79, 7, 0, 0, 0, 79, 81, 3, 4, 2, 4, 80, 74, 1, 0, 0, 0, 80, 77, 1, 0, 0, 0, 81, 84, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 5, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 85, 90, 3, 4, 2, 0, 86, 87, 5, 26, 0, 0, 87, 89, 3, 4, 2, 0, 88, 86, 1, 0, 0, 0, 89, 92, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 7, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 93, 94, 7, 1, 0, 0, 94, 96, 5, 20, 0, 0, 95, 97, 3, 6, 3, 0, 96, 95, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 99, 5, 21, 0, 0, 99, 9, 1, 0, 0, 0, 100, 101, 5, 27, 0, 0, 101, 102, 3, 4, 2, 0, 102, 11, 1, 0, 0, 0, 103, 104, 5, 38, 0, 0, 104, 106, 5, 45, 0, 0, 105, 107, 3, 10, 5, 0, 106, 105, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 13, 1, 0, 0, 0, 108, 109, 5, 5, 0, 0, 109, 113, 5, 24, 0, 0, 110, 112, 3, 12, 6, 0, 111, 110, 1, 0, 0, 0, 112, 115, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 113, 114, 1, 0, 0, 0, 114, 116, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 116, 117, 5, 25, 0, 0, 117, 15, 1, 0, 0, 0, 118, 120, 3, 14, 7, 0, 119, 118, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 124, 1, 0, 0, 0, 121, 123, 3, 38, 19, 0, 122, 121, 1, 0, 0, 0, 123, 126, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 127, 1, 0, 0, 0, 126, 124, 1, 0, 0, 0, 127, 128, 5, 0, 0, 1, 128, 17, 1, 0, 0, 0, 129, 130, 5, 22, 0, 0, 130, 131, 3, 4, 2, 0, 131, 132, 5, 28, 0, 0, 132, 133, 5, 23, 0, 0, 133, 19, 1, 0, 0, 0, 134, 137, 3, 4, 2, 0, 135, 137, 5, 13, 0, 0, 136, 134, 1, 0, 0, 0, 136, 135, 1, 0, 0, 0, 137, 21, 1, 0, 0, 0, 138, 139, 5, 32, 0, 0, 139, 140, 3, 4, 2, 0, 140, 23, 1, 0, 0, 0, 141, 143, 3, 4, 2, 0, 142, 144, 3, 22, 11, 0, 143, 142, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, 146, 5, 14, 0, 0, 146, 147, 5, 15, 0, 0, 147, 148, 5, 16, 0, 0, 148, 200, 1, 0, 0, 0, 149, 151, 3, 4, 2, 0, 150, 152, 3, 22, 11, 0, 151, 150, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 154, 5, 14, 0, 0, 154, 155, 5, 16, 0, 0, 155, 156, 5, 11, 0, 0, 156, 157, 5, 12, 0, 0, 157, 158, 3, 4, 2, 0, 158, 200, 1, 0, 0, 0, 159, 160, 3, 4, 2, 0, 160, 161, 5, 33, 0, 0, 161, 162, 5, 34, 0, 0, 162, 163, 5, 35, 0, 0, 163, 164, 3, 4, 2, 0, 164, 200, 1, 0, 0, 0, 165, 167, 3, 4, 2, 0, 166, 168, 3, 22, 11, 0, 167, 166, 1, 0, 0, 0, 167, 168, 1, 0, 0, 0, 168, 200, 1, 0, 0, 0, 169, 171, 5, 24, 0, 0, 170, 172, 3, 26, 13, 0, 171, 170, 1, 0, 0, 0, 172, 173, 1, 0, 0, 0, 173, 171, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 176, 5, 25, 0, 0, 176, 200, 1, 0, 0, 0, 177, 181, 5, 24, 0, 0, 178, 180, 3, 24, 12, 0, 179, 178, 1, 0, 0, 0, 180, 183, 1, 0, 0, 0, 181, 179, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 184, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 184, 200, 5, 25, 0, 0, 185, 186, 5, 17, 0, 0, 186, 188, 5, 24, 0, 0, 187, 189, 3, 24, 12, 0, 188, 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 188, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 5, 25, 0, 0, 193, 200, 1, 0, 0, 0, 194, 195, 5, 6, 0, 0, 195, 196, 3, 4, 2, 0, 196, 197, 5, 10, 0, 0, 197, 198, 3, 24, 12, 0, 198, 200, 1, 0, 0, 0, 199, 141, 1, 0, 0, 0, 199, 149, 1, 0, 0, 0, 199, 159, 1, 0, 0, 0, 199, 165, 1, 0, 0, 0, 199, 169, 1, 0, 0, 0, 199, 177, 1, 0, 0, 0, 199, 185, 1, 0, 0, 0, 199, 194, 1, 0, 0, 0, 200, 25, 1, 0, 0, 0, 201, 202, 3, 20, 10, 0, 202, 203, 5, 10, 0, 0, 203, 204, 3, 24, 12, 0, 204, 27, 1, 0, 0, 0, 205, 206, 5, 12, 0, 0, 206, 209, 3, 32, 16, 0, 207, 209, 5, 18, 0, 0, 208, 205, 1, 0, 0, 0, 208, 207, 1, 0, 0, 0, 209, 29, 1, 0, 0, 0, 210, 211, 5, 6, 0, 0, 211, 212, 3, 4, 2, 0, 212, 213, 3, 28, 14, 0, 213, 31, 1, 0, 0, 0, 214, 247, 3, 4, 2, 0, 215, 217, 5, 24, 0, 0, 216, 218, 3, 34, 17, 0, 217, 216, 1, 0, 0, 0, 218, 219, 1, 0, 0, 0, 219, 217, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 222, 5, 25, 0, 0, 222, 247, 1, 0, 0, 0, 223, 227, 5, 24, 0, 0, 224, 226, 3, 30, 15, 0, 225, 224, 1, 0, 0, 0, 226, 229, 1, 0, 0, 0, 227, 225, 1, 0, 0, 0, 227, 228, 1, 0, 0, 0, 228, 230, 1, 0, 0, 0, 229, 227, 1, 0, 0, 0, 230, 231, 5, 13, 0, 0, 231, 232, 3, 28, 14, 0, 232, 233, 5, 25, 0, 0, 233, 247, 1, 0, 0, 0, 234, 235, 5, 17, 0, 0, 235, 239, 5, 24, 0, 0, 236, 238, 3, 30, 15, 0, 237, 236, 1, 0, 0, 0, 238, 241, 1, 0, 0, 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 242, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 242, 243, 5, 13, 0, 0, 243, 244, 3, 28, 14, 0, 244, 245, 5, 25, 0, 0, 245, 247, 1, 0, 0, 0, 246, 214, 1, 0, 0, 0, 246, 215, 1, 0, 0, 0, 246, 223, 1, 0, 0, 0, 246, 234, 1, 0, 0, 0, 247, 33, 1, 0, 0, 0, 248, 249, 3, 20, 10, 0, 249, 250, 3, 28, 14, 0, 250, 35, 1, 0, 0, 0, 251, 254, 3, 4, 2, 0, 252, 254, 3, 18, 9, 0, 253, 251, 1, 0, 0, 0, 253, 252, 1, 0, 0, 0, 254, 37, 1, 0, 0, 0, 255, 256, 5, 9, 0, 0, 256, 257, 3, 36, 18, 0, 257, 258, 5, 20, 0, 0, 258, 259, 5, 7, 0, 0, 259, 260, 5, 27, 0, 0, 260, 261, 3, 24, 12, 0, 261, 262, 5, 8, 0, 0, 262, 263, 5, 27, 0, 0, 263, 264, 3, 32, 16, 0, 264, 265, 5, 21, 0, 0, 265, 273, 1, 0, 0, 0, 266, 267, 5, 19, 0, 0, 267, 268, 3, 36, 18, 0, 268, 269, 5, 10, 0, 0, 269, 270, 3, 4, 2, 0, 270, 273, 1, 0, 0, 0, 271, 273, 3, 8, 4, 0, 272, 255, 1, 0, 0, 0, 272, 266, 1, 0, 0, 0, 272, 271, 1, 0, 0, 0, 273, 39, 1, 0, 0, 0, 26, 47, 59, 72, 80, 82, 90, 96, 106, 113, 119, 124, 136, 143, 151, 167, 173, 181, 190, 199, 208, 219, 227, 239, 246, 253, 272] \ No newline at end of file diff --git a/internal/parser/antlrParser/numscript_parser.go b/internal/parser/antlrParser/numscript_parser.go index d3f16599..cd8776ad 100644 --- a/internal/parser/antlrParser/numscript_parser.go +++ b/internal/parser/antlrParser/numscript_parser.go @@ -56,7 +56,7 @@ func numscriptParserInit() { } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 45, 278, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 45, 275, 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, 1, 0, 1, 0, 1, @@ -71,114 +71,112 @@ func numscriptParserInit() { 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 137, 8, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 144, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 152, 8, 12, 1, 12, 1, 12, 1, 12, - 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 162, 8, 12, 1, 12, 1, 12, 1, - 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 171, 8, 12, 1, 12, 1, 12, 4, 12, - 175, 8, 12, 11, 12, 12, 12, 176, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 183, - 8, 12, 10, 12, 12, 12, 186, 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 4, 12, 192, - 8, 12, 11, 12, 12, 12, 193, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, - 12, 3, 12, 203, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, - 3, 14, 212, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 4, - 16, 221, 8, 16, 11, 16, 12, 16, 222, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, - 229, 8, 16, 10, 16, 12, 16, 232, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, - 16, 1, 16, 1, 16, 5, 16, 241, 8, 16, 10, 16, 12, 16, 244, 9, 16, 1, 16, - 1, 16, 1, 16, 1, 16, 3, 16, 250, 8, 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, - 18, 3, 18, 257, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, - 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, - 19, 276, 8, 19, 1, 19, 0, 1, 4, 20, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, - 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 0, 2, 1, 0, 29, 30, 2, 0, 16, 16, - 38, 38, 301, 0, 40, 1, 0, 0, 0, 2, 47, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, - 85, 1, 0, 0, 0, 8, 93, 1, 0, 0, 0, 10, 100, 1, 0, 0, 0, 12, 103, 1, 0, - 0, 0, 14, 108, 1, 0, 0, 0, 16, 119, 1, 0, 0, 0, 18, 129, 1, 0, 0, 0, 20, - 136, 1, 0, 0, 0, 22, 138, 1, 0, 0, 0, 24, 202, 1, 0, 0, 0, 26, 204, 1, - 0, 0, 0, 28, 211, 1, 0, 0, 0, 30, 213, 1, 0, 0, 0, 32, 249, 1, 0, 0, 0, - 34, 251, 1, 0, 0, 0, 36, 256, 1, 0, 0, 0, 38, 275, 1, 0, 0, 0, 40, 41, - 5, 22, 0, 0, 41, 42, 3, 4, 2, 0, 42, 43, 3, 4, 2, 0, 43, 44, 5, 23, 0, - 0, 44, 1, 1, 0, 0, 0, 45, 48, 5, 43, 0, 0, 46, 48, 5, 44, 0, 0, 47, 45, - 1, 0, 0, 0, 47, 46, 1, 0, 0, 0, 48, 3, 1, 0, 0, 0, 49, 50, 6, 2, -1, 0, - 50, 73, 5, 45, 0, 0, 51, 73, 5, 40, 0, 0, 52, 73, 5, 37, 0, 0, 53, 54, - 5, 41, 0, 0, 54, 59, 3, 2, 1, 0, 55, 56, 5, 42, 0, 0, 56, 58, 3, 2, 1, - 0, 57, 55, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, - 1, 0, 0, 0, 60, 73, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 73, 5, 39, 0, 0, - 63, 73, 5, 36, 0, 0, 64, 73, 3, 0, 0, 0, 65, 66, 5, 30, 0, 0, 66, 73, 3, - 4, 2, 5, 67, 68, 5, 20, 0, 0, 68, 69, 3, 4, 2, 0, 69, 70, 5, 21, 0, 0, - 70, 73, 1, 0, 0, 0, 71, 73, 3, 8, 4, 0, 72, 49, 1, 0, 0, 0, 72, 51, 1, - 0, 0, 0, 72, 52, 1, 0, 0, 0, 72, 53, 1, 0, 0, 0, 72, 62, 1, 0, 0, 0, 72, - 63, 1, 0, 0, 0, 72, 64, 1, 0, 0, 0, 72, 65, 1, 0, 0, 0, 72, 67, 1, 0, 0, - 0, 72, 71, 1, 0, 0, 0, 73, 82, 1, 0, 0, 0, 74, 75, 10, 4, 0, 0, 75, 76, - 5, 31, 0, 0, 76, 81, 3, 4, 2, 5, 77, 78, 10, 3, 0, 0, 78, 79, 7, 0, 0, - 0, 79, 81, 3, 4, 2, 4, 80, 74, 1, 0, 0, 0, 80, 77, 1, 0, 0, 0, 81, 84, - 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 5, 1, 0, 0, 0, - 84, 82, 1, 0, 0, 0, 85, 90, 3, 4, 2, 0, 86, 87, 5, 26, 0, 0, 87, 89, 3, - 4, 2, 0, 88, 86, 1, 0, 0, 0, 89, 92, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 90, - 91, 1, 0, 0, 0, 91, 7, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 93, 94, 7, 1, 0, - 0, 94, 96, 5, 20, 0, 0, 95, 97, 3, 6, 3, 0, 96, 95, 1, 0, 0, 0, 96, 97, - 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 99, 5, 21, 0, 0, 99, 9, 1, 0, 0, 0, - 100, 101, 5, 27, 0, 0, 101, 102, 3, 4, 2, 0, 102, 11, 1, 0, 0, 0, 103, - 104, 5, 38, 0, 0, 104, 106, 5, 45, 0, 0, 105, 107, 3, 10, 5, 0, 106, 105, - 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 13, 1, 0, 0, 0, 108, 109, 5, 5, - 0, 0, 109, 113, 5, 24, 0, 0, 110, 112, 3, 12, 6, 0, 111, 110, 1, 0, 0, - 0, 112, 115, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 113, 114, 1, 0, 0, 0, 114, - 116, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 116, 117, 5, 25, 0, 0, 117, 15, - 1, 0, 0, 0, 118, 120, 3, 14, 7, 0, 119, 118, 1, 0, 0, 0, 119, 120, 1, 0, - 0, 0, 120, 124, 1, 0, 0, 0, 121, 123, 3, 38, 19, 0, 122, 121, 1, 0, 0, - 0, 123, 126, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, - 127, 1, 0, 0, 0, 126, 124, 1, 0, 0, 0, 127, 128, 5, 0, 0, 1, 128, 17, 1, - 0, 0, 0, 129, 130, 5, 22, 0, 0, 130, 131, 3, 4, 2, 0, 131, 132, 5, 28, - 0, 0, 132, 133, 5, 23, 0, 0, 133, 19, 1, 0, 0, 0, 134, 137, 3, 4, 2, 0, - 135, 137, 5, 13, 0, 0, 136, 134, 1, 0, 0, 0, 136, 135, 1, 0, 0, 0, 137, - 21, 1, 0, 0, 0, 138, 139, 5, 32, 0, 0, 139, 140, 3, 4, 2, 0, 140, 23, 1, - 0, 0, 0, 141, 143, 3, 4, 2, 0, 142, 144, 3, 22, 11, 0, 143, 142, 1, 0, - 0, 0, 143, 144, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, 146, 5, 14, 0, 0, - 146, 147, 5, 15, 0, 0, 147, 148, 5, 16, 0, 0, 148, 203, 1, 0, 0, 0, 149, - 151, 3, 4, 2, 0, 150, 152, 3, 22, 11, 0, 151, 150, 1, 0, 0, 0, 151, 152, - 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 154, 5, 14, 0, 0, 154, 155, 5, 16, - 0, 0, 155, 156, 5, 11, 0, 0, 156, 157, 5, 12, 0, 0, 157, 158, 3, 4, 2, - 0, 158, 203, 1, 0, 0, 0, 159, 161, 3, 4, 2, 0, 160, 162, 3, 22, 11, 0, - 161, 160, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, - 164, 5, 33, 0, 0, 164, 165, 5, 34, 0, 0, 165, 166, 5, 35, 0, 0, 166, 167, - 3, 4, 2, 0, 167, 203, 1, 0, 0, 0, 168, 170, 3, 4, 2, 0, 169, 171, 3, 22, - 11, 0, 170, 169, 1, 0, 0, 0, 170, 171, 1, 0, 0, 0, 171, 203, 1, 0, 0, 0, - 172, 174, 5, 24, 0, 0, 173, 175, 3, 26, 13, 0, 174, 173, 1, 0, 0, 0, 175, - 176, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 178, - 1, 0, 0, 0, 178, 179, 5, 25, 0, 0, 179, 203, 1, 0, 0, 0, 180, 184, 5, 24, - 0, 0, 181, 183, 3, 24, 12, 0, 182, 181, 1, 0, 0, 0, 183, 186, 1, 0, 0, - 0, 184, 182, 1, 0, 0, 0, 184, 185, 1, 0, 0, 0, 185, 187, 1, 0, 0, 0, 186, - 184, 1, 0, 0, 0, 187, 203, 5, 25, 0, 0, 188, 189, 5, 17, 0, 0, 189, 191, - 5, 24, 0, 0, 190, 192, 3, 24, 12, 0, 191, 190, 1, 0, 0, 0, 192, 193, 1, - 0, 0, 0, 193, 191, 1, 0, 0, 0, 193, 194, 1, 0, 0, 0, 194, 195, 1, 0, 0, - 0, 195, 196, 5, 25, 0, 0, 196, 203, 1, 0, 0, 0, 197, 198, 5, 6, 0, 0, 198, - 199, 3, 4, 2, 0, 199, 200, 5, 10, 0, 0, 200, 201, 3, 24, 12, 0, 201, 203, - 1, 0, 0, 0, 202, 141, 1, 0, 0, 0, 202, 149, 1, 0, 0, 0, 202, 159, 1, 0, - 0, 0, 202, 168, 1, 0, 0, 0, 202, 172, 1, 0, 0, 0, 202, 180, 1, 0, 0, 0, - 202, 188, 1, 0, 0, 0, 202, 197, 1, 0, 0, 0, 203, 25, 1, 0, 0, 0, 204, 205, - 3, 20, 10, 0, 205, 206, 5, 10, 0, 0, 206, 207, 3, 24, 12, 0, 207, 27, 1, - 0, 0, 0, 208, 209, 5, 12, 0, 0, 209, 212, 3, 32, 16, 0, 210, 212, 5, 18, - 0, 0, 211, 208, 1, 0, 0, 0, 211, 210, 1, 0, 0, 0, 212, 29, 1, 0, 0, 0, - 213, 214, 5, 6, 0, 0, 214, 215, 3, 4, 2, 0, 215, 216, 3, 28, 14, 0, 216, - 31, 1, 0, 0, 0, 217, 250, 3, 4, 2, 0, 218, 220, 5, 24, 0, 0, 219, 221, - 3, 34, 17, 0, 220, 219, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 220, 1, - 0, 0, 0, 222, 223, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, 224, 225, 5, 25, 0, - 0, 225, 250, 1, 0, 0, 0, 226, 230, 5, 24, 0, 0, 227, 229, 3, 30, 15, 0, - 228, 227, 1, 0, 0, 0, 229, 232, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 230, - 231, 1, 0, 0, 0, 231, 233, 1, 0, 0, 0, 232, 230, 1, 0, 0, 0, 233, 234, - 5, 13, 0, 0, 234, 235, 3, 28, 14, 0, 235, 236, 5, 25, 0, 0, 236, 250, 1, - 0, 0, 0, 237, 238, 5, 17, 0, 0, 238, 242, 5, 24, 0, 0, 239, 241, 3, 30, - 15, 0, 240, 239, 1, 0, 0, 0, 241, 244, 1, 0, 0, 0, 242, 240, 1, 0, 0, 0, - 242, 243, 1, 0, 0, 0, 243, 245, 1, 0, 0, 0, 244, 242, 1, 0, 0, 0, 245, - 246, 5, 13, 0, 0, 246, 247, 3, 28, 14, 0, 247, 248, 5, 25, 0, 0, 248, 250, - 1, 0, 0, 0, 249, 217, 1, 0, 0, 0, 249, 218, 1, 0, 0, 0, 249, 226, 1, 0, - 0, 0, 249, 237, 1, 0, 0, 0, 250, 33, 1, 0, 0, 0, 251, 252, 3, 20, 10, 0, - 252, 253, 3, 28, 14, 0, 253, 35, 1, 0, 0, 0, 254, 257, 3, 4, 2, 0, 255, - 257, 3, 18, 9, 0, 256, 254, 1, 0, 0, 0, 256, 255, 1, 0, 0, 0, 257, 37, - 1, 0, 0, 0, 258, 259, 5, 9, 0, 0, 259, 260, 3, 36, 18, 0, 260, 261, 5, - 20, 0, 0, 261, 262, 5, 7, 0, 0, 262, 263, 5, 27, 0, 0, 263, 264, 3, 24, - 12, 0, 264, 265, 5, 8, 0, 0, 265, 266, 5, 27, 0, 0, 266, 267, 3, 32, 16, - 0, 267, 268, 5, 21, 0, 0, 268, 276, 1, 0, 0, 0, 269, 270, 5, 19, 0, 0, - 270, 271, 3, 36, 18, 0, 271, 272, 5, 10, 0, 0, 272, 273, 3, 4, 2, 0, 273, - 276, 1, 0, 0, 0, 274, 276, 3, 8, 4, 0, 275, 258, 1, 0, 0, 0, 275, 269, - 1, 0, 0, 0, 275, 274, 1, 0, 0, 0, 276, 39, 1, 0, 0, 0, 27, 47, 59, 72, - 80, 82, 90, 96, 106, 113, 119, 124, 136, 143, 151, 161, 170, 176, 184, - 193, 202, 211, 222, 230, 242, 249, 256, 275, + 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, + 12, 3, 12, 168, 8, 12, 1, 12, 1, 12, 4, 12, 172, 8, 12, 11, 12, 12, 12, + 173, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 180, 8, 12, 10, 12, 12, 12, 183, + 9, 12, 1, 12, 1, 12, 1, 12, 1, 12, 4, 12, 189, 8, 12, 11, 12, 12, 12, 190, + 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 200, 8, 12, 1, + 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 3, 14, 209, 8, 14, 1, 15, + 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 4, 16, 218, 8, 16, 11, 16, 12, + 16, 219, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 226, 8, 16, 10, 16, 12, 16, + 229, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 238, + 8, 16, 10, 16, 12, 16, 241, 9, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 247, + 8, 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 3, 18, 254, 8, 18, 1, 19, 1, + 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, + 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 273, 8, 19, 1, 19, 0, 1, 4, 20, + 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, + 38, 0, 2, 1, 0, 29, 30, 2, 0, 16, 16, 38, 38, 297, 0, 40, 1, 0, 0, 0, 2, + 47, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 85, 1, 0, 0, 0, 8, 93, 1, 0, 0, 0, + 10, 100, 1, 0, 0, 0, 12, 103, 1, 0, 0, 0, 14, 108, 1, 0, 0, 0, 16, 119, + 1, 0, 0, 0, 18, 129, 1, 0, 0, 0, 20, 136, 1, 0, 0, 0, 22, 138, 1, 0, 0, + 0, 24, 199, 1, 0, 0, 0, 26, 201, 1, 0, 0, 0, 28, 208, 1, 0, 0, 0, 30, 210, + 1, 0, 0, 0, 32, 246, 1, 0, 0, 0, 34, 248, 1, 0, 0, 0, 36, 253, 1, 0, 0, + 0, 38, 272, 1, 0, 0, 0, 40, 41, 5, 22, 0, 0, 41, 42, 3, 4, 2, 0, 42, 43, + 3, 4, 2, 0, 43, 44, 5, 23, 0, 0, 44, 1, 1, 0, 0, 0, 45, 48, 5, 43, 0, 0, + 46, 48, 5, 44, 0, 0, 47, 45, 1, 0, 0, 0, 47, 46, 1, 0, 0, 0, 48, 3, 1, + 0, 0, 0, 49, 50, 6, 2, -1, 0, 50, 73, 5, 45, 0, 0, 51, 73, 5, 40, 0, 0, + 52, 73, 5, 37, 0, 0, 53, 54, 5, 41, 0, 0, 54, 59, 3, 2, 1, 0, 55, 56, 5, + 42, 0, 0, 56, 58, 3, 2, 1, 0, 57, 55, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, + 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 73, 1, 0, 0, 0, 61, 59, 1, 0, 0, + 0, 62, 73, 5, 39, 0, 0, 63, 73, 5, 36, 0, 0, 64, 73, 3, 0, 0, 0, 65, 66, + 5, 30, 0, 0, 66, 73, 3, 4, 2, 5, 67, 68, 5, 20, 0, 0, 68, 69, 3, 4, 2, + 0, 69, 70, 5, 21, 0, 0, 70, 73, 1, 0, 0, 0, 71, 73, 3, 8, 4, 0, 72, 49, + 1, 0, 0, 0, 72, 51, 1, 0, 0, 0, 72, 52, 1, 0, 0, 0, 72, 53, 1, 0, 0, 0, + 72, 62, 1, 0, 0, 0, 72, 63, 1, 0, 0, 0, 72, 64, 1, 0, 0, 0, 72, 65, 1, + 0, 0, 0, 72, 67, 1, 0, 0, 0, 72, 71, 1, 0, 0, 0, 73, 82, 1, 0, 0, 0, 74, + 75, 10, 4, 0, 0, 75, 76, 5, 31, 0, 0, 76, 81, 3, 4, 2, 5, 77, 78, 10, 3, + 0, 0, 78, 79, 7, 0, 0, 0, 79, 81, 3, 4, 2, 4, 80, 74, 1, 0, 0, 0, 80, 77, + 1, 0, 0, 0, 81, 84, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, + 83, 5, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 85, 90, 3, 4, 2, 0, 86, 87, 5, 26, + 0, 0, 87, 89, 3, 4, 2, 0, 88, 86, 1, 0, 0, 0, 89, 92, 1, 0, 0, 0, 90, 88, + 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 7, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, + 93, 94, 7, 1, 0, 0, 94, 96, 5, 20, 0, 0, 95, 97, 3, 6, 3, 0, 96, 95, 1, + 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 99, 5, 21, 0, 0, 99, + 9, 1, 0, 0, 0, 100, 101, 5, 27, 0, 0, 101, 102, 3, 4, 2, 0, 102, 11, 1, + 0, 0, 0, 103, 104, 5, 38, 0, 0, 104, 106, 5, 45, 0, 0, 105, 107, 3, 10, + 5, 0, 106, 105, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 13, 1, 0, 0, 0, + 108, 109, 5, 5, 0, 0, 109, 113, 5, 24, 0, 0, 110, 112, 3, 12, 6, 0, 111, + 110, 1, 0, 0, 0, 112, 115, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 113, 114, + 1, 0, 0, 0, 114, 116, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 116, 117, 5, 25, + 0, 0, 117, 15, 1, 0, 0, 0, 118, 120, 3, 14, 7, 0, 119, 118, 1, 0, 0, 0, + 119, 120, 1, 0, 0, 0, 120, 124, 1, 0, 0, 0, 121, 123, 3, 38, 19, 0, 122, + 121, 1, 0, 0, 0, 123, 126, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 124, 125, + 1, 0, 0, 0, 125, 127, 1, 0, 0, 0, 126, 124, 1, 0, 0, 0, 127, 128, 5, 0, + 0, 1, 128, 17, 1, 0, 0, 0, 129, 130, 5, 22, 0, 0, 130, 131, 3, 4, 2, 0, + 131, 132, 5, 28, 0, 0, 132, 133, 5, 23, 0, 0, 133, 19, 1, 0, 0, 0, 134, + 137, 3, 4, 2, 0, 135, 137, 5, 13, 0, 0, 136, 134, 1, 0, 0, 0, 136, 135, + 1, 0, 0, 0, 137, 21, 1, 0, 0, 0, 138, 139, 5, 32, 0, 0, 139, 140, 3, 4, + 2, 0, 140, 23, 1, 0, 0, 0, 141, 143, 3, 4, 2, 0, 142, 144, 3, 22, 11, 0, + 143, 142, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, + 146, 5, 14, 0, 0, 146, 147, 5, 15, 0, 0, 147, 148, 5, 16, 0, 0, 148, 200, + 1, 0, 0, 0, 149, 151, 3, 4, 2, 0, 150, 152, 3, 22, 11, 0, 151, 150, 1, + 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 154, 5, 14, 0, + 0, 154, 155, 5, 16, 0, 0, 155, 156, 5, 11, 0, 0, 156, 157, 5, 12, 0, 0, + 157, 158, 3, 4, 2, 0, 158, 200, 1, 0, 0, 0, 159, 160, 3, 4, 2, 0, 160, + 161, 5, 33, 0, 0, 161, 162, 5, 34, 0, 0, 162, 163, 5, 35, 0, 0, 163, 164, + 3, 4, 2, 0, 164, 200, 1, 0, 0, 0, 165, 167, 3, 4, 2, 0, 166, 168, 3, 22, + 11, 0, 167, 166, 1, 0, 0, 0, 167, 168, 1, 0, 0, 0, 168, 200, 1, 0, 0, 0, + 169, 171, 5, 24, 0, 0, 170, 172, 3, 26, 13, 0, 171, 170, 1, 0, 0, 0, 172, + 173, 1, 0, 0, 0, 173, 171, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 175, + 1, 0, 0, 0, 175, 176, 5, 25, 0, 0, 176, 200, 1, 0, 0, 0, 177, 181, 5, 24, + 0, 0, 178, 180, 3, 24, 12, 0, 179, 178, 1, 0, 0, 0, 180, 183, 1, 0, 0, + 0, 181, 179, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 184, 1, 0, 0, 0, 183, + 181, 1, 0, 0, 0, 184, 200, 5, 25, 0, 0, 185, 186, 5, 17, 0, 0, 186, 188, + 5, 24, 0, 0, 187, 189, 3, 24, 12, 0, 188, 187, 1, 0, 0, 0, 189, 190, 1, + 0, 0, 0, 190, 188, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 192, 1, 0, 0, + 0, 192, 193, 5, 25, 0, 0, 193, 200, 1, 0, 0, 0, 194, 195, 5, 6, 0, 0, 195, + 196, 3, 4, 2, 0, 196, 197, 5, 10, 0, 0, 197, 198, 3, 24, 12, 0, 198, 200, + 1, 0, 0, 0, 199, 141, 1, 0, 0, 0, 199, 149, 1, 0, 0, 0, 199, 159, 1, 0, + 0, 0, 199, 165, 1, 0, 0, 0, 199, 169, 1, 0, 0, 0, 199, 177, 1, 0, 0, 0, + 199, 185, 1, 0, 0, 0, 199, 194, 1, 0, 0, 0, 200, 25, 1, 0, 0, 0, 201, 202, + 3, 20, 10, 0, 202, 203, 5, 10, 0, 0, 203, 204, 3, 24, 12, 0, 204, 27, 1, + 0, 0, 0, 205, 206, 5, 12, 0, 0, 206, 209, 3, 32, 16, 0, 207, 209, 5, 18, + 0, 0, 208, 205, 1, 0, 0, 0, 208, 207, 1, 0, 0, 0, 209, 29, 1, 0, 0, 0, + 210, 211, 5, 6, 0, 0, 211, 212, 3, 4, 2, 0, 212, 213, 3, 28, 14, 0, 213, + 31, 1, 0, 0, 0, 214, 247, 3, 4, 2, 0, 215, 217, 5, 24, 0, 0, 216, 218, + 3, 34, 17, 0, 217, 216, 1, 0, 0, 0, 218, 219, 1, 0, 0, 0, 219, 217, 1, + 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 222, 5, 25, 0, + 0, 222, 247, 1, 0, 0, 0, 223, 227, 5, 24, 0, 0, 224, 226, 3, 30, 15, 0, + 225, 224, 1, 0, 0, 0, 226, 229, 1, 0, 0, 0, 227, 225, 1, 0, 0, 0, 227, + 228, 1, 0, 0, 0, 228, 230, 1, 0, 0, 0, 229, 227, 1, 0, 0, 0, 230, 231, + 5, 13, 0, 0, 231, 232, 3, 28, 14, 0, 232, 233, 5, 25, 0, 0, 233, 247, 1, + 0, 0, 0, 234, 235, 5, 17, 0, 0, 235, 239, 5, 24, 0, 0, 236, 238, 3, 30, + 15, 0, 237, 236, 1, 0, 0, 0, 238, 241, 1, 0, 0, 0, 239, 237, 1, 0, 0, 0, + 239, 240, 1, 0, 0, 0, 240, 242, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 242, + 243, 5, 13, 0, 0, 243, 244, 3, 28, 14, 0, 244, 245, 5, 25, 0, 0, 245, 247, + 1, 0, 0, 0, 246, 214, 1, 0, 0, 0, 246, 215, 1, 0, 0, 0, 246, 223, 1, 0, + 0, 0, 246, 234, 1, 0, 0, 0, 247, 33, 1, 0, 0, 0, 248, 249, 3, 20, 10, 0, + 249, 250, 3, 28, 14, 0, 250, 35, 1, 0, 0, 0, 251, 254, 3, 4, 2, 0, 252, + 254, 3, 18, 9, 0, 253, 251, 1, 0, 0, 0, 253, 252, 1, 0, 0, 0, 254, 37, + 1, 0, 0, 0, 255, 256, 5, 9, 0, 0, 256, 257, 3, 36, 18, 0, 257, 258, 5, + 20, 0, 0, 258, 259, 5, 7, 0, 0, 259, 260, 5, 27, 0, 0, 260, 261, 3, 24, + 12, 0, 261, 262, 5, 8, 0, 0, 262, 263, 5, 27, 0, 0, 263, 264, 3, 32, 16, + 0, 264, 265, 5, 21, 0, 0, 265, 273, 1, 0, 0, 0, 266, 267, 5, 19, 0, 0, + 267, 268, 3, 36, 18, 0, 268, 269, 5, 10, 0, 0, 269, 270, 3, 4, 2, 0, 270, + 273, 1, 0, 0, 0, 271, 273, 3, 8, 4, 0, 272, 255, 1, 0, 0, 0, 272, 266, + 1, 0, 0, 0, 272, 271, 1, 0, 0, 0, 273, 39, 1, 0, 0, 0, 26, 47, 59, 72, + 80, 82, 90, 96, 106, 113, 119, 124, 136, 143, 151, 167, 173, 181, 190, + 199, 208, 219, 227, 239, 246, 253, 272, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -3473,22 +3471,6 @@ func (s *SrcAccountWithScalingContext) ValueExpr(i int) IValueExprContext { return t.(IValueExprContext) } -func (s *SrcAccountWithScalingContext) ColorConstraint() IColorConstraintContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IColorConstraintContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IColorConstraintContext) -} - func (s *SrcAccountWithScalingContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(NumscriptListener); ok { listenerT.EnterSrcAccountWithScaling(s) @@ -3801,13 +3783,13 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { p.EnterRule(localctx, 24, NumscriptParserRULE_source) var _la int - p.SetState(202) + p.SetState(199) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) { case 1: localctx = NewSrcAccountUnboundedOverdraftContext(p, localctx) p.EnterOuterAlt(localctx, 1) @@ -3931,22 +3913,8 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx.(*SrcAccountWithScalingContext).address = _x } - p.SetState(161) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == NumscriptParserRESTRICT { - { - p.SetState(160) - p.ColorConstraint() - } - - } { - p.SetState(163) + p.SetState(160) p.Match(NumscriptParserWITH) if p.HasError() { // Recognition error - abort rule @@ -3954,7 +3922,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(164) + p.SetState(161) p.Match(NumscriptParserSCALING) if p.HasError() { // Recognition error - abort rule @@ -3962,7 +3930,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(165) + p.SetState(162) p.Match(NumscriptParserTHROUGH) if p.HasError() { // Recognition error - abort rule @@ -3970,7 +3938,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(166) + p.SetState(163) var _x = p.valueExpr(0) @@ -3981,10 +3949,10 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcAccountContext(p, localctx) p.EnterOuterAlt(localctx, 4) { - p.SetState(168) + p.SetState(165) p.valueExpr(0) } - p.SetState(170) + p.SetState(167) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3993,7 +3961,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { if _la == NumscriptParserRESTRICT { { - p.SetState(169) + p.SetState(166) p.ColorConstraint() } @@ -4003,14 +3971,14 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcAllotmentContext(p, localctx) p.EnterOuterAlt(localctx, 5) { - p.SetState(172) + p.SetState(169) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(174) + p.SetState(171) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4019,11 +3987,11 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&39514778181632) != 0) { { - p.SetState(173) + p.SetState(170) p.AllotmentClauseSrc() } - p.SetState(176) + p.SetState(173) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4031,7 +3999,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(178) + p.SetState(175) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4043,14 +4011,14 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcInorderContext(p, localctx) p.EnterOuterAlt(localctx, 6) { - p.SetState(180) + p.SetState(177) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(184) + p.SetState(181) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4059,11 +4027,11 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&39514795081792) != 0 { { - p.SetState(181) + p.SetState(178) p.Source() } - p.SetState(186) + p.SetState(183) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4071,7 +4039,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(187) + p.SetState(184) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4083,7 +4051,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcOneofContext(p, localctx) p.EnterOuterAlt(localctx, 7) { - p.SetState(188) + p.SetState(185) p.Match(NumscriptParserONEOF) if p.HasError() { // Recognition error - abort rule @@ -4091,14 +4059,14 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(189) + p.SetState(186) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(191) + p.SetState(188) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4107,11 +4075,11 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&39514795081792) != 0) { { - p.SetState(190) + p.SetState(187) p.Source() } - p.SetState(193) + p.SetState(190) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4119,7 +4087,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(195) + p.SetState(192) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4131,7 +4099,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { localctx = NewSrcCappedContext(p, localctx) p.EnterOuterAlt(localctx, 8) { - p.SetState(197) + p.SetState(194) p.Match(NumscriptParserMAX) if p.HasError() { // Recognition error - abort rule @@ -4139,14 +4107,14 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(198) + p.SetState(195) var _x = p.valueExpr(0) localctx.(*SrcCappedContext).cap_ = _x } { - p.SetState(199) + p.SetState(196) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -4154,7 +4122,7 @@ func (p *NumscriptParser) Source() (localctx ISourceContext) { } } { - p.SetState(200) + p.SetState(197) p.Source() } @@ -4284,11 +4252,11 @@ func (p *NumscriptParser) AllotmentClauseSrc() (localctx IAllotmentClauseSrcCont p.EnterRule(localctx, 26, NumscriptParserRULE_allotmentClauseSrc) p.EnterOuterAlt(localctx, 1) { - p.SetState(204) + p.SetState(201) p.Allotment() } { - p.SetState(205) + p.SetState(202) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -4296,7 +4264,7 @@ func (p *NumscriptParser) AllotmentClauseSrc() (localctx IAllotmentClauseSrcCont } } { - p.SetState(206) + p.SetState(203) p.Source() } @@ -4454,7 +4422,7 @@ func (s *DestinationToContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContext) { localctx = NewKeptOrDestinationContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 28, NumscriptParserRULE_keptOrDestination) - p.SetState(211) + p.SetState(208) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4465,7 +4433,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex localctx = NewDestinationToContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(208) + p.SetState(205) p.Match(NumscriptParserTO) if p.HasError() { // Recognition error - abort rule @@ -4473,7 +4441,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex } } { - p.SetState(209) + p.SetState(206) p.Destination() } @@ -4481,7 +4449,7 @@ func (p *NumscriptParser) KeptOrDestination() (localctx IKeptOrDestinationContex localctx = NewDestinationKeptContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(210) + p.SetState(207) p.Match(NumscriptParserKEPT) if p.HasError() { // Recognition error - abort rule @@ -4616,7 +4584,7 @@ func (p *NumscriptParser) DestinationInOrderClause() (localctx IDestinationInOrd p.EnterRule(localctx, 30, NumscriptParserRULE_destinationInOrderClause) p.EnterOuterAlt(localctx, 1) { - p.SetState(213) + p.SetState(210) p.Match(NumscriptParserMAX) if p.HasError() { // Recognition error - abort rule @@ -4624,11 +4592,11 @@ func (p *NumscriptParser) DestinationInOrderClause() (localctx IDestinationInOrd } } { - p.SetState(214) + p.SetState(211) p.valueExpr(0) } { - p.SetState(215) + p.SetState(212) p.KeptOrDestination() } @@ -5031,18 +4999,18 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { p.EnterRule(localctx, 32, NumscriptParserRULE_destination) var _la int - p.SetState(249) + p.SetState(246) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 24, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 23, p.GetParserRuleContext()) { case 1: localctx = NewDestAccountContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(217) + p.SetState(214) p.valueExpr(0) } @@ -5050,14 +5018,14 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { localctx = NewDestAllotmentContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(218) + p.SetState(215) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(220) + p.SetState(217) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5066,11 +5034,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { for ok := true; ok; ok = ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&39514778181632) != 0) { { - p.SetState(219) + p.SetState(216) p.AllotmentClauseDest() } - p.SetState(222) + p.SetState(219) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5078,7 +5046,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(224) + p.SetState(221) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -5090,14 +5058,14 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { localctx = NewDestInorderContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(226) + p.SetState(223) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(230) + p.SetState(227) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5106,11 +5074,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { for _la == NumscriptParserMAX { { - p.SetState(227) + p.SetState(224) p.DestinationInOrderClause() } - p.SetState(232) + p.SetState(229) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5118,7 +5086,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(233) + p.SetState(230) p.Match(NumscriptParserREMAINING) if p.HasError() { // Recognition error - abort rule @@ -5126,11 +5094,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { } } { - p.SetState(234) + p.SetState(231) p.KeptOrDestination() } { - p.SetState(235) + p.SetState(232) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -5142,7 +5110,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { localctx = NewDestOneofContext(p, localctx) p.EnterOuterAlt(localctx, 4) { - p.SetState(237) + p.SetState(234) p.Match(NumscriptParserONEOF) if p.HasError() { // Recognition error - abort rule @@ -5150,14 +5118,14 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { } } { - p.SetState(238) + p.SetState(235) p.Match(NumscriptParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(242) + p.SetState(239) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5166,11 +5134,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { for _la == NumscriptParserMAX { { - p.SetState(239) + p.SetState(236) p.DestinationInOrderClause() } - p.SetState(244) + p.SetState(241) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5178,7 +5146,7 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(245) + p.SetState(242) p.Match(NumscriptParserREMAINING) if p.HasError() { // Recognition error - abort rule @@ -5186,11 +5154,11 @@ func (p *NumscriptParser) Destination() (localctx IDestinationContext) { } } { - p.SetState(246) + p.SetState(243) p.KeptOrDestination() } { - p.SetState(247) + p.SetState(244) p.Match(NumscriptParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -5319,11 +5287,11 @@ func (p *NumscriptParser) AllotmentClauseDest() (localctx IAllotmentClauseDestCo p.EnterRule(localctx, 34, NumscriptParserRULE_allotmentClauseDest) p.EnterOuterAlt(localctx, 1) { - p.SetState(251) + p.SetState(248) p.Allotment() } { - p.SetState(252) + p.SetState(249) p.KeptOrDestination() } @@ -5489,18 +5457,18 @@ func (s *SentLiteralContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentValueContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 36, NumscriptParserRULE_sentValue) - p.SetState(256) + p.SetState(253) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 25, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 24, p.GetParserRuleContext()) { case 1: localctx = NewSentLiteralContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(254) + p.SetState(251) p.valueExpr(0) } @@ -5508,7 +5476,7 @@ func (p *NumscriptParser) SentValue() (localctx ISentValueContext) { localctx = NewSentAllContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(255) + p.SetState(252) p.SentAllLit() } @@ -5808,7 +5776,7 @@ func (s *FnCallStatementContext) ExitRule(listener antlr.ParseTreeListener) { func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewStatementContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 38, NumscriptParserRULE_statement) - p.SetState(275) + p.SetState(272) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5819,7 +5787,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewSendStatementContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(258) + p.SetState(255) p.Match(NumscriptParserSEND) if p.HasError() { // Recognition error - abort rule @@ -5827,11 +5795,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(259) + p.SetState(256) p.SentValue() } { - p.SetState(260) + p.SetState(257) p.Match(NumscriptParserLPARENS) if p.HasError() { // Recognition error - abort rule @@ -5839,7 +5807,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(261) + p.SetState(258) p.Match(NumscriptParserSOURCE) if p.HasError() { // Recognition error - abort rule @@ -5847,7 +5815,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(262) + p.SetState(259) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -5855,11 +5823,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(263) + p.SetState(260) p.Source() } { - p.SetState(264) + p.SetState(261) p.Match(NumscriptParserDESTINATION) if p.HasError() { // Recognition error - abort rule @@ -5867,7 +5835,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(265) + p.SetState(262) p.Match(NumscriptParserEQ) if p.HasError() { // Recognition error - abort rule @@ -5875,11 +5843,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(266) + p.SetState(263) p.Destination() } { - p.SetState(267) + p.SetState(264) p.Match(NumscriptParserRPARENS) if p.HasError() { // Recognition error - abort rule @@ -5891,7 +5859,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewSaveStatementContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(269) + p.SetState(266) p.Match(NumscriptParserSAVE) if p.HasError() { // Recognition error - abort rule @@ -5899,11 +5867,11 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(270) + p.SetState(267) p.SentValue() } { - p.SetState(271) + p.SetState(268) p.Match(NumscriptParserFROM) if p.HasError() { // Recognition error - abort rule @@ -5911,7 +5879,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { } } { - p.SetState(272) + p.SetState(269) p.valueExpr(0) } @@ -5919,7 +5887,7 @@ func (p *NumscriptParser) Statement() (localctx IStatementContext) { localctx = NewFnCallStatementContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(274) + p.SetState(271) p.FunctionCall() } diff --git a/internal/parser/parser.go b/internal/parser/parser.go index f6ee2a0a..f399a81c 100644 --- a/internal/parser/parser.go +++ b/internal/parser/parser.go @@ -240,7 +240,6 @@ func parseSource(sourceCtx antlrParser.ISourceContext) Source { case *antlrParser.SrcAccountWithScalingContext: return &SourceWithScaling{ Range: ctxToRange(sourceCtx), - Color: parseColorConstraint(sourceCtx.ColorConstraint()), Address: parseValueExpr(sourceCtx.GetAddress()), Through: parseValueExpr(sourceCtx.GetSwap()), } From f1e631ee34b7d786caa13032522f4de559233b2b Mon Sep 17 00:00:00 2001 From: ascandone Date: Mon, 12 Jan 2026 15:46:06 +0100 Subject: [PATCH 12/17] added test --- internal/analysis/hover_test.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/internal/analysis/hover_test.go b/internal/analysis/hover_test.go index a785ba54..fd5ce493 100644 --- a/internal/analysis/hover_test.go +++ b/internal/analysis/hover_test.go @@ -523,3 +523,32 @@ send [ASSET *] ( resolved := checkResult.ResolveVar(variableHover.Node) require.NotNil(t, resolved) } + +func TestHover(t *testing.T) { + + input := `vars { + account $x +} + +send [EUR/2 *] ( + source = { + @acc1 + @acc2 with scaling through $x + } + destination = @dest +) + +` + + rng := parser.RangeOfIndexed(input, "$x", 1) + program := parser.Parse(input).Value + hover := analysis.HoverOn(program, rng.Start) + + varHover, ok := hover.(*analysis.VariableHover) + if !ok { + t.Fatalf("Expected a VariableHover") + } + + require.Equal(t, varHover.Node.Name, "x") + +} From 21057658b3b438259114af51c5ec41386e482034 Mon Sep 17 00:00:00 2001 From: ascandone Date: Mon, 12 Jan 2026 15:58:36 +0100 Subject: [PATCH 13/17] interaction with oneof --- .../scaling/scaling-with-oneof.num | 7 +++ .../scaling/scaling-with-oneof.num.specs.json | 54 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 internal/interpreter/testdata/script-tests/experimental/scaling/scaling-with-oneof.num create mode 100644 internal/interpreter/testdata/script-tests/experimental/scaling/scaling-with-oneof.num.specs.json diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-with-oneof.num b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-with-oneof.num new file mode 100644 index 00000000..b0372689 --- /dev/null +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-with-oneof.num @@ -0,0 +1,7 @@ +send [EUR/2 100] ( + source = oneof { + @acc1 with scaling through @swap + @acc2 + } + destination = @dest +) diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-with-oneof.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-with-oneof.num.specs.json new file mode 100644 index 00000000..59c1aecc --- /dev/null +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-with-oneof.num.specs.json @@ -0,0 +1,54 @@ +{ + "$schema": "https://raw.githubusercontent.com/formancehq/numscript/main/specs.schema.json", + "featureFlags": [ + "experimental-oneof", + "experimental-asset-scaling" + ], + "balances": { + "acc1": {}, + "acc2": { + "EUR/2": 100 + } + }, + "testCases": [ + { + "it": "fallbacks to the second branch when there's not enough", + "expect.postings": [ + { + "source": "acc2", + "destination": "dest", + "amount": 100, + "asset": "EUR/2" + } + ] + }, + { + "it": "succeeds in the first branch", + "balances": { + "acc1": { + "EUR/2": 100 + } + }, + "expect.postings": [ + { + "source": "acc1", + "destination": "acc1:swap", + "amount": 100, + "asset": "EUR/2" + }, + { + "source": "acc1:swap", + "destination": "acc1", + "amount": 100, + "asset": "EUR/2" + }, + { + "source": "acc1", + "destination": "dest", + "amount": 100, + "asset": "EUR/2" + } + ] + } + ] +} \ No newline at end of file From bf5d543f77d3d65ec4570d6cf969e6c2570c23dc Mon Sep 17 00:00:00 2001 From: ascandone Date: Mon, 12 Jan 2026 15:59:57 +0100 Subject: [PATCH 14/17] made test more complex --- .../experimental/scaling/scaling-with-oneof.num | 5 ++++- .../scaling/scaling-with-oneof.num.specs.json | 13 ++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-with-oneof.num b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-with-oneof.num index b0372689..6840bdb7 100644 --- a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-with-oneof.num +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-with-oneof.num @@ -1,7 +1,10 @@ send [EUR/2 100] ( source = oneof { @acc1 with scaling through @swap - @acc2 + { + @acc1 + @acc2 + } } destination = @dest ) diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-with-oneof.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-with-oneof.num.specs.json index 59c1aecc..68baa9dc 100644 --- a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-with-oneof.num.specs.json +++ b/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-with-oneof.num.specs.json @@ -13,11 +13,22 @@ "testCases": [ { "it": "fallbacks to the second branch when there's not enough", + "balances": { + "acc1": { + "EUR/2": 1 + } + }, "expect.postings": [ + { + "source": "acc1", + "destination": "dest", + "amount": 1, + "asset": "EUR/2" + }, { "source": "acc2", "destination": "dest", - "amount": 100, + "amount": 99, "asset": "EUR/2" } ] From 6fe39e806f34e14e2aeb9dc1055ec5927332587f Mon Sep 17 00:00:00 2001 From: ascandone Date: Mon, 12 Jan 2026 16:00:12 +0100 Subject: [PATCH 15/17] renamed folder --- .../{scaling => asset-scaling}/scaling-all-allotment.num | 0 .../scaling-all-allotment.num.specs.json | 0 .../experimental/{scaling => asset-scaling}/scaling-allotment.num | 0 .../{scaling => asset-scaling}/scaling-allotment.num.specs.json | 0 .../experimental/{scaling => asset-scaling}/scaling-kept.num | 0 .../{scaling => asset-scaling}/scaling-kept.num.specs.json | 0 .../experimental/{scaling => asset-scaling}/scaling-send-all.num | 0 .../{scaling => asset-scaling}/scaling-send-all.num.specs.json | 0 .../{scaling => asset-scaling}/scaling-with-oneof.num | 0 .../{scaling => asset-scaling}/scaling-with-oneof.num.specs.json | 0 .../experimental/{scaling => asset-scaling}/scaling.num | 0 .../{scaling => asset-scaling}/scaling.num.specs.json | 0 12 files changed, 0 insertions(+), 0 deletions(-) rename internal/interpreter/testdata/script-tests/experimental/{scaling => asset-scaling}/scaling-all-allotment.num (100%) rename internal/interpreter/testdata/script-tests/experimental/{scaling => asset-scaling}/scaling-all-allotment.num.specs.json (100%) rename internal/interpreter/testdata/script-tests/experimental/{scaling => asset-scaling}/scaling-allotment.num (100%) rename internal/interpreter/testdata/script-tests/experimental/{scaling => asset-scaling}/scaling-allotment.num.specs.json (100%) rename internal/interpreter/testdata/script-tests/experimental/{scaling => asset-scaling}/scaling-kept.num (100%) rename internal/interpreter/testdata/script-tests/experimental/{scaling => asset-scaling}/scaling-kept.num.specs.json (100%) rename internal/interpreter/testdata/script-tests/experimental/{scaling => asset-scaling}/scaling-send-all.num (100%) rename internal/interpreter/testdata/script-tests/experimental/{scaling => asset-scaling}/scaling-send-all.num.specs.json (100%) rename internal/interpreter/testdata/script-tests/experimental/{scaling => asset-scaling}/scaling-with-oneof.num (100%) rename internal/interpreter/testdata/script-tests/experimental/{scaling => asset-scaling}/scaling-with-oneof.num.specs.json (100%) rename internal/interpreter/testdata/script-tests/experimental/{scaling => asset-scaling}/scaling.num (100%) rename internal/interpreter/testdata/script-tests/experimental/{scaling => asset-scaling}/scaling.num.specs.json (100%) diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-all-allotment.num similarity index 100% rename from internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num rename to internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-all-allotment.num diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-all-allotment.num.specs.json similarity index 100% rename from internal/interpreter/testdata/script-tests/experimental/scaling/scaling-all-allotment.num.specs.json rename to internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-all-allotment.num.specs.json diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-allotment.num similarity index 100% rename from internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num rename to internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-allotment.num diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-allotment.num.specs.json similarity index 100% rename from internal/interpreter/testdata/script-tests/experimental/scaling/scaling-allotment.num.specs.json rename to internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-allotment.num.specs.json diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-kept.num similarity index 100% rename from internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num rename to internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-kept.num diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-kept.num.specs.json similarity index 100% rename from internal/interpreter/testdata/script-tests/experimental/scaling/scaling-kept.num.specs.json rename to internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-kept.num.specs.json diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-send-all.num similarity index 100% rename from internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num rename to internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-send-all.num diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-send-all.num.specs.json similarity index 100% rename from internal/interpreter/testdata/script-tests/experimental/scaling/scaling-send-all.num.specs.json rename to internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-send-all.num.specs.json diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-with-oneof.num b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-with-oneof.num similarity index 100% rename from internal/interpreter/testdata/script-tests/experimental/scaling/scaling-with-oneof.num rename to internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-with-oneof.num diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling-with-oneof.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-with-oneof.num.specs.json similarity index 100% rename from internal/interpreter/testdata/script-tests/experimental/scaling/scaling-with-oneof.num.specs.json rename to internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-with-oneof.num.specs.json diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling.num similarity index 100% rename from internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num rename to internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling.num diff --git a/internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling.num.specs.json similarity index 100% rename from internal/interpreter/testdata/script-tests/experimental/scaling/scaling.num.specs.json rename to internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling.num.specs.json From 85d6db41cc6cee7d8a49c9c5baf9b9a2db274064 Mon Sep 17 00:00:00 2001 From: ascandone Date: Mon, 12 Jan 2026 16:54:27 +0100 Subject: [PATCH 16/17] fix: add rng --- internal/interpreter/interpreter.go | 4 ++-- internal/interpreter/interpreter_test.go | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/interpreter/interpreter.go b/internal/interpreter/interpreter.go index de9e680a..0d416699 100644 --- a/internal/interpreter/interpreter.go +++ b/internal/interpreter/interpreter.go @@ -590,7 +590,7 @@ func (s *programState) sendAll(source parser.Source) (*big.Int, InterpreterError baseAsset, assetScale := getAssetScale(s.CurrentAsset) acc, ok := s.CachedBalances[*account] if !ok { - return nil, InvalidUnboundedAddressInScalingAddress{} + return nil, InvalidUnboundedAddressInScalingAddress{Range: source.Range} } sol, totSent := findSolution( @@ -756,7 +756,7 @@ func (s *programState) trySendingUpTo(source parser.Source, amount *big.Int) (*b baseAsset, assetScale := getAssetScale(s.CurrentAsset) acc, ok := s.CachedBalances[*account] if !ok { - return nil, InvalidUnboundedAddressInScalingAddress{} + return nil, InvalidUnboundedAddressInScalingAddress{Range: source.Range} } sol, total := findSolution( diff --git a/internal/interpreter/interpreter_test.go b/internal/interpreter/interpreter_test.go index d64b7007..651d17b7 100644 --- a/internal/interpreter/interpreter_test.go +++ b/internal/interpreter/interpreter_test.go @@ -61,6 +61,9 @@ func removeRange(e machine.InterpreterError) machine.InterpreterError { case machine.MissingFundsErr: e.Range = parser.Range{} return e + case machine.InvalidUnboundedAddressInScalingAddress: + e.Range = parser.Range{} + return e case machine.TypeError: e.Range = parser.Range{} return e From c250b5b71e0d370da9813a482ab03c7f9a250696 Mon Sep 17 00:00:00 2001 From: ascandone Date: Mon, 12 Jan 2026 16:59:50 +0100 Subject: [PATCH 17/17] fix scaling account name --- internal/interpreter/interpreter.go | 9 ++++----- .../scaling-all-allotment.num.specs.json | 4 ++-- .../asset-scaling/scaling-allotment.num.specs.json | 8 ++++---- .../asset-scaling/scaling-kept.num.specs.json | 6 +++--- .../asset-scaling/scaling-send-all.num.specs.json | 12 ++++++------ .../scaling-with-oneof.num.specs.json | 4 ++-- .../asset-scaling/scaling.num.specs.json | 14 +++++++------- 7 files changed, 28 insertions(+), 29 deletions(-) diff --git a/internal/interpreter/interpreter.go b/internal/interpreter/interpreter.go index 0d416699..aaac15ba 100644 --- a/internal/interpreter/interpreter.go +++ b/internal/interpreter/interpreter.go @@ -2,7 +2,6 @@ package interpreter import ( "context" - "fmt" "math/big" "regexp" "strings" @@ -608,7 +607,7 @@ func (s *programState) sendAll(source parser.Source) (*big.Int, InterpreterError asset := buildScaledAsset(baseAsset, scale) s.Postings = append(s.Postings, Posting{ Source: *account, - Destination: fmt.Sprintf("%s:%s", *account, *scalingAccount), + Destination: *scalingAccount, Amount: new(big.Int).Set(convAmt), Asset: asset, }) @@ -616,7 +615,7 @@ func (s *programState) sendAll(source parser.Source) (*big.Int, InterpreterError } s.Postings = append(s.Postings, Posting{ - Source: fmt.Sprintf("%s:%s", *account, *scalingAccount), + Source: *scalingAccount, Destination: *account, Amount: new(big.Int).Set(totSent), Asset: s.CurrentAsset, @@ -779,7 +778,7 @@ func (s *programState) trySendingUpTo(source parser.Source, amount *big.Int) (*b asset := buildScaledAsset(baseAsset, scale) s.Postings = append(s.Postings, Posting{ Source: *account, - Destination: fmt.Sprintf("%s:%s", *account, *scalingAccount), + Destination: *scalingAccount, Amount: new(big.Int).Set(sending), Asset: asset, }) @@ -787,7 +786,7 @@ func (s *programState) trySendingUpTo(source parser.Source, amount *big.Int) (*b } s.Postings = append(s.Postings, Posting{ - Source: fmt.Sprintf("%s:%s", *account, *scalingAccount), + Source: *scalingAccount, Destination: *account, Amount: new(big.Int).Set(amount), Asset: s.CurrentAsset, diff --git a/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-all-allotment.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-all-allotment.num.specs.json index c305ee82..ce35e9ea 100644 --- a/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-all-allotment.num.specs.json +++ b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-all-allotment.num.specs.json @@ -19,12 +19,12 @@ "expect.postings": [ { "source": "acc2", - "destination": "acc2:swap", + "destination": "swap", "amount": 500, "asset": "EUR/3" }, { - "source": "acc2:swap", + "source": "swap", "destination": "acc2", "amount": 50, "asset": "EUR/2" diff --git a/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-allotment.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-allotment.num.specs.json index d57a865c..5c693b3b 100644 --- a/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-allotment.num.specs.json +++ b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-allotment.num.specs.json @@ -19,12 +19,12 @@ "expect.postings": [ { "source": "acc2", - "destination": "acc2:swap", + "destination": "swap", "amount": 500, "asset": "EUR/3" }, { - "source": "acc2:swap", + "source": "swap", "destination": "acc2", "amount": 50, "asset": "EUR/2" @@ -53,12 +53,12 @@ "expect.postings": [ { "source": "acc2", - "destination": "acc2:swap", + "destination": "swap", "amount": 50, "asset": "EUR/2" }, { - "source": "acc2:swap", + "source": "swap", "destination": "acc2", "amount": 50, "asset": "EUR/2" diff --git a/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-kept.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-kept.num.specs.json index 61798405..561b7437 100644 --- a/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-kept.num.specs.json +++ b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-kept.num.specs.json @@ -15,18 +15,18 @@ "expect.postings": [ { "source": "acc", - "destination": "acc:swap", + "destination": "swap", "amount": 2, "asset": "BTC/2" }, { "source": "acc", - "destination": "acc:swap", + "destination": "swap", "amount": 1000000, "asset": "BTC/8" }, { - "source": "acc:swap", + "source": "swap", "destination": "acc", "amount": 3, "asset": "BTC/2" diff --git a/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-send-all.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-send-all.num.specs.json index 6db50d23..c0e0ccc5 100644 --- a/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-send-all.num.specs.json +++ b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-send-all.num.specs.json @@ -16,24 +16,24 @@ "expect.postings": [ { "source": "src", - "destination": "src:swap", + "destination": "swap", "amount": 2, "asset": "EUR" }, { "source": "src", - "destination": "src:swap", + "destination": "swap", "amount": 1, "asset": "EUR/2" }, { "source": "src", - "destination": "src:swap", + "destination": "swap", "amount": 30, "asset": "EUR/3" }, { - "source": "src:swap", + "source": "swap", "destination": "src", "amount": 204, "asset": "EUR/2" @@ -56,12 +56,12 @@ "expect.postings": [ { "source": "src", - "destination": "src:swap", + "destination": "swap", "amount": 20, "asset": "EUR/3" }, { - "source": "src:swap", + "source": "swap", "destination": "src", "amount": 2, "asset": "EUR/2" diff --git a/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-with-oneof.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-with-oneof.num.specs.json index 68baa9dc..3ed71f11 100644 --- a/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-with-oneof.num.specs.json +++ b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling-with-oneof.num.specs.json @@ -43,12 +43,12 @@ "expect.postings": [ { "source": "acc1", - "destination": "acc1:swap", + "destination": "swap", "amount": 100, "asset": "EUR/2" }, { - "source": "acc1:swap", + "source": "swap", "destination": "acc1", "amount": 100, "asset": "EUR/2" diff --git a/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling.num.specs.json b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling.num.specs.json index 7d81637c..fbaf9110 100644 --- a/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling.num.specs.json +++ b/internal/interpreter/testdata/script-tests/experimental/asset-scaling/scaling.num.specs.json @@ -15,12 +15,12 @@ "expect.postings": [ { "source": "src", - "destination": "src:swap", + "destination": "swap", "asset": "EUR", "amount": 4 }, { - "source": "src:swap", + "source": "swap", "destination": "src", "asset": "EUR/2", "amount": 400 @@ -43,12 +43,12 @@ "expect.postings": [ { "source": "src", - "destination": "src:swap", + "destination": "swap", "asset": "EUR/3", "amount": 4000 }, { - "source": "src:swap", + "source": "swap", "destination": "src", "asset": "EUR/2", "amount": 400 @@ -72,18 +72,18 @@ "expect.postings": [ { "source": "src", - "destination": "src:swap", + "destination": "swap", "asset": "EUR", "amount": 2 }, { "source": "src", - "destination": "src:swap", + "destination": "swap", "asset": "EUR/2", "amount": 200 }, { - "source": "src:swap", + "source": "swap", "destination": "src", "asset": "EUR/2", "amount": 400