diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 73d7a5114..9f84f9938 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,12 +3,36 @@ name: build on: [push, pull_request] jobs: + analyze: + name: Static Analysis + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '>=1.19' + + - name: Set up linters + run: make install-tools + + - name: Lint + run: | + make vet + make lint + make fmt + git diff + if [[ $(git diff) != '' ]]; then echo 'Invalid formatting!' >&2; exit 1; fi + build: name: Build runs-on: ubuntu-latest strategy: matrix: - goVer: [1.14, 1.15, 1.16, 1.17] + goVer: [1.18, 1.19] steps: - name: Set up Go ${{ matrix.goVer }} uses: actions/setup-go@v2 @@ -16,14 +40,17 @@ jobs: go-version: ${{ matrix.goVer }} id: go + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + - name: Set up ANTLR env: - ANTLR_VERSION: 4.9 + ANTLR_VERSION: 4.11.1 run: | sudo curl -o /usr/local/lib/antlr-${ANTLR_VERSION}-complete.jar https://www.antlr.org/download/antlr-${ANTLR_VERSION}-complete.jar export CLASSPATH=".:/usr/local/lib/antlr-${ANTLR_VERSION}-complete.jar:$CLASSPATH" mkdir $HOME/antlr-bin - echo -e '#!/bin/bash\njava -jar /usr/local/lib/antlr-4.9-complete.jar "$@"' > $HOME/antlr-bin/antlr + echo -e '#!/bin/bash\njava -jar /usr/local/lib/antlr-4.11.1-complete.jar "$@"' > $HOME/antlr-bin/antlr echo -e '#!/bin/bash\njava org.antlr.v4.gui.TestRig "$@"' > $HOME/antlr-bin/grun chmod +x $HOME/antlr-bin/* export PATH=$PATH:$HOME/antlr-bin @@ -32,25 +59,12 @@ jobs: - name: Set up Lab run: | curl https://raw.githubusercontent.com/MontFerret/lab/master/install.sh -o install.sh - sudo sh install.sh - - - name: Set up linters - run: go get -u github.com/mgechev/revive - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 + chmod +x ./install.sh + LOCATION=$PWD ./install.sh - name: Get dependencies run: make install - - name: Lint - run: | - make vet - make lint - make fmt - git diff - if [[ $(git diff) != '' ]]; then echo 'Invalid formatting!' >&2; exit 1; fi - - name: Generate run: | export PATH=$PATH:$HOME/antlr-bin @@ -65,5 +79,5 @@ jobs: - name: E2E tests run: | docker run -d -p 9222:9222 ghcr.io/montferret/chromium:92.0.4512.0 - make e2e + LAB_BIN=$PWD/lab make e2e docker stop $(docker ps -q) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 2305be2b0..85ee8e63e 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -17,8 +17,6 @@ on: pull_request: # The branches below must be a subset of the branches above branches: [ master ] - schedule: - - cron: '44 5 * * 4' jobs: analyze: @@ -34,34 +32,34 @@ jobs: # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed steps: - - name: Checkout repository - uses: actions/checkout@v2 + - name: Checkout repository + uses: actions/checkout@v2 - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language + # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language - #- run: | - # make bootstrap - # make release + #- run: | + # make bootstrap + # make release - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bec6501c..88a2edf43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,44 @@ ## Changelog +### 0.16.6 + +### Fixed +- Invalid XPath evaluation in HTTP driver [#725](https://github.com/MontFerret/ferret/pull/725) +- Go routines leakage [#726](https://github.com/MontFerret/ferret/pull/726) + +### Updated +- Small tweak in FQL Parser for FQL Formatter [#723](https://github.com/MontFerret/ferret/pull/723) + +### 0.16.5 + +### Fixed +- Query fails if an element is not found (regression) [#722](https://github.com/MontFerret/ferret/pull/722) + +### Updated +- Small tweak in FQL Parser for FQL Formatter [#723](https://github.com/MontFerret/ferret/pull/723) + +### 0.16.4 + +### Fixed +- Fixed inability to parse custom date formats with DATE function [#720](https://github.com/MontFerret/ferret/pull/720) + +### 0.16.3 + +### Fixed +- Panic during XPath execution by HTTP driver [#715](https://github.com/MontFerret/ferret/pull/715) + +### 0.16.2 + +### Fixed +- Unable to use dynamic values in LIMIT clause [#706](https://github.com/MontFerret/ferret/pull/706) +- HTTP driver does not allow to override header values [#707](https://github.com/MontFerret/ferret/pull/707), [#709](https://github.com/MontFerret/ferret/pull/709) +- Cleaned up deps [#710](https://github.com/MontFerret/ferret/pull/710), [#711](https://github.com/MontFerret/ferret/pull/711) + +### 0.16.1 + +### Fixed +- Logical precedence in ternary operator condition [#704](https://github.com/MontFerret/ferret/pull/704) + ### 0.16.0 ### Added diff --git a/Makefile b/Makefile index 0350e1873..bbabe7bc9 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ .PHONY: build install compile test e2e doc fmt lint vet release +export CGO_ENABLED=0 +LAB_BIN ?= lab DIR_BIN = ./bin DIR_PKG = ./pkg DIR_E2E = ./e2e @@ -8,22 +10,27 @@ default: build build: vet generate test compile +install-tools: + go install honnef.co/go/tools/cmd/staticcheck@latest && \ + go install golang.org/x/tools/cmd/goimports@latest && \ + go install github.com/mgechev/revive@latest + install: go get compile: - go build -race -v -o ${DIR_BIN}/ferret \ + go build -v -o ${DIR_BIN}/ferret \ ${DIR_E2E}/cli.go test: - go test -race ${DIR_PKG}/... + go test ${DIR_PKG}/... cover: - go test -race -coverprofile=coverage.txt -covermode=atomic ${DIR_PKG}/... && \ + go test -coverprofile=coverage.txt -covermode=atomic ${DIR_PKG}/... && \ curl -s https://codecov.io/bash | bash e2e: - lab --timeout=120 --attempts=5 --concurrency=1 --wait=http://127.0.0.1:9222/json/version --runtime=bin://./bin/ferret --files=./e2e/tests --cdn=./e2e/pages/dynamic --cdn=./e2e/pages/static + ${LAB_BIN} --timeout=120 --attempts=5 --concurrency=1 --wait=http://127.0.0.1:9222/json/version --runtime=bin://./bin/ferret --files=./e2e/tests --cdn=./e2e/pages/dynamic --cdn=./e2e/pages/static bench: go test -run=XXX -bench=. ${DIR_PKG}/... @@ -36,11 +43,13 @@ doc: # http://golang.org/cmd/go/#hdr-Run_gofmt_on_package_sources fmt: - go fmt ${DIR_PKG}/... + go fmt ${DIR_PKG}/... && \ + goimports -w -local github.com/MontFerret ./pkg ./e2e # https://github.com/mgechev/revive # go get github.com/mgechev/revive lint: + staticcheck ./pkg/compiler ./pkg/drivers ./pkg/runtime ./pkg/stdlib && \ revive -config revive.toml -formatter stylish -exclude ./pkg/parser/fql/... -exclude ./vendor/... ./... # http://godoc.org/code.google.com/p/go.tools/cmd/vet diff --git a/e2e/cli.go b/e2e/cli.go index 5c0505796..0e12d4e61 100644 --- a/e2e/cli.go +++ b/e2e/cli.go @@ -7,6 +7,7 @@ import ( "encoding/json" "flag" "fmt" + "io" "io/ioutil" "os" "os/signal" @@ -114,21 +115,21 @@ func (p *Profiler) Print(label string) { timer, found := p.timers[label] if found { - fmt.Fprintln(writer, fmt.Sprintf("Time: %s", timer.end.Sub(timer.start))) + fmt.Fprintf(writer, "Time: %s\n", timer.end.Sub(timer.start)) } stats, found := p.allocs[label] if found { - fmt.Fprintln(writer, fmt.Sprintf("Alloc: %s", byteCountDecimal(stats.Alloc))) - fmt.Fprintln(writer, fmt.Sprintf("Frees: %s", byteCountDecimal(stats.Frees))) - fmt.Fprintln(writer, fmt.Sprintf("Total Alloc: %s", byteCountDecimal(stats.TotalAlloc))) - fmt.Fprintln(writer, fmt.Sprintf("Heap Alloc: %s", byteCountDecimal(stats.HeapAlloc))) - fmt.Fprintln(writer, fmt.Sprintf("Heap Sys: %s", byteCountDecimal(stats.HeapSys))) - fmt.Fprintln(writer, fmt.Sprintf("Heap Idle: %s", byteCountDecimal(stats.HeapIdle))) - fmt.Fprintln(writer, fmt.Sprintf("Heap In Use: %s", byteCountDecimal(stats.HeapInuse))) - fmt.Fprintln(writer, fmt.Sprintf("Heap Released: %s", byteCountDecimal(stats.HeapReleased))) - fmt.Fprintln(writer, fmt.Sprintf("Heap Objects: %d", stats.HeapObjects)) + fmt.Fprintf(writer, "Alloc: %s\n", byteCountDecimal(stats.Alloc)) + fmt.Fprintf(writer, "Frees: %s\n", byteCountDecimal(stats.Frees)) + fmt.Fprintf(writer, "Total Alloc: %s\n", byteCountDecimal(stats.TotalAlloc)) + fmt.Fprintf(writer, "Heap Alloc: %s\n", byteCountDecimal(stats.HeapAlloc)) + fmt.Fprintf(writer, "Heap Sys: %s\n", byteCountDecimal(stats.HeapSys)) + fmt.Fprintf(writer, "Heap Idle: %s\n", byteCountDecimal(stats.HeapIdle)) + fmt.Fprintf(writer, "Heap In Use: %s\n", byteCountDecimal(stats.HeapInuse)) + fmt.Fprintf(writer, "Heap Released: %s\n", byteCountDecimal(stats.HeapReleased)) + fmt.Fprintf(writer, "Heap Objects: %d\n", stats.HeapObjects) } //cpu, found := p.cpus[label] @@ -138,7 +139,7 @@ func (p *Profiler) Print(label string) { //} if writer.Len() > 0 { - fmt.Println(fmt.Sprintf("%s:", label)) + fmt.Printf("%s:\n", label) fmt.Println("-----") fmt.Println(writer.String()) } @@ -260,7 +261,7 @@ func main() { // check whether the app is getting a query via standard input std := bufio.NewReader(os.Stdin) - b, err := ioutil.ReadAll(std) + b, err := io.ReadAll(std) if err != nil { fmt.Println(err) @@ -440,7 +441,7 @@ func execQuery(ctx context.Context, engine *ferret.Instance, opts []runtime.Opti prof.PrintAll() if out != nil { - fmt.Println(fmt.Sprintf("Output size: %s", byteCountDecimal(uint64(len(out))))) + fmt.Printf("Output size: %s\n", byteCountDecimal(uint64(len(out)))) fmt.Println("") } } diff --git a/e2e/tests/dynamic/element/query/element_not_found_by_css.fql b/e2e/tests/dynamic/element/query/element_not_found_by_css.fql new file mode 100644 index 000000000..2e5d49832 --- /dev/null +++ b/e2e/tests/dynamic/element/query/element_not_found_by_css.fql @@ -0,0 +1,8 @@ +LET url = @lab.cdn.dynamic +LET doc = DOCUMENT(url, { driver: "cdp" }) + +LET el = ELEMENT(doc, "#do-not-exist") + +T::NONE(el) + +RETURN TRUE diff --git a/e2e/tests/dynamic/element/query/element_not_found_by_xpath.fql b/e2e/tests/dynamic/element/query/element_not_found_by_xpath.fql new file mode 100644 index 000000000..5ee8c35c9 --- /dev/null +++ b/e2e/tests/dynamic/element/query/element_not_found_by_xpath.fql @@ -0,0 +1,8 @@ +LET url = @lab.cdn.dynamic +LET doc = DOCUMENT(url, true) + +LET el = ELEMENT(doc, X("//*[@id='do-not-exist']"))? + +T::NONE(el) + +RETURN TRUE diff --git a/e2e/tests/dynamic/element/siblings/next_not_found.fql b/e2e/tests/dynamic/element/siblings/next_not_found.fql new file mode 100644 index 000000000..575088fe6 --- /dev/null +++ b/e2e/tests/dynamic/element/siblings/next_not_found.fql @@ -0,0 +1,8 @@ +LET doc = DOCUMENT(@lab.cdn.dynamic + "/#/lists", { driver:"cdp" }) + +LET current = ELEMENT(doc, "body") +T::NOT::NONE(current) +LET next = current.nextElementSibling +T::NONE(next) + +RETURN NONE \ No newline at end of file diff --git a/e2e/tests/dynamic/element/siblings/prev_not_found.fql b/e2e/tests/dynamic/element/siblings/prev_not_found.fql new file mode 100644 index 000000000..6d16a8809 --- /dev/null +++ b/e2e/tests/dynamic/element/siblings/prev_not_found.fql @@ -0,0 +1,8 @@ +LET doc = DOCUMENT(@lab.cdn.dynamic + "/#/lists", { driver:"cdp" }) + +LET current = ELEMENT(doc, 'head') +T::NOT::NONE(current) +LET prev = current.previousElementSibling +T::NONE(prev) + +RETURN NONE \ No newline at end of file diff --git a/e2e/tests/dynamic/element/xpath/attrs.fql b/e2e/tests/dynamic/element/xpath/attrs.fql new file mode 100644 index 000000000..fd7e8069e --- /dev/null +++ b/e2e/tests/dynamic/element/xpath/attrs.fql @@ -0,0 +1,8 @@ +LET url = @lab.cdn.dynamic +LET page = DOCUMENT(url, true) + +LET actual = XPATH(page, "//body/@class") + +T::NOT::EMPTY(actual) + +RETURN T::EQ(actual[0], "text-center") \ No newline at end of file diff --git a/examples/embedded/main.go b/examples/embedded/main.go index 97b5964af..6b26c1a5a 100644 --- a/examples/embedded/main.go +++ b/examples/embedded/main.go @@ -27,7 +27,7 @@ func main() { } for _, topic := range topics { - fmt.Println(fmt.Sprintf("%s: %s %s", topic.Name, topic.Description, topic.URL)) + fmt.Printf("%s: %s %s\n", topic.Name, topic.Description, topic.URL) } } diff --git a/examples/xpath.fql b/examples/xpath.fql new file mode 100644 index 000000000..b57888b7c --- /dev/null +++ b/examples/xpath.fql @@ -0,0 +1,5 @@ +LET doc = DOCUMENT("https://www.google.ca", { + driver: 'cdp' +}) + +RETURN XPATH(doc, "//meta/@charset") // ["UTF-8"] \ No newline at end of file diff --git a/pkg/compiler/compiler_array_test.go b/pkg/compiler/compiler_array_test.go index 216cc7c31..96921ea7a 100644 --- a/pkg/compiler/compiler_array_test.go +++ b/pkg/compiler/compiler_array_test.go @@ -2,9 +2,11 @@ package compiler_test import ( "context" - "github.com/MontFerret/ferret/pkg/compiler" - . "github.com/smartystreets/goconvey/convey" "testing" + + . "github.com/smartystreets/goconvey/convey" + + "github.com/MontFerret/ferret/pkg/compiler" ) func TestArrayOperator(t *testing.T) { diff --git a/pkg/compiler/compiler_cases_test.go b/pkg/compiler/compiler_cases_test.go index 7e52c4700..63f906b71 100644 --- a/pkg/compiler/compiler_cases_test.go +++ b/pkg/compiler/compiler_cases_test.go @@ -6,6 +6,9 @@ import ( "strings" "testing" + "golang.org/x/text/cases" + "golang.org/x/text/language" + "github.com/MontFerret/ferret/pkg/compiler" "github.com/MontFerret/ferret/pkg/stdlib/arrays" @@ -57,7 +60,8 @@ func TestCases(t *testing.T) { "Mixed": func(s string) string { // Capitalize string. // Source: https://stackoverflow.com/questions/33696034/make-first-letter-of-words-uppercase-in-a-string - return strings.Title(strings.ToLower(s)) + // return strings.Title(strings.ToLower(s)) + return cases.Title(language.English).String(strings.ToLower(s)) }, "Upper": strings.ToUpper, "Lower": strings.ToLower, diff --git a/pkg/compiler/compiler_collect_aggregate_test.go b/pkg/compiler/compiler_collect_aggregate_test.go index 28571a172..2616db03f 100644 --- a/pkg/compiler/compiler_collect_aggregate_test.go +++ b/pkg/compiler/compiler_collect_aggregate_test.go @@ -2,10 +2,12 @@ package compiler_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/compiler" "github.com/MontFerret/ferret/pkg/runtime" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestAggregate(t *testing.T) { diff --git a/pkg/compiler/compiler_collect_count_test.go b/pkg/compiler/compiler_collect_count_test.go index c85cb3eba..20eb70517 100644 --- a/pkg/compiler/compiler_collect_count_test.go +++ b/pkg/compiler/compiler_collect_count_test.go @@ -2,10 +2,12 @@ package compiler_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/compiler" "github.com/MontFerret/ferret/pkg/runtime" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestCollectCount(t *testing.T) { diff --git a/pkg/compiler/compiler_collect_into_test.go b/pkg/compiler/compiler_collect_into_test.go index 2ab6ccc1a..60fb1c82d 100644 --- a/pkg/compiler/compiler_collect_into_test.go +++ b/pkg/compiler/compiler_collect_into_test.go @@ -2,10 +2,12 @@ package compiler_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/compiler" "github.com/MontFerret/ferret/pkg/runtime" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestCollectInto(t *testing.T) { diff --git a/pkg/compiler/compiler_collect_test.go b/pkg/compiler/compiler_collect_test.go index 9fa2dd1b3..991592c0b 100644 --- a/pkg/compiler/compiler_collect_test.go +++ b/pkg/compiler/compiler_collect_test.go @@ -2,10 +2,12 @@ package compiler_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/compiler" "github.com/MontFerret/ferret/pkg/runtime" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestCollect(t *testing.T) { diff --git a/pkg/compiler/compiler_collect_with_count_test.go b/pkg/compiler/compiler_collect_with_count_test.go index f088d6680..7f44c3588 100644 --- a/pkg/compiler/compiler_collect_with_count_test.go +++ b/pkg/compiler/compiler_collect_with_count_test.go @@ -2,10 +2,12 @@ package compiler_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/compiler" "github.com/MontFerret/ferret/pkg/runtime" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestCollectWithCount(t *testing.T) { diff --git a/pkg/compiler/compiler_eq_test.go b/pkg/compiler/compiler_eq_test.go index 59ba60e32..4ef9855d1 100644 --- a/pkg/compiler/compiler_eq_test.go +++ b/pkg/compiler/compiler_eq_test.go @@ -2,10 +2,12 @@ package compiler_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/compiler" "github.com/MontFerret/ferret/pkg/runtime" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestEqualityOperators(t *testing.T) { diff --git a/pkg/compiler/compiler_filter_test.go b/pkg/compiler/compiler_filter_test.go index 96c3ca8bb..6893a35f4 100644 --- a/pkg/compiler/compiler_filter_test.go +++ b/pkg/compiler/compiler_filter_test.go @@ -2,11 +2,13 @@ package compiler_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/compiler" "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestForFilter(t *testing.T) { diff --git a/pkg/compiler/compiler_for_ternary_test.go b/pkg/compiler/compiler_for_ternary_test.go index 7935f5f8e..cbc0ab186 100644 --- a/pkg/compiler/compiler_for_ternary_test.go +++ b/pkg/compiler/compiler_for_ternary_test.go @@ -2,9 +2,11 @@ package compiler_test import ( "context" - "github.com/MontFerret/ferret/pkg/compiler" - . "github.com/smartystreets/goconvey/convey" "testing" + + . "github.com/smartystreets/goconvey/convey" + + "github.com/MontFerret/ferret/pkg/compiler" ) func TestForTernaryExpression(t *testing.T) { diff --git a/pkg/compiler/compiler_for_test.go b/pkg/compiler/compiler_for_test.go index c3b1561f9..1f938b138 100644 --- a/pkg/compiler/compiler_for_test.go +++ b/pkg/compiler/compiler_for_test.go @@ -3,11 +3,13 @@ package compiler_test import ( "context" "encoding/json" - "github.com/MontFerret/ferret/pkg/compiler" - "github.com/MontFerret/ferret/pkg/runtime" - . "github.com/smartystreets/goconvey/convey" "sort" "testing" + + . "github.com/smartystreets/goconvey/convey" + + "github.com/MontFerret/ferret/pkg/compiler" + "github.com/MontFerret/ferret/pkg/runtime" ) func TestFor(t *testing.T) { diff --git a/pkg/compiler/compiler_for_while_ternary_test.go b/pkg/compiler/compiler_for_while_ternary_test.go index af4931316..3bc06fc8c 100644 --- a/pkg/compiler/compiler_for_while_ternary_test.go +++ b/pkg/compiler/compiler_for_while_ternary_test.go @@ -2,11 +2,13 @@ package compiler_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/compiler" "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestForTernaryWhileExpression(t *testing.T) { diff --git a/pkg/compiler/compiler_for_while_test.go b/pkg/compiler/compiler_for_while_test.go index fe39809c0..2e8377bf8 100644 --- a/pkg/compiler/compiler_for_while_test.go +++ b/pkg/compiler/compiler_for_while_test.go @@ -2,12 +2,14 @@ package compiler_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/compiler" "github.com/MontFerret/ferret/pkg/runtime" "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestForWhile(t *testing.T) { diff --git a/pkg/compiler/compiler_func_ns_test.go b/pkg/compiler/compiler_func_ns_test.go index a51123e73..094b4cf73 100644 --- a/pkg/compiler/compiler_func_ns_test.go +++ b/pkg/compiler/compiler_func_ns_test.go @@ -3,13 +3,15 @@ package compiler_test import ( "context" "fmt" + "regexp" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/compiler" "github.com/MontFerret/ferret/pkg/parser" "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" - . "github.com/smartystreets/goconvey/convey" - "regexp" - "testing" ) func TestFunctionNSCall(t *testing.T) { @@ -101,7 +103,7 @@ func TestFunctionNSCall(t *testing.T) { p := parser.New("RETURN TRUE") c := compiler.New() - r := regexp.MustCompile("\\w+") + r := regexp.MustCompile(`\w+`) for _, l := range p.GetLiteralNames() { if r.MatchString(l) { diff --git a/pkg/compiler/compiler_func_test.go b/pkg/compiler/compiler_func_test.go index 4ca3d5d73..50a51cda7 100644 --- a/pkg/compiler/compiler_func_test.go +++ b/pkg/compiler/compiler_func_test.go @@ -2,12 +2,14 @@ package compiler_test import ( "context" + "testing" + + "github.com/pkg/errors" + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/compiler" "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" - "github.com/pkg/errors" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestFunctionCall(t *testing.T) { diff --git a/pkg/compiler/compiler_in_test.go b/pkg/compiler/compiler_in_test.go index d1f6da606..9c7d312d4 100644 --- a/pkg/compiler/compiler_in_test.go +++ b/pkg/compiler/compiler_in_test.go @@ -2,9 +2,11 @@ package compiler_test import ( "context" - "github.com/MontFerret/ferret/pkg/compiler" - . "github.com/smartystreets/goconvey/convey" "testing" + + . "github.com/smartystreets/goconvey/convey" + + "github.com/MontFerret/ferret/pkg/compiler" ) func TestInOperator(t *testing.T) { diff --git a/pkg/compiler/compiler_let_test.go b/pkg/compiler/compiler_let_test.go index cc17c6166..2a5c3e6a5 100644 --- a/pkg/compiler/compiler_let_test.go +++ b/pkg/compiler/compiler_let_test.go @@ -2,12 +2,14 @@ package compiler_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/compiler" "github.com/MontFerret/ferret/pkg/runtime" "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestLet(t *testing.T) { diff --git a/pkg/compiler/compiler_like_test.go b/pkg/compiler/compiler_like_test.go index 14542a7a0..991c1fcb0 100644 --- a/pkg/compiler/compiler_like_test.go +++ b/pkg/compiler/compiler_like_test.go @@ -2,9 +2,11 @@ package compiler_test import ( "context" - "github.com/MontFerret/ferret/pkg/compiler" - . "github.com/smartystreets/goconvey/convey" "testing" + + . "github.com/smartystreets/goconvey/convey" + + "github.com/MontFerret/ferret/pkg/compiler" ) func TestLikeOperator(t *testing.T) { diff --git a/pkg/compiler/compiler_limit_test.go b/pkg/compiler/compiler_limit_test.go index 32b4dcff5..efe02e0a0 100644 --- a/pkg/compiler/compiler_limit_test.go +++ b/pkg/compiler/compiler_limit_test.go @@ -2,11 +2,13 @@ package compiler_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/compiler" "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestForLimit(t *testing.T) { diff --git a/pkg/compiler/compiler_logical_test.go b/pkg/compiler/compiler_logical_test.go index a777854d0..e86821fc4 100644 --- a/pkg/compiler/compiler_logical_test.go +++ b/pkg/compiler/compiler_logical_test.go @@ -3,11 +3,13 @@ package compiler_test import ( "context" "errors" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/compiler" "github.com/MontFerret/ferret/pkg/runtime" "github.com/MontFerret/ferret/pkg/runtime/core" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestLogicalOperators(t *testing.T) { diff --git a/pkg/compiler/compiler_math_test.go b/pkg/compiler/compiler_math_test.go index 0fc07f526..9d0397b67 100644 --- a/pkg/compiler/compiler_math_test.go +++ b/pkg/compiler/compiler_math_test.go @@ -2,10 +2,12 @@ package compiler_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/compiler" "github.com/MontFerret/ferret/pkg/runtime" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestMathOperators(t *testing.T) { diff --git a/pkg/compiler/compiler_member_test.go b/pkg/compiler/compiler_member_test.go index 6f86bc018..fa2ffaf02 100644 --- a/pkg/compiler/compiler_member_test.go +++ b/pkg/compiler/compiler_member_test.go @@ -3,15 +3,17 @@ package compiler_test import ( "context" "fmt" - "github.com/MontFerret/ferret/pkg/parser" - "github.com/MontFerret/ferret/pkg/runtime/core" "regexp" "strconv" "strings" "testing" - "github.com/MontFerret/ferret/pkg/compiler" + "github.com/MontFerret/ferret/pkg/parser" + "github.com/MontFerret/ferret/pkg/runtime/core" + . "github.com/smartystreets/goconvey/convey" + + "github.com/MontFerret/ferret/pkg/compiler" ) func TestMember(t *testing.T) { @@ -525,7 +527,7 @@ RETURN o1.first["second"][o2.prop].fourth["fifth"]["bottom"] Convey("Reserved words as property name", t, func() { p := parser.New("RETURN TRUE") - r := regexp.MustCompile("\\w+") + r := regexp.MustCompile(`\w+`) for idx, l := range p.GetLiteralNames() { if r.MatchString(l) { diff --git a/pkg/compiler/compiler_param_test.go b/pkg/compiler/compiler_param_test.go index 8939a515f..59eced1dc 100644 --- a/pkg/compiler/compiler_param_test.go +++ b/pkg/compiler/compiler_param_test.go @@ -2,10 +2,12 @@ package compiler_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/compiler" "github.com/MontFerret/ferret/pkg/runtime" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestParam(t *testing.T) { diff --git a/pkg/compiler/compiler_precedence_test.go b/pkg/compiler/compiler_precedence_test.go index 5306be3f1..21fc8640c 100644 --- a/pkg/compiler/compiler_precedence_test.go +++ b/pkg/compiler/compiler_precedence_test.go @@ -2,9 +2,10 @@ package compiler_test import ( "context" - "github.com/MontFerret/ferret/pkg/compiler" "testing" + "github.com/MontFerret/ferret/pkg/compiler" + . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/compiler/compiler_range_test.go b/pkg/compiler/compiler_range_test.go index 70779d857..4b8adad83 100644 --- a/pkg/compiler/compiler_range_test.go +++ b/pkg/compiler/compiler_range_test.go @@ -2,9 +2,11 @@ package compiler_test import ( "context" - "github.com/MontFerret/ferret/pkg/compiler" - . "github.com/smartystreets/goconvey/convey" "testing" + + . "github.com/smartystreets/goconvey/convey" + + "github.com/MontFerret/ferret/pkg/compiler" ) func TestRangeOperator(t *testing.T) { diff --git a/pkg/compiler/compiler_regexp_test.go b/pkg/compiler/compiler_regexp_test.go index 7f85253aa..a1af1b5ba 100644 --- a/pkg/compiler/compiler_regexp_test.go +++ b/pkg/compiler/compiler_regexp_test.go @@ -3,12 +3,14 @@ package compiler_test import ( "context" "fmt" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" - "testing" - "github.com/MontFerret/ferret/pkg/compiler" . "github.com/smartystreets/goconvey/convey" + + "github.com/MontFerret/ferret/pkg/compiler" ) func TestRegexpOperator(t *testing.T) { diff --git a/pkg/compiler/compiler_return_test.go b/pkg/compiler/compiler_return_test.go index db067d3ba..e44239774 100644 --- a/pkg/compiler/compiler_return_test.go +++ b/pkg/compiler/compiler_return_test.go @@ -2,10 +2,12 @@ package compiler_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/compiler" "github.com/MontFerret/ferret/pkg/runtime" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestReturn(t *testing.T) { diff --git a/pkg/compiler/compiler_sort_test.go b/pkg/compiler/compiler_sort_test.go index eeb45caa0..e11350cda 100644 --- a/pkg/compiler/compiler_sort_test.go +++ b/pkg/compiler/compiler_sort_test.go @@ -2,11 +2,13 @@ package compiler_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/compiler" "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestForSort(t *testing.T) { diff --git a/pkg/compiler/compiler_str_test.go b/pkg/compiler/compiler_str_test.go index 54a72df69..e4144cdff 100644 --- a/pkg/compiler/compiler_str_test.go +++ b/pkg/compiler/compiler_str_test.go @@ -4,9 +4,11 @@ import ( "context" "encoding/json" "fmt" - "github.com/MontFerret/ferret/pkg/compiler" - . "github.com/smartystreets/goconvey/convey" "testing" + + . "github.com/smartystreets/goconvey/convey" + + "github.com/MontFerret/ferret/pkg/compiler" ) func TestString(t *testing.T) { diff --git a/pkg/compiler/compiler_ternary_test.go b/pkg/compiler/compiler_ternary_test.go index 9eb3dd8f4..e2de74e44 100644 --- a/pkg/compiler/compiler_ternary_test.go +++ b/pkg/compiler/compiler_ternary_test.go @@ -3,9 +3,11 @@ package compiler_test import ( "context" "fmt" - "github.com/MontFerret/ferret/pkg/compiler" - . "github.com/smartystreets/goconvey/convey" "testing" + + . "github.com/smartystreets/goconvey/convey" + + "github.com/MontFerret/ferret/pkg/compiler" ) func TestTernaryOperator(t *testing.T) { diff --git a/pkg/compiler/compiler_unary_test.go b/pkg/compiler/compiler_unary_test.go index 25a291028..eb2a8226e 100644 --- a/pkg/compiler/compiler_unary_test.go +++ b/pkg/compiler/compiler_unary_test.go @@ -2,9 +2,11 @@ package compiler_test import ( "context" - "github.com/MontFerret/ferret/pkg/compiler" - . "github.com/smartystreets/goconvey/convey" "testing" + + . "github.com/smartystreets/goconvey/convey" + + "github.com/MontFerret/ferret/pkg/compiler" ) func TestUnaryOperator(t *testing.T) { diff --git a/pkg/compiler/compiler_use_test.go b/pkg/compiler/compiler_use_test.go index 5b7a7183b..39fc9d378 100644 --- a/pkg/compiler/compiler_use_test.go +++ b/pkg/compiler/compiler_use_test.go @@ -4,11 +4,12 @@ import ( "context" "testing" + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/compiler" "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/stdlib/strings" "github.com/MontFerret/ferret/pkg/stdlib/types" - . "github.com/smartystreets/goconvey/convey" ) func TestUseExpression(t *testing.T) { diff --git a/pkg/compiler/compiler_waitfor_event_ternary_test.go b/pkg/compiler/compiler_waitfor_event_ternary_test.go index c08a59eb6..b10476678 100644 --- a/pkg/compiler/compiler_waitfor_event_ternary_test.go +++ b/pkg/compiler/compiler_waitfor_event_ternary_test.go @@ -2,8 +2,9 @@ package compiler_test import ( "context" - . "github.com/smartystreets/goconvey/convey" "testing" + + . "github.com/smartystreets/goconvey/convey" ) func TestWaitforEventWithinTernaryExpression(t *testing.T) { diff --git a/pkg/compiler/compiler_waitfor_event_test.go b/pkg/compiler/compiler_waitfor_event_test.go index e7ebab855..0065e9331 100644 --- a/pkg/compiler/compiler_waitfor_event_test.go +++ b/pkg/compiler/compiler_waitfor_event_test.go @@ -2,16 +2,18 @@ package compiler_test import ( "context" + "testing" + "time" + + "github.com/pkg/errors" + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/compiler" "github.com/MontFerret/ferret/pkg/runtime" "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/events" "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/runtime/values/types" - "github.com/pkg/errors" - . "github.com/smartystreets/goconvey/convey" - "testing" - "time" ) type ( diff --git a/pkg/compiler/listener.go b/pkg/compiler/listener.go index ab8c50c44..f473ab8fe 100644 --- a/pkg/compiler/listener.go +++ b/pkg/compiler/listener.go @@ -1,7 +1,7 @@ package compiler import ( - "github.com/antlr/antlr4/runtime/Go/antlr" + "github.com/antlr/antlr4/runtime/Go/antlr/v4" "github.com/pkg/errors" ) diff --git a/pkg/compiler/namespace.go b/pkg/compiler/namespace.go index f2beb1096..9cc12711f 100644 --- a/pkg/compiler/namespace.go +++ b/pkg/compiler/namespace.go @@ -4,8 +4,9 @@ import ( "regexp" "strings" - "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/pkg/errors" + + "github.com/MontFerret/ferret/pkg/runtime/core" ) var fnNameValidation = regexp.MustCompile("^[a-zA-Z]+[a-zA-Z0-9_]*(::[a-zA-Z]+[a-zA-Z0-9_]*)*$") @@ -90,9 +91,7 @@ func (nc *NamespaceContainer) RegisteredFunctions() []string { // root namespace, return all functions if nc.name == emptyNS { - for _, k := range fnames { - res = append(res, k) - } + res = append(res, fnames...) } else { nsPrefix := nc.name + separator for _, k := range fnames { diff --git a/pkg/compiler/namespace_test.go b/pkg/compiler/namespace_test.go index e1375089e..92895eb80 100644 --- a/pkg/compiler/namespace_test.go +++ b/pkg/compiler/namespace_test.go @@ -2,11 +2,13 @@ package compiler_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/compiler" "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestNamespaceBuilder(t *testing.T) { diff --git a/pkg/compiler/visitor.go b/pkg/compiler/visitor.go index c71bf6425..d620af953 100644 --- a/pkg/compiler/visitor.go +++ b/pkg/compiler/visitor.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "github.com/antlr/antlr4/runtime/Go/antlr" + "github.com/antlr/antlr4/runtime/Go/antlr/v4" "github.com/pkg/errors" "github.com/MontFerret/ferret/pkg/parser/fql" @@ -56,7 +56,8 @@ func (v *visitor) VisitProgram(ctx *fql.ProgramContext) interface{} { gs := newGlobalScope() rs := newRootScope(gs) - block, err := v.visitBody(ctx.Body().(fql.IBodyContext), rs) + block, err := v.visitBody(ctx.Body(), rs) + if err != nil { return nil, err } @@ -69,7 +70,7 @@ func (v *visitor) visitHeads(heads []fql.IHeadContext) error { namespaces := map[string]struct{}{} for _, head := range heads { - err := v.visitHead(head.(fql.IHeadContext), namespaces) + err := v.visitHead(head, namespaces) if err != nil { return err } @@ -142,7 +143,7 @@ func (v *visitor) visitBody(c fql.IBodyContext, scope *scope) (core.Expression, body := expressions.NewBodyExpression(len(statements) + 1) for _, stmt := range statements { - e, err := v.visitBodyStatement(stmt.(fql.IBodyStatementContext), scope) + e, err := v.visitBodyStatement(stmt, scope) if err != nil { return nil, err } @@ -153,7 +154,7 @@ func (v *visitor) visitBody(c fql.IBodyContext, scope *scope) (core.Expression, exp := ctx.BodyExpression() if exp != nil { - e, err := v.visitBodyExpression(exp.(fql.IBodyExpressionContext), scope) + e, err := v.visitBodyExpression(exp, scope) if err != nil { return nil, err } @@ -170,15 +171,15 @@ func (v *visitor) visitBodyStatement(c fql.IBodyStatementContext, scope *scope) ctx := c.(*fql.BodyStatementContext) if variable := ctx.VariableDeclaration(); variable != nil { - return v.visitVariableDeclaration(variable.(fql.IVariableDeclarationContext), scope) + return v.visitVariableDeclaration(variable, scope) } if funcCall := ctx.FunctionCallExpression(); funcCall != nil { - return v.visitFunctionCallExpression(funcCall.(fql.IFunctionCallExpressionContext), scope) + return v.visitFunctionCallExpression(funcCall, scope) } if waitfor := ctx.WaitForExpression(); waitfor != nil { - return v.visitWaitForExpression(waitfor.(fql.IWaitForExpressionContext), scope) + return v.visitWaitForExpression(waitfor, scope) } return nil, v.unexpectedToken(ctx) @@ -188,11 +189,11 @@ func (v *visitor) visitBodyExpression(c fql.IBodyExpressionContext, scope *scope ctx := c.(*fql.BodyExpressionContext) if exp := ctx.ForExpression(); exp != nil { - return v.visitForExpression(exp.(fql.IForExpressionContext), scope) + return v.visitForExpression(exp, scope) } if exp := ctx.ReturnExpression(); exp != nil { - return v.visitReturnExpression(exp.(fql.IReturnExpressionContext), scope) + return v.visitReturnExpression(exp, scope) } return nil, v.unexpectedToken(ctx) @@ -204,7 +205,7 @@ func (v *visitor) visitReturnExpression(c fql.IReturnExpressionContext, scope *s ctx := c.(*fql.ReturnExpressionContext) if exp := ctx.Expression(); exp != nil { - out, err = v.visitExpression(exp.(fql.IExpressionContext), scope) + out, err = v.visitExpression(exp, scope) } else { return nil, v.unexpectedToken(ctx) } @@ -254,7 +255,7 @@ func (v *visitor) visitForExpression(c fql.IForExpressionContext, scope *scope) return nil, err } } else { - whileExpCtx := ctx.Expression().(fql.IExpressionContext) + whileExpCtx := ctx.Expression() conditionExp, err := v.visitExpression(whileExpCtx, scope) if err != nil { @@ -301,7 +302,7 @@ func (v *visitor) visitForExpression(c fql.IForExpressionContext, scope *scope) if clauseCtx != nil { setter, err := v.visitForExpressionClause( - clauseCtx.(fql.IForExpressionClauseContext), + clauseCtx, forInScope, valVarName, keyVarName, @@ -314,7 +315,7 @@ func (v *visitor) visitForExpression(c fql.IForExpressionContext, scope *scope) parsedClauses = append(parsedClauses, setter) } else if statementCtx != nil { exp, err := v.visitForExpressionStatement( - statementCtx.(fql.IForExpressionStatementContext), + statementCtx, forInScope, ) @@ -396,19 +397,19 @@ func (v *visitor) visitLimitClause(c fql.ILimitClauseContext, scope *scope) (cor clauseValues := ctx.AllLimitClauseValue() if len(clauseValues) > 1 { - offset, err = v.visitLimitClauseValue(clauseValues[0].(fql.ILimitClauseValueContext), scope) + offset, err = v.visitLimitClauseValue(clauseValues[0], scope) if err != nil { return nil, nil, err } - count, err = v.visitLimitClauseValue(clauseValues[1].(fql.ILimitClauseValueContext), scope) + count, err = v.visitLimitClauseValue(clauseValues[1], scope) if err != nil { return nil, nil, err } } else { - count, err = v.visitLimitClauseValue(clauseValues[0].(fql.ILimitClauseValueContext), scope) + count, err = v.visitLimitClauseValue(clauseValues[0], scope) if err != nil { return nil, nil, err @@ -431,7 +432,7 @@ func (v *visitor) visitLimitClauseValue(c fql.ILimitClauseValueContext, scope *s return literals.NewIntLiteral(i), nil } else if paramCtx := ctx.Param(); paramCtx != nil { - return v.visitParam(paramCtx.(fql.IParamContext), scope) + return v.visitParam(paramCtx, scope) } else if variableCtx := ctx.Variable(); variableCtx != nil { return v.visitVariable(variableCtx, scope) } else if funcCtx := ctx.FunctionCallExpression(); funcCtx != nil { @@ -455,7 +456,7 @@ func (v *visitor) visitSortClause(c fql.ISortClauseContext, scope *scope) ([]*cl for idx, sortExpCtx := range sortExpCtxs { sortExpCtx := sortExpCtx.(*fql.SortClauseExpressionContext) - exp, err := v.visitExpression(sortExpCtx.Expression().(fql.IExpressionContext), scope) + exp, err := v.visitExpression(sortExpCtx.Expression(), scope) if err != nil { return nil, err } @@ -501,7 +502,7 @@ func (v *visitor) visitCollectClause(c fql.ICollectClauseContext, scope *scope, selectors = make([]*clauses.CollectSelector, 0, len(collectSelectors)) for _, cs := range collectSelectors { - selector, err := v.visitCollectSelector(cs.(fql.ICollectSelectorContext), scope) + selector, err := v.visitCollectSelector(cs, scope) if err != nil { return nil, err } @@ -520,7 +521,7 @@ func (v *visitor) visitCollectClause(c fql.ICollectClauseContext, scope *scope, // if projection expression is defined like WITH group = { foo: i.bar } if projectionSelectorCtx != nil { - selector, err := v.visitCollectSelector(projectionSelectorCtx.(fql.ICollectSelectorContext), scope) + selector, err := v.visitCollectSelector(projectionSelectorCtx, scope) if err != nil { return nil, err } @@ -592,7 +593,7 @@ func (v *visitor) visitCollectClause(c fql.ICollectClauseContext, scope *scope, selectors := make([]*clauses.CollectAggregateSelector, 0, len(selectorCtxs)) for _, sc := range selectorCtxs { - selector, err := v.visitCollectAggregateSelector(sc.(fql.ICollectAggregateSelectorContext), scope) + selector, err := v.visitCollectAggregateSelector(sc, scope) if err != nil { return nil, err } @@ -623,7 +624,7 @@ func (v *visitor) visitCollectClause(c fql.ICollectClauseContext, scope *scope, func (v *visitor) visitCollectSelector(c fql.ICollectSelectorContext, scope *scope) (*clauses.CollectSelector, error) { ctx := c.(*fql.CollectSelectorContext) variable := ctx.Identifier().GetText() - exp, err := v.visitExpression(ctx.Expression().(fql.IExpressionContext), scope) + exp, err := v.visitExpression(ctx.Expression(), scope) if err != nil { return nil, err @@ -638,7 +639,7 @@ func (v *visitor) visitCollectAggregateSelector(c fql.ICollectAggregateSelectorC fnCtx := ctx.FunctionCallExpression() if fnCtx != nil { - exp, err := v.visitFunctionCallExpression(fnCtx.(fql.IFunctionCallExpressionContext), scope) + exp, err := v.visitFunctionCallExpression(fnCtx, scope) if err != nil { return nil, err @@ -662,43 +663,43 @@ func (v *visitor) visitForExpressionSource(c fql.IForExpressionSourceContext, sc arr := ctx.ArrayLiteral() if arr != nil { - return v.visitArrayLiteral(arr.(fql.IArrayLiteralContext), scope) + return v.visitArrayLiteral(arr, scope) } obj := ctx.ObjectLiteral() if obj != nil { - return v.visitObjectLiteral(obj.(fql.IObjectLiteralContext), scope) + return v.visitObjectLiteral(obj, scope) } variable := ctx.Variable() if variable != nil { - return v.visitVariable(variable.(fql.IVariableContext), scope) + return v.visitVariable(variable, scope) } funcCall := ctx.FunctionCallExpression() if funcCall != nil { - return v.visitFunctionCallExpression(funcCall.(fql.IFunctionCallExpressionContext), scope) + return v.visitFunctionCallExpression(funcCall, scope) } memberExp := ctx.MemberExpression() if memberExp != nil { - return v.visitMemberExpression(memberExp.(fql.IMemberExpressionContext), scope) + return v.visitMemberExpression(memberExp, scope) } rangeOp := ctx.RangeOperator() if rangeOp != nil { - return v.visitRangeOperator(rangeOp.(fql.IRangeOperatorContext), scope) + return v.visitRangeOperator(rangeOp, scope) } param := ctx.Param() if param != nil { - return v.visitParam(param.(fql.IParamContext), scope) + return v.visitParam(param, scope) } return nil, core.Error(ErrInvalidDataSource, ctx.GetText()) @@ -710,7 +711,7 @@ func (v *visitor) visitForExpressionClause(c fql.IForExpressionClauseContext, sc limitCtx := ctx.LimitClause() if limitCtx != nil { - limit, offset, err := v.visitLimitClause(limitCtx.(fql.ILimitClauseContext), scope) + limit, offset, err := v.visitLimitClause(limitCtx, scope) if err != nil { return nil, err } @@ -723,7 +724,7 @@ func (v *visitor) visitForExpressionClause(c fql.IForExpressionClauseContext, sc filterCtx := ctx.FilterClause() if filterCtx != nil { - filterExp, err := v.visitFilterClause(filterCtx.(fql.IFilterClauseContext), scope) + filterExp, err := v.visitFilterClause(filterCtx, scope) if err != nil { return nil, err } @@ -736,7 +737,6 @@ func (v *visitor) visitForExpressionClause(c fql.IForExpressionClauseContext, sc sortCtx := ctx.SortClause() if sortCtx != nil { - sortCtx := sortCtx.(fql.ISortClauseContext) sortExps, err := v.visitSortClause(sortCtx, scope) if err != nil { return nil, err @@ -750,7 +750,6 @@ func (v *visitor) visitForExpressionClause(c fql.IForExpressionClauseContext, sc collectCtx := ctx.CollectClause() if collectCtx != nil { - collectCtx := collectCtx.(fql.ICollectClauseContext) params, err := v.visitCollectClause(collectCtx, scope, valVarName) if err != nil { return nil, err @@ -771,7 +770,7 @@ func (v *visitor) visitForExpressionStatement(c fql.IForExpressionStatementConte if variableCtx != nil { variableExp, err := v.visitVariableDeclaration( - variableCtx.(fql.IVariableDeclarationContext), + variableCtx, scope, ) if err != nil { @@ -787,7 +786,7 @@ func (v *visitor) visitForExpressionStatement(c fql.IForExpressionStatementConte if fnCallCtx != nil { fnCallExp, err := v.visitFunctionCallExpression( - fnCallCtx.(fql.IFunctionCallExpressionContext), + fnCallCtx, scope, ) if err != nil { @@ -1108,7 +1107,7 @@ func (v *visitor) visitPropertyName(c fql.IPropertyNameContext, scope *scope) (c return literals.NewStringLiteral(rw.GetText()), nil } - if rw := ctx.UnsafReservedWord(); rw != nil { + if rw := ctx.UnsafeReservedWord(); rw != nil { return literals.NewStringLiteral(rw.GetText()), nil } @@ -1136,7 +1135,7 @@ func (v *visitor) visitArrayLiteral(c fql.IArrayLiteralContext, scope *scope) (c list := ctx.ArgumentList() if list == nil { - return literals.NewArrayLiteralWith(make([]core.Expression, 0, 0)), nil + return literals.NewArrayLiteralWith(make([]core.Expression, 0)), nil } elements, err := v.visitArgumentList(list, scope) @@ -1258,7 +1257,7 @@ func (v *visitor) visitVariableDeclaration(c fql.IVariableDeclarationContext, sc } if exp := ctx.Expression(); exp != nil { - init, err = v.visitExpression(ctx.Expression().(fql.IExpressionContext), scope) + init, err = v.visitExpression(ctx.Expression(), scope) } if err != nil { @@ -1373,7 +1372,7 @@ func (v *visitor) visitArgumentList(c fql.IArgumentListContext, scope *scope) ([ args := make([]core.Expression, 0, len(exps)) for _, arg := range exps { - exp, err := v.visitExpression(arg.(fql.IExpressionContext), scope) + exp, err := v.visitExpression(arg, scope) if err != nil { return nil, err @@ -1454,7 +1453,7 @@ func (v *visitor) visitExpression(c fql.IExpressionContext, scope *scope) (core. } if ctx.GetTernaryOperator() != nil { - cond, err := v.visitExpression(ctx.GetCondition().(fql.IExpressionContext), scope) + cond, err := v.visitExpression(ctx.GetCondition(), scope) if err != nil { return nil, err @@ -1463,7 +1462,7 @@ func (v *visitor) visitExpression(c fql.IExpressionContext, scope *scope) (core. var consequent core.Expression if onTrue := ctx.GetOnTrue(); onTrue != nil { - exp, err := v.visitExpression(onTrue.(fql.IExpressionContext), scope) + exp, err := v.visitExpression(onTrue, scope) if err != nil { return nil, err @@ -1472,7 +1471,7 @@ func (v *visitor) visitExpression(c fql.IExpressionContext, scope *scope) (core. consequent = exp } - alternate, err := v.visitExpression(ctx.GetOnFalse().(fql.IExpressionContext), scope) + alternate, err := v.visitExpression(ctx.GetOnFalse(), scope) if err != nil { return nil, err diff --git a/pkg/drivers/cdp/dom/loader.go b/pkg/drivers/cdp/dom/loader.go index 5d9ccc748..3586cc383 100644 --- a/pkg/drivers/cdp/dom/loader.go +++ b/pkg/drivers/cdp/dom/loader.go @@ -3,10 +3,11 @@ package dom import ( "context" - "github.com/MontFerret/ferret/pkg/drivers/cdp/eval" - "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/mafredri/cdp/protocol/page" "github.com/mafredri/cdp/protocol/runtime" + + "github.com/MontFerret/ferret/pkg/drivers/cdp/eval" + "github.com/MontFerret/ferret/pkg/runtime/core" ) type NodeLoader struct { diff --git a/pkg/drivers/cdp/eval/function.go b/pkg/drivers/cdp/eval/function.go index c7d2734a6..702ac7b9c 100644 --- a/pkg/drivers/cdp/eval/function.go +++ b/pkg/drivers/cdp/eval/function.go @@ -1,12 +1,14 @@ package eval import ( - "github.com/MontFerret/ferret/pkg/drivers" - "github.com/MontFerret/ferret/pkg/runtime/core" - "github.com/mafredri/cdp/protocol/runtime" - "github.com/wI2L/jettison" "strconv" "strings" + + "github.com/mafredri/cdp/protocol/runtime" + "github.com/wI2L/jettison" + + "github.com/MontFerret/ferret/pkg/drivers" + "github.com/MontFerret/ferret/pkg/runtime/core" ) type Function struct { diff --git a/pkg/drivers/cdp/eval/runtime.go b/pkg/drivers/cdp/eval/runtime.go index cfeb11631..844be8842 100644 --- a/pkg/drivers/cdp/eval/runtime.go +++ b/pkg/drivers/cdp/eval/runtime.go @@ -98,13 +98,17 @@ func (rt *Runtime) EvalValue(ctx context.Context, fn *Function) (core.Value, err return rt.resolver.ToValue(ctx, out) } -func (rt *Runtime) EvalElement(ctx context.Context, fn *Function) (drivers.HTMLElement, error) { +func (rt *Runtime) EvalElement(ctx context.Context, fn *Function) (core.Value, error) { ref, err := rt.EvalRef(ctx, fn) if err != nil { return nil, err } + if ref.ObjectID == nil { + return values.None, nil + } + return rt.resolver.ToElement(ctx, ref) } diff --git a/pkg/drivers/cdp/events/loop_test.go b/pkg/drivers/cdp/events/loop_test.go index 92427ea5c..2e0704de9 100644 --- a/pkg/drivers/cdp/events/loop_test.go +++ b/pkg/drivers/cdp/events/loop_test.go @@ -2,13 +2,15 @@ package events_test import ( "context" - "github.com/MontFerret/ferret/pkg/drivers/cdp/events" - "github.com/mafredri/cdp/rpcc" - . "github.com/smartystreets/goconvey/convey" "sync" "sync/atomic" "testing" "time" + + "github.com/mafredri/cdp/rpcc" + . "github.com/smartystreets/goconvey/convey" + + "github.com/MontFerret/ferret/pkg/drivers/cdp/events" ) type TestEventStream struct { diff --git a/pkg/drivers/cdp/events/source.go b/pkg/drivers/cdp/events/source.go index 0ac8e4b4e..4e32d3384 100644 --- a/pkg/drivers/cdp/events/source.go +++ b/pkg/drivers/cdp/events/source.go @@ -2,6 +2,7 @@ package events import ( "context" + "github.com/mafredri/cdp/rpcc" ) diff --git a/pkg/drivers/cdp/events/stream.go b/pkg/drivers/cdp/events/stream.go index a4d45f958..a1caceafe 100644 --- a/pkg/drivers/cdp/events/stream.go +++ b/pkg/drivers/cdp/events/stream.go @@ -2,10 +2,12 @@ package events import ( "context" + + "github.com/mafredri/cdp/rpcc" + "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/events" "github.com/MontFerret/ferret/pkg/runtime/values" - "github.com/mafredri/cdp/rpcc" ) type ( diff --git a/pkg/drivers/cdp/events/stream_test.go b/pkg/drivers/cdp/events/stream_test.go index ca9348a72..5bc619c17 100644 --- a/pkg/drivers/cdp/events/stream_test.go +++ b/pkg/drivers/cdp/events/stream_test.go @@ -2,15 +2,17 @@ package events_test import ( "context" + "testing" + "time" + + "github.com/mafredri/cdp/rpcc" + "github.com/pkg/errors" + "github.com/stretchr/testify/mock" + events2 "github.com/MontFerret/ferret/pkg/drivers/cdp/events" "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/events" "github.com/MontFerret/ferret/pkg/runtime/values" - "github.com/mafredri/cdp/rpcc" - "github.com/pkg/errors" - "github.com/stretchr/testify/mock" - "testing" - "time" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/drivers/cdp/helpers.go b/pkg/drivers/cdp/helpers.go index e67a8055d..0c0e323e8 100644 --- a/pkg/drivers/cdp/helpers.go +++ b/pkg/drivers/cdp/helpers.go @@ -2,10 +2,12 @@ package cdp import ( "context" + + "github.com/mafredri/cdp/protocol/dom" + "github.com/MontFerret/ferret/pkg/runtime/events" "github.com/mafredri/cdp" - "github.com/mafredri/cdp/protocol/dom" "github.com/mafredri/cdp/protocol/emulation" "github.com/mafredri/cdp/protocol/network" "github.com/mafredri/cdp/protocol/page" @@ -66,7 +68,7 @@ func enableFeatures(ctx context.Context, client *cdp.Client, params drivers.Para }, func() error { - return client.DOM.Enable(ctx, dom.NewEnableArgs()) + return client.DOM.Enable(ctx, dom.NewEnableArgs().SetIncludeWhitespace("all")) }, func() error { diff --git a/pkg/drivers/cdp/network/event.go b/pkg/drivers/cdp/network/event.go index ceb7f9bc3..9149bd4bf 100644 --- a/pkg/drivers/cdp/network/event.go +++ b/pkg/drivers/cdp/network/event.go @@ -2,10 +2,12 @@ package network import ( "context" - "github.com/MontFerret/ferret/pkg/drivers/cdp/dom" + "github.com/mafredri/cdp/protocol/page" "github.com/wI2L/jettison" + "github.com/MontFerret/ferret/pkg/drivers/cdp/dom" + "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" ) diff --git a/pkg/drivers/cdp/templates/attributes.go b/pkg/drivers/cdp/templates/attributes.go index 6bb8eee33..24d9045ab 100644 --- a/pkg/drivers/cdp/templates/attributes.go +++ b/pkg/drivers/cdp/templates/attributes.go @@ -2,9 +2,11 @@ package templates import ( "fmt" + + "github.com/mafredri/cdp/protocol/runtime" + "github.com/MontFerret/ferret/pkg/drivers/cdp/eval" "github.com/MontFerret/ferret/pkg/runtime/values" - "github.com/mafredri/cdp/protocol/runtime" ) const getAttribute = `(el, name) => { diff --git a/pkg/drivers/cdp/templates/blur.go b/pkg/drivers/cdp/templates/blur.go index 07fe4a47a..1866c8012 100644 --- a/pkg/drivers/cdp/templates/blur.go +++ b/pkg/drivers/cdp/templates/blur.go @@ -3,9 +3,10 @@ package templates import ( "fmt" + "github.com/mafredri/cdp/protocol/runtime" + "github.com/MontFerret/ferret/pkg/drivers" "github.com/MontFerret/ferret/pkg/drivers/cdp/eval" - "github.com/mafredri/cdp/protocol/runtime" ) const blur = `(el) => { diff --git a/pkg/drivers/cdp/templates/children.go b/pkg/drivers/cdp/templates/children.go index 4b7a99b98..90d3db5fb 100644 --- a/pkg/drivers/cdp/templates/children.go +++ b/pkg/drivers/cdp/templates/children.go @@ -1,9 +1,10 @@ package templates import ( + "github.com/mafredri/cdp/protocol/runtime" + "github.com/MontFerret/ferret/pkg/drivers/cdp/eval" "github.com/MontFerret/ferret/pkg/runtime/values" - "github.com/mafredri/cdp/protocol/runtime" ) const getChildren = "(el) => Array.from(el.children)" diff --git a/pkg/drivers/cdp/templates/helpers.go b/pkg/drivers/cdp/templates/helpers.go index d1ef8284c..39f670ebe 100644 --- a/pkg/drivers/cdp/templates/helpers.go +++ b/pkg/drivers/cdp/templates/helpers.go @@ -2,6 +2,7 @@ package templates import ( "fmt" + "github.com/MontFerret/ferret/pkg/drivers" "github.com/MontFerret/ferret/pkg/drivers/cdp/eval" ) diff --git a/pkg/drivers/cdp/templates/inner_html.go b/pkg/drivers/cdp/templates/inner_html.go index f7586682e..ecdf216d7 100644 --- a/pkg/drivers/cdp/templates/inner_html.go +++ b/pkg/drivers/cdp/templates/inner_html.go @@ -2,10 +2,12 @@ package templates import ( "fmt" + + "github.com/mafredri/cdp/protocol/runtime" + "github.com/MontFerret/ferret/pkg/drivers" "github.com/MontFerret/ferret/pkg/drivers/cdp/eval" "github.com/MontFerret/ferret/pkg/runtime/values" - "github.com/mafredri/cdp/protocol/runtime" ) const setInnerHTML = `(el, value) => { diff --git a/pkg/drivers/cdp/templates/inner_text.go b/pkg/drivers/cdp/templates/inner_text.go index 09a800529..85ac77734 100644 --- a/pkg/drivers/cdp/templates/inner_text.go +++ b/pkg/drivers/cdp/templates/inner_text.go @@ -2,10 +2,12 @@ package templates import ( "fmt" + + "github.com/mafredri/cdp/protocol/runtime" + "github.com/MontFerret/ferret/pkg/drivers" "github.com/MontFerret/ferret/pkg/drivers/cdp/eval" "github.com/MontFerret/ferret/pkg/runtime/values" - "github.com/mafredri/cdp/protocol/runtime" ) const setInnerText = `(el, value) => { diff --git a/pkg/drivers/cdp/templates/parent.go b/pkg/drivers/cdp/templates/parent.go index 826263d72..3b43e6752 100644 --- a/pkg/drivers/cdp/templates/parent.go +++ b/pkg/drivers/cdp/templates/parent.go @@ -1,8 +1,9 @@ package templates import ( - "github.com/MontFerret/ferret/pkg/drivers/cdp/eval" "github.com/mafredri/cdp/protocol/runtime" + + "github.com/MontFerret/ferret/pkg/drivers/cdp/eval" ) const getParent = "(el) => el.parentElement" diff --git a/pkg/drivers/cdp/templates/query.go b/pkg/drivers/cdp/templates/query.go index 382f4413e..678dc29ca 100644 --- a/pkg/drivers/cdp/templates/query.go +++ b/pkg/drivers/cdp/templates/query.go @@ -2,9 +2,11 @@ package templates import ( "fmt" + + "github.com/mafredri/cdp/protocol/runtime" + "github.com/MontFerret/ferret/pkg/drivers" "github.com/MontFerret/ferret/pkg/drivers/cdp/eval" - "github.com/mafredri/cdp/protocol/runtime" ) const ( @@ -14,27 +16,21 @@ const ( ) var ( - queryCSSSelector = fmt.Sprintf(` + queryCSSSelector = ` (el, selector) => { const found = el.querySelector(selector); - %s - return found; } - `, - notFoundErrorFragment, - ) + ` queryXPathSelector = fmt.Sprintf(` (el, selector) => { %s - - %s return found; } `, - xpathAsElementFragment, notFoundErrorFragment, + xpathAsElementFragment, ) ) diff --git a/pkg/drivers/cdp/templates/select.go b/pkg/drivers/cdp/templates/select.go index 86a0db51f..9b5238a31 100644 --- a/pkg/drivers/cdp/templates/select.go +++ b/pkg/drivers/cdp/templates/select.go @@ -2,10 +2,12 @@ package templates import ( "fmt" + + "github.com/mafredri/cdp/protocol/runtime" + "github.com/MontFerret/ferret/pkg/drivers" "github.com/MontFerret/ferret/pkg/drivers/cdp/eval" "github.com/MontFerret/ferret/pkg/runtime/values" - "github.com/mafredri/cdp/protocol/runtime" ) const selectFragment = ` diff --git a/pkg/drivers/cdp/templates/siblings.go b/pkg/drivers/cdp/templates/siblings.go index 1c70c77fa..0b4ccb9b8 100644 --- a/pkg/drivers/cdp/templates/siblings.go +++ b/pkg/drivers/cdp/templates/siblings.go @@ -1,8 +1,9 @@ package templates import ( - "github.com/MontFerret/ferret/pkg/drivers/cdp/eval" "github.com/mafredri/cdp/protocol/runtime" + + "github.com/MontFerret/ferret/pkg/drivers/cdp/eval" ) const getPreviousElementSibling = "(el) => el.previousElementSibling" diff --git a/pkg/drivers/cdp/templates/styles.go b/pkg/drivers/cdp/templates/styles.go index cb68057b1..19ea0a76f 100644 --- a/pkg/drivers/cdp/templates/styles.go +++ b/pkg/drivers/cdp/templates/styles.go @@ -1,9 +1,10 @@ package templates import ( + "github.com/mafredri/cdp/protocol/runtime" + "github.com/MontFerret/ferret/pkg/drivers/cdp/eval" "github.com/MontFerret/ferret/pkg/runtime/values" - "github.com/mafredri/cdp/protocol/runtime" ) const getStyles = `(el) => { diff --git a/pkg/drivers/cdp/templates/value.go b/pkg/drivers/cdp/templates/value.go index 778e59631..6b2210901 100644 --- a/pkg/drivers/cdp/templates/value.go +++ b/pkg/drivers/cdp/templates/value.go @@ -1,9 +1,10 @@ package templates import ( + "github.com/mafredri/cdp/protocol/runtime" + "github.com/MontFerret/ferret/pkg/drivers/cdp/eval" "github.com/MontFerret/ferret/pkg/runtime/core" - "github.com/mafredri/cdp/protocol/runtime" ) const getValue = `(el) => { diff --git a/pkg/drivers/cdp/templates/wait.go b/pkg/drivers/cdp/templates/wait.go index 12b2d54c6..3fd828215 100644 --- a/pkg/drivers/cdp/templates/wait.go +++ b/pkg/drivers/cdp/templates/wait.go @@ -2,11 +2,13 @@ package templates import ( "fmt" + + "github.com/mafredri/cdp/protocol/runtime" + "github.com/MontFerret/ferret/pkg/drivers" "github.com/MontFerret/ferret/pkg/drivers/cdp/eval" "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" - "github.com/mafredri/cdp/protocol/runtime" ) const ( diff --git a/pkg/drivers/cdp/templates/xpath.go b/pkg/drivers/cdp/templates/xpath.go index 3dd83446a..426e04b51 100644 --- a/pkg/drivers/cdp/templates/xpath.go +++ b/pkg/drivers/cdp/templates/xpath.go @@ -2,9 +2,11 @@ package templates import ( "fmt" + + "github.com/mafredri/cdp/protocol/runtime" + "github.com/MontFerret/ferret/pkg/drivers/cdp/eval" "github.com/MontFerret/ferret/pkg/runtime/values" - "github.com/mafredri/cdp/protocol/runtime" ) const xpath = `(el, expression, resType) => { diff --git a/pkg/drivers/common/errors.go b/pkg/drivers/common/errors.go index 2f3f94f1f..22af84b0c 100644 --- a/pkg/drivers/common/errors.go +++ b/pkg/drivers/common/errors.go @@ -3,8 +3,9 @@ package common import ( "io" - "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/rs/zerolog" + + "github.com/MontFerret/ferret/pkg/runtime/core" ) var ( diff --git a/pkg/drivers/common/styles_test.go b/pkg/drivers/common/styles_test.go index a994ce0a0..df95c67d2 100644 --- a/pkg/drivers/common/styles_test.go +++ b/pkg/drivers/common/styles_test.go @@ -2,10 +2,11 @@ package common_test import ( "bytes" + "testing" + "github.com/MontFerret/ferret/pkg/drivers/common" "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/drivers/container.go b/pkg/drivers/container.go index 0d740569f..2a21a77db 100644 --- a/pkg/drivers/container.go +++ b/pkg/drivers/container.go @@ -2,6 +2,7 @@ package drivers import ( "context" + "github.com/MontFerret/ferret/pkg/runtime/core" ) diff --git a/pkg/drivers/cookie.go b/pkg/drivers/cookie.go index 9560aacbb..21989e03b 100644 --- a/pkg/drivers/cookie.go +++ b/pkg/drivers/cookie.go @@ -136,7 +136,8 @@ func (c HTTPCookie) Hash() uint64 { } func (c HTTPCookie) Copy() core.Value { - return *(&c) + cop := c + return &cop } func (c HTTPCookie) MarshalJSON() ([]byte, error) { diff --git a/pkg/drivers/headers.go b/pkg/drivers/headers.go index 2757dbca3..f3b13c7c8 100644 --- a/pkg/drivers/headers.go +++ b/pkg/drivers/headers.go @@ -9,9 +9,10 @@ import ( "sort" "strings" + "github.com/wI2L/jettison" + "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" - "github.com/wI2L/jettison" ) // HTTPHeaders HTTP header object diff --git a/pkg/drivers/http/element.go b/pkg/drivers/http/element.go index c7a753276..a20a706dc 100644 --- a/pkg/drivers/http/element.go +++ b/pkg/drivers/http/element.go @@ -2,10 +2,11 @@ package http import ( "context" - "golang.org/x/net/html" "hash/fnv" "strings" + "golang.org/x/net/html" + "github.com/PuerkitoBio/goquery" "github.com/wI2L/jettison" diff --git a/pkg/drivers/http/element_test.go b/pkg/drivers/http/element_test.go index 4911cc3a2..35c98abe5 100644 --- a/pkg/drivers/http/element_test.go +++ b/pkg/drivers/http/element_test.go @@ -3,12 +3,15 @@ package http_test import ( "bytes" "context" + "testing" + + "github.com/PuerkitoBio/goquery" + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/drivers" "github.com/MontFerret/ferret/pkg/drivers/http" "github.com/MontFerret/ferret/pkg/runtime/values" - "github.com/PuerkitoBio/goquery" - . "github.com/smartystreets/goconvey/convey" - "testing" + "github.com/MontFerret/ferret/pkg/runtime/values/types" ) func TestElement(t *testing.T) { @@ -447,5 +450,55 @@ func TestElement(t *testing.T) { So(err, ShouldBeNil) So(nt.String(), ShouldEqual, "[\"Album example for Bootstrap\"]") }) + + Convey("Func", func() { + buff := bytes.NewBuffer([]byte(doc)) + + buff.Write([]byte(doc)) + + doc, err := goquery.NewDocumentFromReader(buff) + + So(err, ShouldBeNil) + + el, err := http.NewHTMLElement(doc.Find("html")) + + So(err, ShouldBeNil) + + nt, err := el.XPath(context.Background(), values.NewString("count(//div)")) + + So(err, ShouldBeNil) + So(nt.Type().String(), ShouldEqual, types.Float.String()) + }) + + Convey("Attributes", func() { + buff := bytes.NewBuffer([]byte(`
`)) + godoc, err := goquery.NewDocumentFromReader(buff) + So(err, ShouldBeNil) + + doc, err := http.NewRootHTMLDocument(godoc, "localhost:9090") + So(err, ShouldBeNil) + + nt, err := doc.XPath(context.Background(), values.NewString("//a/@title")) + + So(err, ShouldBeNil) + So(nt.Type().String(), ShouldEqual, types.Array.String()) + So(nt.(*values.Array).First().Type().String(), ShouldEqual, types.String.String()) + So(nt.(*values.Array).First().String(), ShouldEqual, "30") + }) + + Convey("Element node", func() { + buff := bytes.NewBuffer([]byte(`
`)) + godoc, err := goquery.NewDocumentFromReader(buff) + So(err, ShouldBeNil) + + doc, err := http.NewRootHTMLDocument(godoc, "localhost:9090") + So(err, ShouldBeNil) + + nt, err := doc.XPath(context.Background(), values.NewString("//div")) + + So(err, ShouldBeNil) + So(nt.Type().String(), ShouldEqual, types.Array.String()) + So(nt.(*values.Array).First().Type().String(), ShouldEqual, drivers.HTMLElementType.String()) + }) }) } diff --git a/pkg/drivers/http/page.go b/pkg/drivers/http/page.go index d3a93ce74..ea554da5c 100644 --- a/pkg/drivers/http/page.go +++ b/pkg/drivers/http/page.go @@ -2,9 +2,10 @@ package http import ( "context" - "github.com/MontFerret/ferret/pkg/runtime/events" "hash/fnv" + "github.com/MontFerret/ferret/pkg/runtime/events" + "github.com/PuerkitoBio/goquery" "github.com/MontFerret/ferret/pkg/drivers" diff --git a/pkg/drivers/http/xpath.go b/pkg/drivers/http/xpath.go index 73258b927..540affd04 100644 --- a/pkg/drivers/http/xpath.go +++ b/pkg/drivers/http/xpath.go @@ -84,12 +84,15 @@ func EvalXPathTo(selection *goquery.Selection, expression string) (core.Value, e for res.MoveNext() { var item core.Value - node := res.Current().(*htmlquery.NodeNavigator).Current() - - if node.Type == html.TextNode { - item = values.NewString(node.Data) - } else { - i, err := parseXPathNode(node) + node := res.Current() + + switch node.NodeType() { + case xpath.TextNode: + item = values.NewString(node.Value()) + case xpath.AttributeNode: + item = values.NewString(node.Value()) + default: + i, err := parseXPathNode(node.(*htmlquery.NodeNavigator).Current()) if err != nil { return nil, err diff --git a/pkg/drivers/pdf.go b/pkg/drivers/pdf.go index ac8ef3211..408de0dec 100644 --- a/pkg/drivers/pdf.go +++ b/pkg/drivers/pdf.go @@ -26,8 +26,6 @@ type PDFParams struct { MarginRight values.Float // Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages. PageRanges values.String - // Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. Defaults to false. - IgnoreInvalidPageRanges values.Boolean // HTML template for the print values. Should be valid HTML markup with following classes used to inject printing values into them: - `date`: formatted print date - `title`: document title - `url`: document location - `pageNumber`: current page number - `totalPages`: total pages in the document // For example, `` would generate span containing the title. HeaderTemplate values.String diff --git a/pkg/drivers/request.go b/pkg/drivers/request.go index b2a32b619..679b4ca77 100644 --- a/pkg/drivers/request.go +++ b/pkg/drivers/request.go @@ -2,10 +2,12 @@ package drivers import ( "context" + + "github.com/wI2L/jettison" + "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/runtime/values/types" - "github.com/wI2L/jettison" ) // HTTPRequest HTTP request object. @@ -76,7 +78,8 @@ func (req *HTTPRequest) Hash() uint64 { } func (req *HTTPRequest) Copy() core.Value { - return *(&req) + cop := *req + return &cop } func (req *HTTPRequest) GetIn(ctx context.Context, path []core.Value) (core.Value, core.PathError) { diff --git a/pkg/drivers/response.go b/pkg/drivers/response.go index 3719ab4b6..79025fdf9 100644 --- a/pkg/drivers/response.go +++ b/pkg/drivers/response.go @@ -68,7 +68,8 @@ func (resp *HTTPResponse) Unwrap() interface{} { } func (resp *HTTPResponse) Copy() core.Value { - return *(&resp) + cop := *resp + return &cop } func (resp *HTTPResponse) Hash() uint64 { diff --git a/pkg/drivers/screenshot.go b/pkg/drivers/screenshot.go index e48318bfa..45277deb1 100644 --- a/pkg/drivers/screenshot.go +++ b/pkg/drivers/screenshot.go @@ -28,20 +28,19 @@ func IsScreenshotFormatValid(format string) bool { func NewDefaultHTMLPDFParams() PDFParams { return PDFParams{ - Landscape: values.False, - DisplayHeaderFooter: values.False, - PrintBackground: values.False, - Scale: values.Float(1), - PaperWidth: values.Float(8.5), - PaperHeight: values.Float(11), - MarginTop: values.Float(0.4), - MarginBottom: values.Float(0.4), - MarginLeft: values.Float(0.4), - MarginRight: values.Float(0.4), - PageRanges: values.EmptyString, - IgnoreInvalidPageRanges: values.False, - HeaderTemplate: values.EmptyString, - FooterTemplate: values.EmptyString, - PreferCSSPageSize: values.False, + Landscape: values.False, + DisplayHeaderFooter: values.False, + PrintBackground: values.False, + Scale: values.Float(1), + PaperWidth: values.Float(8.5), + PaperHeight: values.Float(11), + MarginTop: values.Float(0.4), + MarginBottom: values.Float(0.4), + MarginLeft: values.Float(0.4), + MarginRight: values.Float(0.4), + PageRanges: values.EmptyString, + HeaderTemplate: values.EmptyString, + FooterTemplate: values.EmptyString, + PreferCSSPageSize: values.False, } } diff --git a/pkg/drivers/scroll.go b/pkg/drivers/scroll.go index d22fc6f3c..ca642ed4c 100644 --- a/pkg/drivers/scroll.go +++ b/pkg/drivers/scroll.go @@ -1,9 +1,11 @@ package drivers import ( - "github.com/MontFerret/ferret/pkg/runtime/values" - "github.com/wI2L/jettison" "strings" + + "github.com/wI2L/jettison" + + "github.com/MontFerret/ferret/pkg/runtime/values" ) // ScrollBehavior defines the transition animation. diff --git a/pkg/drivers/value.go b/pkg/drivers/value.go index 3f3ec044c..6cc0a4d1c 100644 --- a/pkg/drivers/value.go +++ b/pkg/drivers/value.go @@ -2,9 +2,10 @@ package drivers import ( "context" - "github.com/MontFerret/ferret/pkg/runtime/events" "io" + "github.com/MontFerret/ferret/pkg/runtime/events" + "github.com/MontFerret/ferret/pkg/runtime/collections" "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" diff --git a/pkg/parser/antlr/FqlParser.g4 b/pkg/parser/antlr/FqlParser.g4 index 5f3f9786b..4e0bb7ae6 100644 --- a/pkg/parser/antlr/FqlParser.g4 +++ b/pkg/parser/antlr/FqlParser.g4 @@ -94,7 +94,7 @@ limitClause ; limitClauseValue - : IntegerLiteral + : integerLiteral | param | variable | functionCallExpression @@ -171,6 +171,7 @@ timeoutClause param : Param Identifier + | Param safeReservedWord ; variable @@ -232,7 +233,7 @@ propertyName | stringLiteral | param | safeReservedWord - | unsafReservedWord + | unsafeReservedWord ; namespaceIdentifier @@ -266,7 +267,7 @@ functionCall functionName : Identifier | safeReservedWord - | unsafReservedWord + | unsafeReservedWord ; argumentList @@ -300,7 +301,7 @@ safeReservedWord | Current ; -unsafReservedWord +unsafeReservedWord : Return | None | Null diff --git a/pkg/parser/case_changing_stream.go b/pkg/parser/case_changing_stream.go index e9178e135..c4044dfe5 100644 --- a/pkg/parser/case_changing_stream.go +++ b/pkg/parser/case_changing_stream.go @@ -3,21 +3,20 @@ package parser import ( "unicode" - "github.com/antlr/antlr4/runtime/Go/antlr" + "github.com/antlr/antlr4/runtime/Go/antlr/v4" ) // CaseChangingStream wraps an existing CharStream, but upper cases, or // lower cases the input before it is tokenized. type CaseChangingStream struct { antlr.CharStream - upper bool } // newCaseChangingStream returns a new CaseChangingStream that forces // all tokens read from the underlying stream to be either upper case // or lower case based on the upper argument. -func newCaseChangingStream(in antlr.CharStream, upper bool) *CaseChangingStream { +func newCaseChangingStream(in antlr.CharStream, upper bool) antlr.CharStream { return &CaseChangingStream{in, upper} } diff --git a/pkg/parser/fql/FqlLexer.interp b/pkg/parser/fql/FqlLexer.interp index 553689fc2..6e342484a 100644 --- a/pkg/parser/fql/FqlLexer.interp +++ b/pkg/parser/fql/FqlLexer.interp @@ -242,4 +242,4 @@ mode names: DEFAULT_MODE atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 74, 623, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 4, 84, 9, 84, 4, 85, 9, 85, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 176, 10, 2, 12, 2, 14, 2, 179, 11, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 190, 10, 3, 12, 3, 14, 3, 193, 11, 3, 3, 3, 3, 3, 3, 4, 6, 4, 198, 10, 4, 13, 4, 14, 4, 199, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 5, 29, 265, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 271, 10, 30, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 48, 3, 48, 3, 48, 3, 48, 5, 48, 375, 10, 48, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 5, 51, 405, 10, 51, 3, 52, 3, 52, 3, 52, 3, 52, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 62, 3, 62, 3, 62, 3, 62, 5, 62, 465, 10, 62, 3, 63, 3, 63, 3, 63, 3, 64, 3, 64, 3, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 66, 3, 66, 3, 67, 6, 67, 482, 10, 67, 13, 67, 14, 67, 483, 3, 67, 3, 67, 7, 67, 488, 10, 67, 12, 67, 14, 67, 491, 11, 67, 7, 67, 493, 10, 67, 12, 67, 14, 67, 496, 11, 67, 3, 67, 3, 67, 7, 67, 500, 10, 67, 12, 67, 14, 67, 503, 11, 67, 7, 67, 505, 10, 67, 12, 67, 14, 67, 508, 11, 67, 3, 68, 3, 68, 3, 69, 3, 69, 3, 69, 3, 69, 5, 69, 516, 10, 69, 3, 70, 6, 70, 519, 10, 70, 13, 70, 14, 70, 520, 3, 71, 3, 71, 3, 71, 6, 71, 526, 10, 71, 13, 71, 14, 71, 527, 3, 71, 5, 71, 531, 10, 71, 3, 71, 3, 71, 5, 71, 535, 10, 71, 5, 71, 537, 10, 71, 3, 72, 3, 72, 3, 72, 3, 73, 3, 73, 3, 74, 3, 74, 3, 75, 3, 75, 3, 75, 7, 75, 549, 10, 75, 12, 75, 14, 75, 552, 11, 75, 5, 75, 554, 10, 75, 3, 76, 3, 76, 5, 76, 558, 10, 76, 3, 76, 6, 76, 561, 10, 76, 13, 76, 14, 76, 562, 3, 77, 3, 77, 3, 78, 3, 78, 3, 79, 3, 79, 3, 80, 3, 80, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 7, 81, 579, 10, 81, 12, 81, 14, 81, 582, 11, 81, 3, 81, 3, 81, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 7, 82, 592, 10, 82, 12, 82, 14, 82, 595, 11, 82, 3, 82, 3, 82, 3, 83, 3, 83, 3, 83, 3, 83, 7, 83, 603, 10, 83, 12, 83, 14, 83, 606, 11, 83, 3, 83, 3, 83, 3, 84, 3, 84, 3, 84, 3, 84, 7, 84, 614, 10, 84, 12, 84, 14, 84, 617, 11, 84, 3, 84, 3, 84, 3, 85, 3, 85, 3, 85, 3, 177, 2, 86, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 91, 47, 93, 48, 95, 49, 97, 50, 99, 51, 101, 52, 103, 53, 105, 54, 107, 55, 109, 56, 111, 57, 113, 58, 115, 59, 117, 60, 119, 61, 121, 62, 123, 63, 125, 64, 127, 65, 129, 66, 131, 67, 133, 68, 135, 69, 137, 70, 139, 71, 141, 72, 143, 73, 145, 74, 147, 2, 149, 2, 151, 2, 153, 2, 155, 2, 157, 2, 159, 2, 161, 2, 163, 2, 165, 2, 167, 2, 169, 2, 3, 2, 14, 5, 2, 12, 12, 15, 15, 8234, 8235, 6, 2, 11, 11, 13, 14, 34, 34, 162, 162, 3, 2, 50, 59, 5, 2, 50, 59, 67, 72, 99, 104, 3, 2, 51, 59, 4, 2, 71, 71, 103, 103, 4, 2, 45, 45, 47, 47, 4, 2, 67, 92, 99, 124, 4, 2, 36, 36, 94, 94, 4, 2, 41, 41, 94, 94, 3, 2, 98, 98, 3, 2, 182, 182, 2, 647, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3, 2, 2, 2, 2, 95, 3, 2, 2, 2, 2, 97, 3, 2, 2, 2, 2, 99, 3, 2, 2, 2, 2, 101, 3, 2, 2, 2, 2, 103, 3, 2, 2, 2, 2, 105, 3, 2, 2, 2, 2, 107, 3, 2, 2, 2, 2, 109, 3, 2, 2, 2, 2, 111, 3, 2, 2, 2, 2, 113, 3, 2, 2, 2, 2, 115, 3, 2, 2, 2, 2, 117, 3, 2, 2, 2, 2, 119, 3, 2, 2, 2, 2, 121, 3, 2, 2, 2, 2, 123, 3, 2, 2, 2, 2, 125, 3, 2, 2, 2, 2, 127, 3, 2, 2, 2, 2, 129, 3, 2, 2, 2, 2, 131, 3, 2, 2, 2, 2, 133, 3, 2, 2, 2, 2, 135, 3, 2, 2, 2, 2, 137, 3, 2, 2, 2, 2, 139, 3, 2, 2, 2, 2, 141, 3, 2, 2, 2, 2, 143, 3, 2, 2, 2, 2, 145, 3, 2, 2, 2, 3, 171, 3, 2, 2, 2, 5, 185, 3, 2, 2, 2, 7, 197, 3, 2, 2, 2, 9, 203, 3, 2, 2, 2, 11, 207, 3, 2, 2, 2, 13, 209, 3, 2, 2, 2, 15, 211, 3, 2, 2, 2, 17, 213, 3, 2, 2, 2, 19, 215, 3, 2, 2, 2, 21, 217, 3, 2, 2, 2, 23, 219, 3, 2, 2, 2, 25, 221, 3, 2, 2, 2, 27, 223, 3, 2, 2, 2, 29, 225, 3, 2, 2, 2, 31, 227, 3, 2, 2, 2, 33, 229, 3, 2, 2, 2, 35, 231, 3, 2, 2, 2, 37, 234, 3, 2, 2, 2, 39, 237, 3, 2, 2, 2, 41, 240, 3, 2, 2, 2, 43, 243, 3, 2, 2, 2, 45, 245, 3, 2, 2, 2, 47, 247, 3, 2, 2, 2, 49, 249, 3, 2, 2, 2, 51, 251, 3, 2, 2, 2, 53, 253, 3, 2, 2, 2, 55, 256, 3, 2, 2, 2, 57, 264, 3, 2, 2, 2, 59, 270, 3, 2, 2, 2, 61, 272, 3, 2, 2, 2, 63, 275, 3, 2, 2, 2, 65, 277, 3, 2, 2, 2, 67, 279, 3, 2, 2, 2, 69, 282, 3, 2, 2, 2, 71, 285, 3, 2, 2, 2, 73, 289, 3, 2, 2, 2, 75, 296, 3, 2, 2, 2, 77, 304, 3, 2, 2, 2, 79, 312, 3, 2, 2, 2, 81, 320, 3, 2, 2, 2, 83, 329, 3, 2, 2, 2, 85, 336, 3, 2, 2, 2, 87, 344, 3, 2, 2, 2, 89, 349, 3, 2, 2, 2, 91, 355, 3, 2, 2, 2, 93, 359, 3, 2, 2, 2, 95, 374, 3, 2, 2, 2, 97, 376, 3, 2, 2, 2, 99, 381, 3, 2, 2, 2, 101, 404, 3, 2, 2, 2, 103, 406, 3, 2, 2, 2, 105, 410, 3, 2, 2, 2, 107, 415, 3, 2, 2, 2, 109, 420, 3, 2, 2, 2, 111, 425, 3, 2, 2, 2, 113, 431, 3, 2, 2, 2, 115, 435, 3, 2, 2, 2, 117, 439, 3, 2, 2, 2, 119, 449, 3, 2, 2, 2, 121, 455, 3, 2, 2, 2, 123, 464, 3, 2, 2, 2, 125, 466, 3, 2, 2, 2, 127, 469, 3, 2, 2, 2, 129, 472, 3, 2, 2, 2, 131, 478, 3, 2, 2, 2, 133, 481, 3, 2, 2, 2, 135, 509, 3, 2, 2, 2, 137, 515, 3, 2, 2, 2, 139, 518, 3, 2, 2, 2, 141, 536, 3, 2, 2, 2, 143, 538, 3, 2, 2, 2, 145, 541, 3, 2, 2, 2, 147, 543, 3, 2, 2, 2, 149, 553, 3, 2, 2, 2, 151, 555, 3, 2, 2, 2, 153, 564, 3, 2, 2, 2, 155, 566, 3, 2, 2, 2, 157, 568, 3, 2, 2, 2, 159, 570, 3, 2, 2, 2, 161, 572, 3, 2, 2, 2, 163, 585, 3, 2, 2, 2, 165, 598, 3, 2, 2, 2, 167, 609, 3, 2, 2, 2, 169, 620, 3, 2, 2, 2, 171, 172, 7, 49, 2, 2, 172, 173, 7, 44, 2, 2, 173, 177, 3, 2, 2, 2, 174, 176, 11, 2, 2, 2, 175, 174, 3, 2, 2, 2, 176, 179, 3, 2, 2, 2, 177, 178, 3, 2, 2, 2, 177, 175, 3, 2, 2, 2, 178, 180, 3, 2, 2, 2, 179, 177, 3, 2, 2, 2, 180, 181, 7, 44, 2, 2, 181, 182, 7, 49, 2, 2, 182, 183, 3, 2, 2, 2, 183, 184, 8, 2, 2, 2, 184, 4, 3, 2, 2, 2, 185, 186, 7, 49, 2, 2, 186, 187, 7, 49, 2, 2, 187, 191, 3, 2, 2, 2, 188, 190, 10, 2, 2, 2, 189, 188, 3, 2, 2, 2, 190, 193, 3, 2, 2, 2, 191, 189, 3, 2, 2, 2, 191, 192, 3, 2, 2, 2, 192, 194, 3, 2, 2, 2, 193, 191, 3, 2, 2, 2, 194, 195, 8, 3, 2, 2, 195, 6, 3, 2, 2, 2, 196, 198, 9, 3, 2, 2, 197, 196, 3, 2, 2, 2, 198, 199, 3, 2, 2, 2, 199, 197, 3, 2, 2, 2, 199, 200, 3, 2, 2, 2, 200, 201, 3, 2, 2, 2, 201, 202, 8, 4, 2, 2, 202, 8, 3, 2, 2, 2, 203, 204, 9, 2, 2, 2, 204, 205, 3, 2, 2, 2, 205, 206, 8, 5, 2, 2, 206, 10, 3, 2, 2, 2, 207, 208, 7, 60, 2, 2, 208, 12, 3, 2, 2, 2, 209, 210, 7, 61, 2, 2, 210, 14, 3, 2, 2, 2, 211, 212, 7, 48, 2, 2, 212, 16, 3, 2, 2, 2, 213, 214, 7, 46, 2, 2, 214, 18, 3, 2, 2, 2, 215, 216, 7, 93, 2, 2, 216, 20, 3, 2, 2, 2, 217, 218, 7, 95, 2, 2, 218, 22, 3, 2, 2, 2, 219, 220, 7, 42, 2, 2, 220, 24, 3, 2, 2, 2, 221, 222, 7, 43, 2, 2, 222, 26, 3, 2, 2, 2, 223, 224, 7, 125, 2, 2, 224, 28, 3, 2, 2, 2, 225, 226, 7, 127, 2, 2, 226, 30, 3, 2, 2, 2, 227, 228, 7, 64, 2, 2, 228, 32, 3, 2, 2, 2, 229, 230, 7, 62, 2, 2, 230, 34, 3, 2, 2, 2, 231, 232, 7, 63, 2, 2, 232, 233, 7, 63, 2, 2, 233, 36, 3, 2, 2, 2, 234, 235, 7, 64, 2, 2, 235, 236, 7, 63, 2, 2, 236, 38, 3, 2, 2, 2, 237, 238, 7, 62, 2, 2, 238, 239, 7, 63, 2, 2, 239, 40, 3, 2, 2, 2, 240, 241, 7, 35, 2, 2, 241, 242, 7, 63, 2, 2, 242, 42, 3, 2, 2, 2, 243, 244, 7, 44, 2, 2, 244, 44, 3, 2, 2, 2, 245, 246, 7, 49, 2, 2, 246, 46, 3, 2, 2, 2, 247, 248, 7, 39, 2, 2, 248, 48, 3, 2, 2, 2, 249, 250, 7, 45, 2, 2, 250, 50, 3, 2, 2, 2, 251, 252, 7, 47, 2, 2, 252, 52, 3, 2, 2, 2, 253, 254, 7, 47, 2, 2, 254, 255, 7, 47, 2, 2, 255, 54, 3, 2, 2, 2, 256, 257, 7, 45, 2, 2, 257, 258, 7, 45, 2, 2, 258, 56, 3, 2, 2, 2, 259, 260, 7, 67, 2, 2, 260, 261, 7, 80, 2, 2, 261, 265, 7, 70, 2, 2, 262, 263, 7, 40, 2, 2, 263, 265, 7, 40, 2, 2, 264, 259, 3, 2, 2, 2, 264, 262, 3, 2, 2, 2, 265, 58, 3, 2, 2, 2, 266, 267, 7, 81, 2, 2, 267, 271, 7, 84, 2, 2, 268, 269, 7, 126, 2, 2, 269, 271, 7, 126, 2, 2, 270, 266, 3, 2, 2, 2, 270, 268, 3, 2, 2, 2, 271, 60, 3, 2, 2, 2, 272, 273, 5, 15, 8, 2, 273, 274, 5, 15, 8, 2, 274, 62, 3, 2, 2, 2, 275, 276, 7, 63, 2, 2, 276, 64, 3, 2, 2, 2, 277, 278, 7, 65, 2, 2, 278, 66, 3, 2, 2, 2, 279, 280, 7, 35, 2, 2, 280, 281, 7, 128, 2, 2, 281, 68, 3, 2, 2, 2, 282, 283, 7, 63, 2, 2, 283, 284, 7, 128, 2, 2, 284, 70, 3, 2, 2, 2, 285, 286, 7, 72, 2, 2, 286, 287, 7, 81, 2, 2, 287, 288, 7, 84, 2, 2, 288, 72, 3, 2, 2, 2, 289, 290, 7, 84, 2, 2, 290, 291, 7, 71, 2, 2, 291, 292, 7, 86, 2, 2, 292, 293, 7, 87, 2, 2, 293, 294, 7, 84, 2, 2, 294, 295, 7, 80, 2, 2, 295, 74, 3, 2, 2, 2, 296, 297, 7, 89, 2, 2, 297, 298, 7, 67, 2, 2, 298, 299, 7, 75, 2, 2, 299, 300, 7, 86, 2, 2, 300, 301, 7, 72, 2, 2, 301, 302, 7, 81, 2, 2, 302, 303, 7, 84, 2, 2, 303, 76, 3, 2, 2, 2, 304, 305, 7, 81, 2, 2, 305, 306, 7, 82, 2, 2, 306, 307, 7, 86, 2, 2, 307, 308, 7, 75, 2, 2, 308, 309, 7, 81, 2, 2, 309, 310, 7, 80, 2, 2, 310, 311, 7, 85, 2, 2, 311, 78, 3, 2, 2, 2, 312, 313, 7, 86, 2, 2, 313, 314, 7, 75, 2, 2, 314, 315, 7, 79, 2, 2, 315, 316, 7, 71, 2, 2, 316, 317, 7, 81, 2, 2, 317, 318, 7, 87, 2, 2, 318, 319, 7, 86, 2, 2, 319, 80, 3, 2, 2, 2, 320, 321, 7, 70, 2, 2, 321, 322, 7, 75, 2, 2, 322, 323, 7, 85, 2, 2, 323, 324, 7, 86, 2, 2, 324, 325, 7, 75, 2, 2, 325, 326, 7, 80, 2, 2, 326, 327, 7, 69, 2, 2, 327, 328, 7, 86, 2, 2, 328, 82, 3, 2, 2, 2, 329, 330, 7, 72, 2, 2, 330, 331, 7, 75, 2, 2, 331, 332, 7, 78, 2, 2, 332, 333, 7, 86, 2, 2, 333, 334, 7, 71, 2, 2, 334, 335, 7, 84, 2, 2, 335, 84, 3, 2, 2, 2, 336, 337, 7, 69, 2, 2, 337, 338, 7, 87, 2, 2, 338, 339, 7, 84, 2, 2, 339, 340, 7, 84, 2, 2, 340, 341, 7, 71, 2, 2, 341, 342, 7, 80, 2, 2, 342, 343, 7, 86, 2, 2, 343, 86, 3, 2, 2, 2, 344, 345, 7, 85, 2, 2, 345, 346, 7, 81, 2, 2, 346, 347, 7, 84, 2, 2, 347, 348, 7, 86, 2, 2, 348, 88, 3, 2, 2, 2, 349, 350, 7, 78, 2, 2, 350, 351, 7, 75, 2, 2, 351, 352, 7, 79, 2, 2, 352, 353, 7, 75, 2, 2, 353, 354, 7, 86, 2, 2, 354, 90, 3, 2, 2, 2, 355, 356, 7, 78, 2, 2, 356, 357, 7, 71, 2, 2, 357, 358, 7, 86, 2, 2, 358, 92, 3, 2, 2, 2, 359, 360, 7, 69, 2, 2, 360, 361, 7, 81, 2, 2, 361, 362, 7, 78, 2, 2, 362, 363, 7, 78, 2, 2, 363, 364, 7, 71, 2, 2, 364, 365, 7, 69, 2, 2, 365, 366, 7, 86, 2, 2, 366, 94, 3, 2, 2, 2, 367, 368, 7, 67, 2, 2, 368, 369, 7, 85, 2, 2, 369, 375, 7, 69, 2, 2, 370, 371, 7, 70, 2, 2, 371, 372, 7, 71, 2, 2, 372, 373, 7, 85, 2, 2, 373, 375, 7, 69, 2, 2, 374, 367, 3, 2, 2, 2, 374, 370, 3, 2, 2, 2, 375, 96, 3, 2, 2, 2, 376, 377, 7, 80, 2, 2, 377, 378, 7, 81, 2, 2, 378, 379, 7, 80, 2, 2, 379, 380, 7, 71, 2, 2, 380, 98, 3, 2, 2, 2, 381, 382, 7, 80, 2, 2, 382, 383, 7, 87, 2, 2, 383, 384, 7, 78, 2, 2, 384, 385, 7, 78, 2, 2, 385, 100, 3, 2, 2, 2, 386, 387, 7, 86, 2, 2, 387, 388, 7, 84, 2, 2, 388, 389, 7, 87, 2, 2, 389, 405, 7, 71, 2, 2, 390, 391, 7, 118, 2, 2, 391, 392, 7, 116, 2, 2, 392, 393, 7, 119, 2, 2, 393, 405, 7, 103, 2, 2, 394, 395, 7, 72, 2, 2, 395, 396, 7, 67, 2, 2, 396, 397, 7, 78, 2, 2, 397, 398, 7, 85, 2, 2, 398, 405, 7, 71, 2, 2, 399, 400, 7, 104, 2, 2, 400, 401, 7, 99, 2, 2, 401, 402, 7, 110, 2, 2, 402, 403, 7, 117, 2, 2, 403, 405, 7, 103, 2, 2, 404, 386, 3, 2, 2, 2, 404, 390, 3, 2, 2, 2, 404, 394, 3, 2, 2, 2, 404, 399, 3, 2, 2, 2, 405, 102, 3, 2, 2, 2, 406, 407, 7, 87, 2, 2, 407, 408, 7, 85, 2, 2, 408, 409, 7, 71, 2, 2, 409, 104, 3, 2, 2, 2, 410, 411, 7, 75, 2, 2, 411, 412, 7, 80, 2, 2, 412, 413, 7, 86, 2, 2, 413, 414, 7, 81, 2, 2, 414, 106, 3, 2, 2, 2, 415, 416, 7, 77, 2, 2, 416, 417, 7, 71, 2, 2, 417, 418, 7, 71, 2, 2, 418, 419, 7, 82, 2, 2, 419, 108, 3, 2, 2, 2, 420, 421, 7, 89, 2, 2, 421, 422, 7, 75, 2, 2, 422, 423, 7, 86, 2, 2, 423, 424, 7, 74, 2, 2, 424, 110, 3, 2, 2, 2, 425, 426, 7, 69, 2, 2, 426, 427, 7, 81, 2, 2, 427, 428, 7, 87, 2, 2, 428, 429, 7, 80, 2, 2, 429, 430, 7, 86, 2, 2, 430, 112, 3, 2, 2, 2, 431, 432, 7, 67, 2, 2, 432, 433, 7, 78, 2, 2, 433, 434, 7, 78, 2, 2, 434, 114, 3, 2, 2, 2, 435, 436, 7, 67, 2, 2, 436, 437, 7, 80, 2, 2, 437, 438, 7, 91, 2, 2, 438, 116, 3, 2, 2, 2, 439, 440, 7, 67, 2, 2, 440, 441, 7, 73, 2, 2, 441, 442, 7, 73, 2, 2, 442, 443, 7, 84, 2, 2, 443, 444, 7, 71, 2, 2, 444, 445, 7, 73, 2, 2, 445, 446, 7, 67, 2, 2, 446, 447, 7, 86, 2, 2, 447, 448, 7, 71, 2, 2, 448, 118, 3, 2, 2, 2, 449, 450, 7, 71, 2, 2, 450, 451, 7, 88, 2, 2, 451, 452, 7, 71, 2, 2, 452, 453, 7, 80, 2, 2, 453, 454, 7, 86, 2, 2, 454, 120, 3, 2, 2, 2, 455, 456, 7, 78, 2, 2, 456, 457, 7, 75, 2, 2, 457, 458, 7, 77, 2, 2, 458, 459, 7, 71, 2, 2, 459, 122, 3, 2, 2, 2, 460, 461, 7, 80, 2, 2, 461, 462, 7, 81, 2, 2, 462, 465, 7, 86, 2, 2, 463, 465, 7, 35, 2, 2, 464, 460, 3, 2, 2, 2, 464, 463, 3, 2, 2, 2, 465, 124, 3, 2, 2, 2, 466, 467, 7, 75, 2, 2, 467, 468, 7, 80, 2, 2, 468, 126, 3, 2, 2, 2, 469, 470, 7, 70, 2, 2, 470, 471, 7, 81, 2, 2, 471, 128, 3, 2, 2, 2, 472, 473, 7, 89, 2, 2, 473, 474, 7, 74, 2, 2, 474, 475, 7, 75, 2, 2, 475, 476, 7, 78, 2, 2, 476, 477, 7, 71, 2, 2, 477, 130, 3, 2, 2, 2, 478, 479, 7, 66, 2, 2, 479, 132, 3, 2, 2, 2, 480, 482, 5, 153, 77, 2, 481, 480, 3, 2, 2, 2, 482, 483, 3, 2, 2, 2, 483, 481, 3, 2, 2, 2, 483, 484, 3, 2, 2, 2, 484, 494, 3, 2, 2, 2, 485, 489, 5, 155, 78, 2, 486, 488, 5, 133, 67, 2, 487, 486, 3, 2, 2, 2, 488, 491, 3, 2, 2, 2, 489, 487, 3, 2, 2, 2, 489, 490, 3, 2, 2, 2, 490, 493, 3, 2, 2, 2, 491, 489, 3, 2, 2, 2, 492, 485, 3, 2, 2, 2, 493, 496, 3, 2, 2, 2, 494, 492, 3, 2, 2, 2, 494, 495, 3, 2, 2, 2, 495, 506, 3, 2, 2, 2, 496, 494, 3, 2, 2, 2, 497, 501, 5, 159, 80, 2, 498, 500, 5, 133, 67, 2, 499, 498, 3, 2, 2, 2, 500, 503, 3, 2, 2, 2, 501, 499, 3, 2, 2, 2, 501, 502, 3, 2, 2, 2, 502, 505, 3, 2, 2, 2, 503, 501, 3, 2, 2, 2, 504, 497, 3, 2, 2, 2, 505, 508, 3, 2, 2, 2, 506, 504, 3, 2, 2, 2, 506, 507, 3, 2, 2, 2, 507, 134, 3, 2, 2, 2, 508, 506, 3, 2, 2, 2, 509, 510, 5, 157, 79, 2, 510, 136, 3, 2, 2, 2, 511, 516, 5, 163, 82, 2, 512, 516, 5, 161, 81, 2, 513, 516, 5, 165, 83, 2, 514, 516, 5, 167, 84, 2, 515, 511, 3, 2, 2, 2, 515, 512, 3, 2, 2, 2, 515, 513, 3, 2, 2, 2, 515, 514, 3, 2, 2, 2, 516, 138, 3, 2, 2, 2, 517, 519, 9, 4, 2, 2, 518, 517, 3, 2, 2, 2, 519, 520, 3, 2, 2, 2, 520, 518, 3, 2, 2, 2, 520, 521, 3, 2, 2, 2, 521, 140, 3, 2, 2, 2, 522, 523, 5, 149, 75, 2, 523, 525, 5, 15, 8, 2, 524, 526, 9, 4, 2, 2, 525, 524, 3, 2, 2, 2, 526, 527, 3, 2, 2, 2, 527, 525, 3, 2, 2, 2, 527, 528, 3, 2, 2, 2, 528, 530, 3, 2, 2, 2, 529, 531, 5, 151, 76, 2, 530, 529, 3, 2, 2, 2, 530, 531, 3, 2, 2, 2, 531, 537, 3, 2, 2, 2, 532, 534, 5, 149, 75, 2, 533, 535, 5, 151, 76, 2, 534, 533, 3, 2, 2, 2, 534, 535, 3, 2, 2, 2, 535, 537, 3, 2, 2, 2, 536, 522, 3, 2, 2, 2, 536, 532, 3, 2, 2, 2, 537, 142, 3, 2, 2, 2, 538, 539, 5, 133, 67, 2, 539, 540, 5, 169, 85, 2, 540, 144, 3, 2, 2, 2, 541, 542, 11, 2, 2, 2, 542, 146, 3, 2, 2, 2, 543, 544, 9, 5, 2, 2, 544, 148, 3, 2, 2, 2, 545, 554, 7, 50, 2, 2, 546, 550, 9, 6, 2, 2, 547, 549, 9, 4, 2, 2, 548, 547, 3, 2, 2, 2, 549, 552, 3, 2, 2, 2, 550, 548, 3, 2, 2, 2, 550, 551, 3, 2, 2, 2, 551, 554, 3, 2, 2, 2, 552, 550, 3, 2, 2, 2, 553, 545, 3, 2, 2, 2, 553, 546, 3, 2, 2, 2, 554, 150, 3, 2, 2, 2, 555, 557, 9, 7, 2, 2, 556, 558, 9, 8, 2, 2, 557, 556, 3, 2, 2, 2, 557, 558, 3, 2, 2, 2, 558, 560, 3, 2, 2, 2, 559, 561, 9, 4, 2, 2, 560, 559, 3, 2, 2, 2, 561, 562, 3, 2, 2, 2, 562, 560, 3, 2, 2, 2, 562, 563, 3, 2, 2, 2, 563, 152, 3, 2, 2, 2, 564, 565, 9, 9, 2, 2, 565, 154, 3, 2, 2, 2, 566, 567, 5, 157, 79, 2, 567, 156, 3, 2, 2, 2, 568, 569, 7, 97, 2, 2, 569, 158, 3, 2, 2, 2, 570, 571, 4, 50, 59, 2, 571, 160, 3, 2, 2, 2, 572, 580, 7, 36, 2, 2, 573, 574, 7, 94, 2, 2, 574, 579, 11, 2, 2, 2, 575, 576, 7, 36, 2, 2, 576, 579, 7, 36, 2, 2, 577, 579, 10, 10, 2, 2, 578, 573, 3, 2, 2, 2, 578, 575, 3, 2, 2, 2, 578, 577, 3, 2, 2, 2, 579, 582, 3, 2, 2, 2, 580, 578, 3, 2, 2, 2, 580, 581, 3, 2, 2, 2, 581, 583, 3, 2, 2, 2, 582, 580, 3, 2, 2, 2, 583, 584, 7, 36, 2, 2, 584, 162, 3, 2, 2, 2, 585, 593, 7, 41, 2, 2, 586, 587, 7, 94, 2, 2, 587, 592, 11, 2, 2, 2, 588, 589, 7, 41, 2, 2, 589, 592, 7, 41, 2, 2, 590, 592, 10, 11, 2, 2, 591, 586, 3, 2, 2, 2, 591, 588, 3, 2, 2, 2, 591, 590, 3, 2, 2, 2, 592, 595, 3, 2, 2, 2, 593, 591, 3, 2, 2, 2, 593, 594, 3, 2, 2, 2, 594, 596, 3, 2, 2, 2, 595, 593, 3, 2, 2, 2, 596, 597, 7, 41, 2, 2, 597, 164, 3, 2, 2, 2, 598, 604, 7, 98, 2, 2, 599, 600, 7, 94, 2, 2, 600, 603, 7, 98, 2, 2, 601, 603, 10, 12, 2, 2, 602, 599, 3, 2, 2, 2, 602, 601, 3, 2, 2, 2, 603, 606, 3, 2, 2, 2, 604, 602, 3, 2, 2, 2, 604, 605, 3, 2, 2, 2, 605, 607, 3, 2, 2, 2, 606, 604, 3, 2, 2, 2, 607, 608, 7, 98, 2, 2, 608, 166, 3, 2, 2, 2, 609, 615, 7, 182, 2, 2, 610, 611, 7, 94, 2, 2, 611, 614, 7, 182, 2, 2, 612, 614, 10, 13, 2, 2, 613, 610, 3, 2, 2, 2, 613, 612, 3, 2, 2, 2, 614, 617, 3, 2, 2, 2, 615, 613, 3, 2, 2, 2, 615, 616, 3, 2, 2, 2, 616, 618, 3, 2, 2, 2, 617, 615, 3, 2, 2, 2, 618, 619, 7, 182, 2, 2, 619, 168, 3, 2, 2, 2, 620, 621, 7, 60, 2, 2, 621, 622, 7, 60, 2, 2, 622, 170, 3, 2, 2, 2, 34, 2, 177, 191, 199, 264, 270, 374, 404, 464, 483, 489, 494, 501, 506, 515, 520, 527, 530, 534, 536, 550, 553, 557, 562, 578, 580, 591, 593, 602, 604, 613, 615, 3, 2, 3, 2] \ No newline at end of file +[4, 0, 72, 621, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 174, 8, 0, 10, 0, 12, 0, 177, 9, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 188, 8, 1, 10, 1, 12, 1, 191, 9, 1, 1, 1, 1, 1, 1, 2, 4, 2, 196, 8, 2, 11, 2, 12, 2, 197, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 19, 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, 25, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 3, 27, 263, 8, 27, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 269, 8, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 3, 46, 373, 8, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 403, 8, 49, 1, 50, 1, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 60, 3, 60, 463, 8, 60, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 65, 4, 65, 480, 8, 65, 11, 65, 12, 65, 481, 1, 65, 1, 65, 5, 65, 486, 8, 65, 10, 65, 12, 65, 489, 9, 65, 5, 65, 491, 8, 65, 10, 65, 12, 65, 494, 9, 65, 1, 65, 1, 65, 5, 65, 498, 8, 65, 10, 65, 12, 65, 501, 9, 65, 5, 65, 503, 8, 65, 10, 65, 12, 65, 506, 9, 65, 1, 66, 1, 66, 1, 67, 1, 67, 1, 67, 1, 67, 3, 67, 514, 8, 67, 1, 68, 4, 68, 517, 8, 68, 11, 68, 12, 68, 518, 1, 69, 1, 69, 1, 69, 4, 69, 524, 8, 69, 11, 69, 12, 69, 525, 1, 69, 3, 69, 529, 8, 69, 1, 69, 1, 69, 3, 69, 533, 8, 69, 3, 69, 535, 8, 69, 1, 70, 1, 70, 1, 70, 1, 71, 1, 71, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 5, 73, 547, 8, 73, 10, 73, 12, 73, 550, 9, 73, 3, 73, 552, 8, 73, 1, 74, 1, 74, 3, 74, 556, 8, 74, 1, 74, 4, 74, 559, 8, 74, 11, 74, 12, 74, 560, 1, 75, 1, 75, 1, 76, 1, 76, 1, 77, 1, 77, 1, 78, 1, 78, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 5, 79, 577, 8, 79, 10, 79, 12, 79, 580, 9, 79, 1, 79, 1, 79, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 5, 80, 590, 8, 80, 10, 80, 12, 80, 593, 9, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 5, 81, 601, 8, 81, 10, 81, 12, 81, 604, 9, 81, 1, 81, 1, 81, 1, 82, 1, 82, 1, 82, 1, 82, 5, 82, 612, 8, 82, 10, 82, 12, 82, 615, 9, 82, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 1, 175, 0, 84, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 53, 107, 54, 109, 55, 111, 56, 113, 57, 115, 58, 117, 59, 119, 60, 121, 61, 123, 62, 125, 63, 127, 64, 129, 65, 131, 66, 133, 67, 135, 68, 137, 69, 139, 70, 141, 71, 143, 72, 145, 0, 147, 0, 149, 0, 151, 0, 153, 0, 155, 0, 157, 0, 159, 0, 161, 0, 163, 0, 165, 0, 167, 0, 1, 0, 12, 3, 0, 10, 10, 13, 13, 8232, 8233, 4, 0, 9, 9, 11, 12, 32, 32, 160, 160, 1, 0, 48, 57, 3, 0, 48, 57, 65, 70, 97, 102, 1, 0, 49, 57, 2, 0, 69, 69, 101, 101, 2, 0, 43, 43, 45, 45, 2, 0, 65, 90, 97, 122, 2, 0, 34, 34, 92, 92, 2, 0, 39, 39, 92, 92, 1, 0, 96, 96, 1, 0, 180, 180, 645, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, 0, 109, 1, 0, 0, 0, 0, 111, 1, 0, 0, 0, 0, 113, 1, 0, 0, 0, 0, 115, 1, 0, 0, 0, 0, 117, 1, 0, 0, 0, 0, 119, 1, 0, 0, 0, 0, 121, 1, 0, 0, 0, 0, 123, 1, 0, 0, 0, 0, 125, 1, 0, 0, 0, 0, 127, 1, 0, 0, 0, 0, 129, 1, 0, 0, 0, 0, 131, 1, 0, 0, 0, 0, 133, 1, 0, 0, 0, 0, 135, 1, 0, 0, 0, 0, 137, 1, 0, 0, 0, 0, 139, 1, 0, 0, 0, 0, 141, 1, 0, 0, 0, 0, 143, 1, 0, 0, 0, 1, 169, 1, 0, 0, 0, 3, 183, 1, 0, 0, 0, 5, 195, 1, 0, 0, 0, 7, 201, 1, 0, 0, 0, 9, 205, 1, 0, 0, 0, 11, 207, 1, 0, 0, 0, 13, 209, 1, 0, 0, 0, 15, 211, 1, 0, 0, 0, 17, 213, 1, 0, 0, 0, 19, 215, 1, 0, 0, 0, 21, 217, 1, 0, 0, 0, 23, 219, 1, 0, 0, 0, 25, 221, 1, 0, 0, 0, 27, 223, 1, 0, 0, 0, 29, 225, 1, 0, 0, 0, 31, 227, 1, 0, 0, 0, 33, 229, 1, 0, 0, 0, 35, 232, 1, 0, 0, 0, 37, 235, 1, 0, 0, 0, 39, 238, 1, 0, 0, 0, 41, 241, 1, 0, 0, 0, 43, 243, 1, 0, 0, 0, 45, 245, 1, 0, 0, 0, 47, 247, 1, 0, 0, 0, 49, 249, 1, 0, 0, 0, 51, 251, 1, 0, 0, 0, 53, 254, 1, 0, 0, 0, 55, 262, 1, 0, 0, 0, 57, 268, 1, 0, 0, 0, 59, 270, 1, 0, 0, 0, 61, 273, 1, 0, 0, 0, 63, 275, 1, 0, 0, 0, 65, 277, 1, 0, 0, 0, 67, 280, 1, 0, 0, 0, 69, 283, 1, 0, 0, 0, 71, 287, 1, 0, 0, 0, 73, 294, 1, 0, 0, 0, 75, 302, 1, 0, 0, 0, 77, 310, 1, 0, 0, 0, 79, 318, 1, 0, 0, 0, 81, 327, 1, 0, 0, 0, 83, 334, 1, 0, 0, 0, 85, 342, 1, 0, 0, 0, 87, 347, 1, 0, 0, 0, 89, 353, 1, 0, 0, 0, 91, 357, 1, 0, 0, 0, 93, 372, 1, 0, 0, 0, 95, 374, 1, 0, 0, 0, 97, 379, 1, 0, 0, 0, 99, 402, 1, 0, 0, 0, 101, 404, 1, 0, 0, 0, 103, 408, 1, 0, 0, 0, 105, 413, 1, 0, 0, 0, 107, 418, 1, 0, 0, 0, 109, 423, 1, 0, 0, 0, 111, 429, 1, 0, 0, 0, 113, 433, 1, 0, 0, 0, 115, 437, 1, 0, 0, 0, 117, 447, 1, 0, 0, 0, 119, 453, 1, 0, 0, 0, 121, 462, 1, 0, 0, 0, 123, 464, 1, 0, 0, 0, 125, 467, 1, 0, 0, 0, 127, 470, 1, 0, 0, 0, 129, 476, 1, 0, 0, 0, 131, 479, 1, 0, 0, 0, 133, 507, 1, 0, 0, 0, 135, 513, 1, 0, 0, 0, 137, 516, 1, 0, 0, 0, 139, 534, 1, 0, 0, 0, 141, 536, 1, 0, 0, 0, 143, 539, 1, 0, 0, 0, 145, 541, 1, 0, 0, 0, 147, 551, 1, 0, 0, 0, 149, 553, 1, 0, 0, 0, 151, 562, 1, 0, 0, 0, 153, 564, 1, 0, 0, 0, 155, 566, 1, 0, 0, 0, 157, 568, 1, 0, 0, 0, 159, 570, 1, 0, 0, 0, 161, 583, 1, 0, 0, 0, 163, 596, 1, 0, 0, 0, 165, 607, 1, 0, 0, 0, 167, 618, 1, 0, 0, 0, 169, 170, 5, 47, 0, 0, 170, 171, 5, 42, 0, 0, 171, 175, 1, 0, 0, 0, 172, 174, 9, 0, 0, 0, 173, 172, 1, 0, 0, 0, 174, 177, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 176, 178, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 178, 179, 5, 42, 0, 0, 179, 180, 5, 47, 0, 0, 180, 181, 1, 0, 0, 0, 181, 182, 6, 0, 0, 0, 182, 2, 1, 0, 0, 0, 183, 184, 5, 47, 0, 0, 184, 185, 5, 47, 0, 0, 185, 189, 1, 0, 0, 0, 186, 188, 8, 0, 0, 0, 187, 186, 1, 0, 0, 0, 188, 191, 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 192, 1, 0, 0, 0, 191, 189, 1, 0, 0, 0, 192, 193, 6, 1, 0, 0, 193, 4, 1, 0, 0, 0, 194, 196, 7, 1, 0, 0, 195, 194, 1, 0, 0, 0, 196, 197, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 197, 198, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 200, 6, 2, 0, 0, 200, 6, 1, 0, 0, 0, 201, 202, 7, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 204, 6, 3, 0, 0, 204, 8, 1, 0, 0, 0, 205, 206, 5, 58, 0, 0, 206, 10, 1, 0, 0, 0, 207, 208, 5, 59, 0, 0, 208, 12, 1, 0, 0, 0, 209, 210, 5, 46, 0, 0, 210, 14, 1, 0, 0, 0, 211, 212, 5, 44, 0, 0, 212, 16, 1, 0, 0, 0, 213, 214, 5, 91, 0, 0, 214, 18, 1, 0, 0, 0, 215, 216, 5, 93, 0, 0, 216, 20, 1, 0, 0, 0, 217, 218, 5, 40, 0, 0, 218, 22, 1, 0, 0, 0, 219, 220, 5, 41, 0, 0, 220, 24, 1, 0, 0, 0, 221, 222, 5, 123, 0, 0, 222, 26, 1, 0, 0, 0, 223, 224, 5, 125, 0, 0, 224, 28, 1, 0, 0, 0, 225, 226, 5, 62, 0, 0, 226, 30, 1, 0, 0, 0, 227, 228, 5, 60, 0, 0, 228, 32, 1, 0, 0, 0, 229, 230, 5, 61, 0, 0, 230, 231, 5, 61, 0, 0, 231, 34, 1, 0, 0, 0, 232, 233, 5, 62, 0, 0, 233, 234, 5, 61, 0, 0, 234, 36, 1, 0, 0, 0, 235, 236, 5, 60, 0, 0, 236, 237, 5, 61, 0, 0, 237, 38, 1, 0, 0, 0, 238, 239, 5, 33, 0, 0, 239, 240, 5, 61, 0, 0, 240, 40, 1, 0, 0, 0, 241, 242, 5, 42, 0, 0, 242, 42, 1, 0, 0, 0, 243, 244, 5, 47, 0, 0, 244, 44, 1, 0, 0, 0, 245, 246, 5, 37, 0, 0, 246, 46, 1, 0, 0, 0, 247, 248, 5, 43, 0, 0, 248, 48, 1, 0, 0, 0, 249, 250, 5, 45, 0, 0, 250, 50, 1, 0, 0, 0, 251, 252, 5, 45, 0, 0, 252, 253, 5, 45, 0, 0, 253, 52, 1, 0, 0, 0, 254, 255, 5, 43, 0, 0, 255, 256, 5, 43, 0, 0, 256, 54, 1, 0, 0, 0, 257, 258, 5, 65, 0, 0, 258, 259, 5, 78, 0, 0, 259, 263, 5, 68, 0, 0, 260, 261, 5, 38, 0, 0, 261, 263, 5, 38, 0, 0, 262, 257, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 263, 56, 1, 0, 0, 0, 264, 265, 5, 79, 0, 0, 265, 269, 5, 82, 0, 0, 266, 267, 5, 124, 0, 0, 267, 269, 5, 124, 0, 0, 268, 264, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 269, 58, 1, 0, 0, 0, 270, 271, 3, 13, 6, 0, 271, 272, 3, 13, 6, 0, 272, 60, 1, 0, 0, 0, 273, 274, 5, 61, 0, 0, 274, 62, 1, 0, 0, 0, 275, 276, 5, 63, 0, 0, 276, 64, 1, 0, 0, 0, 277, 278, 5, 33, 0, 0, 278, 279, 5, 126, 0, 0, 279, 66, 1, 0, 0, 0, 280, 281, 5, 61, 0, 0, 281, 282, 5, 126, 0, 0, 282, 68, 1, 0, 0, 0, 283, 284, 5, 70, 0, 0, 284, 285, 5, 79, 0, 0, 285, 286, 5, 82, 0, 0, 286, 70, 1, 0, 0, 0, 287, 288, 5, 82, 0, 0, 288, 289, 5, 69, 0, 0, 289, 290, 5, 84, 0, 0, 290, 291, 5, 85, 0, 0, 291, 292, 5, 82, 0, 0, 292, 293, 5, 78, 0, 0, 293, 72, 1, 0, 0, 0, 294, 295, 5, 87, 0, 0, 295, 296, 5, 65, 0, 0, 296, 297, 5, 73, 0, 0, 297, 298, 5, 84, 0, 0, 298, 299, 5, 70, 0, 0, 299, 300, 5, 79, 0, 0, 300, 301, 5, 82, 0, 0, 301, 74, 1, 0, 0, 0, 302, 303, 5, 79, 0, 0, 303, 304, 5, 80, 0, 0, 304, 305, 5, 84, 0, 0, 305, 306, 5, 73, 0, 0, 306, 307, 5, 79, 0, 0, 307, 308, 5, 78, 0, 0, 308, 309, 5, 83, 0, 0, 309, 76, 1, 0, 0, 0, 310, 311, 5, 84, 0, 0, 311, 312, 5, 73, 0, 0, 312, 313, 5, 77, 0, 0, 313, 314, 5, 69, 0, 0, 314, 315, 5, 79, 0, 0, 315, 316, 5, 85, 0, 0, 316, 317, 5, 84, 0, 0, 317, 78, 1, 0, 0, 0, 318, 319, 5, 68, 0, 0, 319, 320, 5, 73, 0, 0, 320, 321, 5, 83, 0, 0, 321, 322, 5, 84, 0, 0, 322, 323, 5, 73, 0, 0, 323, 324, 5, 78, 0, 0, 324, 325, 5, 67, 0, 0, 325, 326, 5, 84, 0, 0, 326, 80, 1, 0, 0, 0, 327, 328, 5, 70, 0, 0, 328, 329, 5, 73, 0, 0, 329, 330, 5, 76, 0, 0, 330, 331, 5, 84, 0, 0, 331, 332, 5, 69, 0, 0, 332, 333, 5, 82, 0, 0, 333, 82, 1, 0, 0, 0, 334, 335, 5, 67, 0, 0, 335, 336, 5, 85, 0, 0, 336, 337, 5, 82, 0, 0, 337, 338, 5, 82, 0, 0, 338, 339, 5, 69, 0, 0, 339, 340, 5, 78, 0, 0, 340, 341, 5, 84, 0, 0, 341, 84, 1, 0, 0, 0, 342, 343, 5, 83, 0, 0, 343, 344, 5, 79, 0, 0, 344, 345, 5, 82, 0, 0, 345, 346, 5, 84, 0, 0, 346, 86, 1, 0, 0, 0, 347, 348, 5, 76, 0, 0, 348, 349, 5, 73, 0, 0, 349, 350, 5, 77, 0, 0, 350, 351, 5, 73, 0, 0, 351, 352, 5, 84, 0, 0, 352, 88, 1, 0, 0, 0, 353, 354, 5, 76, 0, 0, 354, 355, 5, 69, 0, 0, 355, 356, 5, 84, 0, 0, 356, 90, 1, 0, 0, 0, 357, 358, 5, 67, 0, 0, 358, 359, 5, 79, 0, 0, 359, 360, 5, 76, 0, 0, 360, 361, 5, 76, 0, 0, 361, 362, 5, 69, 0, 0, 362, 363, 5, 67, 0, 0, 363, 364, 5, 84, 0, 0, 364, 92, 1, 0, 0, 0, 365, 366, 5, 65, 0, 0, 366, 367, 5, 83, 0, 0, 367, 373, 5, 67, 0, 0, 368, 369, 5, 68, 0, 0, 369, 370, 5, 69, 0, 0, 370, 371, 5, 83, 0, 0, 371, 373, 5, 67, 0, 0, 372, 365, 1, 0, 0, 0, 372, 368, 1, 0, 0, 0, 373, 94, 1, 0, 0, 0, 374, 375, 5, 78, 0, 0, 375, 376, 5, 79, 0, 0, 376, 377, 5, 78, 0, 0, 377, 378, 5, 69, 0, 0, 378, 96, 1, 0, 0, 0, 379, 380, 5, 78, 0, 0, 380, 381, 5, 85, 0, 0, 381, 382, 5, 76, 0, 0, 382, 383, 5, 76, 0, 0, 383, 98, 1, 0, 0, 0, 384, 385, 5, 84, 0, 0, 385, 386, 5, 82, 0, 0, 386, 387, 5, 85, 0, 0, 387, 403, 5, 69, 0, 0, 388, 389, 5, 116, 0, 0, 389, 390, 5, 114, 0, 0, 390, 391, 5, 117, 0, 0, 391, 403, 5, 101, 0, 0, 392, 393, 5, 70, 0, 0, 393, 394, 5, 65, 0, 0, 394, 395, 5, 76, 0, 0, 395, 396, 5, 83, 0, 0, 396, 403, 5, 69, 0, 0, 397, 398, 5, 102, 0, 0, 398, 399, 5, 97, 0, 0, 399, 400, 5, 108, 0, 0, 400, 401, 5, 115, 0, 0, 401, 403, 5, 101, 0, 0, 402, 384, 1, 0, 0, 0, 402, 388, 1, 0, 0, 0, 402, 392, 1, 0, 0, 0, 402, 397, 1, 0, 0, 0, 403, 100, 1, 0, 0, 0, 404, 405, 5, 85, 0, 0, 405, 406, 5, 83, 0, 0, 406, 407, 5, 69, 0, 0, 407, 102, 1, 0, 0, 0, 408, 409, 5, 73, 0, 0, 409, 410, 5, 78, 0, 0, 410, 411, 5, 84, 0, 0, 411, 412, 5, 79, 0, 0, 412, 104, 1, 0, 0, 0, 413, 414, 5, 75, 0, 0, 414, 415, 5, 69, 0, 0, 415, 416, 5, 69, 0, 0, 416, 417, 5, 80, 0, 0, 417, 106, 1, 0, 0, 0, 418, 419, 5, 87, 0, 0, 419, 420, 5, 73, 0, 0, 420, 421, 5, 84, 0, 0, 421, 422, 5, 72, 0, 0, 422, 108, 1, 0, 0, 0, 423, 424, 5, 67, 0, 0, 424, 425, 5, 79, 0, 0, 425, 426, 5, 85, 0, 0, 426, 427, 5, 78, 0, 0, 427, 428, 5, 84, 0, 0, 428, 110, 1, 0, 0, 0, 429, 430, 5, 65, 0, 0, 430, 431, 5, 76, 0, 0, 431, 432, 5, 76, 0, 0, 432, 112, 1, 0, 0, 0, 433, 434, 5, 65, 0, 0, 434, 435, 5, 78, 0, 0, 435, 436, 5, 89, 0, 0, 436, 114, 1, 0, 0, 0, 437, 438, 5, 65, 0, 0, 438, 439, 5, 71, 0, 0, 439, 440, 5, 71, 0, 0, 440, 441, 5, 82, 0, 0, 441, 442, 5, 69, 0, 0, 442, 443, 5, 71, 0, 0, 443, 444, 5, 65, 0, 0, 444, 445, 5, 84, 0, 0, 445, 446, 5, 69, 0, 0, 446, 116, 1, 0, 0, 0, 447, 448, 5, 69, 0, 0, 448, 449, 5, 86, 0, 0, 449, 450, 5, 69, 0, 0, 450, 451, 5, 78, 0, 0, 451, 452, 5, 84, 0, 0, 452, 118, 1, 0, 0, 0, 453, 454, 5, 76, 0, 0, 454, 455, 5, 73, 0, 0, 455, 456, 5, 75, 0, 0, 456, 457, 5, 69, 0, 0, 457, 120, 1, 0, 0, 0, 458, 459, 5, 78, 0, 0, 459, 460, 5, 79, 0, 0, 460, 463, 5, 84, 0, 0, 461, 463, 5, 33, 0, 0, 462, 458, 1, 0, 0, 0, 462, 461, 1, 0, 0, 0, 463, 122, 1, 0, 0, 0, 464, 465, 5, 73, 0, 0, 465, 466, 5, 78, 0, 0, 466, 124, 1, 0, 0, 0, 467, 468, 5, 68, 0, 0, 468, 469, 5, 79, 0, 0, 469, 126, 1, 0, 0, 0, 470, 471, 5, 87, 0, 0, 471, 472, 5, 72, 0, 0, 472, 473, 5, 73, 0, 0, 473, 474, 5, 76, 0, 0, 474, 475, 5, 69, 0, 0, 475, 128, 1, 0, 0, 0, 476, 477, 5, 64, 0, 0, 477, 130, 1, 0, 0, 0, 478, 480, 3, 151, 75, 0, 479, 478, 1, 0, 0, 0, 480, 481, 1, 0, 0, 0, 481, 479, 1, 0, 0, 0, 481, 482, 1, 0, 0, 0, 482, 492, 1, 0, 0, 0, 483, 487, 3, 153, 76, 0, 484, 486, 3, 131, 65, 0, 485, 484, 1, 0, 0, 0, 486, 489, 1, 0, 0, 0, 487, 485, 1, 0, 0, 0, 487, 488, 1, 0, 0, 0, 488, 491, 1, 0, 0, 0, 489, 487, 1, 0, 0, 0, 490, 483, 1, 0, 0, 0, 491, 494, 1, 0, 0, 0, 492, 490, 1, 0, 0, 0, 492, 493, 1, 0, 0, 0, 493, 504, 1, 0, 0, 0, 494, 492, 1, 0, 0, 0, 495, 499, 3, 157, 78, 0, 496, 498, 3, 131, 65, 0, 497, 496, 1, 0, 0, 0, 498, 501, 1, 0, 0, 0, 499, 497, 1, 0, 0, 0, 499, 500, 1, 0, 0, 0, 500, 503, 1, 0, 0, 0, 501, 499, 1, 0, 0, 0, 502, 495, 1, 0, 0, 0, 503, 506, 1, 0, 0, 0, 504, 502, 1, 0, 0, 0, 504, 505, 1, 0, 0, 0, 505, 132, 1, 0, 0, 0, 506, 504, 1, 0, 0, 0, 507, 508, 3, 155, 77, 0, 508, 134, 1, 0, 0, 0, 509, 514, 3, 161, 80, 0, 510, 514, 3, 159, 79, 0, 511, 514, 3, 163, 81, 0, 512, 514, 3, 165, 82, 0, 513, 509, 1, 0, 0, 0, 513, 510, 1, 0, 0, 0, 513, 511, 1, 0, 0, 0, 513, 512, 1, 0, 0, 0, 514, 136, 1, 0, 0, 0, 515, 517, 7, 2, 0, 0, 516, 515, 1, 0, 0, 0, 517, 518, 1, 0, 0, 0, 518, 516, 1, 0, 0, 0, 518, 519, 1, 0, 0, 0, 519, 138, 1, 0, 0, 0, 520, 521, 3, 147, 73, 0, 521, 523, 3, 13, 6, 0, 522, 524, 7, 2, 0, 0, 523, 522, 1, 0, 0, 0, 524, 525, 1, 0, 0, 0, 525, 523, 1, 0, 0, 0, 525, 526, 1, 0, 0, 0, 526, 528, 1, 0, 0, 0, 527, 529, 3, 149, 74, 0, 528, 527, 1, 0, 0, 0, 528, 529, 1, 0, 0, 0, 529, 535, 1, 0, 0, 0, 530, 532, 3, 147, 73, 0, 531, 533, 3, 149, 74, 0, 532, 531, 1, 0, 0, 0, 532, 533, 1, 0, 0, 0, 533, 535, 1, 0, 0, 0, 534, 520, 1, 0, 0, 0, 534, 530, 1, 0, 0, 0, 535, 140, 1, 0, 0, 0, 536, 537, 3, 131, 65, 0, 537, 538, 3, 167, 83, 0, 538, 142, 1, 0, 0, 0, 539, 540, 9, 0, 0, 0, 540, 144, 1, 0, 0, 0, 541, 542, 7, 3, 0, 0, 542, 146, 1, 0, 0, 0, 543, 552, 5, 48, 0, 0, 544, 548, 7, 4, 0, 0, 545, 547, 7, 2, 0, 0, 546, 545, 1, 0, 0, 0, 547, 550, 1, 0, 0, 0, 548, 546, 1, 0, 0, 0, 548, 549, 1, 0, 0, 0, 549, 552, 1, 0, 0, 0, 550, 548, 1, 0, 0, 0, 551, 543, 1, 0, 0, 0, 551, 544, 1, 0, 0, 0, 552, 148, 1, 0, 0, 0, 553, 555, 7, 5, 0, 0, 554, 556, 7, 6, 0, 0, 555, 554, 1, 0, 0, 0, 555, 556, 1, 0, 0, 0, 556, 558, 1, 0, 0, 0, 557, 559, 7, 2, 0, 0, 558, 557, 1, 0, 0, 0, 559, 560, 1, 0, 0, 0, 560, 558, 1, 0, 0, 0, 560, 561, 1, 0, 0, 0, 561, 150, 1, 0, 0, 0, 562, 563, 7, 7, 0, 0, 563, 152, 1, 0, 0, 0, 564, 565, 3, 155, 77, 0, 565, 154, 1, 0, 0, 0, 566, 567, 5, 95, 0, 0, 567, 156, 1, 0, 0, 0, 568, 569, 2, 48, 57, 0, 569, 158, 1, 0, 0, 0, 570, 578, 5, 34, 0, 0, 571, 572, 5, 92, 0, 0, 572, 577, 9, 0, 0, 0, 573, 574, 5, 34, 0, 0, 574, 577, 5, 34, 0, 0, 575, 577, 8, 8, 0, 0, 576, 571, 1, 0, 0, 0, 576, 573, 1, 0, 0, 0, 576, 575, 1, 0, 0, 0, 577, 580, 1, 0, 0, 0, 578, 576, 1, 0, 0, 0, 578, 579, 1, 0, 0, 0, 579, 581, 1, 0, 0, 0, 580, 578, 1, 0, 0, 0, 581, 582, 5, 34, 0, 0, 582, 160, 1, 0, 0, 0, 583, 591, 5, 39, 0, 0, 584, 585, 5, 92, 0, 0, 585, 590, 9, 0, 0, 0, 586, 587, 5, 39, 0, 0, 587, 590, 5, 39, 0, 0, 588, 590, 8, 9, 0, 0, 589, 584, 1, 0, 0, 0, 589, 586, 1, 0, 0, 0, 589, 588, 1, 0, 0, 0, 590, 593, 1, 0, 0, 0, 591, 589, 1, 0, 0, 0, 591, 592, 1, 0, 0, 0, 592, 594, 1, 0, 0, 0, 593, 591, 1, 0, 0, 0, 594, 595, 5, 39, 0, 0, 595, 162, 1, 0, 0, 0, 596, 602, 5, 96, 0, 0, 597, 598, 5, 92, 0, 0, 598, 601, 5, 96, 0, 0, 599, 601, 8, 10, 0, 0, 600, 597, 1, 0, 0, 0, 600, 599, 1, 0, 0, 0, 601, 604, 1, 0, 0, 0, 602, 600, 1, 0, 0, 0, 602, 603, 1, 0, 0, 0, 603, 605, 1, 0, 0, 0, 604, 602, 1, 0, 0, 0, 605, 606, 5, 96, 0, 0, 606, 164, 1, 0, 0, 0, 607, 613, 5, 180, 0, 0, 608, 609, 5, 92, 0, 0, 609, 612, 5, 180, 0, 0, 610, 612, 8, 11, 0, 0, 611, 608, 1, 0, 0, 0, 611, 610, 1, 0, 0, 0, 612, 615, 1, 0, 0, 0, 613, 611, 1, 0, 0, 0, 613, 614, 1, 0, 0, 0, 614, 616, 1, 0, 0, 0, 615, 613, 1, 0, 0, 0, 616, 617, 5, 180, 0, 0, 617, 166, 1, 0, 0, 0, 618, 619, 5, 58, 0, 0, 619, 620, 5, 58, 0, 0, 620, 168, 1, 0, 0, 0, 32, 0, 175, 189, 197, 262, 268, 372, 402, 462, 481, 487, 492, 499, 504, 513, 518, 525, 528, 532, 534, 548, 551, 555, 560, 576, 578, 589, 591, 600, 602, 611, 613, 1, 0, 1, 0] \ No newline at end of file diff --git a/pkg/parser/fql/FqlParser.interp b/pkg/parser/fql/FqlParser.interp index ed917774a..422263978 100644 --- a/pkg/parser/fql/FqlParser.interp +++ b/pkg/parser/fql/FqlParser.interp @@ -204,7 +204,7 @@ functionName argumentList memberExpressionPath safeReservedWord -unsafReservedWord +unsafeReservedWord rangeOperator rangeOperand expression @@ -224,4 +224,4 @@ errorOperator atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 74, 646, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 3, 2, 7, 2, 148, 10, 2, 12, 2, 14, 2, 151, 11, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 6, 7, 6, 163, 10, 6, 12, 6, 14, 6, 166, 11, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 5, 7, 173, 10, 7, 3, 8, 3, 8, 5, 8, 177, 10, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 5, 9, 188, 10, 9, 3, 10, 3, 10, 5, 10, 192, 10, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 5, 11, 200, 10, 11, 3, 11, 3, 11, 3, 11, 7, 11, 205, 10, 11, 12, 11, 14, 11, 208, 11, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 5, 11, 215, 10, 11, 3, 11, 3, 11, 3, 11, 7, 11, 220, 10, 11, 12, 11, 14, 11, 223, 11, 11, 3, 11, 3, 11, 5, 11, 227, 10, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 5, 12, 236, 10, 12, 3, 13, 3, 13, 3, 13, 3, 13, 5, 13, 242, 10, 13, 3, 14, 3, 14, 5, 14, 246, 10, 14, 3, 15, 3, 15, 5, 15, 250, 10, 15, 3, 16, 3, 16, 5, 16, 254, 10, 16, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 5, 18, 263, 10, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 5, 19, 270, 10, 19, 3, 20, 3, 20, 3, 20, 3, 20, 7, 20, 276, 10, 20, 12, 20, 14, 20, 279, 11, 20, 3, 21, 3, 21, 5, 21, 283, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 303, 10, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 7, 24, 312, 10, 24, 12, 24, 14, 24, 315, 11, 24, 3, 25, 3, 25, 3, 25, 3, 25, 7, 25, 321, 10, 25, 12, 25, 14, 25, 324, 11, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 336, 10, 27, 5, 27, 338, 10, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 5, 29, 351, 10, 29, 3, 29, 5, 29, 354, 10, 29, 3, 29, 5, 29, 357, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 364, 10, 30, 3, 31, 3, 31, 3, 31, 5, 31, 369, 10, 31, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 5, 33, 380, 10, 33, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 5, 35, 387, 10, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 5, 36, 396, 10, 36, 3, 37, 3, 37, 5, 37, 400, 10, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 7, 38, 408, 10, 38, 12, 38, 14, 38, 411, 11, 38, 3, 38, 5, 38, 414, 10, 38, 5, 38, 416, 10, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 3, 42, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 5, 44, 439, 10, 44, 3, 45, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 5, 46, 450, 10, 46, 3, 47, 3, 47, 3, 47, 3, 48, 7, 48, 456, 10, 48, 12, 48, 14, 48, 459, 11, 48, 3, 49, 3, 49, 6, 49, 463, 10, 49, 13, 49, 14, 49, 464, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 5, 50, 472, 10, 50, 3, 51, 3, 51, 5, 51, 476, 10, 51, 3, 52, 3, 52, 3, 52, 3, 52, 5, 52, 482, 10, 52, 3, 52, 3, 52, 3, 53, 3, 53, 3, 53, 5, 53, 489, 10, 53, 3, 54, 3, 54, 3, 54, 7, 54, 494, 10, 54, 12, 54, 14, 54, 497, 11, 54, 3, 54, 5, 54, 500, 10, 54, 3, 55, 5, 55, 503, 10, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 5, 55, 510, 10, 55, 3, 55, 5, 55, 513, 10, 55, 3, 56, 3, 56, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 5, 59, 526, 10, 59, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 5, 60, 533, 10, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 5, 60, 546, 10, 60, 3, 60, 3, 60, 7, 60, 550, 10, 60, 12, 60, 14, 60, 553, 11, 60, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 7, 61, 574, 10, 61, 12, 61, 14, 61, 577, 11, 61, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 5, 62, 590, 10, 62, 3, 62, 3, 62, 5, 62, 594, 10, 62, 5, 62, 596, 10, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 7, 62, 610, 10, 62, 12, 62, 14, 62, 613, 11, 62, 3, 63, 3, 63, 3, 63, 5, 63, 618, 10, 63, 3, 64, 3, 64, 3, 65, 5, 65, 623, 10, 65, 3, 65, 3, 65, 3, 66, 5, 66, 628, 10, 66, 3, 66, 3, 66, 3, 67, 3, 67, 3, 68, 3, 68, 3, 69, 3, 69, 3, 70, 3, 70, 3, 71, 3, 71, 3, 72, 3, 72, 3, 73, 3, 73, 3, 73, 2, 5, 118, 120, 122, 74, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 2, 12, 3, 2, 68, 69, 3, 2, 50, 51, 6, 2, 30, 31, 40, 46, 48, 49, 54, 61, 6, 2, 37, 39, 47, 47, 50, 53, 62, 66, 4, 2, 50, 50, 58, 59, 3, 2, 17, 22, 4, 2, 26, 27, 63, 63, 3, 2, 35, 36, 3, 2, 23, 25, 3, 2, 26, 27, 2, 684, 2, 149, 3, 2, 2, 2, 4, 154, 3, 2, 2, 2, 6, 156, 3, 2, 2, 2, 8, 158, 3, 2, 2, 2, 10, 164, 3, 2, 2, 2, 12, 172, 3, 2, 2, 2, 14, 176, 3, 2, 2, 2, 16, 187, 3, 2, 2, 2, 18, 189, 3, 2, 2, 2, 20, 226, 3, 2, 2, 2, 22, 235, 3, 2, 2, 2, 24, 241, 3, 2, 2, 2, 26, 245, 3, 2, 2, 2, 28, 249, 3, 2, 2, 2, 30, 253, 3, 2, 2, 2, 32, 255, 3, 2, 2, 2, 34, 258, 3, 2, 2, 2, 36, 269, 3, 2, 2, 2, 38, 271, 3, 2, 2, 2, 40, 280, 3, 2, 2, 2, 42, 302, 3, 2, 2, 2, 44, 304, 3, 2, 2, 2, 46, 308, 3, 2, 2, 2, 48, 316, 3, 2, 2, 2, 50, 325, 3, 2, 2, 2, 52, 337, 3, 2, 2, 2, 54, 339, 3, 2, 2, 2, 56, 344, 3, 2, 2, 2, 58, 363, 3, 2, 2, 2, 60, 368, 3, 2, 2, 2, 62, 370, 3, 2, 2, 2, 64, 373, 3, 2, 2, 2, 66, 381, 3, 2, 2, 2, 68, 386, 3, 2, 2, 2, 70, 395, 3, 2, 2, 2, 72, 397, 3, 2, 2, 2, 74, 403, 3, 2, 2, 2, 76, 419, 3, 2, 2, 2, 78, 421, 3, 2, 2, 2, 80, 423, 3, 2, 2, 2, 82, 425, 3, 2, 2, 2, 84, 427, 3, 2, 2, 2, 86, 438, 3, 2, 2, 2, 88, 440, 3, 2, 2, 2, 90, 449, 3, 2, 2, 2, 92, 451, 3, 2, 2, 2, 94, 457, 3, 2, 2, 2, 96, 460, 3, 2, 2, 2, 98, 471, 3, 2, 2, 2, 100, 473, 3, 2, 2, 2, 102, 477, 3, 2, 2, 2, 104, 488, 3, 2, 2, 2, 106, 490, 3, 2, 2, 2, 108, 512, 3, 2, 2, 2, 110, 514, 3, 2, 2, 2, 112, 516, 3, 2, 2, 2, 114, 518, 3, 2, 2, 2, 116, 525, 3, 2, 2, 2, 118, 532, 3, 2, 2, 2, 120, 554, 3, 2, 2, 2, 122, 595, 3, 2, 2, 2, 124, 614, 3, 2, 2, 2, 126, 619, 3, 2, 2, 2, 128, 622, 3, 2, 2, 2, 130, 627, 3, 2, 2, 2, 132, 631, 3, 2, 2, 2, 134, 633, 3, 2, 2, 2, 136, 635, 3, 2, 2, 2, 138, 637, 3, 2, 2, 2, 140, 639, 3, 2, 2, 2, 142, 641, 3, 2, 2, 2, 144, 643, 3, 2, 2, 2, 146, 148, 5, 4, 3, 2, 147, 146, 3, 2, 2, 2, 148, 151, 3, 2, 2, 2, 149, 147, 3, 2, 2, 2, 149, 150, 3, 2, 2, 2, 150, 152, 3, 2, 2, 2, 151, 149, 3, 2, 2, 2, 152, 153, 5, 10, 6, 2, 153, 3, 3, 2, 2, 2, 154, 155, 5, 6, 4, 2, 155, 5, 3, 2, 2, 2, 156, 157, 5, 8, 5, 2, 157, 7, 3, 2, 2, 2, 158, 159, 7, 53, 2, 2, 159, 160, 5, 92, 47, 2, 160, 9, 3, 2, 2, 2, 161, 163, 5, 12, 7, 2, 162, 161, 3, 2, 2, 2, 163, 166, 3, 2, 2, 2, 164, 162, 3, 2, 2, 2, 164, 165, 3, 2, 2, 2, 165, 167, 3, 2, 2, 2, 166, 164, 3, 2, 2, 2, 167, 168, 5, 14, 8, 2, 168, 11, 3, 2, 2, 2, 169, 173, 5, 16, 9, 2, 170, 173, 5, 100, 51, 2, 171, 173, 5, 56, 29, 2, 172, 169, 3, 2, 2, 2, 172, 170, 3, 2, 2, 2, 172, 171, 3, 2, 2, 2, 173, 13, 3, 2, 2, 2, 174, 177, 5, 18, 10, 2, 175, 177, 5, 20, 11, 2, 176, 174, 3, 2, 2, 2, 176, 175, 3, 2, 2, 2, 177, 15, 3, 2, 2, 2, 178, 179, 7, 47, 2, 2, 179, 180, 9, 2, 2, 2, 180, 181, 7, 33, 2, 2, 181, 188, 5, 118, 60, 2, 182, 183, 7, 47, 2, 2, 183, 184, 5, 110, 56, 2, 184, 185, 7, 33, 2, 2, 185, 186, 5, 118, 60, 2, 186, 188, 3, 2, 2, 2, 187, 178, 3, 2, 2, 2, 187, 182, 3, 2, 2, 2, 188, 17, 3, 2, 2, 2, 189, 191, 7, 38, 2, 2, 190, 192, 7, 42, 2, 2, 191, 190, 3, 2, 2, 2, 191, 192, 3, 2, 2, 2, 192, 193, 3, 2, 2, 2, 193, 194, 5, 118, 60, 2, 194, 19, 3, 2, 2, 2, 195, 196, 7, 37, 2, 2, 196, 199, 9, 2, 2, 2, 197, 198, 7, 10, 2, 2, 198, 200, 7, 68, 2, 2, 199, 197, 3, 2, 2, 2, 199, 200, 3, 2, 2, 2, 200, 201, 3, 2, 2, 2, 201, 202, 7, 64, 2, 2, 202, 206, 5, 22, 12, 2, 203, 205, 5, 28, 15, 2, 204, 203, 3, 2, 2, 2, 205, 208, 3, 2, 2, 2, 206, 204, 3, 2, 2, 2, 206, 207, 3, 2, 2, 2, 207, 209, 3, 2, 2, 2, 208, 206, 3, 2, 2, 2, 209, 210, 5, 30, 16, 2, 210, 227, 3, 2, 2, 2, 211, 212, 7, 37, 2, 2, 212, 214, 9, 2, 2, 2, 213, 215, 7, 65, 2, 2, 214, 213, 3, 2, 2, 2, 214, 215, 3, 2, 2, 2, 215, 216, 3, 2, 2, 2, 216, 217, 7, 66, 2, 2, 217, 221, 5, 118, 60, 2, 218, 220, 5, 28, 15, 2, 219, 218, 3, 2, 2, 2, 220, 223, 3, 2, 2, 2, 221, 219, 3, 2, 2, 2, 221, 222, 3, 2, 2, 2, 222, 224, 3, 2, 2, 2, 223, 221, 3, 2, 2, 2, 224, 225, 5, 30, 16, 2, 225, 227, 3, 2, 2, 2, 226, 195, 3, 2, 2, 2, 226, 211, 3, 2, 2, 2, 227, 21, 3, 2, 2, 2, 228, 236, 5, 100, 51, 2, 229, 236, 5, 72, 37, 2, 230, 236, 5, 74, 38, 2, 231, 236, 5, 68, 35, 2, 232, 236, 5, 96, 49, 2, 233, 236, 5, 114, 58, 2, 234, 236, 5, 66, 34, 2, 235, 228, 3, 2, 2, 2, 235, 229, 3, 2, 2, 2, 235, 230, 3, 2, 2, 2, 235, 231, 3, 2, 2, 2, 235, 232, 3, 2, 2, 2, 235, 233, 3, 2, 2, 2, 235, 234, 3, 2, 2, 2, 236, 23, 3, 2, 2, 2, 237, 242, 5, 34, 18, 2, 238, 242, 5, 38, 20, 2, 239, 242, 5, 32, 17, 2, 240, 242, 5, 42, 22, 2, 241, 237, 3, 2, 2, 2, 241, 238, 3, 2, 2, 2, 241, 239, 3, 2, 2, 2, 241, 240, 3, 2, 2, 2, 242, 25, 3, 2, 2, 2, 243, 246, 5, 16, 9, 2, 244, 246, 5, 100, 51, 2, 245, 243, 3, 2, 2, 2, 245, 244, 3, 2, 2, 2, 246, 27, 3, 2, 2, 2, 247, 250, 5, 26, 14, 2, 248, 250, 5, 24, 13, 2, 249, 247, 3, 2, 2, 2, 249, 248, 3, 2, 2, 2, 250, 29, 3, 2, 2, 2, 251, 254, 5, 18, 10, 2, 252, 254, 5, 20, 11, 2, 253, 251, 3, 2, 2, 2, 253, 252, 3, 2, 2, 2, 254, 31, 3, 2, 2, 2, 255, 256, 7, 43, 2, 2, 256, 257, 5, 118, 60, 2, 257, 33, 3, 2, 2, 2, 258, 259, 7, 46, 2, 2, 259, 262, 5, 36, 19, 2, 260, 261, 7, 10, 2, 2, 261, 263, 5, 36, 19, 2, 262, 260, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 35, 3, 2, 2, 2, 264, 270, 7, 71, 2, 2, 265, 270, 5, 66, 34, 2, 266, 270, 5, 68, 35, 2, 267, 270, 5, 100, 51, 2, 268, 270, 5, 96, 49, 2, 269, 264, 3, 2, 2, 2, 269, 265, 3, 2, 2, 2, 269, 266, 3, 2, 2, 2, 269, 267, 3, 2, 2, 2, 269, 268, 3, 2, 2, 2, 270, 37, 3, 2, 2, 2, 271, 272, 7, 45, 2, 2, 272, 277, 5, 40, 21, 2, 273, 274, 7, 10, 2, 2, 274, 276, 5, 40, 21, 2, 275, 273, 3, 2, 2, 2, 276, 279, 3, 2, 2, 2, 277, 275, 3, 2, 2, 2, 277, 278, 3, 2, 2, 2, 278, 39, 3, 2, 2, 2, 279, 277, 3, 2, 2, 2, 280, 282, 5, 118, 60, 2, 281, 283, 7, 49, 2, 2, 282, 281, 3, 2, 2, 2, 282, 283, 3, 2, 2, 2, 283, 41, 3, 2, 2, 2, 284, 285, 7, 48, 2, 2, 285, 303, 5, 54, 28, 2, 286, 287, 7, 48, 2, 2, 287, 303, 5, 48, 25, 2, 288, 289, 7, 48, 2, 2, 289, 290, 5, 46, 24, 2, 290, 291, 5, 48, 25, 2, 291, 303, 3, 2, 2, 2, 292, 293, 7, 48, 2, 2, 293, 294, 5, 46, 24, 2, 294, 295, 5, 52, 27, 2, 295, 303, 3, 2, 2, 2, 296, 297, 7, 48, 2, 2, 297, 298, 5, 46, 24, 2, 298, 299, 5, 54, 28, 2, 299, 303, 3, 2, 2, 2, 300, 301, 7, 48, 2, 2, 301, 303, 5, 46, 24, 2, 302, 284, 3, 2, 2, 2, 302, 286, 3, 2, 2, 2, 302, 288, 3, 2, 2, 2, 302, 292, 3, 2, 2, 2, 302, 296, 3, 2, 2, 2, 302, 300, 3, 2, 2, 2, 303, 43, 3, 2, 2, 2, 304, 305, 7, 68, 2, 2, 305, 306, 7, 33, 2, 2, 306, 307, 5, 118, 60, 2, 307, 45, 3, 2, 2, 2, 308, 313, 5, 44, 23, 2, 309, 310, 7, 10, 2, 2, 310, 312, 5, 44, 23, 2, 311, 309, 3, 2, 2, 2, 312, 315, 3, 2, 2, 2, 313, 311, 3, 2, 2, 2, 313, 314, 3, 2, 2, 2, 314, 47, 3, 2, 2, 2, 315, 313, 3, 2, 2, 2, 316, 317, 7, 60, 2, 2, 317, 322, 5, 50, 26, 2, 318, 319, 7, 10, 2, 2, 319, 321, 5, 50, 26, 2, 320, 318, 3, 2, 2, 2, 321, 324, 3, 2, 2, 2, 322, 320, 3, 2, 2, 2, 322, 323, 3, 2, 2, 2, 323, 49, 3, 2, 2, 2, 324, 322, 3, 2, 2, 2, 325, 326, 7, 68, 2, 2, 326, 327, 7, 33, 2, 2, 327, 328, 5, 100, 51, 2, 328, 51, 3, 2, 2, 2, 329, 330, 7, 54, 2, 2, 330, 338, 5, 44, 23, 2, 331, 332, 7, 54, 2, 2, 332, 335, 7, 68, 2, 2, 333, 334, 7, 55, 2, 2, 334, 336, 7, 68, 2, 2, 335, 333, 3, 2, 2, 2, 335, 336, 3, 2, 2, 2, 336, 338, 3, 2, 2, 2, 337, 329, 3, 2, 2, 2, 337, 331, 3, 2, 2, 2, 338, 53, 3, 2, 2, 2, 339, 340, 7, 56, 2, 2, 340, 341, 7, 57, 2, 2, 341, 342, 7, 54, 2, 2, 342, 343, 7, 68, 2, 2, 343, 55, 3, 2, 2, 2, 344, 345, 7, 39, 2, 2, 345, 346, 7, 61, 2, 2, 346, 347, 5, 58, 30, 2, 347, 348, 7, 64, 2, 2, 348, 350, 5, 60, 31, 2, 349, 351, 5, 62, 32, 2, 350, 349, 3, 2, 2, 2, 350, 351, 3, 2, 2, 2, 351, 353, 3, 2, 2, 2, 352, 354, 5, 32, 17, 2, 353, 352, 3, 2, 2, 2, 353, 354, 3, 2, 2, 2, 354, 356, 3, 2, 2, 2, 355, 357, 5, 64, 33, 2, 356, 355, 3, 2, 2, 2, 356, 357, 3, 2, 2, 2, 357, 57, 3, 2, 2, 2, 358, 364, 5, 78, 40, 2, 359, 364, 5, 68, 35, 2, 360, 364, 5, 66, 34, 2, 361, 364, 5, 100, 51, 2, 362, 364, 5, 96, 49, 2, 363, 358, 3, 2, 2, 2, 363, 359, 3, 2, 2, 2, 363, 360, 3, 2, 2, 2, 363, 361, 3, 2, 2, 2, 363, 362, 3, 2, 2, 2, 364, 59, 3, 2, 2, 2, 365, 369, 5, 100, 51, 2, 366, 369, 5, 68, 35, 2, 367, 369, 5, 96, 49, 2, 368, 365, 3, 2, 2, 2, 368, 366, 3, 2, 2, 2, 368, 367, 3, 2, 2, 2, 369, 61, 3, 2, 2, 2, 370, 371, 7, 40, 2, 2, 371, 372, 5, 74, 38, 2, 372, 63, 3, 2, 2, 2, 373, 379, 7, 41, 2, 2, 374, 380, 5, 82, 42, 2, 375, 380, 5, 68, 35, 2, 376, 380, 5, 66, 34, 2, 377, 380, 5, 96, 49, 2, 378, 380, 5, 102, 52, 2, 379, 374, 3, 2, 2, 2, 379, 375, 3, 2, 2, 2, 379, 376, 3, 2, 2, 2, 379, 377, 3, 2, 2, 2, 379, 378, 3, 2, 2, 2, 380, 65, 3, 2, 2, 2, 381, 382, 7, 67, 2, 2, 382, 383, 7, 68, 2, 2, 383, 67, 3, 2, 2, 2, 384, 387, 7, 68, 2, 2, 385, 387, 5, 110, 56, 2, 386, 384, 3, 2, 2, 2, 386, 385, 3, 2, 2, 2, 387, 69, 3, 2, 2, 2, 388, 396, 5, 72, 37, 2, 389, 396, 5, 74, 38, 2, 390, 396, 5, 76, 39, 2, 391, 396, 5, 78, 40, 2, 392, 396, 5, 80, 41, 2, 393, 396, 5, 82, 42, 2, 394, 396, 5, 84, 43, 2, 395, 388, 3, 2, 2, 2, 395, 389, 3, 2, 2, 2, 395, 390, 3, 2, 2, 2, 395, 391, 3, 2, 2, 2, 395, 392, 3, 2, 2, 2, 395, 393, 3, 2, 2, 2, 395, 394, 3, 2, 2, 2, 396, 71, 3, 2, 2, 2, 397, 399, 7, 11, 2, 2, 398, 400, 5, 106, 54, 2, 399, 398, 3, 2, 2, 2, 399, 400, 3, 2, 2, 2, 400, 401, 3, 2, 2, 2, 401, 402, 7, 12, 2, 2, 402, 73, 3, 2, 2, 2, 403, 415, 7, 15, 2, 2, 404, 409, 5, 86, 44, 2, 405, 406, 7, 10, 2, 2, 406, 408, 5, 86, 44, 2, 407, 405, 3, 2, 2, 2, 408, 411, 3, 2, 2, 2, 409, 407, 3, 2, 2, 2, 409, 410, 3, 2, 2, 2, 410, 413, 3, 2, 2, 2, 411, 409, 3, 2, 2, 2, 412, 414, 7, 10, 2, 2, 413, 412, 3, 2, 2, 2, 413, 414, 3, 2, 2, 2, 414, 416, 3, 2, 2, 2, 415, 404, 3, 2, 2, 2, 415, 416, 3, 2, 2, 2, 416, 417, 3, 2, 2, 2, 417, 418, 7, 16, 2, 2, 418, 75, 3, 2, 2, 2, 419, 420, 7, 52, 2, 2, 420, 77, 3, 2, 2, 2, 421, 422, 7, 70, 2, 2, 422, 79, 3, 2, 2, 2, 423, 424, 7, 72, 2, 2, 424, 81, 3, 2, 2, 2, 425, 426, 7, 71, 2, 2, 426, 83, 3, 2, 2, 2, 427, 428, 9, 3, 2, 2, 428, 85, 3, 2, 2, 2, 429, 430, 5, 90, 46, 2, 430, 431, 7, 7, 2, 2, 431, 432, 5, 118, 60, 2, 432, 439, 3, 2, 2, 2, 433, 434, 5, 88, 45, 2, 434, 435, 7, 7, 2, 2, 435, 436, 5, 118, 60, 2, 436, 439, 3, 2, 2, 2, 437, 439, 5, 68, 35, 2, 438, 429, 3, 2, 2, 2, 438, 433, 3, 2, 2, 2, 438, 437, 3, 2, 2, 2, 439, 87, 3, 2, 2, 2, 440, 441, 7, 11, 2, 2, 441, 442, 5, 118, 60, 2, 442, 443, 7, 12, 2, 2, 443, 89, 3, 2, 2, 2, 444, 450, 7, 68, 2, 2, 445, 450, 5, 78, 40, 2, 446, 450, 5, 66, 34, 2, 447, 450, 5, 110, 56, 2, 448, 450, 5, 112, 57, 2, 449, 444, 3, 2, 2, 2, 449, 445, 3, 2, 2, 2, 449, 446, 3, 2, 2, 2, 449, 447, 3, 2, 2, 2, 449, 448, 3, 2, 2, 2, 450, 91, 3, 2, 2, 2, 451, 452, 5, 94, 48, 2, 452, 453, 7, 68, 2, 2, 453, 93, 3, 2, 2, 2, 454, 456, 7, 73, 2, 2, 455, 454, 3, 2, 2, 2, 456, 459, 3, 2, 2, 2, 457, 455, 3, 2, 2, 2, 457, 458, 3, 2, 2, 2, 458, 95, 3, 2, 2, 2, 459, 457, 3, 2, 2, 2, 460, 462, 5, 98, 50, 2, 461, 463, 5, 108, 55, 2, 462, 461, 3, 2, 2, 2, 463, 464, 3, 2, 2, 2, 464, 462, 3, 2, 2, 2, 464, 465, 3, 2, 2, 2, 465, 97, 3, 2, 2, 2, 466, 472, 5, 68, 35, 2, 467, 472, 5, 66, 34, 2, 468, 472, 5, 72, 37, 2, 469, 472, 5, 74, 38, 2, 470, 472, 5, 102, 52, 2, 471, 466, 3, 2, 2, 2, 471, 467, 3, 2, 2, 2, 471, 468, 3, 2, 2, 2, 471, 469, 3, 2, 2, 2, 471, 470, 3, 2, 2, 2, 472, 99, 3, 2, 2, 2, 473, 475, 5, 102, 52, 2, 474, 476, 5, 144, 73, 2, 475, 474, 3, 2, 2, 2, 475, 476, 3, 2, 2, 2, 476, 101, 3, 2, 2, 2, 477, 478, 5, 94, 48, 2, 478, 479, 5, 104, 53, 2, 479, 481, 7, 13, 2, 2, 480, 482, 5, 106, 54, 2, 481, 480, 3, 2, 2, 2, 481, 482, 3, 2, 2, 2, 482, 483, 3, 2, 2, 2, 483, 484, 7, 14, 2, 2, 484, 103, 3, 2, 2, 2, 485, 489, 7, 68, 2, 2, 486, 489, 5, 110, 56, 2, 487, 489, 5, 112, 57, 2, 488, 485, 3, 2, 2, 2, 488, 486, 3, 2, 2, 2, 488, 487, 3, 2, 2, 2, 489, 105, 3, 2, 2, 2, 490, 495, 5, 118, 60, 2, 491, 492, 7, 10, 2, 2, 492, 494, 5, 118, 60, 2, 493, 491, 3, 2, 2, 2, 494, 497, 3, 2, 2, 2, 495, 493, 3, 2, 2, 2, 495, 496, 3, 2, 2, 2, 496, 499, 3, 2, 2, 2, 497, 495, 3, 2, 2, 2, 498, 500, 7, 10, 2, 2, 499, 498, 3, 2, 2, 2, 499, 500, 3, 2, 2, 2, 500, 107, 3, 2, 2, 2, 501, 503, 5, 144, 73, 2, 502, 501, 3, 2, 2, 2, 502, 503, 3, 2, 2, 2, 503, 504, 3, 2, 2, 2, 504, 505, 7, 9, 2, 2, 505, 513, 5, 90, 46, 2, 506, 507, 5, 144, 73, 2, 507, 508, 7, 9, 2, 2, 508, 510, 3, 2, 2, 2, 509, 506, 3, 2, 2, 2, 509, 510, 3, 2, 2, 2, 510, 511, 3, 2, 2, 2, 511, 513, 5, 88, 45, 2, 512, 502, 3, 2, 2, 2, 512, 509, 3, 2, 2, 2, 513, 109, 3, 2, 2, 2, 514, 515, 9, 4, 2, 2, 515, 111, 3, 2, 2, 2, 516, 517, 9, 5, 2, 2, 517, 113, 3, 2, 2, 2, 518, 519, 5, 116, 59, 2, 519, 520, 7, 32, 2, 2, 520, 521, 5, 116, 59, 2, 521, 115, 3, 2, 2, 2, 522, 526, 5, 82, 42, 2, 523, 526, 5, 68, 35, 2, 524, 526, 5, 66, 34, 2, 525, 522, 3, 2, 2, 2, 525, 523, 3, 2, 2, 2, 525, 524, 3, 2, 2, 2, 526, 117, 3, 2, 2, 2, 527, 528, 8, 60, 1, 2, 528, 529, 5, 132, 67, 2, 529, 530, 5, 118, 60, 7, 530, 533, 3, 2, 2, 2, 531, 533, 5, 120, 61, 2, 532, 527, 3, 2, 2, 2, 532, 531, 3, 2, 2, 2, 533, 551, 3, 2, 2, 2, 534, 535, 12, 6, 2, 2, 535, 536, 5, 136, 69, 2, 536, 537, 5, 118, 60, 7, 537, 550, 3, 2, 2, 2, 538, 539, 12, 5, 2, 2, 539, 540, 5, 138, 70, 2, 540, 541, 5, 118, 60, 6, 541, 550, 3, 2, 2, 2, 542, 543, 12, 4, 2, 2, 543, 545, 7, 34, 2, 2, 544, 546, 5, 118, 60, 2, 545, 544, 3, 2, 2, 2, 545, 546, 3, 2, 2, 2, 546, 547, 3, 2, 2, 2, 547, 548, 7, 7, 2, 2, 548, 550, 5, 118, 60, 5, 549, 534, 3, 2, 2, 2, 549, 538, 3, 2, 2, 2, 549, 542, 3, 2, 2, 2, 550, 553, 3, 2, 2, 2, 551, 549, 3, 2, 2, 2, 551, 552, 3, 2, 2, 2, 552, 119, 3, 2, 2, 2, 553, 551, 3, 2, 2, 2, 554, 555, 8, 61, 1, 2, 555, 556, 5, 122, 62, 2, 556, 575, 3, 2, 2, 2, 557, 558, 12, 7, 2, 2, 558, 559, 5, 126, 64, 2, 559, 560, 5, 120, 61, 8, 560, 574, 3, 2, 2, 2, 561, 562, 12, 6, 2, 2, 562, 563, 5, 124, 63, 2, 563, 564, 5, 120, 61, 7, 564, 574, 3, 2, 2, 2, 565, 566, 12, 5, 2, 2, 566, 567, 5, 128, 65, 2, 567, 568, 5, 120, 61, 6, 568, 574, 3, 2, 2, 2, 569, 570, 12, 4, 2, 2, 570, 571, 5, 130, 66, 2, 571, 572, 5, 120, 61, 5, 572, 574, 3, 2, 2, 2, 573, 557, 3, 2, 2, 2, 573, 561, 3, 2, 2, 2, 573, 565, 3, 2, 2, 2, 573, 569, 3, 2, 2, 2, 574, 577, 3, 2, 2, 2, 575, 573, 3, 2, 2, 2, 575, 576, 3, 2, 2, 2, 576, 121, 3, 2, 2, 2, 577, 575, 3, 2, 2, 2, 578, 579, 8, 62, 1, 2, 579, 596, 5, 100, 51, 2, 580, 596, 5, 114, 58, 2, 581, 596, 5, 70, 36, 2, 582, 596, 5, 68, 35, 2, 583, 596, 5, 96, 49, 2, 584, 596, 5, 66, 34, 2, 585, 589, 7, 13, 2, 2, 586, 590, 5, 20, 11, 2, 587, 590, 5, 56, 29, 2, 588, 590, 5, 118, 60, 2, 589, 586, 3, 2, 2, 2, 589, 587, 3, 2, 2, 2, 589, 588, 3, 2, 2, 2, 590, 591, 3, 2, 2, 2, 591, 593, 7, 14, 2, 2, 592, 594, 5, 144, 73, 2, 593, 592, 3, 2, 2, 2, 593, 594, 3, 2, 2, 2, 594, 596, 3, 2, 2, 2, 595, 578, 3, 2, 2, 2, 595, 580, 3, 2, 2, 2, 595, 581, 3, 2, 2, 2, 595, 582, 3, 2, 2, 2, 595, 583, 3, 2, 2, 2, 595, 584, 3, 2, 2, 2, 595, 585, 3, 2, 2, 2, 596, 611, 3, 2, 2, 2, 597, 598, 12, 12, 2, 2, 598, 599, 5, 140, 71, 2, 599, 600, 5, 122, 62, 13, 600, 610, 3, 2, 2, 2, 601, 602, 12, 11, 2, 2, 602, 603, 5, 142, 72, 2, 603, 604, 5, 122, 62, 12, 604, 610, 3, 2, 2, 2, 605, 606, 12, 10, 2, 2, 606, 607, 5, 134, 68, 2, 607, 608, 5, 122, 62, 11, 608, 610, 3, 2, 2, 2, 609, 597, 3, 2, 2, 2, 609, 601, 3, 2, 2, 2, 609, 605, 3, 2, 2, 2, 610, 613, 3, 2, 2, 2, 611, 609, 3, 2, 2, 2, 611, 612, 3, 2, 2, 2, 612, 123, 3, 2, 2, 2, 613, 611, 3, 2, 2, 2, 614, 617, 9, 6, 2, 2, 615, 618, 5, 128, 65, 2, 616, 618, 5, 126, 64, 2, 617, 615, 3, 2, 2, 2, 617, 616, 3, 2, 2, 2, 618, 125, 3, 2, 2, 2, 619, 620, 9, 7, 2, 2, 620, 127, 3, 2, 2, 2, 621, 623, 7, 63, 2, 2, 622, 621, 3, 2, 2, 2, 622, 623, 3, 2, 2, 2, 623, 624, 3, 2, 2, 2, 624, 625, 7, 64, 2, 2, 625, 129, 3, 2, 2, 2, 626, 628, 7, 63, 2, 2, 627, 626, 3, 2, 2, 2, 627, 628, 3, 2, 2, 2, 628, 629, 3, 2, 2, 2, 629, 630, 7, 62, 2, 2, 630, 131, 3, 2, 2, 2, 631, 632, 9, 8, 2, 2, 632, 133, 3, 2, 2, 2, 633, 634, 9, 9, 2, 2, 634, 135, 3, 2, 2, 2, 635, 636, 7, 30, 2, 2, 636, 137, 3, 2, 2, 2, 637, 638, 7, 31, 2, 2, 638, 139, 3, 2, 2, 2, 639, 640, 9, 10, 2, 2, 640, 141, 3, 2, 2, 2, 641, 642, 9, 11, 2, 2, 642, 143, 3, 2, 2, 2, 643, 644, 7, 34, 2, 2, 644, 145, 3, 2, 2, 2, 67, 149, 164, 172, 176, 187, 191, 199, 206, 214, 221, 226, 235, 241, 245, 249, 253, 262, 269, 277, 282, 302, 313, 322, 335, 337, 350, 353, 356, 363, 368, 379, 386, 395, 399, 409, 413, 415, 438, 449, 457, 464, 471, 475, 481, 488, 495, 499, 502, 509, 512, 525, 532, 545, 549, 551, 573, 575, 589, 593, 595, 609, 611, 617, 622, 627] \ No newline at end of file +[4, 1, 72, 647, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 1, 0, 5, 0, 146, 8, 0, 10, 0, 12, 0, 149, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 5, 4, 161, 8, 4, 10, 4, 12, 4, 164, 9, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 3, 5, 171, 8, 5, 1, 6, 1, 6, 3, 6, 175, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 186, 8, 7, 1, 8, 1, 8, 3, 8, 190, 8, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 198, 8, 9, 1, 9, 1, 9, 1, 9, 5, 9, 203, 8, 9, 10, 9, 12, 9, 206, 9, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 213, 8, 9, 1, 9, 1, 9, 1, 9, 5, 9, 218, 8, 9, 10, 9, 12, 9, 221, 9, 9, 1, 9, 1, 9, 3, 9, 225, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 234, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 240, 8, 11, 1, 12, 1, 12, 3, 12, 244, 8, 12, 1, 13, 1, 13, 3, 13, 248, 8, 13, 1, 14, 1, 14, 3, 14, 252, 8, 14, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 261, 8, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 268, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 5, 18, 274, 8, 18, 10, 18, 12, 18, 277, 9, 18, 1, 19, 1, 19, 3, 19, 281, 8, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 3, 20, 301, 8, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 5, 22, 310, 8, 22, 10, 22, 12, 22, 313, 9, 22, 1, 23, 1, 23, 1, 23, 1, 23, 5, 23, 319, 8, 23, 10, 23, 12, 23, 322, 9, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 334, 8, 25, 3, 25, 336, 8, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 3, 27, 349, 8, 27, 1, 27, 3, 27, 352, 8, 27, 1, 27, 3, 27, 355, 8, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 362, 8, 28, 1, 29, 1, 29, 1, 29, 3, 29, 367, 8, 29, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 3, 31, 378, 8, 31, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 384, 8, 32, 1, 33, 1, 33, 3, 33, 388, 8, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 397, 8, 34, 1, 35, 1, 35, 3, 35, 401, 8, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 5, 36, 409, 8, 36, 10, 36, 12, 36, 412, 9, 36, 1, 36, 3, 36, 415, 8, 36, 3, 36, 417, 8, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 38, 1, 38, 1, 39, 1, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 3, 42, 440, 8, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 3, 44, 451, 8, 44, 1, 45, 1, 45, 1, 45, 1, 46, 5, 46, 457, 8, 46, 10, 46, 12, 46, 460, 9, 46, 1, 47, 1, 47, 4, 47, 464, 8, 47, 11, 47, 12, 47, 465, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 473, 8, 48, 1, 49, 1, 49, 3, 49, 477, 8, 49, 1, 50, 1, 50, 1, 50, 1, 50, 3, 50, 483, 8, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 3, 51, 490, 8, 51, 1, 52, 1, 52, 1, 52, 5, 52, 495, 8, 52, 10, 52, 12, 52, 498, 9, 52, 1, 52, 3, 52, 501, 8, 52, 1, 53, 3, 53, 504, 8, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 3, 53, 511, 8, 53, 1, 53, 3, 53, 514, 8, 53, 1, 54, 1, 54, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 3, 57, 527, 8, 57, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 3, 58, 534, 8, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 3, 58, 547, 8, 58, 1, 58, 1, 58, 5, 58, 551, 8, 58, 10, 58, 12, 58, 554, 9, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 5, 59, 575, 8, 59, 10, 59, 12, 59, 578, 9, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 3, 60, 591, 8, 60, 1, 60, 1, 60, 3, 60, 595, 8, 60, 3, 60, 597, 8, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 5, 60, 611, 8, 60, 10, 60, 12, 60, 614, 9, 60, 1, 61, 1, 61, 1, 61, 3, 61, 619, 8, 61, 1, 62, 1, 62, 1, 63, 3, 63, 624, 8, 63, 1, 63, 1, 63, 1, 64, 3, 64, 629, 8, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 66, 1, 66, 1, 67, 1, 67, 1, 68, 1, 68, 1, 69, 1, 69, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 0, 3, 116, 118, 120, 72, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 0, 10, 1, 0, 66, 67, 1, 0, 48, 49, 4, 0, 28, 29, 38, 44, 46, 47, 52, 59, 4, 0, 35, 37, 45, 45, 48, 51, 60, 64, 2, 0, 48, 48, 56, 57, 1, 0, 15, 20, 2, 0, 24, 25, 61, 61, 1, 0, 33, 34, 1, 0, 21, 23, 1, 0, 24, 25, 686, 0, 147, 1, 0, 0, 0, 2, 152, 1, 0, 0, 0, 4, 154, 1, 0, 0, 0, 6, 156, 1, 0, 0, 0, 8, 162, 1, 0, 0, 0, 10, 170, 1, 0, 0, 0, 12, 174, 1, 0, 0, 0, 14, 185, 1, 0, 0, 0, 16, 187, 1, 0, 0, 0, 18, 224, 1, 0, 0, 0, 20, 233, 1, 0, 0, 0, 22, 239, 1, 0, 0, 0, 24, 243, 1, 0, 0, 0, 26, 247, 1, 0, 0, 0, 28, 251, 1, 0, 0, 0, 30, 253, 1, 0, 0, 0, 32, 256, 1, 0, 0, 0, 34, 267, 1, 0, 0, 0, 36, 269, 1, 0, 0, 0, 38, 278, 1, 0, 0, 0, 40, 300, 1, 0, 0, 0, 42, 302, 1, 0, 0, 0, 44, 306, 1, 0, 0, 0, 46, 314, 1, 0, 0, 0, 48, 323, 1, 0, 0, 0, 50, 335, 1, 0, 0, 0, 52, 337, 1, 0, 0, 0, 54, 342, 1, 0, 0, 0, 56, 361, 1, 0, 0, 0, 58, 366, 1, 0, 0, 0, 60, 368, 1, 0, 0, 0, 62, 371, 1, 0, 0, 0, 64, 383, 1, 0, 0, 0, 66, 387, 1, 0, 0, 0, 68, 396, 1, 0, 0, 0, 70, 398, 1, 0, 0, 0, 72, 404, 1, 0, 0, 0, 74, 420, 1, 0, 0, 0, 76, 422, 1, 0, 0, 0, 78, 424, 1, 0, 0, 0, 80, 426, 1, 0, 0, 0, 82, 428, 1, 0, 0, 0, 84, 439, 1, 0, 0, 0, 86, 441, 1, 0, 0, 0, 88, 450, 1, 0, 0, 0, 90, 452, 1, 0, 0, 0, 92, 458, 1, 0, 0, 0, 94, 461, 1, 0, 0, 0, 96, 472, 1, 0, 0, 0, 98, 474, 1, 0, 0, 0, 100, 478, 1, 0, 0, 0, 102, 489, 1, 0, 0, 0, 104, 491, 1, 0, 0, 0, 106, 513, 1, 0, 0, 0, 108, 515, 1, 0, 0, 0, 110, 517, 1, 0, 0, 0, 112, 519, 1, 0, 0, 0, 114, 526, 1, 0, 0, 0, 116, 533, 1, 0, 0, 0, 118, 555, 1, 0, 0, 0, 120, 596, 1, 0, 0, 0, 122, 615, 1, 0, 0, 0, 124, 620, 1, 0, 0, 0, 126, 623, 1, 0, 0, 0, 128, 628, 1, 0, 0, 0, 130, 632, 1, 0, 0, 0, 132, 634, 1, 0, 0, 0, 134, 636, 1, 0, 0, 0, 136, 638, 1, 0, 0, 0, 138, 640, 1, 0, 0, 0, 140, 642, 1, 0, 0, 0, 142, 644, 1, 0, 0, 0, 144, 146, 3, 2, 1, 0, 145, 144, 1, 0, 0, 0, 146, 149, 1, 0, 0, 0, 147, 145, 1, 0, 0, 0, 147, 148, 1, 0, 0, 0, 148, 150, 1, 0, 0, 0, 149, 147, 1, 0, 0, 0, 150, 151, 3, 8, 4, 0, 151, 1, 1, 0, 0, 0, 152, 153, 3, 4, 2, 0, 153, 3, 1, 0, 0, 0, 154, 155, 3, 6, 3, 0, 155, 5, 1, 0, 0, 0, 156, 157, 5, 51, 0, 0, 157, 158, 3, 90, 45, 0, 158, 7, 1, 0, 0, 0, 159, 161, 3, 10, 5, 0, 160, 159, 1, 0, 0, 0, 161, 164, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 165, 1, 0, 0, 0, 164, 162, 1, 0, 0, 0, 165, 166, 3, 12, 6, 0, 166, 9, 1, 0, 0, 0, 167, 171, 3, 14, 7, 0, 168, 171, 3, 98, 49, 0, 169, 171, 3, 54, 27, 0, 170, 167, 1, 0, 0, 0, 170, 168, 1, 0, 0, 0, 170, 169, 1, 0, 0, 0, 171, 11, 1, 0, 0, 0, 172, 175, 3, 16, 8, 0, 173, 175, 3, 18, 9, 0, 174, 172, 1, 0, 0, 0, 174, 173, 1, 0, 0, 0, 175, 13, 1, 0, 0, 0, 176, 177, 5, 45, 0, 0, 177, 178, 7, 0, 0, 0, 178, 179, 5, 31, 0, 0, 179, 186, 3, 116, 58, 0, 180, 181, 5, 45, 0, 0, 181, 182, 3, 108, 54, 0, 182, 183, 5, 31, 0, 0, 183, 184, 3, 116, 58, 0, 184, 186, 1, 0, 0, 0, 185, 176, 1, 0, 0, 0, 185, 180, 1, 0, 0, 0, 186, 15, 1, 0, 0, 0, 187, 189, 5, 36, 0, 0, 188, 190, 5, 40, 0, 0, 189, 188, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 192, 3, 116, 58, 0, 192, 17, 1, 0, 0, 0, 193, 194, 5, 35, 0, 0, 194, 197, 7, 0, 0, 0, 195, 196, 5, 8, 0, 0, 196, 198, 5, 66, 0, 0, 197, 195, 1, 0, 0, 0, 197, 198, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 200, 5, 62, 0, 0, 200, 204, 3, 20, 10, 0, 201, 203, 3, 26, 13, 0, 202, 201, 1, 0, 0, 0, 203, 206, 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 204, 205, 1, 0, 0, 0, 205, 207, 1, 0, 0, 0, 206, 204, 1, 0, 0, 0, 207, 208, 3, 28, 14, 0, 208, 225, 1, 0, 0, 0, 209, 210, 5, 35, 0, 0, 210, 212, 7, 0, 0, 0, 211, 213, 5, 63, 0, 0, 212, 211, 1, 0, 0, 0, 212, 213, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 215, 5, 64, 0, 0, 215, 219, 3, 116, 58, 0, 216, 218, 3, 26, 13, 0, 217, 216, 1, 0, 0, 0, 218, 221, 1, 0, 0, 0, 219, 217, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 222, 1, 0, 0, 0, 221, 219, 1, 0, 0, 0, 222, 223, 3, 28, 14, 0, 223, 225, 1, 0, 0, 0, 224, 193, 1, 0, 0, 0, 224, 209, 1, 0, 0, 0, 225, 19, 1, 0, 0, 0, 226, 234, 3, 98, 49, 0, 227, 234, 3, 70, 35, 0, 228, 234, 3, 72, 36, 0, 229, 234, 3, 66, 33, 0, 230, 234, 3, 94, 47, 0, 231, 234, 3, 112, 56, 0, 232, 234, 3, 64, 32, 0, 233, 226, 1, 0, 0, 0, 233, 227, 1, 0, 0, 0, 233, 228, 1, 0, 0, 0, 233, 229, 1, 0, 0, 0, 233, 230, 1, 0, 0, 0, 233, 231, 1, 0, 0, 0, 233, 232, 1, 0, 0, 0, 234, 21, 1, 0, 0, 0, 235, 240, 3, 32, 16, 0, 236, 240, 3, 36, 18, 0, 237, 240, 3, 30, 15, 0, 238, 240, 3, 40, 20, 0, 239, 235, 1, 0, 0, 0, 239, 236, 1, 0, 0, 0, 239, 237, 1, 0, 0, 0, 239, 238, 1, 0, 0, 0, 240, 23, 1, 0, 0, 0, 241, 244, 3, 14, 7, 0, 242, 244, 3, 98, 49, 0, 243, 241, 1, 0, 0, 0, 243, 242, 1, 0, 0, 0, 244, 25, 1, 0, 0, 0, 245, 248, 3, 24, 12, 0, 246, 248, 3, 22, 11, 0, 247, 245, 1, 0, 0, 0, 247, 246, 1, 0, 0, 0, 248, 27, 1, 0, 0, 0, 249, 252, 3, 16, 8, 0, 250, 252, 3, 18, 9, 0, 251, 249, 1, 0, 0, 0, 251, 250, 1, 0, 0, 0, 252, 29, 1, 0, 0, 0, 253, 254, 5, 41, 0, 0, 254, 255, 3, 116, 58, 0, 255, 31, 1, 0, 0, 0, 256, 257, 5, 44, 0, 0, 257, 260, 3, 34, 17, 0, 258, 259, 5, 8, 0, 0, 259, 261, 3, 34, 17, 0, 260, 258, 1, 0, 0, 0, 260, 261, 1, 0, 0, 0, 261, 33, 1, 0, 0, 0, 262, 268, 3, 80, 40, 0, 263, 268, 3, 64, 32, 0, 264, 268, 3, 66, 33, 0, 265, 268, 3, 98, 49, 0, 266, 268, 3, 94, 47, 0, 267, 262, 1, 0, 0, 0, 267, 263, 1, 0, 0, 0, 267, 264, 1, 0, 0, 0, 267, 265, 1, 0, 0, 0, 267, 266, 1, 0, 0, 0, 268, 35, 1, 0, 0, 0, 269, 270, 5, 43, 0, 0, 270, 275, 3, 38, 19, 0, 271, 272, 5, 8, 0, 0, 272, 274, 3, 38, 19, 0, 273, 271, 1, 0, 0, 0, 274, 277, 1, 0, 0, 0, 275, 273, 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, 37, 1, 0, 0, 0, 277, 275, 1, 0, 0, 0, 278, 280, 3, 116, 58, 0, 279, 281, 5, 47, 0, 0, 280, 279, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 39, 1, 0, 0, 0, 282, 283, 5, 46, 0, 0, 283, 301, 3, 52, 26, 0, 284, 285, 5, 46, 0, 0, 285, 301, 3, 46, 23, 0, 286, 287, 5, 46, 0, 0, 287, 288, 3, 44, 22, 0, 288, 289, 3, 46, 23, 0, 289, 301, 1, 0, 0, 0, 290, 291, 5, 46, 0, 0, 291, 292, 3, 44, 22, 0, 292, 293, 3, 50, 25, 0, 293, 301, 1, 0, 0, 0, 294, 295, 5, 46, 0, 0, 295, 296, 3, 44, 22, 0, 296, 297, 3, 52, 26, 0, 297, 301, 1, 0, 0, 0, 298, 299, 5, 46, 0, 0, 299, 301, 3, 44, 22, 0, 300, 282, 1, 0, 0, 0, 300, 284, 1, 0, 0, 0, 300, 286, 1, 0, 0, 0, 300, 290, 1, 0, 0, 0, 300, 294, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 301, 41, 1, 0, 0, 0, 302, 303, 5, 66, 0, 0, 303, 304, 5, 31, 0, 0, 304, 305, 3, 116, 58, 0, 305, 43, 1, 0, 0, 0, 306, 311, 3, 42, 21, 0, 307, 308, 5, 8, 0, 0, 308, 310, 3, 42, 21, 0, 309, 307, 1, 0, 0, 0, 310, 313, 1, 0, 0, 0, 311, 309, 1, 0, 0, 0, 311, 312, 1, 0, 0, 0, 312, 45, 1, 0, 0, 0, 313, 311, 1, 0, 0, 0, 314, 315, 5, 58, 0, 0, 315, 320, 3, 48, 24, 0, 316, 317, 5, 8, 0, 0, 317, 319, 3, 48, 24, 0, 318, 316, 1, 0, 0, 0, 319, 322, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 47, 1, 0, 0, 0, 322, 320, 1, 0, 0, 0, 323, 324, 5, 66, 0, 0, 324, 325, 5, 31, 0, 0, 325, 326, 3, 98, 49, 0, 326, 49, 1, 0, 0, 0, 327, 328, 5, 52, 0, 0, 328, 336, 3, 42, 21, 0, 329, 330, 5, 52, 0, 0, 330, 333, 5, 66, 0, 0, 331, 332, 5, 53, 0, 0, 332, 334, 5, 66, 0, 0, 333, 331, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 336, 1, 0, 0, 0, 335, 327, 1, 0, 0, 0, 335, 329, 1, 0, 0, 0, 336, 51, 1, 0, 0, 0, 337, 338, 5, 54, 0, 0, 338, 339, 5, 55, 0, 0, 339, 340, 5, 52, 0, 0, 340, 341, 5, 66, 0, 0, 341, 53, 1, 0, 0, 0, 342, 343, 5, 37, 0, 0, 343, 344, 5, 59, 0, 0, 344, 345, 3, 56, 28, 0, 345, 346, 5, 62, 0, 0, 346, 348, 3, 58, 29, 0, 347, 349, 3, 60, 30, 0, 348, 347, 1, 0, 0, 0, 348, 349, 1, 0, 0, 0, 349, 351, 1, 0, 0, 0, 350, 352, 3, 30, 15, 0, 351, 350, 1, 0, 0, 0, 351, 352, 1, 0, 0, 0, 352, 354, 1, 0, 0, 0, 353, 355, 3, 62, 31, 0, 354, 353, 1, 0, 0, 0, 354, 355, 1, 0, 0, 0, 355, 55, 1, 0, 0, 0, 356, 362, 3, 76, 38, 0, 357, 362, 3, 66, 33, 0, 358, 362, 3, 64, 32, 0, 359, 362, 3, 98, 49, 0, 360, 362, 3, 94, 47, 0, 361, 356, 1, 0, 0, 0, 361, 357, 1, 0, 0, 0, 361, 358, 1, 0, 0, 0, 361, 359, 1, 0, 0, 0, 361, 360, 1, 0, 0, 0, 362, 57, 1, 0, 0, 0, 363, 367, 3, 98, 49, 0, 364, 367, 3, 66, 33, 0, 365, 367, 3, 94, 47, 0, 366, 363, 1, 0, 0, 0, 366, 364, 1, 0, 0, 0, 366, 365, 1, 0, 0, 0, 367, 59, 1, 0, 0, 0, 368, 369, 5, 38, 0, 0, 369, 370, 3, 72, 36, 0, 370, 61, 1, 0, 0, 0, 371, 377, 5, 39, 0, 0, 372, 378, 3, 80, 40, 0, 373, 378, 3, 66, 33, 0, 374, 378, 3, 64, 32, 0, 375, 378, 3, 94, 47, 0, 376, 378, 3, 100, 50, 0, 377, 372, 1, 0, 0, 0, 377, 373, 1, 0, 0, 0, 377, 374, 1, 0, 0, 0, 377, 375, 1, 0, 0, 0, 377, 376, 1, 0, 0, 0, 378, 63, 1, 0, 0, 0, 379, 380, 5, 65, 0, 0, 380, 384, 5, 66, 0, 0, 381, 382, 5, 65, 0, 0, 382, 384, 3, 108, 54, 0, 383, 379, 1, 0, 0, 0, 383, 381, 1, 0, 0, 0, 384, 65, 1, 0, 0, 0, 385, 388, 5, 66, 0, 0, 386, 388, 3, 108, 54, 0, 387, 385, 1, 0, 0, 0, 387, 386, 1, 0, 0, 0, 388, 67, 1, 0, 0, 0, 389, 397, 3, 70, 35, 0, 390, 397, 3, 72, 36, 0, 391, 397, 3, 74, 37, 0, 392, 397, 3, 76, 38, 0, 393, 397, 3, 78, 39, 0, 394, 397, 3, 80, 40, 0, 395, 397, 3, 82, 41, 0, 396, 389, 1, 0, 0, 0, 396, 390, 1, 0, 0, 0, 396, 391, 1, 0, 0, 0, 396, 392, 1, 0, 0, 0, 396, 393, 1, 0, 0, 0, 396, 394, 1, 0, 0, 0, 396, 395, 1, 0, 0, 0, 397, 69, 1, 0, 0, 0, 398, 400, 5, 9, 0, 0, 399, 401, 3, 104, 52, 0, 400, 399, 1, 0, 0, 0, 400, 401, 1, 0, 0, 0, 401, 402, 1, 0, 0, 0, 402, 403, 5, 10, 0, 0, 403, 71, 1, 0, 0, 0, 404, 416, 5, 13, 0, 0, 405, 410, 3, 84, 42, 0, 406, 407, 5, 8, 0, 0, 407, 409, 3, 84, 42, 0, 408, 406, 1, 0, 0, 0, 409, 412, 1, 0, 0, 0, 410, 408, 1, 0, 0, 0, 410, 411, 1, 0, 0, 0, 411, 414, 1, 0, 0, 0, 412, 410, 1, 0, 0, 0, 413, 415, 5, 8, 0, 0, 414, 413, 1, 0, 0, 0, 414, 415, 1, 0, 0, 0, 415, 417, 1, 0, 0, 0, 416, 405, 1, 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, 418, 1, 0, 0, 0, 418, 419, 5, 14, 0, 0, 419, 73, 1, 0, 0, 0, 420, 421, 5, 50, 0, 0, 421, 75, 1, 0, 0, 0, 422, 423, 5, 68, 0, 0, 423, 77, 1, 0, 0, 0, 424, 425, 5, 70, 0, 0, 425, 79, 1, 0, 0, 0, 426, 427, 5, 69, 0, 0, 427, 81, 1, 0, 0, 0, 428, 429, 7, 1, 0, 0, 429, 83, 1, 0, 0, 0, 430, 431, 3, 88, 44, 0, 431, 432, 5, 5, 0, 0, 432, 433, 3, 116, 58, 0, 433, 440, 1, 0, 0, 0, 434, 435, 3, 86, 43, 0, 435, 436, 5, 5, 0, 0, 436, 437, 3, 116, 58, 0, 437, 440, 1, 0, 0, 0, 438, 440, 3, 66, 33, 0, 439, 430, 1, 0, 0, 0, 439, 434, 1, 0, 0, 0, 439, 438, 1, 0, 0, 0, 440, 85, 1, 0, 0, 0, 441, 442, 5, 9, 0, 0, 442, 443, 3, 116, 58, 0, 443, 444, 5, 10, 0, 0, 444, 87, 1, 0, 0, 0, 445, 451, 5, 66, 0, 0, 446, 451, 3, 76, 38, 0, 447, 451, 3, 64, 32, 0, 448, 451, 3, 108, 54, 0, 449, 451, 3, 110, 55, 0, 450, 445, 1, 0, 0, 0, 450, 446, 1, 0, 0, 0, 450, 447, 1, 0, 0, 0, 450, 448, 1, 0, 0, 0, 450, 449, 1, 0, 0, 0, 451, 89, 1, 0, 0, 0, 452, 453, 3, 92, 46, 0, 453, 454, 5, 66, 0, 0, 454, 91, 1, 0, 0, 0, 455, 457, 5, 71, 0, 0, 456, 455, 1, 0, 0, 0, 457, 460, 1, 0, 0, 0, 458, 456, 1, 0, 0, 0, 458, 459, 1, 0, 0, 0, 459, 93, 1, 0, 0, 0, 460, 458, 1, 0, 0, 0, 461, 463, 3, 96, 48, 0, 462, 464, 3, 106, 53, 0, 463, 462, 1, 0, 0, 0, 464, 465, 1, 0, 0, 0, 465, 463, 1, 0, 0, 0, 465, 466, 1, 0, 0, 0, 466, 95, 1, 0, 0, 0, 467, 473, 3, 66, 33, 0, 468, 473, 3, 64, 32, 0, 469, 473, 3, 70, 35, 0, 470, 473, 3, 72, 36, 0, 471, 473, 3, 100, 50, 0, 472, 467, 1, 0, 0, 0, 472, 468, 1, 0, 0, 0, 472, 469, 1, 0, 0, 0, 472, 470, 1, 0, 0, 0, 472, 471, 1, 0, 0, 0, 473, 97, 1, 0, 0, 0, 474, 476, 3, 100, 50, 0, 475, 477, 3, 142, 71, 0, 476, 475, 1, 0, 0, 0, 476, 477, 1, 0, 0, 0, 477, 99, 1, 0, 0, 0, 478, 479, 3, 92, 46, 0, 479, 480, 3, 102, 51, 0, 480, 482, 5, 11, 0, 0, 481, 483, 3, 104, 52, 0, 482, 481, 1, 0, 0, 0, 482, 483, 1, 0, 0, 0, 483, 484, 1, 0, 0, 0, 484, 485, 5, 12, 0, 0, 485, 101, 1, 0, 0, 0, 486, 490, 5, 66, 0, 0, 487, 490, 3, 108, 54, 0, 488, 490, 3, 110, 55, 0, 489, 486, 1, 0, 0, 0, 489, 487, 1, 0, 0, 0, 489, 488, 1, 0, 0, 0, 490, 103, 1, 0, 0, 0, 491, 496, 3, 116, 58, 0, 492, 493, 5, 8, 0, 0, 493, 495, 3, 116, 58, 0, 494, 492, 1, 0, 0, 0, 495, 498, 1, 0, 0, 0, 496, 494, 1, 0, 0, 0, 496, 497, 1, 0, 0, 0, 497, 500, 1, 0, 0, 0, 498, 496, 1, 0, 0, 0, 499, 501, 5, 8, 0, 0, 500, 499, 1, 0, 0, 0, 500, 501, 1, 0, 0, 0, 501, 105, 1, 0, 0, 0, 502, 504, 3, 142, 71, 0, 503, 502, 1, 0, 0, 0, 503, 504, 1, 0, 0, 0, 504, 505, 1, 0, 0, 0, 505, 506, 5, 7, 0, 0, 506, 514, 3, 88, 44, 0, 507, 508, 3, 142, 71, 0, 508, 509, 5, 7, 0, 0, 509, 511, 1, 0, 0, 0, 510, 507, 1, 0, 0, 0, 510, 511, 1, 0, 0, 0, 511, 512, 1, 0, 0, 0, 512, 514, 3, 86, 43, 0, 513, 503, 1, 0, 0, 0, 513, 510, 1, 0, 0, 0, 514, 107, 1, 0, 0, 0, 515, 516, 7, 2, 0, 0, 516, 109, 1, 0, 0, 0, 517, 518, 7, 3, 0, 0, 518, 111, 1, 0, 0, 0, 519, 520, 3, 114, 57, 0, 520, 521, 5, 30, 0, 0, 521, 522, 3, 114, 57, 0, 522, 113, 1, 0, 0, 0, 523, 527, 3, 80, 40, 0, 524, 527, 3, 66, 33, 0, 525, 527, 3, 64, 32, 0, 526, 523, 1, 0, 0, 0, 526, 524, 1, 0, 0, 0, 526, 525, 1, 0, 0, 0, 527, 115, 1, 0, 0, 0, 528, 529, 6, 58, -1, 0, 529, 530, 3, 130, 65, 0, 530, 531, 3, 116, 58, 5, 531, 534, 1, 0, 0, 0, 532, 534, 3, 118, 59, 0, 533, 528, 1, 0, 0, 0, 533, 532, 1, 0, 0, 0, 534, 552, 1, 0, 0, 0, 535, 536, 10, 4, 0, 0, 536, 537, 3, 134, 67, 0, 537, 538, 3, 116, 58, 5, 538, 551, 1, 0, 0, 0, 539, 540, 10, 3, 0, 0, 540, 541, 3, 136, 68, 0, 541, 542, 3, 116, 58, 4, 542, 551, 1, 0, 0, 0, 543, 544, 10, 2, 0, 0, 544, 546, 5, 32, 0, 0, 545, 547, 3, 116, 58, 0, 546, 545, 1, 0, 0, 0, 546, 547, 1, 0, 0, 0, 547, 548, 1, 0, 0, 0, 548, 549, 5, 5, 0, 0, 549, 551, 3, 116, 58, 3, 550, 535, 1, 0, 0, 0, 550, 539, 1, 0, 0, 0, 550, 543, 1, 0, 0, 0, 551, 554, 1, 0, 0, 0, 552, 550, 1, 0, 0, 0, 552, 553, 1, 0, 0, 0, 553, 117, 1, 0, 0, 0, 554, 552, 1, 0, 0, 0, 555, 556, 6, 59, -1, 0, 556, 557, 3, 120, 60, 0, 557, 576, 1, 0, 0, 0, 558, 559, 10, 5, 0, 0, 559, 560, 3, 124, 62, 0, 560, 561, 3, 118, 59, 6, 561, 575, 1, 0, 0, 0, 562, 563, 10, 4, 0, 0, 563, 564, 3, 122, 61, 0, 564, 565, 3, 118, 59, 5, 565, 575, 1, 0, 0, 0, 566, 567, 10, 3, 0, 0, 567, 568, 3, 126, 63, 0, 568, 569, 3, 118, 59, 4, 569, 575, 1, 0, 0, 0, 570, 571, 10, 2, 0, 0, 571, 572, 3, 128, 64, 0, 572, 573, 3, 118, 59, 3, 573, 575, 1, 0, 0, 0, 574, 558, 1, 0, 0, 0, 574, 562, 1, 0, 0, 0, 574, 566, 1, 0, 0, 0, 574, 570, 1, 0, 0, 0, 575, 578, 1, 0, 0, 0, 576, 574, 1, 0, 0, 0, 576, 577, 1, 0, 0, 0, 577, 119, 1, 0, 0, 0, 578, 576, 1, 0, 0, 0, 579, 580, 6, 60, -1, 0, 580, 597, 3, 98, 49, 0, 581, 597, 3, 112, 56, 0, 582, 597, 3, 68, 34, 0, 583, 597, 3, 66, 33, 0, 584, 597, 3, 94, 47, 0, 585, 597, 3, 64, 32, 0, 586, 590, 5, 11, 0, 0, 587, 591, 3, 18, 9, 0, 588, 591, 3, 54, 27, 0, 589, 591, 3, 116, 58, 0, 590, 587, 1, 0, 0, 0, 590, 588, 1, 0, 0, 0, 590, 589, 1, 0, 0, 0, 591, 592, 1, 0, 0, 0, 592, 594, 5, 12, 0, 0, 593, 595, 3, 142, 71, 0, 594, 593, 1, 0, 0, 0, 594, 595, 1, 0, 0, 0, 595, 597, 1, 0, 0, 0, 596, 579, 1, 0, 0, 0, 596, 581, 1, 0, 0, 0, 596, 582, 1, 0, 0, 0, 596, 583, 1, 0, 0, 0, 596, 584, 1, 0, 0, 0, 596, 585, 1, 0, 0, 0, 596, 586, 1, 0, 0, 0, 597, 612, 1, 0, 0, 0, 598, 599, 10, 10, 0, 0, 599, 600, 3, 138, 69, 0, 600, 601, 3, 120, 60, 11, 601, 611, 1, 0, 0, 0, 602, 603, 10, 9, 0, 0, 603, 604, 3, 140, 70, 0, 604, 605, 3, 120, 60, 10, 605, 611, 1, 0, 0, 0, 606, 607, 10, 8, 0, 0, 607, 608, 3, 132, 66, 0, 608, 609, 3, 120, 60, 9, 609, 611, 1, 0, 0, 0, 610, 598, 1, 0, 0, 0, 610, 602, 1, 0, 0, 0, 610, 606, 1, 0, 0, 0, 611, 614, 1, 0, 0, 0, 612, 610, 1, 0, 0, 0, 612, 613, 1, 0, 0, 0, 613, 121, 1, 0, 0, 0, 614, 612, 1, 0, 0, 0, 615, 618, 7, 4, 0, 0, 616, 619, 3, 126, 63, 0, 617, 619, 3, 124, 62, 0, 618, 616, 1, 0, 0, 0, 618, 617, 1, 0, 0, 0, 619, 123, 1, 0, 0, 0, 620, 621, 7, 5, 0, 0, 621, 125, 1, 0, 0, 0, 622, 624, 5, 61, 0, 0, 623, 622, 1, 0, 0, 0, 623, 624, 1, 0, 0, 0, 624, 625, 1, 0, 0, 0, 625, 626, 5, 62, 0, 0, 626, 127, 1, 0, 0, 0, 627, 629, 5, 61, 0, 0, 628, 627, 1, 0, 0, 0, 628, 629, 1, 0, 0, 0, 629, 630, 1, 0, 0, 0, 630, 631, 5, 60, 0, 0, 631, 129, 1, 0, 0, 0, 632, 633, 7, 6, 0, 0, 633, 131, 1, 0, 0, 0, 634, 635, 7, 7, 0, 0, 635, 133, 1, 0, 0, 0, 636, 637, 5, 28, 0, 0, 637, 135, 1, 0, 0, 0, 638, 639, 5, 29, 0, 0, 639, 137, 1, 0, 0, 0, 640, 641, 7, 8, 0, 0, 641, 139, 1, 0, 0, 0, 642, 643, 7, 9, 0, 0, 643, 141, 1, 0, 0, 0, 644, 645, 5, 32, 0, 0, 645, 143, 1, 0, 0, 0, 66, 147, 162, 170, 174, 185, 189, 197, 204, 212, 219, 224, 233, 239, 243, 247, 251, 260, 267, 275, 280, 300, 311, 320, 333, 335, 348, 351, 354, 361, 366, 377, 383, 387, 396, 400, 410, 414, 416, 439, 450, 458, 465, 472, 476, 482, 489, 496, 500, 503, 510, 513, 526, 533, 546, 550, 552, 574, 576, 590, 594, 596, 610, 612, 618, 623, 628] \ No newline at end of file diff --git a/pkg/parser/fql/fql_lexer.go b/pkg/parser/fql/fql_lexer.go index e96159f63..cc3c8731c 100644 --- a/pkg/parser/fql/fql_lexer.go +++ b/pkg/parser/fql/fql_lexer.go @@ -1,375 +1,395 @@ -// Code generated from antlr/FqlLexer.g4 by ANTLR 4.9.3. DO NOT EDIT. +// Code generated from java-escape by ANTLR 4.11.1. DO NOT EDIT. package fql import ( "fmt" + "sync" "unicode" - "github.com/antlr/antlr4/runtime/Go/antlr" + "github.com/antlr/antlr4/runtime/Go/antlr/v4" ) // Suppress unused import error var _ = fmt.Printf +var _ = sync.Once{} var _ = unicode.IsLetter -var serializedLexerAtn = []uint16{ - 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 74, 623, - 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, - 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, - 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, - 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, - 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, - 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, - 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, - 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, - 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, - 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, - 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, - 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, - 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, - 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, - 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, - 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 4, 84, 9, 84, 4, 85, 9, 85, 3, 2, - 3, 2, 3, 2, 3, 2, 7, 2, 176, 10, 2, 12, 2, 14, 2, 179, 11, 2, 3, 2, 3, - 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 190, 10, 3, 12, 3, 14, - 3, 193, 11, 3, 3, 3, 3, 3, 3, 4, 6, 4, 198, 10, 4, 13, 4, 14, 4, 199, 3, - 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, - 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, - 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, - 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, - 3, 23, 3, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, - 27, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 5, 29, 265, - 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 271, 10, 30, 3, 31, 3, 31, 3, - 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, - 3, 36, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, - 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, - 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, - 40, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, - 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 43, 3, - 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 44, - 3, 44, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 46, 3, - 46, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 48, 3, 48, - 3, 48, 3, 48, 3, 48, 3, 48, 3, 48, 5, 48, 375, 10, 48, 3, 49, 3, 49, 3, - 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, - 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, - 51, 3, 51, 3, 51, 3, 51, 3, 51, 5, 51, 405, 10, 51, 3, 52, 3, 52, 3, 52, - 3, 52, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, - 54, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, - 3, 56, 3, 57, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 3, 58, 3, 59, 3, - 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, - 3, 60, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 62, 3, - 62, 3, 62, 3, 62, 5, 62, 465, 10, 62, 3, 63, 3, 63, 3, 63, 3, 64, 3, 64, - 3, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 66, 3, 66, 3, 67, 6, - 67, 482, 10, 67, 13, 67, 14, 67, 483, 3, 67, 3, 67, 7, 67, 488, 10, 67, - 12, 67, 14, 67, 491, 11, 67, 7, 67, 493, 10, 67, 12, 67, 14, 67, 496, 11, - 67, 3, 67, 3, 67, 7, 67, 500, 10, 67, 12, 67, 14, 67, 503, 11, 67, 7, 67, - 505, 10, 67, 12, 67, 14, 67, 508, 11, 67, 3, 68, 3, 68, 3, 69, 3, 69, 3, - 69, 3, 69, 5, 69, 516, 10, 69, 3, 70, 6, 70, 519, 10, 70, 13, 70, 14, 70, - 520, 3, 71, 3, 71, 3, 71, 6, 71, 526, 10, 71, 13, 71, 14, 71, 527, 3, 71, - 5, 71, 531, 10, 71, 3, 71, 3, 71, 5, 71, 535, 10, 71, 5, 71, 537, 10, 71, - 3, 72, 3, 72, 3, 72, 3, 73, 3, 73, 3, 74, 3, 74, 3, 75, 3, 75, 3, 75, 7, - 75, 549, 10, 75, 12, 75, 14, 75, 552, 11, 75, 5, 75, 554, 10, 75, 3, 76, - 3, 76, 5, 76, 558, 10, 76, 3, 76, 6, 76, 561, 10, 76, 13, 76, 14, 76, 562, - 3, 77, 3, 77, 3, 78, 3, 78, 3, 79, 3, 79, 3, 80, 3, 80, 3, 81, 3, 81, 3, - 81, 3, 81, 3, 81, 3, 81, 7, 81, 579, 10, 81, 12, 81, 14, 81, 582, 11, 81, - 3, 81, 3, 81, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 7, 82, 592, 10, - 82, 12, 82, 14, 82, 595, 11, 82, 3, 82, 3, 82, 3, 83, 3, 83, 3, 83, 3, - 83, 7, 83, 603, 10, 83, 12, 83, 14, 83, 606, 11, 83, 3, 83, 3, 83, 3, 84, - 3, 84, 3, 84, 3, 84, 7, 84, 614, 10, 84, 12, 84, 14, 84, 617, 11, 84, 3, - 84, 3, 84, 3, 85, 3, 85, 3, 85, 3, 177, 2, 86, 3, 3, 5, 4, 7, 5, 9, 6, - 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, - 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, - 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, - 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, - 43, 85, 44, 87, 45, 89, 46, 91, 47, 93, 48, 95, 49, 97, 50, 99, 51, 101, - 52, 103, 53, 105, 54, 107, 55, 109, 56, 111, 57, 113, 58, 115, 59, 117, - 60, 119, 61, 121, 62, 123, 63, 125, 64, 127, 65, 129, 66, 131, 67, 133, - 68, 135, 69, 137, 70, 139, 71, 141, 72, 143, 73, 145, 74, 147, 2, 149, - 2, 151, 2, 153, 2, 155, 2, 157, 2, 159, 2, 161, 2, 163, 2, 165, 2, 167, - 2, 169, 2, 3, 2, 14, 5, 2, 12, 12, 15, 15, 8234, 8235, 6, 2, 11, 11, 13, - 14, 34, 34, 162, 162, 3, 2, 50, 59, 5, 2, 50, 59, 67, 72, 99, 104, 3, 2, - 51, 59, 4, 2, 71, 71, 103, 103, 4, 2, 45, 45, 47, 47, 4, 2, 67, 92, 99, - 124, 4, 2, 36, 36, 94, 94, 4, 2, 41, 41, 94, 94, 3, 2, 98, 98, 3, 2, 182, - 182, 2, 647, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, - 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, - 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, - 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, - 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, - 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, - 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, - 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, - 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, - 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, - 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, - 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3, - 2, 2, 2, 2, 95, 3, 2, 2, 2, 2, 97, 3, 2, 2, 2, 2, 99, 3, 2, 2, 2, 2, 101, - 3, 2, 2, 2, 2, 103, 3, 2, 2, 2, 2, 105, 3, 2, 2, 2, 2, 107, 3, 2, 2, 2, - 2, 109, 3, 2, 2, 2, 2, 111, 3, 2, 2, 2, 2, 113, 3, 2, 2, 2, 2, 115, 3, - 2, 2, 2, 2, 117, 3, 2, 2, 2, 2, 119, 3, 2, 2, 2, 2, 121, 3, 2, 2, 2, 2, - 123, 3, 2, 2, 2, 2, 125, 3, 2, 2, 2, 2, 127, 3, 2, 2, 2, 2, 129, 3, 2, - 2, 2, 2, 131, 3, 2, 2, 2, 2, 133, 3, 2, 2, 2, 2, 135, 3, 2, 2, 2, 2, 137, - 3, 2, 2, 2, 2, 139, 3, 2, 2, 2, 2, 141, 3, 2, 2, 2, 2, 143, 3, 2, 2, 2, - 2, 145, 3, 2, 2, 2, 3, 171, 3, 2, 2, 2, 5, 185, 3, 2, 2, 2, 7, 197, 3, - 2, 2, 2, 9, 203, 3, 2, 2, 2, 11, 207, 3, 2, 2, 2, 13, 209, 3, 2, 2, 2, - 15, 211, 3, 2, 2, 2, 17, 213, 3, 2, 2, 2, 19, 215, 3, 2, 2, 2, 21, 217, - 3, 2, 2, 2, 23, 219, 3, 2, 2, 2, 25, 221, 3, 2, 2, 2, 27, 223, 3, 2, 2, - 2, 29, 225, 3, 2, 2, 2, 31, 227, 3, 2, 2, 2, 33, 229, 3, 2, 2, 2, 35, 231, - 3, 2, 2, 2, 37, 234, 3, 2, 2, 2, 39, 237, 3, 2, 2, 2, 41, 240, 3, 2, 2, - 2, 43, 243, 3, 2, 2, 2, 45, 245, 3, 2, 2, 2, 47, 247, 3, 2, 2, 2, 49, 249, - 3, 2, 2, 2, 51, 251, 3, 2, 2, 2, 53, 253, 3, 2, 2, 2, 55, 256, 3, 2, 2, - 2, 57, 264, 3, 2, 2, 2, 59, 270, 3, 2, 2, 2, 61, 272, 3, 2, 2, 2, 63, 275, - 3, 2, 2, 2, 65, 277, 3, 2, 2, 2, 67, 279, 3, 2, 2, 2, 69, 282, 3, 2, 2, - 2, 71, 285, 3, 2, 2, 2, 73, 289, 3, 2, 2, 2, 75, 296, 3, 2, 2, 2, 77, 304, - 3, 2, 2, 2, 79, 312, 3, 2, 2, 2, 81, 320, 3, 2, 2, 2, 83, 329, 3, 2, 2, - 2, 85, 336, 3, 2, 2, 2, 87, 344, 3, 2, 2, 2, 89, 349, 3, 2, 2, 2, 91, 355, - 3, 2, 2, 2, 93, 359, 3, 2, 2, 2, 95, 374, 3, 2, 2, 2, 97, 376, 3, 2, 2, - 2, 99, 381, 3, 2, 2, 2, 101, 404, 3, 2, 2, 2, 103, 406, 3, 2, 2, 2, 105, - 410, 3, 2, 2, 2, 107, 415, 3, 2, 2, 2, 109, 420, 3, 2, 2, 2, 111, 425, - 3, 2, 2, 2, 113, 431, 3, 2, 2, 2, 115, 435, 3, 2, 2, 2, 117, 439, 3, 2, - 2, 2, 119, 449, 3, 2, 2, 2, 121, 455, 3, 2, 2, 2, 123, 464, 3, 2, 2, 2, - 125, 466, 3, 2, 2, 2, 127, 469, 3, 2, 2, 2, 129, 472, 3, 2, 2, 2, 131, - 478, 3, 2, 2, 2, 133, 481, 3, 2, 2, 2, 135, 509, 3, 2, 2, 2, 137, 515, - 3, 2, 2, 2, 139, 518, 3, 2, 2, 2, 141, 536, 3, 2, 2, 2, 143, 538, 3, 2, - 2, 2, 145, 541, 3, 2, 2, 2, 147, 543, 3, 2, 2, 2, 149, 553, 3, 2, 2, 2, - 151, 555, 3, 2, 2, 2, 153, 564, 3, 2, 2, 2, 155, 566, 3, 2, 2, 2, 157, - 568, 3, 2, 2, 2, 159, 570, 3, 2, 2, 2, 161, 572, 3, 2, 2, 2, 163, 585, - 3, 2, 2, 2, 165, 598, 3, 2, 2, 2, 167, 609, 3, 2, 2, 2, 169, 620, 3, 2, - 2, 2, 171, 172, 7, 49, 2, 2, 172, 173, 7, 44, 2, 2, 173, 177, 3, 2, 2, - 2, 174, 176, 11, 2, 2, 2, 175, 174, 3, 2, 2, 2, 176, 179, 3, 2, 2, 2, 177, - 178, 3, 2, 2, 2, 177, 175, 3, 2, 2, 2, 178, 180, 3, 2, 2, 2, 179, 177, - 3, 2, 2, 2, 180, 181, 7, 44, 2, 2, 181, 182, 7, 49, 2, 2, 182, 183, 3, - 2, 2, 2, 183, 184, 8, 2, 2, 2, 184, 4, 3, 2, 2, 2, 185, 186, 7, 49, 2, - 2, 186, 187, 7, 49, 2, 2, 187, 191, 3, 2, 2, 2, 188, 190, 10, 2, 2, 2, - 189, 188, 3, 2, 2, 2, 190, 193, 3, 2, 2, 2, 191, 189, 3, 2, 2, 2, 191, - 192, 3, 2, 2, 2, 192, 194, 3, 2, 2, 2, 193, 191, 3, 2, 2, 2, 194, 195, - 8, 3, 2, 2, 195, 6, 3, 2, 2, 2, 196, 198, 9, 3, 2, 2, 197, 196, 3, 2, 2, - 2, 198, 199, 3, 2, 2, 2, 199, 197, 3, 2, 2, 2, 199, 200, 3, 2, 2, 2, 200, - 201, 3, 2, 2, 2, 201, 202, 8, 4, 2, 2, 202, 8, 3, 2, 2, 2, 203, 204, 9, - 2, 2, 2, 204, 205, 3, 2, 2, 2, 205, 206, 8, 5, 2, 2, 206, 10, 3, 2, 2, - 2, 207, 208, 7, 60, 2, 2, 208, 12, 3, 2, 2, 2, 209, 210, 7, 61, 2, 2, 210, - 14, 3, 2, 2, 2, 211, 212, 7, 48, 2, 2, 212, 16, 3, 2, 2, 2, 213, 214, 7, - 46, 2, 2, 214, 18, 3, 2, 2, 2, 215, 216, 7, 93, 2, 2, 216, 20, 3, 2, 2, - 2, 217, 218, 7, 95, 2, 2, 218, 22, 3, 2, 2, 2, 219, 220, 7, 42, 2, 2, 220, - 24, 3, 2, 2, 2, 221, 222, 7, 43, 2, 2, 222, 26, 3, 2, 2, 2, 223, 224, 7, - 125, 2, 2, 224, 28, 3, 2, 2, 2, 225, 226, 7, 127, 2, 2, 226, 30, 3, 2, - 2, 2, 227, 228, 7, 64, 2, 2, 228, 32, 3, 2, 2, 2, 229, 230, 7, 62, 2, 2, - 230, 34, 3, 2, 2, 2, 231, 232, 7, 63, 2, 2, 232, 233, 7, 63, 2, 2, 233, - 36, 3, 2, 2, 2, 234, 235, 7, 64, 2, 2, 235, 236, 7, 63, 2, 2, 236, 38, - 3, 2, 2, 2, 237, 238, 7, 62, 2, 2, 238, 239, 7, 63, 2, 2, 239, 40, 3, 2, - 2, 2, 240, 241, 7, 35, 2, 2, 241, 242, 7, 63, 2, 2, 242, 42, 3, 2, 2, 2, - 243, 244, 7, 44, 2, 2, 244, 44, 3, 2, 2, 2, 245, 246, 7, 49, 2, 2, 246, - 46, 3, 2, 2, 2, 247, 248, 7, 39, 2, 2, 248, 48, 3, 2, 2, 2, 249, 250, 7, - 45, 2, 2, 250, 50, 3, 2, 2, 2, 251, 252, 7, 47, 2, 2, 252, 52, 3, 2, 2, - 2, 253, 254, 7, 47, 2, 2, 254, 255, 7, 47, 2, 2, 255, 54, 3, 2, 2, 2, 256, - 257, 7, 45, 2, 2, 257, 258, 7, 45, 2, 2, 258, 56, 3, 2, 2, 2, 259, 260, - 7, 67, 2, 2, 260, 261, 7, 80, 2, 2, 261, 265, 7, 70, 2, 2, 262, 263, 7, - 40, 2, 2, 263, 265, 7, 40, 2, 2, 264, 259, 3, 2, 2, 2, 264, 262, 3, 2, - 2, 2, 265, 58, 3, 2, 2, 2, 266, 267, 7, 81, 2, 2, 267, 271, 7, 84, 2, 2, - 268, 269, 7, 126, 2, 2, 269, 271, 7, 126, 2, 2, 270, 266, 3, 2, 2, 2, 270, - 268, 3, 2, 2, 2, 271, 60, 3, 2, 2, 2, 272, 273, 5, 15, 8, 2, 273, 274, - 5, 15, 8, 2, 274, 62, 3, 2, 2, 2, 275, 276, 7, 63, 2, 2, 276, 64, 3, 2, - 2, 2, 277, 278, 7, 65, 2, 2, 278, 66, 3, 2, 2, 2, 279, 280, 7, 35, 2, 2, - 280, 281, 7, 128, 2, 2, 281, 68, 3, 2, 2, 2, 282, 283, 7, 63, 2, 2, 283, - 284, 7, 128, 2, 2, 284, 70, 3, 2, 2, 2, 285, 286, 7, 72, 2, 2, 286, 287, - 7, 81, 2, 2, 287, 288, 7, 84, 2, 2, 288, 72, 3, 2, 2, 2, 289, 290, 7, 84, - 2, 2, 290, 291, 7, 71, 2, 2, 291, 292, 7, 86, 2, 2, 292, 293, 7, 87, 2, - 2, 293, 294, 7, 84, 2, 2, 294, 295, 7, 80, 2, 2, 295, 74, 3, 2, 2, 2, 296, - 297, 7, 89, 2, 2, 297, 298, 7, 67, 2, 2, 298, 299, 7, 75, 2, 2, 299, 300, - 7, 86, 2, 2, 300, 301, 7, 72, 2, 2, 301, 302, 7, 81, 2, 2, 302, 303, 7, - 84, 2, 2, 303, 76, 3, 2, 2, 2, 304, 305, 7, 81, 2, 2, 305, 306, 7, 82, - 2, 2, 306, 307, 7, 86, 2, 2, 307, 308, 7, 75, 2, 2, 308, 309, 7, 81, 2, - 2, 309, 310, 7, 80, 2, 2, 310, 311, 7, 85, 2, 2, 311, 78, 3, 2, 2, 2, 312, - 313, 7, 86, 2, 2, 313, 314, 7, 75, 2, 2, 314, 315, 7, 79, 2, 2, 315, 316, - 7, 71, 2, 2, 316, 317, 7, 81, 2, 2, 317, 318, 7, 87, 2, 2, 318, 319, 7, - 86, 2, 2, 319, 80, 3, 2, 2, 2, 320, 321, 7, 70, 2, 2, 321, 322, 7, 75, - 2, 2, 322, 323, 7, 85, 2, 2, 323, 324, 7, 86, 2, 2, 324, 325, 7, 75, 2, - 2, 325, 326, 7, 80, 2, 2, 326, 327, 7, 69, 2, 2, 327, 328, 7, 86, 2, 2, - 328, 82, 3, 2, 2, 2, 329, 330, 7, 72, 2, 2, 330, 331, 7, 75, 2, 2, 331, - 332, 7, 78, 2, 2, 332, 333, 7, 86, 2, 2, 333, 334, 7, 71, 2, 2, 334, 335, - 7, 84, 2, 2, 335, 84, 3, 2, 2, 2, 336, 337, 7, 69, 2, 2, 337, 338, 7, 87, - 2, 2, 338, 339, 7, 84, 2, 2, 339, 340, 7, 84, 2, 2, 340, 341, 7, 71, 2, - 2, 341, 342, 7, 80, 2, 2, 342, 343, 7, 86, 2, 2, 343, 86, 3, 2, 2, 2, 344, - 345, 7, 85, 2, 2, 345, 346, 7, 81, 2, 2, 346, 347, 7, 84, 2, 2, 347, 348, - 7, 86, 2, 2, 348, 88, 3, 2, 2, 2, 349, 350, 7, 78, 2, 2, 350, 351, 7, 75, - 2, 2, 351, 352, 7, 79, 2, 2, 352, 353, 7, 75, 2, 2, 353, 354, 7, 86, 2, - 2, 354, 90, 3, 2, 2, 2, 355, 356, 7, 78, 2, 2, 356, 357, 7, 71, 2, 2, 357, - 358, 7, 86, 2, 2, 358, 92, 3, 2, 2, 2, 359, 360, 7, 69, 2, 2, 360, 361, - 7, 81, 2, 2, 361, 362, 7, 78, 2, 2, 362, 363, 7, 78, 2, 2, 363, 364, 7, - 71, 2, 2, 364, 365, 7, 69, 2, 2, 365, 366, 7, 86, 2, 2, 366, 94, 3, 2, - 2, 2, 367, 368, 7, 67, 2, 2, 368, 369, 7, 85, 2, 2, 369, 375, 7, 69, 2, - 2, 370, 371, 7, 70, 2, 2, 371, 372, 7, 71, 2, 2, 372, 373, 7, 85, 2, 2, - 373, 375, 7, 69, 2, 2, 374, 367, 3, 2, 2, 2, 374, 370, 3, 2, 2, 2, 375, - 96, 3, 2, 2, 2, 376, 377, 7, 80, 2, 2, 377, 378, 7, 81, 2, 2, 378, 379, - 7, 80, 2, 2, 379, 380, 7, 71, 2, 2, 380, 98, 3, 2, 2, 2, 381, 382, 7, 80, - 2, 2, 382, 383, 7, 87, 2, 2, 383, 384, 7, 78, 2, 2, 384, 385, 7, 78, 2, - 2, 385, 100, 3, 2, 2, 2, 386, 387, 7, 86, 2, 2, 387, 388, 7, 84, 2, 2, - 388, 389, 7, 87, 2, 2, 389, 405, 7, 71, 2, 2, 390, 391, 7, 118, 2, 2, 391, - 392, 7, 116, 2, 2, 392, 393, 7, 119, 2, 2, 393, 405, 7, 103, 2, 2, 394, - 395, 7, 72, 2, 2, 395, 396, 7, 67, 2, 2, 396, 397, 7, 78, 2, 2, 397, 398, - 7, 85, 2, 2, 398, 405, 7, 71, 2, 2, 399, 400, 7, 104, 2, 2, 400, 401, 7, - 99, 2, 2, 401, 402, 7, 110, 2, 2, 402, 403, 7, 117, 2, 2, 403, 405, 7, - 103, 2, 2, 404, 386, 3, 2, 2, 2, 404, 390, 3, 2, 2, 2, 404, 394, 3, 2, - 2, 2, 404, 399, 3, 2, 2, 2, 405, 102, 3, 2, 2, 2, 406, 407, 7, 87, 2, 2, - 407, 408, 7, 85, 2, 2, 408, 409, 7, 71, 2, 2, 409, 104, 3, 2, 2, 2, 410, - 411, 7, 75, 2, 2, 411, 412, 7, 80, 2, 2, 412, 413, 7, 86, 2, 2, 413, 414, - 7, 81, 2, 2, 414, 106, 3, 2, 2, 2, 415, 416, 7, 77, 2, 2, 416, 417, 7, - 71, 2, 2, 417, 418, 7, 71, 2, 2, 418, 419, 7, 82, 2, 2, 419, 108, 3, 2, - 2, 2, 420, 421, 7, 89, 2, 2, 421, 422, 7, 75, 2, 2, 422, 423, 7, 86, 2, - 2, 423, 424, 7, 74, 2, 2, 424, 110, 3, 2, 2, 2, 425, 426, 7, 69, 2, 2, - 426, 427, 7, 81, 2, 2, 427, 428, 7, 87, 2, 2, 428, 429, 7, 80, 2, 2, 429, - 430, 7, 86, 2, 2, 430, 112, 3, 2, 2, 2, 431, 432, 7, 67, 2, 2, 432, 433, - 7, 78, 2, 2, 433, 434, 7, 78, 2, 2, 434, 114, 3, 2, 2, 2, 435, 436, 7, - 67, 2, 2, 436, 437, 7, 80, 2, 2, 437, 438, 7, 91, 2, 2, 438, 116, 3, 2, - 2, 2, 439, 440, 7, 67, 2, 2, 440, 441, 7, 73, 2, 2, 441, 442, 7, 73, 2, - 2, 442, 443, 7, 84, 2, 2, 443, 444, 7, 71, 2, 2, 444, 445, 7, 73, 2, 2, - 445, 446, 7, 67, 2, 2, 446, 447, 7, 86, 2, 2, 447, 448, 7, 71, 2, 2, 448, - 118, 3, 2, 2, 2, 449, 450, 7, 71, 2, 2, 450, 451, 7, 88, 2, 2, 451, 452, - 7, 71, 2, 2, 452, 453, 7, 80, 2, 2, 453, 454, 7, 86, 2, 2, 454, 120, 3, - 2, 2, 2, 455, 456, 7, 78, 2, 2, 456, 457, 7, 75, 2, 2, 457, 458, 7, 77, - 2, 2, 458, 459, 7, 71, 2, 2, 459, 122, 3, 2, 2, 2, 460, 461, 7, 80, 2, - 2, 461, 462, 7, 81, 2, 2, 462, 465, 7, 86, 2, 2, 463, 465, 7, 35, 2, 2, - 464, 460, 3, 2, 2, 2, 464, 463, 3, 2, 2, 2, 465, 124, 3, 2, 2, 2, 466, - 467, 7, 75, 2, 2, 467, 468, 7, 80, 2, 2, 468, 126, 3, 2, 2, 2, 469, 470, - 7, 70, 2, 2, 470, 471, 7, 81, 2, 2, 471, 128, 3, 2, 2, 2, 472, 473, 7, - 89, 2, 2, 473, 474, 7, 74, 2, 2, 474, 475, 7, 75, 2, 2, 475, 476, 7, 78, - 2, 2, 476, 477, 7, 71, 2, 2, 477, 130, 3, 2, 2, 2, 478, 479, 7, 66, 2, - 2, 479, 132, 3, 2, 2, 2, 480, 482, 5, 153, 77, 2, 481, 480, 3, 2, 2, 2, - 482, 483, 3, 2, 2, 2, 483, 481, 3, 2, 2, 2, 483, 484, 3, 2, 2, 2, 484, - 494, 3, 2, 2, 2, 485, 489, 5, 155, 78, 2, 486, 488, 5, 133, 67, 2, 487, - 486, 3, 2, 2, 2, 488, 491, 3, 2, 2, 2, 489, 487, 3, 2, 2, 2, 489, 490, - 3, 2, 2, 2, 490, 493, 3, 2, 2, 2, 491, 489, 3, 2, 2, 2, 492, 485, 3, 2, - 2, 2, 493, 496, 3, 2, 2, 2, 494, 492, 3, 2, 2, 2, 494, 495, 3, 2, 2, 2, - 495, 506, 3, 2, 2, 2, 496, 494, 3, 2, 2, 2, 497, 501, 5, 159, 80, 2, 498, - 500, 5, 133, 67, 2, 499, 498, 3, 2, 2, 2, 500, 503, 3, 2, 2, 2, 501, 499, - 3, 2, 2, 2, 501, 502, 3, 2, 2, 2, 502, 505, 3, 2, 2, 2, 503, 501, 3, 2, - 2, 2, 504, 497, 3, 2, 2, 2, 505, 508, 3, 2, 2, 2, 506, 504, 3, 2, 2, 2, - 506, 507, 3, 2, 2, 2, 507, 134, 3, 2, 2, 2, 508, 506, 3, 2, 2, 2, 509, - 510, 5, 157, 79, 2, 510, 136, 3, 2, 2, 2, 511, 516, 5, 163, 82, 2, 512, - 516, 5, 161, 81, 2, 513, 516, 5, 165, 83, 2, 514, 516, 5, 167, 84, 2, 515, - 511, 3, 2, 2, 2, 515, 512, 3, 2, 2, 2, 515, 513, 3, 2, 2, 2, 515, 514, - 3, 2, 2, 2, 516, 138, 3, 2, 2, 2, 517, 519, 9, 4, 2, 2, 518, 517, 3, 2, - 2, 2, 519, 520, 3, 2, 2, 2, 520, 518, 3, 2, 2, 2, 520, 521, 3, 2, 2, 2, - 521, 140, 3, 2, 2, 2, 522, 523, 5, 149, 75, 2, 523, 525, 5, 15, 8, 2, 524, - 526, 9, 4, 2, 2, 525, 524, 3, 2, 2, 2, 526, 527, 3, 2, 2, 2, 527, 525, - 3, 2, 2, 2, 527, 528, 3, 2, 2, 2, 528, 530, 3, 2, 2, 2, 529, 531, 5, 151, - 76, 2, 530, 529, 3, 2, 2, 2, 530, 531, 3, 2, 2, 2, 531, 537, 3, 2, 2, 2, - 532, 534, 5, 149, 75, 2, 533, 535, 5, 151, 76, 2, 534, 533, 3, 2, 2, 2, - 534, 535, 3, 2, 2, 2, 535, 537, 3, 2, 2, 2, 536, 522, 3, 2, 2, 2, 536, - 532, 3, 2, 2, 2, 537, 142, 3, 2, 2, 2, 538, 539, 5, 133, 67, 2, 539, 540, - 5, 169, 85, 2, 540, 144, 3, 2, 2, 2, 541, 542, 11, 2, 2, 2, 542, 146, 3, - 2, 2, 2, 543, 544, 9, 5, 2, 2, 544, 148, 3, 2, 2, 2, 545, 554, 7, 50, 2, - 2, 546, 550, 9, 6, 2, 2, 547, 549, 9, 4, 2, 2, 548, 547, 3, 2, 2, 2, 549, - 552, 3, 2, 2, 2, 550, 548, 3, 2, 2, 2, 550, 551, 3, 2, 2, 2, 551, 554, - 3, 2, 2, 2, 552, 550, 3, 2, 2, 2, 553, 545, 3, 2, 2, 2, 553, 546, 3, 2, - 2, 2, 554, 150, 3, 2, 2, 2, 555, 557, 9, 7, 2, 2, 556, 558, 9, 8, 2, 2, - 557, 556, 3, 2, 2, 2, 557, 558, 3, 2, 2, 2, 558, 560, 3, 2, 2, 2, 559, - 561, 9, 4, 2, 2, 560, 559, 3, 2, 2, 2, 561, 562, 3, 2, 2, 2, 562, 560, - 3, 2, 2, 2, 562, 563, 3, 2, 2, 2, 563, 152, 3, 2, 2, 2, 564, 565, 9, 9, - 2, 2, 565, 154, 3, 2, 2, 2, 566, 567, 5, 157, 79, 2, 567, 156, 3, 2, 2, - 2, 568, 569, 7, 97, 2, 2, 569, 158, 3, 2, 2, 2, 570, 571, 4, 50, 59, 2, - 571, 160, 3, 2, 2, 2, 572, 580, 7, 36, 2, 2, 573, 574, 7, 94, 2, 2, 574, - 579, 11, 2, 2, 2, 575, 576, 7, 36, 2, 2, 576, 579, 7, 36, 2, 2, 577, 579, - 10, 10, 2, 2, 578, 573, 3, 2, 2, 2, 578, 575, 3, 2, 2, 2, 578, 577, 3, - 2, 2, 2, 579, 582, 3, 2, 2, 2, 580, 578, 3, 2, 2, 2, 580, 581, 3, 2, 2, - 2, 581, 583, 3, 2, 2, 2, 582, 580, 3, 2, 2, 2, 583, 584, 7, 36, 2, 2, 584, - 162, 3, 2, 2, 2, 585, 593, 7, 41, 2, 2, 586, 587, 7, 94, 2, 2, 587, 592, - 11, 2, 2, 2, 588, 589, 7, 41, 2, 2, 589, 592, 7, 41, 2, 2, 590, 592, 10, - 11, 2, 2, 591, 586, 3, 2, 2, 2, 591, 588, 3, 2, 2, 2, 591, 590, 3, 2, 2, - 2, 592, 595, 3, 2, 2, 2, 593, 591, 3, 2, 2, 2, 593, 594, 3, 2, 2, 2, 594, - 596, 3, 2, 2, 2, 595, 593, 3, 2, 2, 2, 596, 597, 7, 41, 2, 2, 597, 164, - 3, 2, 2, 2, 598, 604, 7, 98, 2, 2, 599, 600, 7, 94, 2, 2, 600, 603, 7, - 98, 2, 2, 601, 603, 10, 12, 2, 2, 602, 599, 3, 2, 2, 2, 602, 601, 3, 2, - 2, 2, 603, 606, 3, 2, 2, 2, 604, 602, 3, 2, 2, 2, 604, 605, 3, 2, 2, 2, - 605, 607, 3, 2, 2, 2, 606, 604, 3, 2, 2, 2, 607, 608, 7, 98, 2, 2, 608, - 166, 3, 2, 2, 2, 609, 615, 7, 182, 2, 2, 610, 611, 7, 94, 2, 2, 611, 614, - 7, 182, 2, 2, 612, 614, 10, 13, 2, 2, 613, 610, 3, 2, 2, 2, 613, 612, 3, - 2, 2, 2, 614, 617, 3, 2, 2, 2, 615, 613, 3, 2, 2, 2, 615, 616, 3, 2, 2, - 2, 616, 618, 3, 2, 2, 2, 617, 615, 3, 2, 2, 2, 618, 619, 7, 182, 2, 2, - 619, 168, 3, 2, 2, 2, 620, 621, 7, 60, 2, 2, 621, 622, 7, 60, 2, 2, 622, - 170, 3, 2, 2, 2, 34, 2, 177, 191, 199, 264, 270, 374, 404, 464, 483, 489, - 494, 501, 506, 515, 520, 527, 530, 534, 536, 550, 553, 557, 562, 578, 580, - 591, 593, 602, 604, 613, 615, 3, 2, 3, 2, -} - -var lexerChannelNames = []string{ - "DEFAULT_TOKEN_CHANNEL", "HIDDEN", -} - -var lexerModeNames = []string{ - "DEFAULT_MODE", -} - -var lexerLiteralNames = []string{ - "", "", "", "", "", "':'", "';'", "'.'", "','", "'['", "']'", "'('", "')'", - "'{'", "'}'", "'>'", "'<'", "'=='", "'>='", "'<='", "'!='", "'*'", "'/'", - "'%'", "'+'", "'-'", "'--'", "'++'", "", "", "", "'='", "'?'", "'!~'", - "'=~'", "'FOR'", "'RETURN'", "'WAITFOR'", "'OPTIONS'", "'TIMEOUT'", "'DISTINCT'", - "'FILTER'", "'CURRENT'", "'SORT'", "'LIMIT'", "'LET'", "'COLLECT'", "", - "'NONE'", "'NULL'", "", "'USE'", "'INTO'", "'KEEP'", "'WITH'", "'COUNT'", - "'ALL'", "'ANY'", "'AGGREGATE'", "'EVENT'", "'LIKE'", "", "'IN'", "'DO'", - "'WHILE'", "'@'", +type FqlLexer struct { + *antlr.BaseLexer + channelNames []string + modeNames []string + // TODO: EOF string } -var lexerSymbolicNames = []string{ - "", "MultiLineComment", "SingleLineComment", "WhiteSpaces", "LineTerminator", - "Colon", "SemiColon", "Dot", "Comma", "OpenBracket", "CloseBracket", "OpenParen", - "CloseParen", "OpenBrace", "CloseBrace", "Gt", "Lt", "Eq", "Gte", "Lte", - "Neq", "Multi", "Div", "Mod", "Plus", "Minus", "MinusMinus", "PlusPlus", - "And", "Or", "Range", "Assign", "QuestionMark", "RegexNotMatch", "RegexMatch", - "For", "Return", "Waitfor", "Options", "Timeout", "Distinct", "Filter", - "Current", "Sort", "Limit", "Let", "Collect", "SortDirection", "None", - "Null", "BooleanLiteral", "Use", "Into", "Keep", "With", "Count", "All", - "Any", "Aggregate", "Event", "Like", "Not", "In", "Do", "While", "Param", - "Identifier", "IgnoreIdentifier", "StringLiteral", "IntegerLiteral", "FloatLiteral", - "NamespaceSegment", "UnknownIdentifier", +var fqllexerLexerStaticData struct { + once sync.Once + serializedATN []int32 + channelNames []string + modeNames []string + literalNames []string + symbolicNames []string + ruleNames []string + predictionContextCache *antlr.PredictionContextCache + atn *antlr.ATN + decisionToDFA []*antlr.DFA } -var lexerRuleNames = []string{ - "MultiLineComment", "SingleLineComment", "WhiteSpaces", "LineTerminator", - "Colon", "SemiColon", "Dot", "Comma", "OpenBracket", "CloseBracket", "OpenParen", - "CloseParen", "OpenBrace", "CloseBrace", "Gt", "Lt", "Eq", "Gte", "Lte", - "Neq", "Multi", "Div", "Mod", "Plus", "Minus", "MinusMinus", "PlusPlus", - "And", "Or", "Range", "Assign", "QuestionMark", "RegexNotMatch", "RegexMatch", - "For", "Return", "Waitfor", "Options", "Timeout", "Distinct", "Filter", - "Current", "Sort", "Limit", "Let", "Collect", "SortDirection", "None", - "Null", "BooleanLiteral", "Use", "Into", "Keep", "With", "Count", "All", - "Any", "Aggregate", "Event", "Like", "Not", "In", "Do", "While", "Param", - "Identifier", "IgnoreIdentifier", "StringLiteral", "IntegerLiteral", "FloatLiteral", - "NamespaceSegment", "UnknownIdentifier", "HexDigit", "DecimalIntegerLiteral", - "ExponentPart", "Letter", "Symbols", "Underscore", "Digit", "DQSring", - "SQString", "BacktickString", "TickString", "NamespaceSeparator", +func fqllexerLexerInit() { + staticData := &fqllexerLexerStaticData + staticData.channelNames = []string{ + "DEFAULT_TOKEN_CHANNEL", "HIDDEN", + } + staticData.modeNames = []string{ + "DEFAULT_MODE", + } + staticData.literalNames = []string{ + "", "", "", "", "", "':'", "';'", "'.'", "','", "'['", "']'", "'('", + "')'", "'{'", "'}'", "'>'", "'<'", "'=='", "'>='", "'<='", "'!='", "'*'", + "'/'", "'%'", "'+'", "'-'", "'--'", "'++'", "", "", "", "'='", "'?'", + "'!~'", "'=~'", "'FOR'", "'RETURN'", "'WAITFOR'", "'OPTIONS'", "'TIMEOUT'", + "'DISTINCT'", "'FILTER'", "'CURRENT'", "'SORT'", "'LIMIT'", "'LET'", + "'COLLECT'", "", "'NONE'", "'NULL'", "", "'USE'", "'INTO'", "'KEEP'", + "'WITH'", "'COUNT'", "'ALL'", "'ANY'", "'AGGREGATE'", "'EVENT'", "'LIKE'", + "", "'IN'", "'DO'", "'WHILE'", "'@'", + } + staticData.symbolicNames = []string{ + "", "MultiLineComment", "SingleLineComment", "WhiteSpaces", "LineTerminator", + "Colon", "SemiColon", "Dot", "Comma", "OpenBracket", "CloseBracket", + "OpenParen", "CloseParen", "OpenBrace", "CloseBrace", "Gt", "Lt", "Eq", + "Gte", "Lte", "Neq", "Multi", "Div", "Mod", "Plus", "Minus", "MinusMinus", + "PlusPlus", "And", "Or", "Range", "Assign", "QuestionMark", "RegexNotMatch", + "RegexMatch", "For", "Return", "Waitfor", "Options", "Timeout", "Distinct", + "Filter", "Current", "Sort", "Limit", "Let", "Collect", "SortDirection", + "None", "Null", "BooleanLiteral", "Use", "Into", "Keep", "With", "Count", + "All", "Any", "Aggregate", "Event", "Like", "Not", "In", "Do", "While", + "Param", "Identifier", "IgnoreIdentifier", "StringLiteral", "IntegerLiteral", + "FloatLiteral", "NamespaceSegment", "UnknownIdentifier", + } + staticData.ruleNames = []string{ + "MultiLineComment", "SingleLineComment", "WhiteSpaces", "LineTerminator", + "Colon", "SemiColon", "Dot", "Comma", "OpenBracket", "CloseBracket", + "OpenParen", "CloseParen", "OpenBrace", "CloseBrace", "Gt", "Lt", "Eq", + "Gte", "Lte", "Neq", "Multi", "Div", "Mod", "Plus", "Minus", "MinusMinus", + "PlusPlus", "And", "Or", "Range", "Assign", "QuestionMark", "RegexNotMatch", + "RegexMatch", "For", "Return", "Waitfor", "Options", "Timeout", "Distinct", + "Filter", "Current", "Sort", "Limit", "Let", "Collect", "SortDirection", + "None", "Null", "BooleanLiteral", "Use", "Into", "Keep", "With", "Count", + "All", "Any", "Aggregate", "Event", "Like", "Not", "In", "Do", "While", + "Param", "Identifier", "IgnoreIdentifier", "StringLiteral", "IntegerLiteral", + "FloatLiteral", "NamespaceSegment", "UnknownIdentifier", "HexDigit", + "DecimalIntegerLiteral", "ExponentPart", "Letter", "Symbols", "Underscore", + "Digit", "DQSring", "SQString", "BacktickString", "TickString", "NamespaceSeparator", + } + staticData.predictionContextCache = antlr.NewPredictionContextCache() + staticData.serializedATN = []int32{ + 4, 0, 72, 621, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, + 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, + 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, + 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, + 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, + 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, + 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, + 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, + 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, + 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, + 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, + 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, + 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, + 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, + 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, + 83, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 174, 8, 0, 10, 0, 12, 0, 177, 9, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 188, 8, 1, 10, + 1, 12, 1, 191, 9, 1, 1, 1, 1, 1, 1, 2, 4, 2, 196, 8, 2, 11, 2, 12, 2, 197, + 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, + 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, + 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, + 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 19, 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, + 25, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 3, 27, 263, + 8, 27, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 269, 8, 28, 1, 29, 1, 29, 1, + 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, + 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, + 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, + 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, + 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, + 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, + 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, + 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, + 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, + 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 3, 46, 373, 8, 46, 1, 47, 1, 47, 1, + 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, + 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, + 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 403, 8, 49, 1, 50, 1, 50, 1, 50, + 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, + 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, + 1, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 56, 1, 57, 1, + 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, + 1, 58, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 60, 1, + 60, 1, 60, 1, 60, 3, 60, 463, 8, 60, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, + 1, 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 65, 4, + 65, 480, 8, 65, 11, 65, 12, 65, 481, 1, 65, 1, 65, 5, 65, 486, 8, 65, 10, + 65, 12, 65, 489, 9, 65, 5, 65, 491, 8, 65, 10, 65, 12, 65, 494, 9, 65, + 1, 65, 1, 65, 5, 65, 498, 8, 65, 10, 65, 12, 65, 501, 9, 65, 5, 65, 503, + 8, 65, 10, 65, 12, 65, 506, 9, 65, 1, 66, 1, 66, 1, 67, 1, 67, 1, 67, 1, + 67, 3, 67, 514, 8, 67, 1, 68, 4, 68, 517, 8, 68, 11, 68, 12, 68, 518, 1, + 69, 1, 69, 1, 69, 4, 69, 524, 8, 69, 11, 69, 12, 69, 525, 1, 69, 3, 69, + 529, 8, 69, 1, 69, 1, 69, 3, 69, 533, 8, 69, 3, 69, 535, 8, 69, 1, 70, + 1, 70, 1, 70, 1, 71, 1, 71, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 5, 73, 547, + 8, 73, 10, 73, 12, 73, 550, 9, 73, 3, 73, 552, 8, 73, 1, 74, 1, 74, 3, + 74, 556, 8, 74, 1, 74, 4, 74, 559, 8, 74, 11, 74, 12, 74, 560, 1, 75, 1, + 75, 1, 76, 1, 76, 1, 77, 1, 77, 1, 78, 1, 78, 1, 79, 1, 79, 1, 79, 1, 79, + 1, 79, 1, 79, 5, 79, 577, 8, 79, 10, 79, 12, 79, 580, 9, 79, 1, 79, 1, + 79, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 5, 80, 590, 8, 80, 10, 80, + 12, 80, 593, 9, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 5, 81, 601, + 8, 81, 10, 81, 12, 81, 604, 9, 81, 1, 81, 1, 81, 1, 82, 1, 82, 1, 82, 1, + 82, 5, 82, 612, 8, 82, 10, 82, 12, 82, 615, 9, 82, 1, 82, 1, 82, 1, 83, + 1, 83, 1, 83, 1, 175, 0, 84, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, + 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, + 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, + 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, + 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, + 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, + 53, 107, 54, 109, 55, 111, 56, 113, 57, 115, 58, 117, 59, 119, 60, 121, + 61, 123, 62, 125, 63, 127, 64, 129, 65, 131, 66, 133, 67, 135, 68, 137, + 69, 139, 70, 141, 71, 143, 72, 145, 0, 147, 0, 149, 0, 151, 0, 153, 0, + 155, 0, 157, 0, 159, 0, 161, 0, 163, 0, 165, 0, 167, 0, 1, 0, 12, 3, 0, + 10, 10, 13, 13, 8232, 8233, 4, 0, 9, 9, 11, 12, 32, 32, 160, 160, 1, 0, + 48, 57, 3, 0, 48, 57, 65, 70, 97, 102, 1, 0, 49, 57, 2, 0, 69, 69, 101, + 101, 2, 0, 43, 43, 45, 45, 2, 0, 65, 90, 97, 122, 2, 0, 34, 34, 92, 92, + 2, 0, 39, 39, 92, 92, 1, 0, 96, 96, 1, 0, 180, 180, 645, 0, 1, 1, 0, 0, + 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, + 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, + 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, + 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, + 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, + 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, + 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, + 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, + 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, + 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, + 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, + 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, + 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, + 0, 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, 0, 109, + 1, 0, 0, 0, 0, 111, 1, 0, 0, 0, 0, 113, 1, 0, 0, 0, 0, 115, 1, 0, 0, 0, + 0, 117, 1, 0, 0, 0, 0, 119, 1, 0, 0, 0, 0, 121, 1, 0, 0, 0, 0, 123, 1, + 0, 0, 0, 0, 125, 1, 0, 0, 0, 0, 127, 1, 0, 0, 0, 0, 129, 1, 0, 0, 0, 0, + 131, 1, 0, 0, 0, 0, 133, 1, 0, 0, 0, 0, 135, 1, 0, 0, 0, 0, 137, 1, 0, + 0, 0, 0, 139, 1, 0, 0, 0, 0, 141, 1, 0, 0, 0, 0, 143, 1, 0, 0, 0, 1, 169, + 1, 0, 0, 0, 3, 183, 1, 0, 0, 0, 5, 195, 1, 0, 0, 0, 7, 201, 1, 0, 0, 0, + 9, 205, 1, 0, 0, 0, 11, 207, 1, 0, 0, 0, 13, 209, 1, 0, 0, 0, 15, 211, + 1, 0, 0, 0, 17, 213, 1, 0, 0, 0, 19, 215, 1, 0, 0, 0, 21, 217, 1, 0, 0, + 0, 23, 219, 1, 0, 0, 0, 25, 221, 1, 0, 0, 0, 27, 223, 1, 0, 0, 0, 29, 225, + 1, 0, 0, 0, 31, 227, 1, 0, 0, 0, 33, 229, 1, 0, 0, 0, 35, 232, 1, 0, 0, + 0, 37, 235, 1, 0, 0, 0, 39, 238, 1, 0, 0, 0, 41, 241, 1, 0, 0, 0, 43, 243, + 1, 0, 0, 0, 45, 245, 1, 0, 0, 0, 47, 247, 1, 0, 0, 0, 49, 249, 1, 0, 0, + 0, 51, 251, 1, 0, 0, 0, 53, 254, 1, 0, 0, 0, 55, 262, 1, 0, 0, 0, 57, 268, + 1, 0, 0, 0, 59, 270, 1, 0, 0, 0, 61, 273, 1, 0, 0, 0, 63, 275, 1, 0, 0, + 0, 65, 277, 1, 0, 0, 0, 67, 280, 1, 0, 0, 0, 69, 283, 1, 0, 0, 0, 71, 287, + 1, 0, 0, 0, 73, 294, 1, 0, 0, 0, 75, 302, 1, 0, 0, 0, 77, 310, 1, 0, 0, + 0, 79, 318, 1, 0, 0, 0, 81, 327, 1, 0, 0, 0, 83, 334, 1, 0, 0, 0, 85, 342, + 1, 0, 0, 0, 87, 347, 1, 0, 0, 0, 89, 353, 1, 0, 0, 0, 91, 357, 1, 0, 0, + 0, 93, 372, 1, 0, 0, 0, 95, 374, 1, 0, 0, 0, 97, 379, 1, 0, 0, 0, 99, 402, + 1, 0, 0, 0, 101, 404, 1, 0, 0, 0, 103, 408, 1, 0, 0, 0, 105, 413, 1, 0, + 0, 0, 107, 418, 1, 0, 0, 0, 109, 423, 1, 0, 0, 0, 111, 429, 1, 0, 0, 0, + 113, 433, 1, 0, 0, 0, 115, 437, 1, 0, 0, 0, 117, 447, 1, 0, 0, 0, 119, + 453, 1, 0, 0, 0, 121, 462, 1, 0, 0, 0, 123, 464, 1, 0, 0, 0, 125, 467, + 1, 0, 0, 0, 127, 470, 1, 0, 0, 0, 129, 476, 1, 0, 0, 0, 131, 479, 1, 0, + 0, 0, 133, 507, 1, 0, 0, 0, 135, 513, 1, 0, 0, 0, 137, 516, 1, 0, 0, 0, + 139, 534, 1, 0, 0, 0, 141, 536, 1, 0, 0, 0, 143, 539, 1, 0, 0, 0, 145, + 541, 1, 0, 0, 0, 147, 551, 1, 0, 0, 0, 149, 553, 1, 0, 0, 0, 151, 562, + 1, 0, 0, 0, 153, 564, 1, 0, 0, 0, 155, 566, 1, 0, 0, 0, 157, 568, 1, 0, + 0, 0, 159, 570, 1, 0, 0, 0, 161, 583, 1, 0, 0, 0, 163, 596, 1, 0, 0, 0, + 165, 607, 1, 0, 0, 0, 167, 618, 1, 0, 0, 0, 169, 170, 5, 47, 0, 0, 170, + 171, 5, 42, 0, 0, 171, 175, 1, 0, 0, 0, 172, 174, 9, 0, 0, 0, 173, 172, + 1, 0, 0, 0, 174, 177, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 175, 173, 1, 0, + 0, 0, 176, 178, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 178, 179, 5, 42, 0, 0, + 179, 180, 5, 47, 0, 0, 180, 181, 1, 0, 0, 0, 181, 182, 6, 0, 0, 0, 182, + 2, 1, 0, 0, 0, 183, 184, 5, 47, 0, 0, 184, 185, 5, 47, 0, 0, 185, 189, + 1, 0, 0, 0, 186, 188, 8, 0, 0, 0, 187, 186, 1, 0, 0, 0, 188, 191, 1, 0, + 0, 0, 189, 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 192, 1, 0, 0, 0, + 191, 189, 1, 0, 0, 0, 192, 193, 6, 1, 0, 0, 193, 4, 1, 0, 0, 0, 194, 196, + 7, 1, 0, 0, 195, 194, 1, 0, 0, 0, 196, 197, 1, 0, 0, 0, 197, 195, 1, 0, + 0, 0, 197, 198, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 200, 6, 2, 0, 0, + 200, 6, 1, 0, 0, 0, 201, 202, 7, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 204, + 6, 3, 0, 0, 204, 8, 1, 0, 0, 0, 205, 206, 5, 58, 0, 0, 206, 10, 1, 0, 0, + 0, 207, 208, 5, 59, 0, 0, 208, 12, 1, 0, 0, 0, 209, 210, 5, 46, 0, 0, 210, + 14, 1, 0, 0, 0, 211, 212, 5, 44, 0, 0, 212, 16, 1, 0, 0, 0, 213, 214, 5, + 91, 0, 0, 214, 18, 1, 0, 0, 0, 215, 216, 5, 93, 0, 0, 216, 20, 1, 0, 0, + 0, 217, 218, 5, 40, 0, 0, 218, 22, 1, 0, 0, 0, 219, 220, 5, 41, 0, 0, 220, + 24, 1, 0, 0, 0, 221, 222, 5, 123, 0, 0, 222, 26, 1, 0, 0, 0, 223, 224, + 5, 125, 0, 0, 224, 28, 1, 0, 0, 0, 225, 226, 5, 62, 0, 0, 226, 30, 1, 0, + 0, 0, 227, 228, 5, 60, 0, 0, 228, 32, 1, 0, 0, 0, 229, 230, 5, 61, 0, 0, + 230, 231, 5, 61, 0, 0, 231, 34, 1, 0, 0, 0, 232, 233, 5, 62, 0, 0, 233, + 234, 5, 61, 0, 0, 234, 36, 1, 0, 0, 0, 235, 236, 5, 60, 0, 0, 236, 237, + 5, 61, 0, 0, 237, 38, 1, 0, 0, 0, 238, 239, 5, 33, 0, 0, 239, 240, 5, 61, + 0, 0, 240, 40, 1, 0, 0, 0, 241, 242, 5, 42, 0, 0, 242, 42, 1, 0, 0, 0, + 243, 244, 5, 47, 0, 0, 244, 44, 1, 0, 0, 0, 245, 246, 5, 37, 0, 0, 246, + 46, 1, 0, 0, 0, 247, 248, 5, 43, 0, 0, 248, 48, 1, 0, 0, 0, 249, 250, 5, + 45, 0, 0, 250, 50, 1, 0, 0, 0, 251, 252, 5, 45, 0, 0, 252, 253, 5, 45, + 0, 0, 253, 52, 1, 0, 0, 0, 254, 255, 5, 43, 0, 0, 255, 256, 5, 43, 0, 0, + 256, 54, 1, 0, 0, 0, 257, 258, 5, 65, 0, 0, 258, 259, 5, 78, 0, 0, 259, + 263, 5, 68, 0, 0, 260, 261, 5, 38, 0, 0, 261, 263, 5, 38, 0, 0, 262, 257, + 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 263, 56, 1, 0, 0, 0, 264, 265, 5, 79, + 0, 0, 265, 269, 5, 82, 0, 0, 266, 267, 5, 124, 0, 0, 267, 269, 5, 124, + 0, 0, 268, 264, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 269, 58, 1, 0, 0, 0, + 270, 271, 3, 13, 6, 0, 271, 272, 3, 13, 6, 0, 272, 60, 1, 0, 0, 0, 273, + 274, 5, 61, 0, 0, 274, 62, 1, 0, 0, 0, 275, 276, 5, 63, 0, 0, 276, 64, + 1, 0, 0, 0, 277, 278, 5, 33, 0, 0, 278, 279, 5, 126, 0, 0, 279, 66, 1, + 0, 0, 0, 280, 281, 5, 61, 0, 0, 281, 282, 5, 126, 0, 0, 282, 68, 1, 0, + 0, 0, 283, 284, 5, 70, 0, 0, 284, 285, 5, 79, 0, 0, 285, 286, 5, 82, 0, + 0, 286, 70, 1, 0, 0, 0, 287, 288, 5, 82, 0, 0, 288, 289, 5, 69, 0, 0, 289, + 290, 5, 84, 0, 0, 290, 291, 5, 85, 0, 0, 291, 292, 5, 82, 0, 0, 292, 293, + 5, 78, 0, 0, 293, 72, 1, 0, 0, 0, 294, 295, 5, 87, 0, 0, 295, 296, 5, 65, + 0, 0, 296, 297, 5, 73, 0, 0, 297, 298, 5, 84, 0, 0, 298, 299, 5, 70, 0, + 0, 299, 300, 5, 79, 0, 0, 300, 301, 5, 82, 0, 0, 301, 74, 1, 0, 0, 0, 302, + 303, 5, 79, 0, 0, 303, 304, 5, 80, 0, 0, 304, 305, 5, 84, 0, 0, 305, 306, + 5, 73, 0, 0, 306, 307, 5, 79, 0, 0, 307, 308, 5, 78, 0, 0, 308, 309, 5, + 83, 0, 0, 309, 76, 1, 0, 0, 0, 310, 311, 5, 84, 0, 0, 311, 312, 5, 73, + 0, 0, 312, 313, 5, 77, 0, 0, 313, 314, 5, 69, 0, 0, 314, 315, 5, 79, 0, + 0, 315, 316, 5, 85, 0, 0, 316, 317, 5, 84, 0, 0, 317, 78, 1, 0, 0, 0, 318, + 319, 5, 68, 0, 0, 319, 320, 5, 73, 0, 0, 320, 321, 5, 83, 0, 0, 321, 322, + 5, 84, 0, 0, 322, 323, 5, 73, 0, 0, 323, 324, 5, 78, 0, 0, 324, 325, 5, + 67, 0, 0, 325, 326, 5, 84, 0, 0, 326, 80, 1, 0, 0, 0, 327, 328, 5, 70, + 0, 0, 328, 329, 5, 73, 0, 0, 329, 330, 5, 76, 0, 0, 330, 331, 5, 84, 0, + 0, 331, 332, 5, 69, 0, 0, 332, 333, 5, 82, 0, 0, 333, 82, 1, 0, 0, 0, 334, + 335, 5, 67, 0, 0, 335, 336, 5, 85, 0, 0, 336, 337, 5, 82, 0, 0, 337, 338, + 5, 82, 0, 0, 338, 339, 5, 69, 0, 0, 339, 340, 5, 78, 0, 0, 340, 341, 5, + 84, 0, 0, 341, 84, 1, 0, 0, 0, 342, 343, 5, 83, 0, 0, 343, 344, 5, 79, + 0, 0, 344, 345, 5, 82, 0, 0, 345, 346, 5, 84, 0, 0, 346, 86, 1, 0, 0, 0, + 347, 348, 5, 76, 0, 0, 348, 349, 5, 73, 0, 0, 349, 350, 5, 77, 0, 0, 350, + 351, 5, 73, 0, 0, 351, 352, 5, 84, 0, 0, 352, 88, 1, 0, 0, 0, 353, 354, + 5, 76, 0, 0, 354, 355, 5, 69, 0, 0, 355, 356, 5, 84, 0, 0, 356, 90, 1, + 0, 0, 0, 357, 358, 5, 67, 0, 0, 358, 359, 5, 79, 0, 0, 359, 360, 5, 76, + 0, 0, 360, 361, 5, 76, 0, 0, 361, 362, 5, 69, 0, 0, 362, 363, 5, 67, 0, + 0, 363, 364, 5, 84, 0, 0, 364, 92, 1, 0, 0, 0, 365, 366, 5, 65, 0, 0, 366, + 367, 5, 83, 0, 0, 367, 373, 5, 67, 0, 0, 368, 369, 5, 68, 0, 0, 369, 370, + 5, 69, 0, 0, 370, 371, 5, 83, 0, 0, 371, 373, 5, 67, 0, 0, 372, 365, 1, + 0, 0, 0, 372, 368, 1, 0, 0, 0, 373, 94, 1, 0, 0, 0, 374, 375, 5, 78, 0, + 0, 375, 376, 5, 79, 0, 0, 376, 377, 5, 78, 0, 0, 377, 378, 5, 69, 0, 0, + 378, 96, 1, 0, 0, 0, 379, 380, 5, 78, 0, 0, 380, 381, 5, 85, 0, 0, 381, + 382, 5, 76, 0, 0, 382, 383, 5, 76, 0, 0, 383, 98, 1, 0, 0, 0, 384, 385, + 5, 84, 0, 0, 385, 386, 5, 82, 0, 0, 386, 387, 5, 85, 0, 0, 387, 403, 5, + 69, 0, 0, 388, 389, 5, 116, 0, 0, 389, 390, 5, 114, 0, 0, 390, 391, 5, + 117, 0, 0, 391, 403, 5, 101, 0, 0, 392, 393, 5, 70, 0, 0, 393, 394, 5, + 65, 0, 0, 394, 395, 5, 76, 0, 0, 395, 396, 5, 83, 0, 0, 396, 403, 5, 69, + 0, 0, 397, 398, 5, 102, 0, 0, 398, 399, 5, 97, 0, 0, 399, 400, 5, 108, + 0, 0, 400, 401, 5, 115, 0, 0, 401, 403, 5, 101, 0, 0, 402, 384, 1, 0, 0, + 0, 402, 388, 1, 0, 0, 0, 402, 392, 1, 0, 0, 0, 402, 397, 1, 0, 0, 0, 403, + 100, 1, 0, 0, 0, 404, 405, 5, 85, 0, 0, 405, 406, 5, 83, 0, 0, 406, 407, + 5, 69, 0, 0, 407, 102, 1, 0, 0, 0, 408, 409, 5, 73, 0, 0, 409, 410, 5, + 78, 0, 0, 410, 411, 5, 84, 0, 0, 411, 412, 5, 79, 0, 0, 412, 104, 1, 0, + 0, 0, 413, 414, 5, 75, 0, 0, 414, 415, 5, 69, 0, 0, 415, 416, 5, 69, 0, + 0, 416, 417, 5, 80, 0, 0, 417, 106, 1, 0, 0, 0, 418, 419, 5, 87, 0, 0, + 419, 420, 5, 73, 0, 0, 420, 421, 5, 84, 0, 0, 421, 422, 5, 72, 0, 0, 422, + 108, 1, 0, 0, 0, 423, 424, 5, 67, 0, 0, 424, 425, 5, 79, 0, 0, 425, 426, + 5, 85, 0, 0, 426, 427, 5, 78, 0, 0, 427, 428, 5, 84, 0, 0, 428, 110, 1, + 0, 0, 0, 429, 430, 5, 65, 0, 0, 430, 431, 5, 76, 0, 0, 431, 432, 5, 76, + 0, 0, 432, 112, 1, 0, 0, 0, 433, 434, 5, 65, 0, 0, 434, 435, 5, 78, 0, + 0, 435, 436, 5, 89, 0, 0, 436, 114, 1, 0, 0, 0, 437, 438, 5, 65, 0, 0, + 438, 439, 5, 71, 0, 0, 439, 440, 5, 71, 0, 0, 440, 441, 5, 82, 0, 0, 441, + 442, 5, 69, 0, 0, 442, 443, 5, 71, 0, 0, 443, 444, 5, 65, 0, 0, 444, 445, + 5, 84, 0, 0, 445, 446, 5, 69, 0, 0, 446, 116, 1, 0, 0, 0, 447, 448, 5, + 69, 0, 0, 448, 449, 5, 86, 0, 0, 449, 450, 5, 69, 0, 0, 450, 451, 5, 78, + 0, 0, 451, 452, 5, 84, 0, 0, 452, 118, 1, 0, 0, 0, 453, 454, 5, 76, 0, + 0, 454, 455, 5, 73, 0, 0, 455, 456, 5, 75, 0, 0, 456, 457, 5, 69, 0, 0, + 457, 120, 1, 0, 0, 0, 458, 459, 5, 78, 0, 0, 459, 460, 5, 79, 0, 0, 460, + 463, 5, 84, 0, 0, 461, 463, 5, 33, 0, 0, 462, 458, 1, 0, 0, 0, 462, 461, + 1, 0, 0, 0, 463, 122, 1, 0, 0, 0, 464, 465, 5, 73, 0, 0, 465, 466, 5, 78, + 0, 0, 466, 124, 1, 0, 0, 0, 467, 468, 5, 68, 0, 0, 468, 469, 5, 79, 0, + 0, 469, 126, 1, 0, 0, 0, 470, 471, 5, 87, 0, 0, 471, 472, 5, 72, 0, 0, + 472, 473, 5, 73, 0, 0, 473, 474, 5, 76, 0, 0, 474, 475, 5, 69, 0, 0, 475, + 128, 1, 0, 0, 0, 476, 477, 5, 64, 0, 0, 477, 130, 1, 0, 0, 0, 478, 480, + 3, 151, 75, 0, 479, 478, 1, 0, 0, 0, 480, 481, 1, 0, 0, 0, 481, 479, 1, + 0, 0, 0, 481, 482, 1, 0, 0, 0, 482, 492, 1, 0, 0, 0, 483, 487, 3, 153, + 76, 0, 484, 486, 3, 131, 65, 0, 485, 484, 1, 0, 0, 0, 486, 489, 1, 0, 0, + 0, 487, 485, 1, 0, 0, 0, 487, 488, 1, 0, 0, 0, 488, 491, 1, 0, 0, 0, 489, + 487, 1, 0, 0, 0, 490, 483, 1, 0, 0, 0, 491, 494, 1, 0, 0, 0, 492, 490, + 1, 0, 0, 0, 492, 493, 1, 0, 0, 0, 493, 504, 1, 0, 0, 0, 494, 492, 1, 0, + 0, 0, 495, 499, 3, 157, 78, 0, 496, 498, 3, 131, 65, 0, 497, 496, 1, 0, + 0, 0, 498, 501, 1, 0, 0, 0, 499, 497, 1, 0, 0, 0, 499, 500, 1, 0, 0, 0, + 500, 503, 1, 0, 0, 0, 501, 499, 1, 0, 0, 0, 502, 495, 1, 0, 0, 0, 503, + 506, 1, 0, 0, 0, 504, 502, 1, 0, 0, 0, 504, 505, 1, 0, 0, 0, 505, 132, + 1, 0, 0, 0, 506, 504, 1, 0, 0, 0, 507, 508, 3, 155, 77, 0, 508, 134, 1, + 0, 0, 0, 509, 514, 3, 161, 80, 0, 510, 514, 3, 159, 79, 0, 511, 514, 3, + 163, 81, 0, 512, 514, 3, 165, 82, 0, 513, 509, 1, 0, 0, 0, 513, 510, 1, + 0, 0, 0, 513, 511, 1, 0, 0, 0, 513, 512, 1, 0, 0, 0, 514, 136, 1, 0, 0, + 0, 515, 517, 7, 2, 0, 0, 516, 515, 1, 0, 0, 0, 517, 518, 1, 0, 0, 0, 518, + 516, 1, 0, 0, 0, 518, 519, 1, 0, 0, 0, 519, 138, 1, 0, 0, 0, 520, 521, + 3, 147, 73, 0, 521, 523, 3, 13, 6, 0, 522, 524, 7, 2, 0, 0, 523, 522, 1, + 0, 0, 0, 524, 525, 1, 0, 0, 0, 525, 523, 1, 0, 0, 0, 525, 526, 1, 0, 0, + 0, 526, 528, 1, 0, 0, 0, 527, 529, 3, 149, 74, 0, 528, 527, 1, 0, 0, 0, + 528, 529, 1, 0, 0, 0, 529, 535, 1, 0, 0, 0, 530, 532, 3, 147, 73, 0, 531, + 533, 3, 149, 74, 0, 532, 531, 1, 0, 0, 0, 532, 533, 1, 0, 0, 0, 533, 535, + 1, 0, 0, 0, 534, 520, 1, 0, 0, 0, 534, 530, 1, 0, 0, 0, 535, 140, 1, 0, + 0, 0, 536, 537, 3, 131, 65, 0, 537, 538, 3, 167, 83, 0, 538, 142, 1, 0, + 0, 0, 539, 540, 9, 0, 0, 0, 540, 144, 1, 0, 0, 0, 541, 542, 7, 3, 0, 0, + 542, 146, 1, 0, 0, 0, 543, 552, 5, 48, 0, 0, 544, 548, 7, 4, 0, 0, 545, + 547, 7, 2, 0, 0, 546, 545, 1, 0, 0, 0, 547, 550, 1, 0, 0, 0, 548, 546, + 1, 0, 0, 0, 548, 549, 1, 0, 0, 0, 549, 552, 1, 0, 0, 0, 550, 548, 1, 0, + 0, 0, 551, 543, 1, 0, 0, 0, 551, 544, 1, 0, 0, 0, 552, 148, 1, 0, 0, 0, + 553, 555, 7, 5, 0, 0, 554, 556, 7, 6, 0, 0, 555, 554, 1, 0, 0, 0, 555, + 556, 1, 0, 0, 0, 556, 558, 1, 0, 0, 0, 557, 559, 7, 2, 0, 0, 558, 557, + 1, 0, 0, 0, 559, 560, 1, 0, 0, 0, 560, 558, 1, 0, 0, 0, 560, 561, 1, 0, + 0, 0, 561, 150, 1, 0, 0, 0, 562, 563, 7, 7, 0, 0, 563, 152, 1, 0, 0, 0, + 564, 565, 3, 155, 77, 0, 565, 154, 1, 0, 0, 0, 566, 567, 5, 95, 0, 0, 567, + 156, 1, 0, 0, 0, 568, 569, 2, 48, 57, 0, 569, 158, 1, 0, 0, 0, 570, 578, + 5, 34, 0, 0, 571, 572, 5, 92, 0, 0, 572, 577, 9, 0, 0, 0, 573, 574, 5, + 34, 0, 0, 574, 577, 5, 34, 0, 0, 575, 577, 8, 8, 0, 0, 576, 571, 1, 0, + 0, 0, 576, 573, 1, 0, 0, 0, 576, 575, 1, 0, 0, 0, 577, 580, 1, 0, 0, 0, + 578, 576, 1, 0, 0, 0, 578, 579, 1, 0, 0, 0, 579, 581, 1, 0, 0, 0, 580, + 578, 1, 0, 0, 0, 581, 582, 5, 34, 0, 0, 582, 160, 1, 0, 0, 0, 583, 591, + 5, 39, 0, 0, 584, 585, 5, 92, 0, 0, 585, 590, 9, 0, 0, 0, 586, 587, 5, + 39, 0, 0, 587, 590, 5, 39, 0, 0, 588, 590, 8, 9, 0, 0, 589, 584, 1, 0, + 0, 0, 589, 586, 1, 0, 0, 0, 589, 588, 1, 0, 0, 0, 590, 593, 1, 0, 0, 0, + 591, 589, 1, 0, 0, 0, 591, 592, 1, 0, 0, 0, 592, 594, 1, 0, 0, 0, 593, + 591, 1, 0, 0, 0, 594, 595, 5, 39, 0, 0, 595, 162, 1, 0, 0, 0, 596, 602, + 5, 96, 0, 0, 597, 598, 5, 92, 0, 0, 598, 601, 5, 96, 0, 0, 599, 601, 8, + 10, 0, 0, 600, 597, 1, 0, 0, 0, 600, 599, 1, 0, 0, 0, 601, 604, 1, 0, 0, + 0, 602, 600, 1, 0, 0, 0, 602, 603, 1, 0, 0, 0, 603, 605, 1, 0, 0, 0, 604, + 602, 1, 0, 0, 0, 605, 606, 5, 96, 0, 0, 606, 164, 1, 0, 0, 0, 607, 613, + 5, 180, 0, 0, 608, 609, 5, 92, 0, 0, 609, 612, 5, 180, 0, 0, 610, 612, + 8, 11, 0, 0, 611, 608, 1, 0, 0, 0, 611, 610, 1, 0, 0, 0, 612, 615, 1, 0, + 0, 0, 613, 611, 1, 0, 0, 0, 613, 614, 1, 0, 0, 0, 614, 616, 1, 0, 0, 0, + 615, 613, 1, 0, 0, 0, 616, 617, 5, 180, 0, 0, 617, 166, 1, 0, 0, 0, 618, + 619, 5, 58, 0, 0, 619, 620, 5, 58, 0, 0, 620, 168, 1, 0, 0, 0, 32, 0, 175, + 189, 197, 262, 268, 372, 402, 462, 481, 487, 492, 499, 504, 513, 518, 525, + 528, 532, 534, 548, 551, 555, 560, 576, 578, 589, 591, 600, 602, 611, 613, + 1, 0, 1, 0, + } + deserializer := antlr.NewATNDeserializer(nil) + staticData.atn = deserializer.Deserialize(staticData.serializedATN) + atn := staticData.atn + staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState)) + decisionToDFA := staticData.decisionToDFA + for index, state := range atn.DecisionToState { + decisionToDFA[index] = antlr.NewDFA(state, index) + } } -type FqlLexer struct { - *antlr.BaseLexer - channelNames []string - modeNames []string - // TODO: EOF string +// FqlLexerInit initializes any static state used to implement FqlLexer. By default the +// static state used to implement the lexer is lazily initialized during the first call to +// NewFqlLexer(). You can call this function if you wish to initialize the static state ahead +// of time. +func FqlLexerInit() { + staticData := &fqllexerLexerStaticData + staticData.once.Do(fqllexerLexerInit) } // NewFqlLexer produces a new lexer instance for the optional input antlr.CharStream. -// -// The *FqlLexer instance produced may be reused by calling the SetInputStream method. -// The initial lexer configuration is expensive to construct, and the object is not thread-safe; -// however, if used within a Golang sync.Pool, the construction cost amortizes well and the -// objects can be used in a thread-safe manner. func NewFqlLexer(input antlr.CharStream) *FqlLexer { + FqlLexerInit() l := new(FqlLexer) - lexerDeserializer := antlr.NewATNDeserializer(nil) - lexerAtn := lexerDeserializer.DeserializeFromUInt16(serializedLexerAtn) - lexerDecisionToDFA := make([]*antlr.DFA, len(lexerAtn.DecisionToState)) - for index, ds := range lexerAtn.DecisionToState { - lexerDecisionToDFA[index] = antlr.NewDFA(ds, index) - } l.BaseLexer = antlr.NewBaseLexer(input) - l.Interpreter = antlr.NewLexerATNSimulator(l, lexerAtn, lexerDecisionToDFA, antlr.NewPredictionContextCache()) - - l.channelNames = lexerChannelNames - l.modeNames = lexerModeNames - l.RuleNames = lexerRuleNames - l.LiteralNames = lexerLiteralNames - l.SymbolicNames = lexerSymbolicNames + staticData := &fqllexerLexerStaticData + l.Interpreter = antlr.NewLexerATNSimulator(l, staticData.atn, staticData.decisionToDFA, staticData.predictionContextCache) + l.channelNames = staticData.channelNames + l.modeNames = staticData.modeNames + l.RuleNames = staticData.ruleNames + l.LiteralNames = staticData.literalNames + l.SymbolicNames = staticData.symbolicNames l.GrammarFileName = "FqlLexer.g4" // TODO: l.EOF = antlr.TokenEOF diff --git a/pkg/parser/fql/fql_parser.go b/pkg/parser/fql/fql_parser.go index bd41c2d78..3daa028a2 100644 --- a/pkg/parser/fql/fql_parser.go +++ b/pkg/parser/fql/fql_parser.go @@ -1,383 +1,404 @@ -// Code generated from antlr/FqlParser.g4 by ANTLR 4.9.3. DO NOT EDIT. +// Code generated from java-escape by ANTLR 4.11.1. DO NOT EDIT. package fql // FqlParser import ( "fmt" - "reflect" "strconv" + "sync" - "github.com/antlr/antlr4/runtime/Go/antlr" + "github.com/antlr/antlr4/runtime/Go/antlr/v4" ) // Suppress unused import errors var _ = fmt.Printf -var _ = reflect.Copy var _ = strconv.Itoa - -var parserATN = []uint16{ - 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 74, 646, - 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, - 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, - 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, - 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, - 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, - 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, - 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, - 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, - 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, - 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, - 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, - 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, - 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, - 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 3, 2, 7, 2, 148, 10, 2, 12, 2, 14, - 2, 151, 11, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, - 6, 7, 6, 163, 10, 6, 12, 6, 14, 6, 166, 11, 6, 3, 6, 3, 6, 3, 7, 3, 7, - 3, 7, 5, 7, 173, 10, 7, 3, 8, 3, 8, 5, 8, 177, 10, 8, 3, 9, 3, 9, 3, 9, - 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 5, 9, 188, 10, 9, 3, 10, 3, 10, 5, - 10, 192, 10, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 5, 11, 200, - 10, 11, 3, 11, 3, 11, 3, 11, 7, 11, 205, 10, 11, 12, 11, 14, 11, 208, 11, - 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 5, 11, 215, 10, 11, 3, 11, 3, 11, - 3, 11, 7, 11, 220, 10, 11, 12, 11, 14, 11, 223, 11, 11, 3, 11, 3, 11, 5, - 11, 227, 10, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 5, 12, - 236, 10, 12, 3, 13, 3, 13, 3, 13, 3, 13, 5, 13, 242, 10, 13, 3, 14, 3, - 14, 5, 14, 246, 10, 14, 3, 15, 3, 15, 5, 15, 250, 10, 15, 3, 16, 3, 16, - 5, 16, 254, 10, 16, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 5, - 18, 263, 10, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 5, 19, 270, 10, 19, - 3, 20, 3, 20, 3, 20, 3, 20, 7, 20, 276, 10, 20, 12, 20, 14, 20, 279, 11, - 20, 3, 21, 3, 21, 5, 21, 283, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, - 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, - 22, 3, 22, 3, 22, 5, 22, 303, 10, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, - 3, 24, 3, 24, 7, 24, 312, 10, 24, 12, 24, 14, 24, 315, 11, 24, 3, 25, 3, - 25, 3, 25, 3, 25, 7, 25, 321, 10, 25, 12, 25, 14, 25, 324, 11, 25, 3, 26, - 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 336, - 10, 27, 5, 27, 338, 10, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, - 29, 3, 29, 3, 29, 3, 29, 3, 29, 5, 29, 351, 10, 29, 3, 29, 5, 29, 354, - 10, 29, 3, 29, 5, 29, 357, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, - 30, 364, 10, 30, 3, 31, 3, 31, 3, 31, 5, 31, 369, 10, 31, 3, 32, 3, 32, - 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 5, 33, 380, 10, 33, 3, - 34, 3, 34, 3, 34, 3, 35, 3, 35, 5, 35, 387, 10, 35, 3, 36, 3, 36, 3, 36, - 3, 36, 3, 36, 3, 36, 3, 36, 5, 36, 396, 10, 36, 3, 37, 3, 37, 5, 37, 400, - 10, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 7, 38, 408, 10, 38, 12, - 38, 14, 38, 411, 11, 38, 3, 38, 5, 38, 414, 10, 38, 5, 38, 416, 10, 38, - 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 3, 42, 3, - 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, - 5, 44, 439, 10, 44, 3, 45, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 46, 3, - 46, 3, 46, 5, 46, 450, 10, 46, 3, 47, 3, 47, 3, 47, 3, 48, 7, 48, 456, - 10, 48, 12, 48, 14, 48, 459, 11, 48, 3, 49, 3, 49, 6, 49, 463, 10, 49, - 13, 49, 14, 49, 464, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 5, 50, 472, 10, - 50, 3, 51, 3, 51, 5, 51, 476, 10, 51, 3, 52, 3, 52, 3, 52, 3, 52, 5, 52, - 482, 10, 52, 3, 52, 3, 52, 3, 53, 3, 53, 3, 53, 5, 53, 489, 10, 53, 3, - 54, 3, 54, 3, 54, 7, 54, 494, 10, 54, 12, 54, 14, 54, 497, 11, 54, 3, 54, - 5, 54, 500, 10, 54, 3, 55, 5, 55, 503, 10, 55, 3, 55, 3, 55, 3, 55, 3, - 55, 3, 55, 5, 55, 510, 10, 55, 3, 55, 5, 55, 513, 10, 55, 3, 56, 3, 56, - 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 5, 59, 526, - 10, 59, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 5, 60, 533, 10, 60, 3, 60, 3, - 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 5, 60, - 546, 10, 60, 3, 60, 3, 60, 7, 60, 550, 10, 60, 12, 60, 14, 60, 553, 11, - 60, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, - 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 7, 61, 574, - 10, 61, 12, 61, 14, 61, 577, 11, 61, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, - 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 5, 62, 590, 10, 62, 3, 62, 3, - 62, 5, 62, 594, 10, 62, 5, 62, 596, 10, 62, 3, 62, 3, 62, 3, 62, 3, 62, - 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 7, 62, 610, 10, - 62, 12, 62, 14, 62, 613, 11, 62, 3, 63, 3, 63, 3, 63, 5, 63, 618, 10, 63, - 3, 64, 3, 64, 3, 65, 5, 65, 623, 10, 65, 3, 65, 3, 65, 3, 66, 5, 66, 628, - 10, 66, 3, 66, 3, 66, 3, 67, 3, 67, 3, 68, 3, 68, 3, 69, 3, 69, 3, 70, - 3, 70, 3, 71, 3, 71, 3, 72, 3, 72, 3, 73, 3, 73, 3, 73, 2, 5, 118, 120, - 122, 74, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, - 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, - 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, - 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, - 136, 138, 140, 142, 144, 2, 12, 3, 2, 68, 69, 3, 2, 50, 51, 6, 2, 30, 31, - 40, 46, 48, 49, 54, 61, 6, 2, 37, 39, 47, 47, 50, 53, 62, 66, 4, 2, 50, - 50, 58, 59, 3, 2, 17, 22, 4, 2, 26, 27, 63, 63, 3, 2, 35, 36, 3, 2, 23, - 25, 3, 2, 26, 27, 2, 684, 2, 149, 3, 2, 2, 2, 4, 154, 3, 2, 2, 2, 6, 156, - 3, 2, 2, 2, 8, 158, 3, 2, 2, 2, 10, 164, 3, 2, 2, 2, 12, 172, 3, 2, 2, - 2, 14, 176, 3, 2, 2, 2, 16, 187, 3, 2, 2, 2, 18, 189, 3, 2, 2, 2, 20, 226, - 3, 2, 2, 2, 22, 235, 3, 2, 2, 2, 24, 241, 3, 2, 2, 2, 26, 245, 3, 2, 2, - 2, 28, 249, 3, 2, 2, 2, 30, 253, 3, 2, 2, 2, 32, 255, 3, 2, 2, 2, 34, 258, - 3, 2, 2, 2, 36, 269, 3, 2, 2, 2, 38, 271, 3, 2, 2, 2, 40, 280, 3, 2, 2, - 2, 42, 302, 3, 2, 2, 2, 44, 304, 3, 2, 2, 2, 46, 308, 3, 2, 2, 2, 48, 316, - 3, 2, 2, 2, 50, 325, 3, 2, 2, 2, 52, 337, 3, 2, 2, 2, 54, 339, 3, 2, 2, - 2, 56, 344, 3, 2, 2, 2, 58, 363, 3, 2, 2, 2, 60, 368, 3, 2, 2, 2, 62, 370, - 3, 2, 2, 2, 64, 373, 3, 2, 2, 2, 66, 381, 3, 2, 2, 2, 68, 386, 3, 2, 2, - 2, 70, 395, 3, 2, 2, 2, 72, 397, 3, 2, 2, 2, 74, 403, 3, 2, 2, 2, 76, 419, - 3, 2, 2, 2, 78, 421, 3, 2, 2, 2, 80, 423, 3, 2, 2, 2, 82, 425, 3, 2, 2, - 2, 84, 427, 3, 2, 2, 2, 86, 438, 3, 2, 2, 2, 88, 440, 3, 2, 2, 2, 90, 449, - 3, 2, 2, 2, 92, 451, 3, 2, 2, 2, 94, 457, 3, 2, 2, 2, 96, 460, 3, 2, 2, - 2, 98, 471, 3, 2, 2, 2, 100, 473, 3, 2, 2, 2, 102, 477, 3, 2, 2, 2, 104, - 488, 3, 2, 2, 2, 106, 490, 3, 2, 2, 2, 108, 512, 3, 2, 2, 2, 110, 514, - 3, 2, 2, 2, 112, 516, 3, 2, 2, 2, 114, 518, 3, 2, 2, 2, 116, 525, 3, 2, - 2, 2, 118, 532, 3, 2, 2, 2, 120, 554, 3, 2, 2, 2, 122, 595, 3, 2, 2, 2, - 124, 614, 3, 2, 2, 2, 126, 619, 3, 2, 2, 2, 128, 622, 3, 2, 2, 2, 130, - 627, 3, 2, 2, 2, 132, 631, 3, 2, 2, 2, 134, 633, 3, 2, 2, 2, 136, 635, - 3, 2, 2, 2, 138, 637, 3, 2, 2, 2, 140, 639, 3, 2, 2, 2, 142, 641, 3, 2, - 2, 2, 144, 643, 3, 2, 2, 2, 146, 148, 5, 4, 3, 2, 147, 146, 3, 2, 2, 2, - 148, 151, 3, 2, 2, 2, 149, 147, 3, 2, 2, 2, 149, 150, 3, 2, 2, 2, 150, - 152, 3, 2, 2, 2, 151, 149, 3, 2, 2, 2, 152, 153, 5, 10, 6, 2, 153, 3, 3, - 2, 2, 2, 154, 155, 5, 6, 4, 2, 155, 5, 3, 2, 2, 2, 156, 157, 5, 8, 5, 2, - 157, 7, 3, 2, 2, 2, 158, 159, 7, 53, 2, 2, 159, 160, 5, 92, 47, 2, 160, - 9, 3, 2, 2, 2, 161, 163, 5, 12, 7, 2, 162, 161, 3, 2, 2, 2, 163, 166, 3, - 2, 2, 2, 164, 162, 3, 2, 2, 2, 164, 165, 3, 2, 2, 2, 165, 167, 3, 2, 2, - 2, 166, 164, 3, 2, 2, 2, 167, 168, 5, 14, 8, 2, 168, 11, 3, 2, 2, 2, 169, - 173, 5, 16, 9, 2, 170, 173, 5, 100, 51, 2, 171, 173, 5, 56, 29, 2, 172, - 169, 3, 2, 2, 2, 172, 170, 3, 2, 2, 2, 172, 171, 3, 2, 2, 2, 173, 13, 3, - 2, 2, 2, 174, 177, 5, 18, 10, 2, 175, 177, 5, 20, 11, 2, 176, 174, 3, 2, - 2, 2, 176, 175, 3, 2, 2, 2, 177, 15, 3, 2, 2, 2, 178, 179, 7, 47, 2, 2, - 179, 180, 9, 2, 2, 2, 180, 181, 7, 33, 2, 2, 181, 188, 5, 118, 60, 2, 182, - 183, 7, 47, 2, 2, 183, 184, 5, 110, 56, 2, 184, 185, 7, 33, 2, 2, 185, - 186, 5, 118, 60, 2, 186, 188, 3, 2, 2, 2, 187, 178, 3, 2, 2, 2, 187, 182, - 3, 2, 2, 2, 188, 17, 3, 2, 2, 2, 189, 191, 7, 38, 2, 2, 190, 192, 7, 42, - 2, 2, 191, 190, 3, 2, 2, 2, 191, 192, 3, 2, 2, 2, 192, 193, 3, 2, 2, 2, - 193, 194, 5, 118, 60, 2, 194, 19, 3, 2, 2, 2, 195, 196, 7, 37, 2, 2, 196, - 199, 9, 2, 2, 2, 197, 198, 7, 10, 2, 2, 198, 200, 7, 68, 2, 2, 199, 197, - 3, 2, 2, 2, 199, 200, 3, 2, 2, 2, 200, 201, 3, 2, 2, 2, 201, 202, 7, 64, - 2, 2, 202, 206, 5, 22, 12, 2, 203, 205, 5, 28, 15, 2, 204, 203, 3, 2, 2, - 2, 205, 208, 3, 2, 2, 2, 206, 204, 3, 2, 2, 2, 206, 207, 3, 2, 2, 2, 207, - 209, 3, 2, 2, 2, 208, 206, 3, 2, 2, 2, 209, 210, 5, 30, 16, 2, 210, 227, - 3, 2, 2, 2, 211, 212, 7, 37, 2, 2, 212, 214, 9, 2, 2, 2, 213, 215, 7, 65, - 2, 2, 214, 213, 3, 2, 2, 2, 214, 215, 3, 2, 2, 2, 215, 216, 3, 2, 2, 2, - 216, 217, 7, 66, 2, 2, 217, 221, 5, 118, 60, 2, 218, 220, 5, 28, 15, 2, - 219, 218, 3, 2, 2, 2, 220, 223, 3, 2, 2, 2, 221, 219, 3, 2, 2, 2, 221, - 222, 3, 2, 2, 2, 222, 224, 3, 2, 2, 2, 223, 221, 3, 2, 2, 2, 224, 225, - 5, 30, 16, 2, 225, 227, 3, 2, 2, 2, 226, 195, 3, 2, 2, 2, 226, 211, 3, - 2, 2, 2, 227, 21, 3, 2, 2, 2, 228, 236, 5, 100, 51, 2, 229, 236, 5, 72, - 37, 2, 230, 236, 5, 74, 38, 2, 231, 236, 5, 68, 35, 2, 232, 236, 5, 96, - 49, 2, 233, 236, 5, 114, 58, 2, 234, 236, 5, 66, 34, 2, 235, 228, 3, 2, - 2, 2, 235, 229, 3, 2, 2, 2, 235, 230, 3, 2, 2, 2, 235, 231, 3, 2, 2, 2, - 235, 232, 3, 2, 2, 2, 235, 233, 3, 2, 2, 2, 235, 234, 3, 2, 2, 2, 236, - 23, 3, 2, 2, 2, 237, 242, 5, 34, 18, 2, 238, 242, 5, 38, 20, 2, 239, 242, - 5, 32, 17, 2, 240, 242, 5, 42, 22, 2, 241, 237, 3, 2, 2, 2, 241, 238, 3, - 2, 2, 2, 241, 239, 3, 2, 2, 2, 241, 240, 3, 2, 2, 2, 242, 25, 3, 2, 2, - 2, 243, 246, 5, 16, 9, 2, 244, 246, 5, 100, 51, 2, 245, 243, 3, 2, 2, 2, - 245, 244, 3, 2, 2, 2, 246, 27, 3, 2, 2, 2, 247, 250, 5, 26, 14, 2, 248, - 250, 5, 24, 13, 2, 249, 247, 3, 2, 2, 2, 249, 248, 3, 2, 2, 2, 250, 29, - 3, 2, 2, 2, 251, 254, 5, 18, 10, 2, 252, 254, 5, 20, 11, 2, 253, 251, 3, - 2, 2, 2, 253, 252, 3, 2, 2, 2, 254, 31, 3, 2, 2, 2, 255, 256, 7, 43, 2, - 2, 256, 257, 5, 118, 60, 2, 257, 33, 3, 2, 2, 2, 258, 259, 7, 46, 2, 2, - 259, 262, 5, 36, 19, 2, 260, 261, 7, 10, 2, 2, 261, 263, 5, 36, 19, 2, - 262, 260, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 35, 3, 2, 2, 2, 264, 270, - 7, 71, 2, 2, 265, 270, 5, 66, 34, 2, 266, 270, 5, 68, 35, 2, 267, 270, - 5, 100, 51, 2, 268, 270, 5, 96, 49, 2, 269, 264, 3, 2, 2, 2, 269, 265, - 3, 2, 2, 2, 269, 266, 3, 2, 2, 2, 269, 267, 3, 2, 2, 2, 269, 268, 3, 2, - 2, 2, 270, 37, 3, 2, 2, 2, 271, 272, 7, 45, 2, 2, 272, 277, 5, 40, 21, - 2, 273, 274, 7, 10, 2, 2, 274, 276, 5, 40, 21, 2, 275, 273, 3, 2, 2, 2, - 276, 279, 3, 2, 2, 2, 277, 275, 3, 2, 2, 2, 277, 278, 3, 2, 2, 2, 278, - 39, 3, 2, 2, 2, 279, 277, 3, 2, 2, 2, 280, 282, 5, 118, 60, 2, 281, 283, - 7, 49, 2, 2, 282, 281, 3, 2, 2, 2, 282, 283, 3, 2, 2, 2, 283, 41, 3, 2, - 2, 2, 284, 285, 7, 48, 2, 2, 285, 303, 5, 54, 28, 2, 286, 287, 7, 48, 2, - 2, 287, 303, 5, 48, 25, 2, 288, 289, 7, 48, 2, 2, 289, 290, 5, 46, 24, - 2, 290, 291, 5, 48, 25, 2, 291, 303, 3, 2, 2, 2, 292, 293, 7, 48, 2, 2, - 293, 294, 5, 46, 24, 2, 294, 295, 5, 52, 27, 2, 295, 303, 3, 2, 2, 2, 296, - 297, 7, 48, 2, 2, 297, 298, 5, 46, 24, 2, 298, 299, 5, 54, 28, 2, 299, - 303, 3, 2, 2, 2, 300, 301, 7, 48, 2, 2, 301, 303, 5, 46, 24, 2, 302, 284, - 3, 2, 2, 2, 302, 286, 3, 2, 2, 2, 302, 288, 3, 2, 2, 2, 302, 292, 3, 2, - 2, 2, 302, 296, 3, 2, 2, 2, 302, 300, 3, 2, 2, 2, 303, 43, 3, 2, 2, 2, - 304, 305, 7, 68, 2, 2, 305, 306, 7, 33, 2, 2, 306, 307, 5, 118, 60, 2, - 307, 45, 3, 2, 2, 2, 308, 313, 5, 44, 23, 2, 309, 310, 7, 10, 2, 2, 310, - 312, 5, 44, 23, 2, 311, 309, 3, 2, 2, 2, 312, 315, 3, 2, 2, 2, 313, 311, - 3, 2, 2, 2, 313, 314, 3, 2, 2, 2, 314, 47, 3, 2, 2, 2, 315, 313, 3, 2, - 2, 2, 316, 317, 7, 60, 2, 2, 317, 322, 5, 50, 26, 2, 318, 319, 7, 10, 2, - 2, 319, 321, 5, 50, 26, 2, 320, 318, 3, 2, 2, 2, 321, 324, 3, 2, 2, 2, - 322, 320, 3, 2, 2, 2, 322, 323, 3, 2, 2, 2, 323, 49, 3, 2, 2, 2, 324, 322, - 3, 2, 2, 2, 325, 326, 7, 68, 2, 2, 326, 327, 7, 33, 2, 2, 327, 328, 5, - 100, 51, 2, 328, 51, 3, 2, 2, 2, 329, 330, 7, 54, 2, 2, 330, 338, 5, 44, - 23, 2, 331, 332, 7, 54, 2, 2, 332, 335, 7, 68, 2, 2, 333, 334, 7, 55, 2, - 2, 334, 336, 7, 68, 2, 2, 335, 333, 3, 2, 2, 2, 335, 336, 3, 2, 2, 2, 336, - 338, 3, 2, 2, 2, 337, 329, 3, 2, 2, 2, 337, 331, 3, 2, 2, 2, 338, 53, 3, - 2, 2, 2, 339, 340, 7, 56, 2, 2, 340, 341, 7, 57, 2, 2, 341, 342, 7, 54, - 2, 2, 342, 343, 7, 68, 2, 2, 343, 55, 3, 2, 2, 2, 344, 345, 7, 39, 2, 2, - 345, 346, 7, 61, 2, 2, 346, 347, 5, 58, 30, 2, 347, 348, 7, 64, 2, 2, 348, - 350, 5, 60, 31, 2, 349, 351, 5, 62, 32, 2, 350, 349, 3, 2, 2, 2, 350, 351, - 3, 2, 2, 2, 351, 353, 3, 2, 2, 2, 352, 354, 5, 32, 17, 2, 353, 352, 3, - 2, 2, 2, 353, 354, 3, 2, 2, 2, 354, 356, 3, 2, 2, 2, 355, 357, 5, 64, 33, - 2, 356, 355, 3, 2, 2, 2, 356, 357, 3, 2, 2, 2, 357, 57, 3, 2, 2, 2, 358, - 364, 5, 78, 40, 2, 359, 364, 5, 68, 35, 2, 360, 364, 5, 66, 34, 2, 361, - 364, 5, 100, 51, 2, 362, 364, 5, 96, 49, 2, 363, 358, 3, 2, 2, 2, 363, - 359, 3, 2, 2, 2, 363, 360, 3, 2, 2, 2, 363, 361, 3, 2, 2, 2, 363, 362, - 3, 2, 2, 2, 364, 59, 3, 2, 2, 2, 365, 369, 5, 100, 51, 2, 366, 369, 5, - 68, 35, 2, 367, 369, 5, 96, 49, 2, 368, 365, 3, 2, 2, 2, 368, 366, 3, 2, - 2, 2, 368, 367, 3, 2, 2, 2, 369, 61, 3, 2, 2, 2, 370, 371, 7, 40, 2, 2, - 371, 372, 5, 74, 38, 2, 372, 63, 3, 2, 2, 2, 373, 379, 7, 41, 2, 2, 374, - 380, 5, 82, 42, 2, 375, 380, 5, 68, 35, 2, 376, 380, 5, 66, 34, 2, 377, - 380, 5, 96, 49, 2, 378, 380, 5, 102, 52, 2, 379, 374, 3, 2, 2, 2, 379, - 375, 3, 2, 2, 2, 379, 376, 3, 2, 2, 2, 379, 377, 3, 2, 2, 2, 379, 378, - 3, 2, 2, 2, 380, 65, 3, 2, 2, 2, 381, 382, 7, 67, 2, 2, 382, 383, 7, 68, - 2, 2, 383, 67, 3, 2, 2, 2, 384, 387, 7, 68, 2, 2, 385, 387, 5, 110, 56, - 2, 386, 384, 3, 2, 2, 2, 386, 385, 3, 2, 2, 2, 387, 69, 3, 2, 2, 2, 388, - 396, 5, 72, 37, 2, 389, 396, 5, 74, 38, 2, 390, 396, 5, 76, 39, 2, 391, - 396, 5, 78, 40, 2, 392, 396, 5, 80, 41, 2, 393, 396, 5, 82, 42, 2, 394, - 396, 5, 84, 43, 2, 395, 388, 3, 2, 2, 2, 395, 389, 3, 2, 2, 2, 395, 390, - 3, 2, 2, 2, 395, 391, 3, 2, 2, 2, 395, 392, 3, 2, 2, 2, 395, 393, 3, 2, - 2, 2, 395, 394, 3, 2, 2, 2, 396, 71, 3, 2, 2, 2, 397, 399, 7, 11, 2, 2, - 398, 400, 5, 106, 54, 2, 399, 398, 3, 2, 2, 2, 399, 400, 3, 2, 2, 2, 400, - 401, 3, 2, 2, 2, 401, 402, 7, 12, 2, 2, 402, 73, 3, 2, 2, 2, 403, 415, - 7, 15, 2, 2, 404, 409, 5, 86, 44, 2, 405, 406, 7, 10, 2, 2, 406, 408, 5, - 86, 44, 2, 407, 405, 3, 2, 2, 2, 408, 411, 3, 2, 2, 2, 409, 407, 3, 2, - 2, 2, 409, 410, 3, 2, 2, 2, 410, 413, 3, 2, 2, 2, 411, 409, 3, 2, 2, 2, - 412, 414, 7, 10, 2, 2, 413, 412, 3, 2, 2, 2, 413, 414, 3, 2, 2, 2, 414, - 416, 3, 2, 2, 2, 415, 404, 3, 2, 2, 2, 415, 416, 3, 2, 2, 2, 416, 417, - 3, 2, 2, 2, 417, 418, 7, 16, 2, 2, 418, 75, 3, 2, 2, 2, 419, 420, 7, 52, - 2, 2, 420, 77, 3, 2, 2, 2, 421, 422, 7, 70, 2, 2, 422, 79, 3, 2, 2, 2, - 423, 424, 7, 72, 2, 2, 424, 81, 3, 2, 2, 2, 425, 426, 7, 71, 2, 2, 426, - 83, 3, 2, 2, 2, 427, 428, 9, 3, 2, 2, 428, 85, 3, 2, 2, 2, 429, 430, 5, - 90, 46, 2, 430, 431, 7, 7, 2, 2, 431, 432, 5, 118, 60, 2, 432, 439, 3, - 2, 2, 2, 433, 434, 5, 88, 45, 2, 434, 435, 7, 7, 2, 2, 435, 436, 5, 118, - 60, 2, 436, 439, 3, 2, 2, 2, 437, 439, 5, 68, 35, 2, 438, 429, 3, 2, 2, - 2, 438, 433, 3, 2, 2, 2, 438, 437, 3, 2, 2, 2, 439, 87, 3, 2, 2, 2, 440, - 441, 7, 11, 2, 2, 441, 442, 5, 118, 60, 2, 442, 443, 7, 12, 2, 2, 443, - 89, 3, 2, 2, 2, 444, 450, 7, 68, 2, 2, 445, 450, 5, 78, 40, 2, 446, 450, - 5, 66, 34, 2, 447, 450, 5, 110, 56, 2, 448, 450, 5, 112, 57, 2, 449, 444, - 3, 2, 2, 2, 449, 445, 3, 2, 2, 2, 449, 446, 3, 2, 2, 2, 449, 447, 3, 2, - 2, 2, 449, 448, 3, 2, 2, 2, 450, 91, 3, 2, 2, 2, 451, 452, 5, 94, 48, 2, - 452, 453, 7, 68, 2, 2, 453, 93, 3, 2, 2, 2, 454, 456, 7, 73, 2, 2, 455, - 454, 3, 2, 2, 2, 456, 459, 3, 2, 2, 2, 457, 455, 3, 2, 2, 2, 457, 458, - 3, 2, 2, 2, 458, 95, 3, 2, 2, 2, 459, 457, 3, 2, 2, 2, 460, 462, 5, 98, - 50, 2, 461, 463, 5, 108, 55, 2, 462, 461, 3, 2, 2, 2, 463, 464, 3, 2, 2, - 2, 464, 462, 3, 2, 2, 2, 464, 465, 3, 2, 2, 2, 465, 97, 3, 2, 2, 2, 466, - 472, 5, 68, 35, 2, 467, 472, 5, 66, 34, 2, 468, 472, 5, 72, 37, 2, 469, - 472, 5, 74, 38, 2, 470, 472, 5, 102, 52, 2, 471, 466, 3, 2, 2, 2, 471, - 467, 3, 2, 2, 2, 471, 468, 3, 2, 2, 2, 471, 469, 3, 2, 2, 2, 471, 470, - 3, 2, 2, 2, 472, 99, 3, 2, 2, 2, 473, 475, 5, 102, 52, 2, 474, 476, 5, - 144, 73, 2, 475, 474, 3, 2, 2, 2, 475, 476, 3, 2, 2, 2, 476, 101, 3, 2, - 2, 2, 477, 478, 5, 94, 48, 2, 478, 479, 5, 104, 53, 2, 479, 481, 7, 13, - 2, 2, 480, 482, 5, 106, 54, 2, 481, 480, 3, 2, 2, 2, 481, 482, 3, 2, 2, - 2, 482, 483, 3, 2, 2, 2, 483, 484, 7, 14, 2, 2, 484, 103, 3, 2, 2, 2, 485, - 489, 7, 68, 2, 2, 486, 489, 5, 110, 56, 2, 487, 489, 5, 112, 57, 2, 488, - 485, 3, 2, 2, 2, 488, 486, 3, 2, 2, 2, 488, 487, 3, 2, 2, 2, 489, 105, - 3, 2, 2, 2, 490, 495, 5, 118, 60, 2, 491, 492, 7, 10, 2, 2, 492, 494, 5, - 118, 60, 2, 493, 491, 3, 2, 2, 2, 494, 497, 3, 2, 2, 2, 495, 493, 3, 2, - 2, 2, 495, 496, 3, 2, 2, 2, 496, 499, 3, 2, 2, 2, 497, 495, 3, 2, 2, 2, - 498, 500, 7, 10, 2, 2, 499, 498, 3, 2, 2, 2, 499, 500, 3, 2, 2, 2, 500, - 107, 3, 2, 2, 2, 501, 503, 5, 144, 73, 2, 502, 501, 3, 2, 2, 2, 502, 503, - 3, 2, 2, 2, 503, 504, 3, 2, 2, 2, 504, 505, 7, 9, 2, 2, 505, 513, 5, 90, - 46, 2, 506, 507, 5, 144, 73, 2, 507, 508, 7, 9, 2, 2, 508, 510, 3, 2, 2, - 2, 509, 506, 3, 2, 2, 2, 509, 510, 3, 2, 2, 2, 510, 511, 3, 2, 2, 2, 511, - 513, 5, 88, 45, 2, 512, 502, 3, 2, 2, 2, 512, 509, 3, 2, 2, 2, 513, 109, - 3, 2, 2, 2, 514, 515, 9, 4, 2, 2, 515, 111, 3, 2, 2, 2, 516, 517, 9, 5, - 2, 2, 517, 113, 3, 2, 2, 2, 518, 519, 5, 116, 59, 2, 519, 520, 7, 32, 2, - 2, 520, 521, 5, 116, 59, 2, 521, 115, 3, 2, 2, 2, 522, 526, 5, 82, 42, - 2, 523, 526, 5, 68, 35, 2, 524, 526, 5, 66, 34, 2, 525, 522, 3, 2, 2, 2, - 525, 523, 3, 2, 2, 2, 525, 524, 3, 2, 2, 2, 526, 117, 3, 2, 2, 2, 527, - 528, 8, 60, 1, 2, 528, 529, 5, 132, 67, 2, 529, 530, 5, 118, 60, 7, 530, - 533, 3, 2, 2, 2, 531, 533, 5, 120, 61, 2, 532, 527, 3, 2, 2, 2, 532, 531, - 3, 2, 2, 2, 533, 551, 3, 2, 2, 2, 534, 535, 12, 6, 2, 2, 535, 536, 5, 136, - 69, 2, 536, 537, 5, 118, 60, 7, 537, 550, 3, 2, 2, 2, 538, 539, 12, 5, - 2, 2, 539, 540, 5, 138, 70, 2, 540, 541, 5, 118, 60, 6, 541, 550, 3, 2, - 2, 2, 542, 543, 12, 4, 2, 2, 543, 545, 7, 34, 2, 2, 544, 546, 5, 118, 60, - 2, 545, 544, 3, 2, 2, 2, 545, 546, 3, 2, 2, 2, 546, 547, 3, 2, 2, 2, 547, - 548, 7, 7, 2, 2, 548, 550, 5, 118, 60, 5, 549, 534, 3, 2, 2, 2, 549, 538, - 3, 2, 2, 2, 549, 542, 3, 2, 2, 2, 550, 553, 3, 2, 2, 2, 551, 549, 3, 2, - 2, 2, 551, 552, 3, 2, 2, 2, 552, 119, 3, 2, 2, 2, 553, 551, 3, 2, 2, 2, - 554, 555, 8, 61, 1, 2, 555, 556, 5, 122, 62, 2, 556, 575, 3, 2, 2, 2, 557, - 558, 12, 7, 2, 2, 558, 559, 5, 126, 64, 2, 559, 560, 5, 120, 61, 8, 560, - 574, 3, 2, 2, 2, 561, 562, 12, 6, 2, 2, 562, 563, 5, 124, 63, 2, 563, 564, - 5, 120, 61, 7, 564, 574, 3, 2, 2, 2, 565, 566, 12, 5, 2, 2, 566, 567, 5, - 128, 65, 2, 567, 568, 5, 120, 61, 6, 568, 574, 3, 2, 2, 2, 569, 570, 12, - 4, 2, 2, 570, 571, 5, 130, 66, 2, 571, 572, 5, 120, 61, 5, 572, 574, 3, - 2, 2, 2, 573, 557, 3, 2, 2, 2, 573, 561, 3, 2, 2, 2, 573, 565, 3, 2, 2, - 2, 573, 569, 3, 2, 2, 2, 574, 577, 3, 2, 2, 2, 575, 573, 3, 2, 2, 2, 575, - 576, 3, 2, 2, 2, 576, 121, 3, 2, 2, 2, 577, 575, 3, 2, 2, 2, 578, 579, - 8, 62, 1, 2, 579, 596, 5, 100, 51, 2, 580, 596, 5, 114, 58, 2, 581, 596, - 5, 70, 36, 2, 582, 596, 5, 68, 35, 2, 583, 596, 5, 96, 49, 2, 584, 596, - 5, 66, 34, 2, 585, 589, 7, 13, 2, 2, 586, 590, 5, 20, 11, 2, 587, 590, - 5, 56, 29, 2, 588, 590, 5, 118, 60, 2, 589, 586, 3, 2, 2, 2, 589, 587, - 3, 2, 2, 2, 589, 588, 3, 2, 2, 2, 590, 591, 3, 2, 2, 2, 591, 593, 7, 14, - 2, 2, 592, 594, 5, 144, 73, 2, 593, 592, 3, 2, 2, 2, 593, 594, 3, 2, 2, - 2, 594, 596, 3, 2, 2, 2, 595, 578, 3, 2, 2, 2, 595, 580, 3, 2, 2, 2, 595, - 581, 3, 2, 2, 2, 595, 582, 3, 2, 2, 2, 595, 583, 3, 2, 2, 2, 595, 584, - 3, 2, 2, 2, 595, 585, 3, 2, 2, 2, 596, 611, 3, 2, 2, 2, 597, 598, 12, 12, - 2, 2, 598, 599, 5, 140, 71, 2, 599, 600, 5, 122, 62, 13, 600, 610, 3, 2, - 2, 2, 601, 602, 12, 11, 2, 2, 602, 603, 5, 142, 72, 2, 603, 604, 5, 122, - 62, 12, 604, 610, 3, 2, 2, 2, 605, 606, 12, 10, 2, 2, 606, 607, 5, 134, - 68, 2, 607, 608, 5, 122, 62, 11, 608, 610, 3, 2, 2, 2, 609, 597, 3, 2, - 2, 2, 609, 601, 3, 2, 2, 2, 609, 605, 3, 2, 2, 2, 610, 613, 3, 2, 2, 2, - 611, 609, 3, 2, 2, 2, 611, 612, 3, 2, 2, 2, 612, 123, 3, 2, 2, 2, 613, - 611, 3, 2, 2, 2, 614, 617, 9, 6, 2, 2, 615, 618, 5, 128, 65, 2, 616, 618, - 5, 126, 64, 2, 617, 615, 3, 2, 2, 2, 617, 616, 3, 2, 2, 2, 618, 125, 3, - 2, 2, 2, 619, 620, 9, 7, 2, 2, 620, 127, 3, 2, 2, 2, 621, 623, 7, 63, 2, - 2, 622, 621, 3, 2, 2, 2, 622, 623, 3, 2, 2, 2, 623, 624, 3, 2, 2, 2, 624, - 625, 7, 64, 2, 2, 625, 129, 3, 2, 2, 2, 626, 628, 7, 63, 2, 2, 627, 626, - 3, 2, 2, 2, 627, 628, 3, 2, 2, 2, 628, 629, 3, 2, 2, 2, 629, 630, 7, 62, - 2, 2, 630, 131, 3, 2, 2, 2, 631, 632, 9, 8, 2, 2, 632, 133, 3, 2, 2, 2, - 633, 634, 9, 9, 2, 2, 634, 135, 3, 2, 2, 2, 635, 636, 7, 30, 2, 2, 636, - 137, 3, 2, 2, 2, 637, 638, 7, 31, 2, 2, 638, 139, 3, 2, 2, 2, 639, 640, - 9, 10, 2, 2, 640, 141, 3, 2, 2, 2, 641, 642, 9, 11, 2, 2, 642, 143, 3, - 2, 2, 2, 643, 644, 7, 34, 2, 2, 644, 145, 3, 2, 2, 2, 67, 149, 164, 172, - 176, 187, 191, 199, 206, 214, 221, 226, 235, 241, 245, 249, 253, 262, 269, - 277, 282, 302, 313, 322, 335, 337, 350, 353, 356, 363, 368, 379, 386, 395, - 399, 409, 413, 415, 438, 449, 457, 464, 471, 475, 481, 488, 495, 499, 502, - 509, 512, 525, 532, 545, 549, 551, 573, 575, 589, 593, 595, 609, 611, 617, - 622, 627, -} -var literalNames = []string{ - "", "", "", "", "", "':'", "';'", "'.'", "','", "'['", "']'", "'('", "')'", - "'{'", "'}'", "'>'", "'<'", "'=='", "'>='", "'<='", "'!='", "'*'", "'/'", - "'%'", "'+'", "'-'", "'--'", "'++'", "", "", "", "'='", "'?'", "'!~'", - "'=~'", "'FOR'", "'RETURN'", "'WAITFOR'", "'OPTIONS'", "'TIMEOUT'", "'DISTINCT'", - "'FILTER'", "'CURRENT'", "'SORT'", "'LIMIT'", "'LET'", "'COLLECT'", "", - "'NONE'", "'NULL'", "", "'USE'", "'INTO'", "'KEEP'", "'WITH'", "'COUNT'", - "'ALL'", "'ANY'", "'AGGREGATE'", "'EVENT'", "'LIKE'", "", "'IN'", "'DO'", - "'WHILE'", "'@'", -} -var symbolicNames = []string{ - "", "MultiLineComment", "SingleLineComment", "WhiteSpaces", "LineTerminator", - "Colon", "SemiColon", "Dot", "Comma", "OpenBracket", "CloseBracket", "OpenParen", - "CloseParen", "OpenBrace", "CloseBrace", "Gt", "Lt", "Eq", "Gte", "Lte", - "Neq", "Multi", "Div", "Mod", "Plus", "Minus", "MinusMinus", "PlusPlus", - "And", "Or", "Range", "Assign", "QuestionMark", "RegexNotMatch", "RegexMatch", - "For", "Return", "Waitfor", "Options", "Timeout", "Distinct", "Filter", - "Current", "Sort", "Limit", "Let", "Collect", "SortDirection", "None", - "Null", "BooleanLiteral", "Use", "Into", "Keep", "With", "Count", "All", - "Any", "Aggregate", "Event", "Like", "Not", "In", "Do", "While", "Param", - "Identifier", "IgnoreIdentifier", "StringLiteral", "IntegerLiteral", "FloatLiteral", - "NamespaceSegment", "UnknownIdentifier", -} - -var ruleNames = []string{ - "program", "head", "useExpression", "use", "body", "bodyStatement", "bodyExpression", - "variableDeclaration", "returnExpression", "forExpression", "forExpressionSource", - "forExpressionClause", "forExpressionStatement", "forExpressionBody", "forExpressionReturn", - "filterClause", "limitClause", "limitClauseValue", "sortClause", "sortClauseExpression", - "collectClause", "collectSelector", "collectGrouping", "collectAggregator", - "collectAggregateSelector", "collectGroupVariable", "collectCounter", "waitForExpression", - "waitForEventName", "waitForEventSource", "optionsClause", "timeoutClause", - "param", "variable", "literal", "arrayLiteral", "objectLiteral", "booleanLiteral", - "stringLiteral", "floatLiteral", "integerLiteral", "noneLiteral", "propertyAssignment", - "computedPropertyName", "propertyName", "namespaceIdentifier", "namespace", - "memberExpression", "memberExpressionSource", "functionCallExpression", - "functionCall", "functionName", "argumentList", "memberExpressionPath", - "safeReservedWord", "unsafReservedWord", "rangeOperator", "rangeOperand", - "expression", "predicate", "expressionAtom", "arrayOperator", "equalityOperator", - "inOperator", "likeOperator", "unaryOperator", "regexpOperator", "logicalAndOperator", - "logicalOrOperator", "multiplicativeOperator", "additiveOperator", "errorOperator", -} +var _ = sync.Once{} type FqlParser struct { *antlr.BaseParser } +var fqlparserParserStaticData struct { + once sync.Once + serializedATN []int32 + literalNames []string + symbolicNames []string + ruleNames []string + predictionContextCache *antlr.PredictionContextCache + atn *antlr.ATN + decisionToDFA []*antlr.DFA +} + +func fqlparserParserInit() { + staticData := &fqlparserParserStaticData + staticData.literalNames = []string{ + "", "", "", "", "", "':'", "';'", "'.'", "','", "'['", "']'", "'('", + "')'", "'{'", "'}'", "'>'", "'<'", "'=='", "'>='", "'<='", "'!='", "'*'", + "'/'", "'%'", "'+'", "'-'", "'--'", "'++'", "", "", "", "'='", "'?'", + "'!~'", "'=~'", "'FOR'", "'RETURN'", "'WAITFOR'", "'OPTIONS'", "'TIMEOUT'", + "'DISTINCT'", "'FILTER'", "'CURRENT'", "'SORT'", "'LIMIT'", "'LET'", + "'COLLECT'", "", "'NONE'", "'NULL'", "", "'USE'", "'INTO'", "'KEEP'", + "'WITH'", "'COUNT'", "'ALL'", "'ANY'", "'AGGREGATE'", "'EVENT'", "'LIKE'", + "", "'IN'", "'DO'", "'WHILE'", "'@'", + } + staticData.symbolicNames = []string{ + "", "MultiLineComment", "SingleLineComment", "WhiteSpaces", "LineTerminator", + "Colon", "SemiColon", "Dot", "Comma", "OpenBracket", "CloseBracket", + "OpenParen", "CloseParen", "OpenBrace", "CloseBrace", "Gt", "Lt", "Eq", + "Gte", "Lte", "Neq", "Multi", "Div", "Mod", "Plus", "Minus", "MinusMinus", + "PlusPlus", "And", "Or", "Range", "Assign", "QuestionMark", "RegexNotMatch", + "RegexMatch", "For", "Return", "Waitfor", "Options", "Timeout", "Distinct", + "Filter", "Current", "Sort", "Limit", "Let", "Collect", "SortDirection", + "None", "Null", "BooleanLiteral", "Use", "Into", "Keep", "With", "Count", + "All", "Any", "Aggregate", "Event", "Like", "Not", "In", "Do", "While", + "Param", "Identifier", "IgnoreIdentifier", "StringLiteral", "IntegerLiteral", + "FloatLiteral", "NamespaceSegment", "UnknownIdentifier", + } + staticData.ruleNames = []string{ + "program", "head", "useExpression", "use", "body", "bodyStatement", + "bodyExpression", "variableDeclaration", "returnExpression", "forExpression", + "forExpressionSource", "forExpressionClause", "forExpressionStatement", + "forExpressionBody", "forExpressionReturn", "filterClause", "limitClause", + "limitClauseValue", "sortClause", "sortClauseExpression", "collectClause", + "collectSelector", "collectGrouping", "collectAggregator", "collectAggregateSelector", + "collectGroupVariable", "collectCounter", "waitForExpression", "waitForEventName", + "waitForEventSource", "optionsClause", "timeoutClause", "param", "variable", + "literal", "arrayLiteral", "objectLiteral", "booleanLiteral", "stringLiteral", + "floatLiteral", "integerLiteral", "noneLiteral", "propertyAssignment", + "computedPropertyName", "propertyName", "namespaceIdentifier", "namespace", + "memberExpression", "memberExpressionSource", "functionCallExpression", + "functionCall", "functionName", "argumentList", "memberExpressionPath", + "safeReservedWord", "unsafeReservedWord", "rangeOperator", "rangeOperand", + "expression", "predicate", "expressionAtom", "arrayOperator", "equalityOperator", + "inOperator", "likeOperator", "unaryOperator", "regexpOperator", "logicalAndOperator", + "logicalOrOperator", "multiplicativeOperator", "additiveOperator", "errorOperator", + } + staticData.predictionContextCache = antlr.NewPredictionContextCache() + staticData.serializedATN = []int32{ + 4, 1, 72, 647, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, + 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, + 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, + 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, + 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, + 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, + 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, + 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, + 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, + 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, + 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, + 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, + 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 1, 0, 5, 0, 146, 8, 0, + 10, 0, 12, 0, 149, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, + 1, 3, 1, 4, 5, 4, 161, 8, 4, 10, 4, 12, 4, 164, 9, 4, 1, 4, 1, 4, 1, 5, + 1, 5, 1, 5, 3, 5, 171, 8, 5, 1, 6, 1, 6, 3, 6, 175, 8, 6, 1, 7, 1, 7, 1, + 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 186, 8, 7, 1, 8, 1, 8, 3, + 8, 190, 8, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 198, 8, 9, 1, 9, + 1, 9, 1, 9, 5, 9, 203, 8, 9, 10, 9, 12, 9, 206, 9, 9, 1, 9, 1, 9, 1, 9, + 1, 9, 1, 9, 3, 9, 213, 8, 9, 1, 9, 1, 9, 1, 9, 5, 9, 218, 8, 9, 10, 9, + 12, 9, 221, 9, 9, 1, 9, 1, 9, 3, 9, 225, 8, 9, 1, 10, 1, 10, 1, 10, 1, + 10, 1, 10, 1, 10, 1, 10, 3, 10, 234, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, + 3, 11, 240, 8, 11, 1, 12, 1, 12, 3, 12, 244, 8, 12, 1, 13, 1, 13, 3, 13, + 248, 8, 13, 1, 14, 1, 14, 3, 14, 252, 8, 14, 1, 15, 1, 15, 1, 15, 1, 16, + 1, 16, 1, 16, 1, 16, 3, 16, 261, 8, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, + 17, 3, 17, 268, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 5, 18, 274, 8, 18, 10, + 18, 12, 18, 277, 9, 18, 1, 19, 1, 19, 3, 19, 281, 8, 19, 1, 20, 1, 20, + 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, + 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 3, 20, 301, 8, 20, 1, 21, 1, 21, + 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 5, 22, 310, 8, 22, 10, 22, 12, 22, 313, + 9, 22, 1, 23, 1, 23, 1, 23, 1, 23, 5, 23, 319, 8, 23, 10, 23, 12, 23, 322, + 9, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, + 25, 3, 25, 334, 8, 25, 3, 25, 336, 8, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, + 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 3, 27, 349, 8, 27, 1, 27, + 3, 27, 352, 8, 27, 1, 27, 3, 27, 355, 8, 27, 1, 28, 1, 28, 1, 28, 1, 28, + 1, 28, 3, 28, 362, 8, 28, 1, 29, 1, 29, 1, 29, 3, 29, 367, 8, 29, 1, 30, + 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 3, 31, 378, 8, + 31, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 384, 8, 32, 1, 33, 1, 33, 3, 33, + 388, 8, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 397, + 8, 34, 1, 35, 1, 35, 3, 35, 401, 8, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, + 36, 1, 36, 5, 36, 409, 8, 36, 10, 36, 12, 36, 412, 9, 36, 1, 36, 3, 36, + 415, 8, 36, 3, 36, 417, 8, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 38, 1, 38, + 1, 39, 1, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, + 42, 1, 42, 1, 42, 1, 42, 1, 42, 3, 42, 440, 8, 42, 1, 43, 1, 43, 1, 43, + 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 3, 44, 451, 8, 44, 1, 45, 1, + 45, 1, 45, 1, 46, 5, 46, 457, 8, 46, 10, 46, 12, 46, 460, 9, 46, 1, 47, + 1, 47, 4, 47, 464, 8, 47, 11, 47, 12, 47, 465, 1, 48, 1, 48, 1, 48, 1, + 48, 1, 48, 3, 48, 473, 8, 48, 1, 49, 1, 49, 3, 49, 477, 8, 49, 1, 50, 1, + 50, 1, 50, 1, 50, 3, 50, 483, 8, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, + 3, 51, 490, 8, 51, 1, 52, 1, 52, 1, 52, 5, 52, 495, 8, 52, 10, 52, 12, + 52, 498, 9, 52, 1, 52, 3, 52, 501, 8, 52, 1, 53, 3, 53, 504, 8, 53, 1, + 53, 1, 53, 1, 53, 1, 53, 1, 53, 3, 53, 511, 8, 53, 1, 53, 3, 53, 514, 8, + 53, 1, 54, 1, 54, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 56, 1, 57, 1, 57, + 1, 57, 3, 57, 527, 8, 57, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 3, 58, 534, + 8, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, + 58, 1, 58, 3, 58, 547, 8, 58, 1, 58, 1, 58, 5, 58, 551, 8, 58, 10, 58, + 12, 58, 554, 9, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, + 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, + 1, 59, 5, 59, 575, 8, 59, 10, 59, 12, 59, 578, 9, 59, 1, 60, 1, 60, 1, + 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 3, 60, 591, + 8, 60, 1, 60, 1, 60, 3, 60, 595, 8, 60, 3, 60, 597, 8, 60, 1, 60, 1, 60, + 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 5, + 60, 611, 8, 60, 10, 60, 12, 60, 614, 9, 60, 1, 61, 1, 61, 1, 61, 3, 61, + 619, 8, 61, 1, 62, 1, 62, 1, 63, 3, 63, 624, 8, 63, 1, 63, 1, 63, 1, 64, + 3, 64, 629, 8, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 66, 1, 66, 1, 67, 1, + 67, 1, 68, 1, 68, 1, 69, 1, 69, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 0, 3, + 116, 118, 120, 72, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, + 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, + 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, + 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, + 132, 134, 136, 138, 140, 142, 0, 10, 1, 0, 66, 67, 1, 0, 48, 49, 4, 0, + 28, 29, 38, 44, 46, 47, 52, 59, 4, 0, 35, 37, 45, 45, 48, 51, 60, 64, 2, + 0, 48, 48, 56, 57, 1, 0, 15, 20, 2, 0, 24, 25, 61, 61, 1, 0, 33, 34, 1, + 0, 21, 23, 1, 0, 24, 25, 686, 0, 147, 1, 0, 0, 0, 2, 152, 1, 0, 0, 0, 4, + 154, 1, 0, 0, 0, 6, 156, 1, 0, 0, 0, 8, 162, 1, 0, 0, 0, 10, 170, 1, 0, + 0, 0, 12, 174, 1, 0, 0, 0, 14, 185, 1, 0, 0, 0, 16, 187, 1, 0, 0, 0, 18, + 224, 1, 0, 0, 0, 20, 233, 1, 0, 0, 0, 22, 239, 1, 0, 0, 0, 24, 243, 1, + 0, 0, 0, 26, 247, 1, 0, 0, 0, 28, 251, 1, 0, 0, 0, 30, 253, 1, 0, 0, 0, + 32, 256, 1, 0, 0, 0, 34, 267, 1, 0, 0, 0, 36, 269, 1, 0, 0, 0, 38, 278, + 1, 0, 0, 0, 40, 300, 1, 0, 0, 0, 42, 302, 1, 0, 0, 0, 44, 306, 1, 0, 0, + 0, 46, 314, 1, 0, 0, 0, 48, 323, 1, 0, 0, 0, 50, 335, 1, 0, 0, 0, 52, 337, + 1, 0, 0, 0, 54, 342, 1, 0, 0, 0, 56, 361, 1, 0, 0, 0, 58, 366, 1, 0, 0, + 0, 60, 368, 1, 0, 0, 0, 62, 371, 1, 0, 0, 0, 64, 383, 1, 0, 0, 0, 66, 387, + 1, 0, 0, 0, 68, 396, 1, 0, 0, 0, 70, 398, 1, 0, 0, 0, 72, 404, 1, 0, 0, + 0, 74, 420, 1, 0, 0, 0, 76, 422, 1, 0, 0, 0, 78, 424, 1, 0, 0, 0, 80, 426, + 1, 0, 0, 0, 82, 428, 1, 0, 0, 0, 84, 439, 1, 0, 0, 0, 86, 441, 1, 0, 0, + 0, 88, 450, 1, 0, 0, 0, 90, 452, 1, 0, 0, 0, 92, 458, 1, 0, 0, 0, 94, 461, + 1, 0, 0, 0, 96, 472, 1, 0, 0, 0, 98, 474, 1, 0, 0, 0, 100, 478, 1, 0, 0, + 0, 102, 489, 1, 0, 0, 0, 104, 491, 1, 0, 0, 0, 106, 513, 1, 0, 0, 0, 108, + 515, 1, 0, 0, 0, 110, 517, 1, 0, 0, 0, 112, 519, 1, 0, 0, 0, 114, 526, + 1, 0, 0, 0, 116, 533, 1, 0, 0, 0, 118, 555, 1, 0, 0, 0, 120, 596, 1, 0, + 0, 0, 122, 615, 1, 0, 0, 0, 124, 620, 1, 0, 0, 0, 126, 623, 1, 0, 0, 0, + 128, 628, 1, 0, 0, 0, 130, 632, 1, 0, 0, 0, 132, 634, 1, 0, 0, 0, 134, + 636, 1, 0, 0, 0, 136, 638, 1, 0, 0, 0, 138, 640, 1, 0, 0, 0, 140, 642, + 1, 0, 0, 0, 142, 644, 1, 0, 0, 0, 144, 146, 3, 2, 1, 0, 145, 144, 1, 0, + 0, 0, 146, 149, 1, 0, 0, 0, 147, 145, 1, 0, 0, 0, 147, 148, 1, 0, 0, 0, + 148, 150, 1, 0, 0, 0, 149, 147, 1, 0, 0, 0, 150, 151, 3, 8, 4, 0, 151, + 1, 1, 0, 0, 0, 152, 153, 3, 4, 2, 0, 153, 3, 1, 0, 0, 0, 154, 155, 3, 6, + 3, 0, 155, 5, 1, 0, 0, 0, 156, 157, 5, 51, 0, 0, 157, 158, 3, 90, 45, 0, + 158, 7, 1, 0, 0, 0, 159, 161, 3, 10, 5, 0, 160, 159, 1, 0, 0, 0, 161, 164, + 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 165, 1, 0, + 0, 0, 164, 162, 1, 0, 0, 0, 165, 166, 3, 12, 6, 0, 166, 9, 1, 0, 0, 0, + 167, 171, 3, 14, 7, 0, 168, 171, 3, 98, 49, 0, 169, 171, 3, 54, 27, 0, + 170, 167, 1, 0, 0, 0, 170, 168, 1, 0, 0, 0, 170, 169, 1, 0, 0, 0, 171, + 11, 1, 0, 0, 0, 172, 175, 3, 16, 8, 0, 173, 175, 3, 18, 9, 0, 174, 172, + 1, 0, 0, 0, 174, 173, 1, 0, 0, 0, 175, 13, 1, 0, 0, 0, 176, 177, 5, 45, + 0, 0, 177, 178, 7, 0, 0, 0, 178, 179, 5, 31, 0, 0, 179, 186, 3, 116, 58, + 0, 180, 181, 5, 45, 0, 0, 181, 182, 3, 108, 54, 0, 182, 183, 5, 31, 0, + 0, 183, 184, 3, 116, 58, 0, 184, 186, 1, 0, 0, 0, 185, 176, 1, 0, 0, 0, + 185, 180, 1, 0, 0, 0, 186, 15, 1, 0, 0, 0, 187, 189, 5, 36, 0, 0, 188, + 190, 5, 40, 0, 0, 189, 188, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 191, + 1, 0, 0, 0, 191, 192, 3, 116, 58, 0, 192, 17, 1, 0, 0, 0, 193, 194, 5, + 35, 0, 0, 194, 197, 7, 0, 0, 0, 195, 196, 5, 8, 0, 0, 196, 198, 5, 66, + 0, 0, 197, 195, 1, 0, 0, 0, 197, 198, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, + 199, 200, 5, 62, 0, 0, 200, 204, 3, 20, 10, 0, 201, 203, 3, 26, 13, 0, + 202, 201, 1, 0, 0, 0, 203, 206, 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 204, + 205, 1, 0, 0, 0, 205, 207, 1, 0, 0, 0, 206, 204, 1, 0, 0, 0, 207, 208, + 3, 28, 14, 0, 208, 225, 1, 0, 0, 0, 209, 210, 5, 35, 0, 0, 210, 212, 7, + 0, 0, 0, 211, 213, 5, 63, 0, 0, 212, 211, 1, 0, 0, 0, 212, 213, 1, 0, 0, + 0, 213, 214, 1, 0, 0, 0, 214, 215, 5, 64, 0, 0, 215, 219, 3, 116, 58, 0, + 216, 218, 3, 26, 13, 0, 217, 216, 1, 0, 0, 0, 218, 221, 1, 0, 0, 0, 219, + 217, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 222, 1, 0, 0, 0, 221, 219, + 1, 0, 0, 0, 222, 223, 3, 28, 14, 0, 223, 225, 1, 0, 0, 0, 224, 193, 1, + 0, 0, 0, 224, 209, 1, 0, 0, 0, 225, 19, 1, 0, 0, 0, 226, 234, 3, 98, 49, + 0, 227, 234, 3, 70, 35, 0, 228, 234, 3, 72, 36, 0, 229, 234, 3, 66, 33, + 0, 230, 234, 3, 94, 47, 0, 231, 234, 3, 112, 56, 0, 232, 234, 3, 64, 32, + 0, 233, 226, 1, 0, 0, 0, 233, 227, 1, 0, 0, 0, 233, 228, 1, 0, 0, 0, 233, + 229, 1, 0, 0, 0, 233, 230, 1, 0, 0, 0, 233, 231, 1, 0, 0, 0, 233, 232, + 1, 0, 0, 0, 234, 21, 1, 0, 0, 0, 235, 240, 3, 32, 16, 0, 236, 240, 3, 36, + 18, 0, 237, 240, 3, 30, 15, 0, 238, 240, 3, 40, 20, 0, 239, 235, 1, 0, + 0, 0, 239, 236, 1, 0, 0, 0, 239, 237, 1, 0, 0, 0, 239, 238, 1, 0, 0, 0, + 240, 23, 1, 0, 0, 0, 241, 244, 3, 14, 7, 0, 242, 244, 3, 98, 49, 0, 243, + 241, 1, 0, 0, 0, 243, 242, 1, 0, 0, 0, 244, 25, 1, 0, 0, 0, 245, 248, 3, + 24, 12, 0, 246, 248, 3, 22, 11, 0, 247, 245, 1, 0, 0, 0, 247, 246, 1, 0, + 0, 0, 248, 27, 1, 0, 0, 0, 249, 252, 3, 16, 8, 0, 250, 252, 3, 18, 9, 0, + 251, 249, 1, 0, 0, 0, 251, 250, 1, 0, 0, 0, 252, 29, 1, 0, 0, 0, 253, 254, + 5, 41, 0, 0, 254, 255, 3, 116, 58, 0, 255, 31, 1, 0, 0, 0, 256, 257, 5, + 44, 0, 0, 257, 260, 3, 34, 17, 0, 258, 259, 5, 8, 0, 0, 259, 261, 3, 34, + 17, 0, 260, 258, 1, 0, 0, 0, 260, 261, 1, 0, 0, 0, 261, 33, 1, 0, 0, 0, + 262, 268, 3, 80, 40, 0, 263, 268, 3, 64, 32, 0, 264, 268, 3, 66, 33, 0, + 265, 268, 3, 98, 49, 0, 266, 268, 3, 94, 47, 0, 267, 262, 1, 0, 0, 0, 267, + 263, 1, 0, 0, 0, 267, 264, 1, 0, 0, 0, 267, 265, 1, 0, 0, 0, 267, 266, + 1, 0, 0, 0, 268, 35, 1, 0, 0, 0, 269, 270, 5, 43, 0, 0, 270, 275, 3, 38, + 19, 0, 271, 272, 5, 8, 0, 0, 272, 274, 3, 38, 19, 0, 273, 271, 1, 0, 0, + 0, 274, 277, 1, 0, 0, 0, 275, 273, 1, 0, 0, 0, 275, 276, 1, 0, 0, 0, 276, + 37, 1, 0, 0, 0, 277, 275, 1, 0, 0, 0, 278, 280, 3, 116, 58, 0, 279, 281, + 5, 47, 0, 0, 280, 279, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 39, 1, 0, + 0, 0, 282, 283, 5, 46, 0, 0, 283, 301, 3, 52, 26, 0, 284, 285, 5, 46, 0, + 0, 285, 301, 3, 46, 23, 0, 286, 287, 5, 46, 0, 0, 287, 288, 3, 44, 22, + 0, 288, 289, 3, 46, 23, 0, 289, 301, 1, 0, 0, 0, 290, 291, 5, 46, 0, 0, + 291, 292, 3, 44, 22, 0, 292, 293, 3, 50, 25, 0, 293, 301, 1, 0, 0, 0, 294, + 295, 5, 46, 0, 0, 295, 296, 3, 44, 22, 0, 296, 297, 3, 52, 26, 0, 297, + 301, 1, 0, 0, 0, 298, 299, 5, 46, 0, 0, 299, 301, 3, 44, 22, 0, 300, 282, + 1, 0, 0, 0, 300, 284, 1, 0, 0, 0, 300, 286, 1, 0, 0, 0, 300, 290, 1, 0, + 0, 0, 300, 294, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 301, 41, 1, 0, 0, 0, + 302, 303, 5, 66, 0, 0, 303, 304, 5, 31, 0, 0, 304, 305, 3, 116, 58, 0, + 305, 43, 1, 0, 0, 0, 306, 311, 3, 42, 21, 0, 307, 308, 5, 8, 0, 0, 308, + 310, 3, 42, 21, 0, 309, 307, 1, 0, 0, 0, 310, 313, 1, 0, 0, 0, 311, 309, + 1, 0, 0, 0, 311, 312, 1, 0, 0, 0, 312, 45, 1, 0, 0, 0, 313, 311, 1, 0, + 0, 0, 314, 315, 5, 58, 0, 0, 315, 320, 3, 48, 24, 0, 316, 317, 5, 8, 0, + 0, 317, 319, 3, 48, 24, 0, 318, 316, 1, 0, 0, 0, 319, 322, 1, 0, 0, 0, + 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 47, 1, 0, 0, 0, 322, 320, + 1, 0, 0, 0, 323, 324, 5, 66, 0, 0, 324, 325, 5, 31, 0, 0, 325, 326, 3, + 98, 49, 0, 326, 49, 1, 0, 0, 0, 327, 328, 5, 52, 0, 0, 328, 336, 3, 42, + 21, 0, 329, 330, 5, 52, 0, 0, 330, 333, 5, 66, 0, 0, 331, 332, 5, 53, 0, + 0, 332, 334, 5, 66, 0, 0, 333, 331, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, + 336, 1, 0, 0, 0, 335, 327, 1, 0, 0, 0, 335, 329, 1, 0, 0, 0, 336, 51, 1, + 0, 0, 0, 337, 338, 5, 54, 0, 0, 338, 339, 5, 55, 0, 0, 339, 340, 5, 52, + 0, 0, 340, 341, 5, 66, 0, 0, 341, 53, 1, 0, 0, 0, 342, 343, 5, 37, 0, 0, + 343, 344, 5, 59, 0, 0, 344, 345, 3, 56, 28, 0, 345, 346, 5, 62, 0, 0, 346, + 348, 3, 58, 29, 0, 347, 349, 3, 60, 30, 0, 348, 347, 1, 0, 0, 0, 348, 349, + 1, 0, 0, 0, 349, 351, 1, 0, 0, 0, 350, 352, 3, 30, 15, 0, 351, 350, 1, + 0, 0, 0, 351, 352, 1, 0, 0, 0, 352, 354, 1, 0, 0, 0, 353, 355, 3, 62, 31, + 0, 354, 353, 1, 0, 0, 0, 354, 355, 1, 0, 0, 0, 355, 55, 1, 0, 0, 0, 356, + 362, 3, 76, 38, 0, 357, 362, 3, 66, 33, 0, 358, 362, 3, 64, 32, 0, 359, + 362, 3, 98, 49, 0, 360, 362, 3, 94, 47, 0, 361, 356, 1, 0, 0, 0, 361, 357, + 1, 0, 0, 0, 361, 358, 1, 0, 0, 0, 361, 359, 1, 0, 0, 0, 361, 360, 1, 0, + 0, 0, 362, 57, 1, 0, 0, 0, 363, 367, 3, 98, 49, 0, 364, 367, 3, 66, 33, + 0, 365, 367, 3, 94, 47, 0, 366, 363, 1, 0, 0, 0, 366, 364, 1, 0, 0, 0, + 366, 365, 1, 0, 0, 0, 367, 59, 1, 0, 0, 0, 368, 369, 5, 38, 0, 0, 369, + 370, 3, 72, 36, 0, 370, 61, 1, 0, 0, 0, 371, 377, 5, 39, 0, 0, 372, 378, + 3, 80, 40, 0, 373, 378, 3, 66, 33, 0, 374, 378, 3, 64, 32, 0, 375, 378, + 3, 94, 47, 0, 376, 378, 3, 100, 50, 0, 377, 372, 1, 0, 0, 0, 377, 373, + 1, 0, 0, 0, 377, 374, 1, 0, 0, 0, 377, 375, 1, 0, 0, 0, 377, 376, 1, 0, + 0, 0, 378, 63, 1, 0, 0, 0, 379, 380, 5, 65, 0, 0, 380, 384, 5, 66, 0, 0, + 381, 382, 5, 65, 0, 0, 382, 384, 3, 108, 54, 0, 383, 379, 1, 0, 0, 0, 383, + 381, 1, 0, 0, 0, 384, 65, 1, 0, 0, 0, 385, 388, 5, 66, 0, 0, 386, 388, + 3, 108, 54, 0, 387, 385, 1, 0, 0, 0, 387, 386, 1, 0, 0, 0, 388, 67, 1, + 0, 0, 0, 389, 397, 3, 70, 35, 0, 390, 397, 3, 72, 36, 0, 391, 397, 3, 74, + 37, 0, 392, 397, 3, 76, 38, 0, 393, 397, 3, 78, 39, 0, 394, 397, 3, 80, + 40, 0, 395, 397, 3, 82, 41, 0, 396, 389, 1, 0, 0, 0, 396, 390, 1, 0, 0, + 0, 396, 391, 1, 0, 0, 0, 396, 392, 1, 0, 0, 0, 396, 393, 1, 0, 0, 0, 396, + 394, 1, 0, 0, 0, 396, 395, 1, 0, 0, 0, 397, 69, 1, 0, 0, 0, 398, 400, 5, + 9, 0, 0, 399, 401, 3, 104, 52, 0, 400, 399, 1, 0, 0, 0, 400, 401, 1, 0, + 0, 0, 401, 402, 1, 0, 0, 0, 402, 403, 5, 10, 0, 0, 403, 71, 1, 0, 0, 0, + 404, 416, 5, 13, 0, 0, 405, 410, 3, 84, 42, 0, 406, 407, 5, 8, 0, 0, 407, + 409, 3, 84, 42, 0, 408, 406, 1, 0, 0, 0, 409, 412, 1, 0, 0, 0, 410, 408, + 1, 0, 0, 0, 410, 411, 1, 0, 0, 0, 411, 414, 1, 0, 0, 0, 412, 410, 1, 0, + 0, 0, 413, 415, 5, 8, 0, 0, 414, 413, 1, 0, 0, 0, 414, 415, 1, 0, 0, 0, + 415, 417, 1, 0, 0, 0, 416, 405, 1, 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, + 418, 1, 0, 0, 0, 418, 419, 5, 14, 0, 0, 419, 73, 1, 0, 0, 0, 420, 421, + 5, 50, 0, 0, 421, 75, 1, 0, 0, 0, 422, 423, 5, 68, 0, 0, 423, 77, 1, 0, + 0, 0, 424, 425, 5, 70, 0, 0, 425, 79, 1, 0, 0, 0, 426, 427, 5, 69, 0, 0, + 427, 81, 1, 0, 0, 0, 428, 429, 7, 1, 0, 0, 429, 83, 1, 0, 0, 0, 430, 431, + 3, 88, 44, 0, 431, 432, 5, 5, 0, 0, 432, 433, 3, 116, 58, 0, 433, 440, + 1, 0, 0, 0, 434, 435, 3, 86, 43, 0, 435, 436, 5, 5, 0, 0, 436, 437, 3, + 116, 58, 0, 437, 440, 1, 0, 0, 0, 438, 440, 3, 66, 33, 0, 439, 430, 1, + 0, 0, 0, 439, 434, 1, 0, 0, 0, 439, 438, 1, 0, 0, 0, 440, 85, 1, 0, 0, + 0, 441, 442, 5, 9, 0, 0, 442, 443, 3, 116, 58, 0, 443, 444, 5, 10, 0, 0, + 444, 87, 1, 0, 0, 0, 445, 451, 5, 66, 0, 0, 446, 451, 3, 76, 38, 0, 447, + 451, 3, 64, 32, 0, 448, 451, 3, 108, 54, 0, 449, 451, 3, 110, 55, 0, 450, + 445, 1, 0, 0, 0, 450, 446, 1, 0, 0, 0, 450, 447, 1, 0, 0, 0, 450, 448, + 1, 0, 0, 0, 450, 449, 1, 0, 0, 0, 451, 89, 1, 0, 0, 0, 452, 453, 3, 92, + 46, 0, 453, 454, 5, 66, 0, 0, 454, 91, 1, 0, 0, 0, 455, 457, 5, 71, 0, + 0, 456, 455, 1, 0, 0, 0, 457, 460, 1, 0, 0, 0, 458, 456, 1, 0, 0, 0, 458, + 459, 1, 0, 0, 0, 459, 93, 1, 0, 0, 0, 460, 458, 1, 0, 0, 0, 461, 463, 3, + 96, 48, 0, 462, 464, 3, 106, 53, 0, 463, 462, 1, 0, 0, 0, 464, 465, 1, + 0, 0, 0, 465, 463, 1, 0, 0, 0, 465, 466, 1, 0, 0, 0, 466, 95, 1, 0, 0, + 0, 467, 473, 3, 66, 33, 0, 468, 473, 3, 64, 32, 0, 469, 473, 3, 70, 35, + 0, 470, 473, 3, 72, 36, 0, 471, 473, 3, 100, 50, 0, 472, 467, 1, 0, 0, + 0, 472, 468, 1, 0, 0, 0, 472, 469, 1, 0, 0, 0, 472, 470, 1, 0, 0, 0, 472, + 471, 1, 0, 0, 0, 473, 97, 1, 0, 0, 0, 474, 476, 3, 100, 50, 0, 475, 477, + 3, 142, 71, 0, 476, 475, 1, 0, 0, 0, 476, 477, 1, 0, 0, 0, 477, 99, 1, + 0, 0, 0, 478, 479, 3, 92, 46, 0, 479, 480, 3, 102, 51, 0, 480, 482, 5, + 11, 0, 0, 481, 483, 3, 104, 52, 0, 482, 481, 1, 0, 0, 0, 482, 483, 1, 0, + 0, 0, 483, 484, 1, 0, 0, 0, 484, 485, 5, 12, 0, 0, 485, 101, 1, 0, 0, 0, + 486, 490, 5, 66, 0, 0, 487, 490, 3, 108, 54, 0, 488, 490, 3, 110, 55, 0, + 489, 486, 1, 0, 0, 0, 489, 487, 1, 0, 0, 0, 489, 488, 1, 0, 0, 0, 490, + 103, 1, 0, 0, 0, 491, 496, 3, 116, 58, 0, 492, 493, 5, 8, 0, 0, 493, 495, + 3, 116, 58, 0, 494, 492, 1, 0, 0, 0, 495, 498, 1, 0, 0, 0, 496, 494, 1, + 0, 0, 0, 496, 497, 1, 0, 0, 0, 497, 500, 1, 0, 0, 0, 498, 496, 1, 0, 0, + 0, 499, 501, 5, 8, 0, 0, 500, 499, 1, 0, 0, 0, 500, 501, 1, 0, 0, 0, 501, + 105, 1, 0, 0, 0, 502, 504, 3, 142, 71, 0, 503, 502, 1, 0, 0, 0, 503, 504, + 1, 0, 0, 0, 504, 505, 1, 0, 0, 0, 505, 506, 5, 7, 0, 0, 506, 514, 3, 88, + 44, 0, 507, 508, 3, 142, 71, 0, 508, 509, 5, 7, 0, 0, 509, 511, 1, 0, 0, + 0, 510, 507, 1, 0, 0, 0, 510, 511, 1, 0, 0, 0, 511, 512, 1, 0, 0, 0, 512, + 514, 3, 86, 43, 0, 513, 503, 1, 0, 0, 0, 513, 510, 1, 0, 0, 0, 514, 107, + 1, 0, 0, 0, 515, 516, 7, 2, 0, 0, 516, 109, 1, 0, 0, 0, 517, 518, 7, 3, + 0, 0, 518, 111, 1, 0, 0, 0, 519, 520, 3, 114, 57, 0, 520, 521, 5, 30, 0, + 0, 521, 522, 3, 114, 57, 0, 522, 113, 1, 0, 0, 0, 523, 527, 3, 80, 40, + 0, 524, 527, 3, 66, 33, 0, 525, 527, 3, 64, 32, 0, 526, 523, 1, 0, 0, 0, + 526, 524, 1, 0, 0, 0, 526, 525, 1, 0, 0, 0, 527, 115, 1, 0, 0, 0, 528, + 529, 6, 58, -1, 0, 529, 530, 3, 130, 65, 0, 530, 531, 3, 116, 58, 5, 531, + 534, 1, 0, 0, 0, 532, 534, 3, 118, 59, 0, 533, 528, 1, 0, 0, 0, 533, 532, + 1, 0, 0, 0, 534, 552, 1, 0, 0, 0, 535, 536, 10, 4, 0, 0, 536, 537, 3, 134, + 67, 0, 537, 538, 3, 116, 58, 5, 538, 551, 1, 0, 0, 0, 539, 540, 10, 3, + 0, 0, 540, 541, 3, 136, 68, 0, 541, 542, 3, 116, 58, 4, 542, 551, 1, 0, + 0, 0, 543, 544, 10, 2, 0, 0, 544, 546, 5, 32, 0, 0, 545, 547, 3, 116, 58, + 0, 546, 545, 1, 0, 0, 0, 546, 547, 1, 0, 0, 0, 547, 548, 1, 0, 0, 0, 548, + 549, 5, 5, 0, 0, 549, 551, 3, 116, 58, 3, 550, 535, 1, 0, 0, 0, 550, 539, + 1, 0, 0, 0, 550, 543, 1, 0, 0, 0, 551, 554, 1, 0, 0, 0, 552, 550, 1, 0, + 0, 0, 552, 553, 1, 0, 0, 0, 553, 117, 1, 0, 0, 0, 554, 552, 1, 0, 0, 0, + 555, 556, 6, 59, -1, 0, 556, 557, 3, 120, 60, 0, 557, 576, 1, 0, 0, 0, + 558, 559, 10, 5, 0, 0, 559, 560, 3, 124, 62, 0, 560, 561, 3, 118, 59, 6, + 561, 575, 1, 0, 0, 0, 562, 563, 10, 4, 0, 0, 563, 564, 3, 122, 61, 0, 564, + 565, 3, 118, 59, 5, 565, 575, 1, 0, 0, 0, 566, 567, 10, 3, 0, 0, 567, 568, + 3, 126, 63, 0, 568, 569, 3, 118, 59, 4, 569, 575, 1, 0, 0, 0, 570, 571, + 10, 2, 0, 0, 571, 572, 3, 128, 64, 0, 572, 573, 3, 118, 59, 3, 573, 575, + 1, 0, 0, 0, 574, 558, 1, 0, 0, 0, 574, 562, 1, 0, 0, 0, 574, 566, 1, 0, + 0, 0, 574, 570, 1, 0, 0, 0, 575, 578, 1, 0, 0, 0, 576, 574, 1, 0, 0, 0, + 576, 577, 1, 0, 0, 0, 577, 119, 1, 0, 0, 0, 578, 576, 1, 0, 0, 0, 579, + 580, 6, 60, -1, 0, 580, 597, 3, 98, 49, 0, 581, 597, 3, 112, 56, 0, 582, + 597, 3, 68, 34, 0, 583, 597, 3, 66, 33, 0, 584, 597, 3, 94, 47, 0, 585, + 597, 3, 64, 32, 0, 586, 590, 5, 11, 0, 0, 587, 591, 3, 18, 9, 0, 588, 591, + 3, 54, 27, 0, 589, 591, 3, 116, 58, 0, 590, 587, 1, 0, 0, 0, 590, 588, + 1, 0, 0, 0, 590, 589, 1, 0, 0, 0, 591, 592, 1, 0, 0, 0, 592, 594, 5, 12, + 0, 0, 593, 595, 3, 142, 71, 0, 594, 593, 1, 0, 0, 0, 594, 595, 1, 0, 0, + 0, 595, 597, 1, 0, 0, 0, 596, 579, 1, 0, 0, 0, 596, 581, 1, 0, 0, 0, 596, + 582, 1, 0, 0, 0, 596, 583, 1, 0, 0, 0, 596, 584, 1, 0, 0, 0, 596, 585, + 1, 0, 0, 0, 596, 586, 1, 0, 0, 0, 597, 612, 1, 0, 0, 0, 598, 599, 10, 10, + 0, 0, 599, 600, 3, 138, 69, 0, 600, 601, 3, 120, 60, 11, 601, 611, 1, 0, + 0, 0, 602, 603, 10, 9, 0, 0, 603, 604, 3, 140, 70, 0, 604, 605, 3, 120, + 60, 10, 605, 611, 1, 0, 0, 0, 606, 607, 10, 8, 0, 0, 607, 608, 3, 132, + 66, 0, 608, 609, 3, 120, 60, 9, 609, 611, 1, 0, 0, 0, 610, 598, 1, 0, 0, + 0, 610, 602, 1, 0, 0, 0, 610, 606, 1, 0, 0, 0, 611, 614, 1, 0, 0, 0, 612, + 610, 1, 0, 0, 0, 612, 613, 1, 0, 0, 0, 613, 121, 1, 0, 0, 0, 614, 612, + 1, 0, 0, 0, 615, 618, 7, 4, 0, 0, 616, 619, 3, 126, 63, 0, 617, 619, 3, + 124, 62, 0, 618, 616, 1, 0, 0, 0, 618, 617, 1, 0, 0, 0, 619, 123, 1, 0, + 0, 0, 620, 621, 7, 5, 0, 0, 621, 125, 1, 0, 0, 0, 622, 624, 5, 61, 0, 0, + 623, 622, 1, 0, 0, 0, 623, 624, 1, 0, 0, 0, 624, 625, 1, 0, 0, 0, 625, + 626, 5, 62, 0, 0, 626, 127, 1, 0, 0, 0, 627, 629, 5, 61, 0, 0, 628, 627, + 1, 0, 0, 0, 628, 629, 1, 0, 0, 0, 629, 630, 1, 0, 0, 0, 630, 631, 5, 60, + 0, 0, 631, 129, 1, 0, 0, 0, 632, 633, 7, 6, 0, 0, 633, 131, 1, 0, 0, 0, + 634, 635, 7, 7, 0, 0, 635, 133, 1, 0, 0, 0, 636, 637, 5, 28, 0, 0, 637, + 135, 1, 0, 0, 0, 638, 639, 5, 29, 0, 0, 639, 137, 1, 0, 0, 0, 640, 641, + 7, 8, 0, 0, 641, 139, 1, 0, 0, 0, 642, 643, 7, 9, 0, 0, 643, 141, 1, 0, + 0, 0, 644, 645, 5, 32, 0, 0, 645, 143, 1, 0, 0, 0, 66, 147, 162, 170, 174, + 185, 189, 197, 204, 212, 219, 224, 233, 239, 243, 247, 251, 260, 267, 275, + 280, 300, 311, 320, 333, 335, 348, 351, 354, 361, 366, 377, 383, 387, 396, + 400, 410, 414, 416, 439, 450, 458, 465, 472, 476, 482, 489, 496, 500, 503, + 510, 513, 526, 533, 546, 550, 552, 574, 576, 590, 594, 596, 610, 612, 618, + 623, 628, + } + deserializer := antlr.NewATNDeserializer(nil) + staticData.atn = deserializer.Deserialize(staticData.serializedATN) + atn := staticData.atn + staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState)) + decisionToDFA := staticData.decisionToDFA + for index, state := range atn.DecisionToState { + decisionToDFA[index] = antlr.NewDFA(state, index) + } +} + +// FqlParserInit initializes any static state used to implement FqlParser. By default the +// static state used to implement the parser is lazily initialized during the first call to +// NewFqlParser(). You can call this function if you wish to initialize the static state ahead +// of time. +func FqlParserInit() { + staticData := &fqlparserParserStaticData + staticData.once.Do(fqlparserParserInit) +} + // NewFqlParser produces a new parser instance for the optional input antlr.TokenStream. -// -// The *FqlParser instance produced may be reused by calling the SetInputStream method. -// The initial parser configuration is expensive to construct, and the object is not thread-safe; -// however, if used within a Golang sync.Pool, the construction cost amortizes well and the -// objects can be used in a thread-safe manner. func NewFqlParser(input antlr.TokenStream) *FqlParser { + FqlParserInit() this := new(FqlParser) - deserializer := antlr.NewATNDeserializer(nil) - deserializedATN := deserializer.DeserializeFromUInt16(parserATN) - decisionToDFA := make([]*antlr.DFA, len(deserializedATN.DecisionToState)) - for index, ds := range deserializedATN.DecisionToState { - decisionToDFA[index] = antlr.NewDFA(ds, index) - } this.BaseParser = antlr.NewBaseParser(input) - - this.Interpreter = antlr.NewParserATNSimulator(this, deserializedATN, decisionToDFA, antlr.NewPredictionContextCache()) - this.RuleNames = ruleNames - this.LiteralNames = literalNames - this.SymbolicNames = symbolicNames - this.GrammarFileName = "FqlParser.g4" + staticData := &fqlparserParserStaticData + this.Interpreter = antlr.NewParserATNSimulator(this, staticData.atn, staticData.decisionToDFA, staticData.predictionContextCache) + this.RuleNames = staticData.ruleNames + this.LiteralNames = staticData.literalNames + this.SymbolicNames = staticData.symbolicNames + this.GrammarFileName = "java-escape" return this } @@ -516,7 +537,7 @@ const ( FqlParserRULE_argumentList = 52 FqlParserRULE_memberExpressionPath = 53 FqlParserRULE_safeReservedWord = 54 - FqlParserRULE_unsafReservedWord = 55 + FqlParserRULE_unsafeReservedWord = 55 FqlParserRULE_rangeOperator = 56 FqlParserRULE_rangeOperand = 57 FqlParserRULE_expression = 58 @@ -574,7 +595,13 @@ func NewProgramContext(parser antlr.Parser, parent antlr.ParserRuleContext, invo func (s *ProgramContext) GetParser() antlr.Parser { return s.parser } func (s *ProgramContext) Body() IBodyContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IBodyContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBodyContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -584,12 +611,20 @@ func (s *ProgramContext) Body() IBodyContext { } func (s *ProgramContext) AllHead() []IHeadContext { - var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IHeadContext)(nil)).Elem()) - var tst = make([]IHeadContext, len(ts)) + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IHeadContext); ok { + len++ + } + } - for i, t := range ts { - if t != nil { + tst := make([]IHeadContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IHeadContext); ok { tst[i] = t.(IHeadContext) + i++ } } @@ -597,7 +632,17 @@ func (s *ProgramContext) AllHead() []IHeadContext { } func (s *ProgramContext) Head(i int) IHeadContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IHeadContext)(nil)).Elem(), i) + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IHeadContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil @@ -725,7 +770,13 @@ func NewHeadContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokin func (s *HeadContext) GetParser() antlr.Parser { return s.parser } func (s *HeadContext) UseExpression() IUseExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IUseExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IUseExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -835,7 +886,13 @@ func NewUseExpressionContext(parser antlr.Parser, parent antlr.ParserRuleContext func (s *UseExpressionContext) GetParser() antlr.Parser { return s.parser } func (s *UseExpressionContext) Use() IUseContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IUseContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IUseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -949,7 +1006,13 @@ func (s *UseContext) Use() antlr.TerminalNode { } func (s *UseContext) NamespaceIdentifier() INamespaceIdentifierContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*INamespaceIdentifierContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(INamespaceIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -1063,7 +1126,13 @@ func NewBodyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokin func (s *BodyContext) GetParser() antlr.Parser { return s.parser } func (s *BodyContext) BodyExpression() IBodyExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IBodyExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBodyExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -1073,12 +1142,20 @@ func (s *BodyContext) BodyExpression() IBodyExpressionContext { } func (s *BodyContext) AllBodyStatement() []IBodyStatementContext { - var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IBodyStatementContext)(nil)).Elem()) - var tst = make([]IBodyStatementContext, len(ts)) + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IBodyStatementContext); ok { + len++ + } + } - for i, t := range ts { - if t != nil { + tst := make([]IBodyStatementContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IBodyStatementContext); ok { tst[i] = t.(IBodyStatementContext) + i++ } } @@ -1086,7 +1163,17 @@ func (s *BodyContext) AllBodyStatement() []IBodyStatementContext { } func (s *BodyContext) BodyStatement(i int) IBodyStatementContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IBodyStatementContext)(nil)).Elem(), i) + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBodyStatementContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil @@ -1214,7 +1301,13 @@ func NewBodyStatementContext(parser antlr.Parser, parent antlr.ParserRuleContext func (s *BodyStatementContext) GetParser() antlr.Parser { return s.parser } func (s *BodyStatementContext) VariableDeclaration() IVariableDeclarationContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IVariableDeclarationContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IVariableDeclarationContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -1224,7 +1317,13 @@ func (s *BodyStatementContext) VariableDeclaration() IVariableDeclarationContext } func (s *BodyStatementContext) FunctionCallExpression() IFunctionCallExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IFunctionCallExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFunctionCallExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -1234,7 +1333,13 @@ func (s *BodyStatementContext) FunctionCallExpression() IFunctionCallExpressionC } func (s *BodyStatementContext) WaitForExpression() IWaitForExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IWaitForExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IWaitForExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -1364,7 +1469,13 @@ func NewBodyExpressionContext(parser antlr.Parser, parent antlr.ParserRuleContex func (s *BodyExpressionContext) GetParser() antlr.Parser { return s.parser } func (s *BodyExpressionContext) ReturnExpression() IReturnExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IReturnExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IReturnExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -1374,7 +1485,13 @@ func (s *BodyExpressionContext) ReturnExpression() IReturnExpressionContext { } func (s *BodyExpressionContext) ForExpression() IForExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IForExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IForExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -1519,7 +1636,13 @@ func (s *VariableDeclarationContext) Assign() antlr.TerminalNode { } func (s *VariableDeclarationContext) Expression() IExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -1537,7 +1660,13 @@ func (s *VariableDeclarationContext) IgnoreIdentifier() antlr.TerminalNode { } func (s *VariableDeclarationContext) SafeReservedWord() ISafeReservedWordContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ISafeReservedWordContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISafeReservedWordContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -1703,7 +1832,13 @@ func (s *ReturnExpressionContext) Return() antlr.TerminalNode { } func (s *ReturnExpressionContext) Expression() IExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -1861,7 +1996,13 @@ func (s *ForExpressionContext) In() antlr.TerminalNode { } func (s *ForExpressionContext) ForExpressionSource() IForExpressionSourceContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IForExpressionSourceContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IForExpressionSourceContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -1871,7 +2012,13 @@ func (s *ForExpressionContext) ForExpressionSource() IForExpressionSourceContext } func (s *ForExpressionContext) ForExpressionReturn() IForExpressionReturnContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IForExpressionReturnContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IForExpressionReturnContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -1897,12 +2044,20 @@ func (s *ForExpressionContext) Comma() antlr.TerminalNode { } func (s *ForExpressionContext) AllForExpressionBody() []IForExpressionBodyContext { - var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IForExpressionBodyContext)(nil)).Elem()) - var tst = make([]IForExpressionBodyContext, len(ts)) + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IForExpressionBodyContext); ok { + len++ + } + } - for i, t := range ts { - if t != nil { + tst := make([]IForExpressionBodyContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IForExpressionBodyContext); ok { tst[i] = t.(IForExpressionBodyContext) + i++ } } @@ -1910,7 +2065,17 @@ func (s *ForExpressionContext) AllForExpressionBody() []IForExpressionBodyContex } func (s *ForExpressionContext) ForExpressionBody(i int) IForExpressionBodyContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IForExpressionBodyContext)(nil)).Elem(), i) + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IForExpressionBodyContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil @@ -1924,7 +2089,13 @@ func (s *ForExpressionContext) While() antlr.TerminalNode { } func (s *ForExpressionContext) Expression() IExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2175,7 +2346,13 @@ func NewForExpressionSourceContext(parser antlr.Parser, parent antlr.ParserRuleC func (s *ForExpressionSourceContext) GetParser() antlr.Parser { return s.parser } func (s *ForExpressionSourceContext) FunctionCallExpression() IFunctionCallExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IFunctionCallExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFunctionCallExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2185,7 +2362,13 @@ func (s *ForExpressionSourceContext) FunctionCallExpression() IFunctionCallExpre } func (s *ForExpressionSourceContext) ArrayLiteral() IArrayLiteralContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IArrayLiteralContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArrayLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2195,7 +2378,13 @@ func (s *ForExpressionSourceContext) ArrayLiteral() IArrayLiteralContext { } func (s *ForExpressionSourceContext) ObjectLiteral() IObjectLiteralContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IObjectLiteralContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IObjectLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2205,7 +2394,13 @@ func (s *ForExpressionSourceContext) ObjectLiteral() IObjectLiteralContext { } func (s *ForExpressionSourceContext) Variable() IVariableContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IVariableContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IVariableContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2215,7 +2410,13 @@ func (s *ForExpressionSourceContext) Variable() IVariableContext { } func (s *ForExpressionSourceContext) MemberExpression() IMemberExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IMemberExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMemberExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2225,7 +2426,13 @@ func (s *ForExpressionSourceContext) MemberExpression() IMemberExpressionContext } func (s *ForExpressionSourceContext) RangeOperator() IRangeOperatorContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IRangeOperatorContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IRangeOperatorContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2235,7 +2442,13 @@ func (s *ForExpressionSourceContext) RangeOperator() IRangeOperatorContext { } func (s *ForExpressionSourceContext) Param() IParamContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IParamContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IParamContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2393,7 +2606,13 @@ func NewForExpressionClauseContext(parser antlr.Parser, parent antlr.ParserRuleC func (s *ForExpressionClauseContext) GetParser() antlr.Parser { return s.parser } func (s *ForExpressionClauseContext) LimitClause() ILimitClauseContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ILimitClauseContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ILimitClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2403,7 +2622,13 @@ func (s *ForExpressionClauseContext) LimitClause() ILimitClauseContext { } func (s *ForExpressionClauseContext) SortClause() ISortClauseContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ISortClauseContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISortClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2413,7 +2638,13 @@ func (s *ForExpressionClauseContext) SortClause() ISortClauseContext { } func (s *ForExpressionClauseContext) FilterClause() IFilterClauseContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IFilterClauseContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFilterClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2423,7 +2654,13 @@ func (s *ForExpressionClauseContext) FilterClause() IFilterClauseContext { } func (s *ForExpressionClauseContext) CollectClause() ICollectClauseContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ICollectClauseContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICollectClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2563,7 +2800,13 @@ func NewForExpressionStatementContext(parser antlr.Parser, parent antlr.ParserRu func (s *ForExpressionStatementContext) GetParser() antlr.Parser { return s.parser } func (s *ForExpressionStatementContext) VariableDeclaration() IVariableDeclarationContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IVariableDeclarationContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IVariableDeclarationContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2573,7 +2816,13 @@ func (s *ForExpressionStatementContext) VariableDeclaration() IVariableDeclarati } func (s *ForExpressionStatementContext) FunctionCallExpression() IFunctionCallExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IFunctionCallExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFunctionCallExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2696,7 +2945,13 @@ func NewForExpressionBodyContext(parser antlr.Parser, parent antlr.ParserRuleCon func (s *ForExpressionBodyContext) GetParser() antlr.Parser { return s.parser } func (s *ForExpressionBodyContext) ForExpressionStatement() IForExpressionStatementContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IForExpressionStatementContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IForExpressionStatementContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2706,7 +2961,13 @@ func (s *ForExpressionBodyContext) ForExpressionStatement() IForExpressionStatem } func (s *ForExpressionBodyContext) ForExpressionClause() IForExpressionClauseContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IForExpressionClauseContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IForExpressionClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2829,7 +3090,13 @@ func NewForExpressionReturnContext(parser antlr.Parser, parent antlr.ParserRuleC func (s *ForExpressionReturnContext) GetParser() antlr.Parser { return s.parser } func (s *ForExpressionReturnContext) ReturnExpression() IReturnExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IReturnExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IReturnExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2839,7 +3106,13 @@ func (s *ForExpressionReturnContext) ReturnExpression() IReturnExpressionContext } func (s *ForExpressionReturnContext) ForExpression() IForExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IForExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IForExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2969,7 +3242,13 @@ func (s *FilterClauseContext) Filter() antlr.TerminalNode { } func (s *FilterClauseContext) Expression() IExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -3087,12 +3366,20 @@ func (s *LimitClauseContext) Limit() antlr.TerminalNode { } func (s *LimitClauseContext) AllLimitClauseValue() []ILimitClauseValueContext { - var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ILimitClauseValueContext)(nil)).Elem()) - var tst = make([]ILimitClauseValueContext, len(ts)) + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(ILimitClauseValueContext); ok { + len++ + } + } - for i, t := range ts { - if t != nil { + tst := make([]ILimitClauseValueContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(ILimitClauseValueContext); ok { tst[i] = t.(ILimitClauseValueContext) + i++ } } @@ -3100,7 +3387,17 @@ func (s *LimitClauseContext) AllLimitClauseValue() []ILimitClauseValueContext { } func (s *LimitClauseContext) LimitClauseValue(i int) ILimitClauseValueContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ILimitClauseValueContext)(nil)).Elem(), i) + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ILimitClauseValueContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil @@ -3233,12 +3530,30 @@ func NewLimitClauseValueContext(parser antlr.Parser, parent antlr.ParserRuleCont func (s *LimitClauseValueContext) GetParser() antlr.Parser { return s.parser } -func (s *LimitClauseValueContext) IntegerLiteral() antlr.TerminalNode { - return s.GetToken(FqlParserIntegerLiteral, 0) +func (s *LimitClauseValueContext) IntegerLiteral() IIntegerLiteralContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIntegerLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIntegerLiteralContext) } func (s *LimitClauseValueContext) Param() IParamContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IParamContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IParamContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -3248,7 +3563,13 @@ func (s *LimitClauseValueContext) Param() IParamContext { } func (s *LimitClauseValueContext) Variable() IVariableContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IVariableContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IVariableContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -3258,7 +3579,13 @@ func (s *LimitClauseValueContext) Variable() IVariableContext { } func (s *LimitClauseValueContext) FunctionCallExpression() IFunctionCallExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IFunctionCallExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFunctionCallExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -3268,7 +3595,13 @@ func (s *LimitClauseValueContext) FunctionCallExpression() IFunctionCallExpressi } func (s *LimitClauseValueContext) MemberExpression() IMemberExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IMemberExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMemberExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -3337,7 +3670,7 @@ func (p *FqlParser) LimitClauseValue() (localctx ILimitClauseValueContext) { p.EnterOuterAlt(localctx, 1) { p.SetState(262) - p.Match(FqlParserIntegerLiteral) + p.IntegerLiteral() } case 2: @@ -3416,12 +3749,20 @@ func (s *SortClauseContext) Sort() antlr.TerminalNode { } func (s *SortClauseContext) AllSortClauseExpression() []ISortClauseExpressionContext { - var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ISortClauseExpressionContext)(nil)).Elem()) - var tst = make([]ISortClauseExpressionContext, len(ts)) + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(ISortClauseExpressionContext); ok { + len++ + } + } - for i, t := range ts { - if t != nil { + tst := make([]ISortClauseExpressionContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(ISortClauseExpressionContext); ok { tst[i] = t.(ISortClauseExpressionContext) + i++ } } @@ -3429,7 +3770,17 @@ func (s *SortClauseContext) AllSortClauseExpression() []ISortClauseExpressionCon } func (s *SortClauseContext) SortClauseExpression(i int) ISortClauseExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ISortClauseExpressionContext)(nil)).Elem(), i) + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISortClauseExpressionContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil @@ -3570,7 +3921,13 @@ func NewSortClauseExpressionContext(parser antlr.Parser, parent antlr.ParserRule func (s *SortClauseExpressionContext) GetParser() antlr.Parser { return s.parser } func (s *SortClauseExpressionContext) Expression() IExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -3698,7 +4055,13 @@ func (s *CollectClauseContext) Collect() antlr.TerminalNode { } func (s *CollectClauseContext) CollectCounter() ICollectCounterContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ICollectCounterContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICollectCounterContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -3708,7 +4071,13 @@ func (s *CollectClauseContext) CollectCounter() ICollectCounterContext { } func (s *CollectClauseContext) CollectAggregator() ICollectAggregatorContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ICollectAggregatorContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICollectAggregatorContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -3718,7 +4087,13 @@ func (s *CollectClauseContext) CollectAggregator() ICollectAggregatorContext { } func (s *CollectClauseContext) CollectGrouping() ICollectGroupingContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ICollectGroupingContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICollectGroupingContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -3728,7 +4103,13 @@ func (s *CollectClauseContext) CollectGrouping() ICollectGroupingContext { } func (s *CollectClauseContext) CollectGroupVariable() ICollectGroupVariableContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ICollectGroupVariableContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICollectGroupVariableContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -3923,7 +4304,13 @@ func (s *CollectSelectorContext) Assign() antlr.TerminalNode { } func (s *CollectSelectorContext) Expression() IExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -4041,12 +4428,20 @@ func NewCollectGroupingContext(parser antlr.Parser, parent antlr.ParserRuleConte func (s *CollectGroupingContext) GetParser() antlr.Parser { return s.parser } func (s *CollectGroupingContext) AllCollectSelector() []ICollectSelectorContext { - var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ICollectSelectorContext)(nil)).Elem()) - var tst = make([]ICollectSelectorContext, len(ts)) + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(ICollectSelectorContext); ok { + len++ + } + } - for i, t := range ts { - if t != nil { + tst := make([]ICollectSelectorContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(ICollectSelectorContext); ok { tst[i] = t.(ICollectSelectorContext) + i++ } } @@ -4054,7 +4449,17 @@ func (s *CollectGroupingContext) AllCollectSelector() []ICollectSelectorContext } func (s *CollectGroupingContext) CollectSelector(i int) ICollectSelectorContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ICollectSelectorContext)(nil)).Elem(), i) + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICollectSelectorContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil @@ -4195,12 +4600,20 @@ func (s *CollectAggregatorContext) Aggregate() antlr.TerminalNode { } func (s *CollectAggregatorContext) AllCollectAggregateSelector() []ICollectAggregateSelectorContext { - var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ICollectAggregateSelectorContext)(nil)).Elem()) - var tst = make([]ICollectAggregateSelectorContext, len(ts)) + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(ICollectAggregateSelectorContext); ok { + len++ + } + } - for i, t := range ts { - if t != nil { + tst := make([]ICollectAggregateSelectorContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(ICollectAggregateSelectorContext); ok { tst[i] = t.(ICollectAggregateSelectorContext) + i++ } } @@ -4208,7 +4621,17 @@ func (s *CollectAggregatorContext) AllCollectAggregateSelector() []ICollectAggre } func (s *CollectAggregatorContext) CollectAggregateSelector(i int) ICollectAggregateSelectorContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ICollectAggregateSelectorContext)(nil)).Elem(), i) + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICollectAggregateSelectorContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil @@ -4357,7 +4780,13 @@ func (s *CollectAggregateSelectorContext) Assign() antlr.TerminalNode { } func (s *CollectAggregateSelectorContext) FunctionCallExpression() IFunctionCallExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IFunctionCallExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFunctionCallExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -4479,7 +4908,13 @@ func (s *CollectGroupVariableContext) Into() antlr.TerminalNode { } func (s *CollectGroupVariableContext) CollectSelector() ICollectSelectorContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ICollectSelectorContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICollectSelectorContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -4772,7 +5207,13 @@ func (s *WaitForExpressionContext) Event() antlr.TerminalNode { } func (s *WaitForExpressionContext) WaitForEventName() IWaitForEventNameContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IWaitForEventNameContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IWaitForEventNameContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -4786,7 +5227,13 @@ func (s *WaitForExpressionContext) In() antlr.TerminalNode { } func (s *WaitForExpressionContext) WaitForEventSource() IWaitForEventSourceContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IWaitForEventSourceContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IWaitForEventSourceContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -4796,7 +5243,13 @@ func (s *WaitForExpressionContext) WaitForEventSource() IWaitForEventSourceConte } func (s *WaitForExpressionContext) OptionsClause() IOptionsClauseContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IOptionsClauseContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IOptionsClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -4806,7 +5259,13 @@ func (s *WaitForExpressionContext) OptionsClause() IOptionsClauseContext { } func (s *WaitForExpressionContext) FilterClause() IFilterClauseContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IFilterClauseContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFilterClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -4816,7 +5275,13 @@ func (s *WaitForExpressionContext) FilterClause() IFilterClauseContext { } func (s *WaitForExpressionContext) TimeoutClause() ITimeoutClauseContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ITimeoutClauseContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITimeoutClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -4972,7 +5437,13 @@ func NewWaitForEventNameContext(parser antlr.Parser, parent antlr.ParserRuleCont func (s *WaitForEventNameContext) GetParser() antlr.Parser { return s.parser } func (s *WaitForEventNameContext) StringLiteral() IStringLiteralContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IStringLiteralContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IStringLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -4982,7 +5453,13 @@ func (s *WaitForEventNameContext) StringLiteral() IStringLiteralContext { } func (s *WaitForEventNameContext) Variable() IVariableContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IVariableContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IVariableContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -4992,7 +5469,13 @@ func (s *WaitForEventNameContext) Variable() IVariableContext { } func (s *WaitForEventNameContext) Param() IParamContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IParamContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IParamContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -5002,7 +5485,13 @@ func (s *WaitForEventNameContext) Param() IParamContext { } func (s *WaitForEventNameContext) FunctionCallExpression() IFunctionCallExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IFunctionCallExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFunctionCallExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -5012,7 +5501,13 @@ func (s *WaitForEventNameContext) FunctionCallExpression() IFunctionCallExpressi } func (s *WaitForEventNameContext) MemberExpression() IMemberExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IMemberExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMemberExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -5156,7 +5651,13 @@ func NewWaitForEventSourceContext(parser antlr.Parser, parent antlr.ParserRuleCo func (s *WaitForEventSourceContext) GetParser() antlr.Parser { return s.parser } func (s *WaitForEventSourceContext) FunctionCallExpression() IFunctionCallExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IFunctionCallExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFunctionCallExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -5166,7 +5667,13 @@ func (s *WaitForEventSourceContext) FunctionCallExpression() IFunctionCallExpres } func (s *WaitForEventSourceContext) Variable() IVariableContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IVariableContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IVariableContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -5176,7 +5683,13 @@ func (s *WaitForEventSourceContext) Variable() IVariableContext { } func (s *WaitForEventSourceContext) MemberExpression() IMemberExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IMemberExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMemberExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -5310,7 +5823,13 @@ func (s *OptionsClauseContext) Options() antlr.TerminalNode { } func (s *OptionsClauseContext) ObjectLiteral() IObjectLiteralContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IObjectLiteralContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IObjectLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -5428,7 +5947,13 @@ func (s *TimeoutClauseContext) Timeout() antlr.TerminalNode { } func (s *TimeoutClauseContext) IntegerLiteral() IIntegerLiteralContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IIntegerLiteralContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIntegerLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -5438,7 +5963,13 @@ func (s *TimeoutClauseContext) IntegerLiteral() IIntegerLiteralContext { } func (s *TimeoutClauseContext) Variable() IVariableContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IVariableContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IVariableContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -5448,7 +5979,13 @@ func (s *TimeoutClauseContext) Variable() IVariableContext { } func (s *TimeoutClauseContext) Param() IParamContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IParamContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IParamContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -5458,7 +5995,13 @@ func (s *TimeoutClauseContext) Param() IParamContext { } func (s *TimeoutClauseContext) MemberExpression() IMemberExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IMemberExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMemberExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -5468,7 +6011,13 @@ func (s *TimeoutClauseContext) MemberExpression() IMemberExpressionContext { } func (s *TimeoutClauseContext) FunctionCall() IFunctionCallContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IFunctionCallContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFunctionCallContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -5619,6 +6168,22 @@ func (s *ParamContext) Identifier() antlr.TerminalNode { return s.GetToken(FqlParserIdentifier, 0) } +func (s *ParamContext) SafeReservedWord() ISafeReservedWordContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISafeReservedWordContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISafeReservedWordContext) +} + func (s *ParamContext) GetRuleContext() antlr.RuleContext { return s } @@ -5672,14 +6237,31 @@ func (p *FqlParser) Param() (localctx IParamContext) { } }() - p.EnterOuterAlt(localctx, 1) - { - p.SetState(379) - p.Match(FqlParserParam) - } - { - p.SetState(380) - p.Match(FqlParserIdentifier) + p.SetState(383) + p.GetErrorHandler().Sync(p) + switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 31, p.GetParserRuleContext()) { + case 1: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(379) + p.Match(FqlParserParam) + } + { + p.SetState(380) + p.Match(FqlParserIdentifier) + } + + case 2: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(381) + p.Match(FqlParserParam) + } + { + p.SetState(382) + p.SafeReservedWord() + } + } return localctx @@ -5728,7 +6310,13 @@ func (s *VariableContext) Identifier() antlr.TerminalNode { } func (s *VariableContext) SafeReservedWord() ISafeReservedWordContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ISafeReservedWordContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISafeReservedWordContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -5790,21 +6378,21 @@ func (p *FqlParser) Variable() (localctx IVariableContext) { } }() - p.SetState(384) + p.SetState(387) p.GetErrorHandler().Sync(p) switch p.GetTokenStream().LA(1) { case FqlParserIdentifier: p.EnterOuterAlt(localctx, 1) { - p.SetState(382) + p.SetState(385) p.Match(FqlParserIdentifier) } case FqlParserAnd, FqlParserOr, FqlParserOptions, FqlParserTimeout, FqlParserDistinct, FqlParserFilter, FqlParserCurrent, FqlParserSort, FqlParserLimit, FqlParserCollect, FqlParserSortDirection, FqlParserInto, FqlParserKeep, FqlParserWith, FqlParserCount, FqlParserAll, FqlParserAny, FqlParserAggregate, FqlParserEvent: p.EnterOuterAlt(localctx, 2) { - p.SetState(383) + p.SetState(386) p.SafeReservedWord() } @@ -5854,7 +6442,13 @@ func NewLiteralContext(parser antlr.Parser, parent antlr.ParserRuleContext, invo func (s *LiteralContext) GetParser() antlr.Parser { return s.parser } func (s *LiteralContext) ArrayLiteral() IArrayLiteralContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IArrayLiteralContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArrayLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -5864,7 +6458,13 @@ func (s *LiteralContext) ArrayLiteral() IArrayLiteralContext { } func (s *LiteralContext) ObjectLiteral() IObjectLiteralContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IObjectLiteralContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IObjectLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -5874,7 +6474,13 @@ func (s *LiteralContext) ObjectLiteral() IObjectLiteralContext { } func (s *LiteralContext) BooleanLiteral() IBooleanLiteralContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IBooleanLiteralContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBooleanLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -5884,7 +6490,13 @@ func (s *LiteralContext) BooleanLiteral() IBooleanLiteralContext { } func (s *LiteralContext) StringLiteral() IStringLiteralContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IStringLiteralContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IStringLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -5894,7 +6506,13 @@ func (s *LiteralContext) StringLiteral() IStringLiteralContext { } func (s *LiteralContext) FloatLiteral() IFloatLiteralContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IFloatLiteralContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFloatLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -5904,7 +6522,13 @@ func (s *LiteralContext) FloatLiteral() IFloatLiteralContext { } func (s *LiteralContext) IntegerLiteral() IIntegerLiteralContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IIntegerLiteralContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIntegerLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -5914,7 +6538,13 @@ func (s *LiteralContext) IntegerLiteral() IIntegerLiteralContext { } func (s *LiteralContext) NoneLiteral() INoneLiteralContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*INoneLiteralContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(INoneLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -5976,56 +6606,56 @@ func (p *FqlParser) Literal() (localctx ILiteralContext) { } }() - p.SetState(393) + p.SetState(396) p.GetErrorHandler().Sync(p) switch p.GetTokenStream().LA(1) { case FqlParserOpenBracket: p.EnterOuterAlt(localctx, 1) { - p.SetState(386) + p.SetState(389) p.ArrayLiteral() } case FqlParserOpenBrace: p.EnterOuterAlt(localctx, 2) { - p.SetState(387) + p.SetState(390) p.ObjectLiteral() } case FqlParserBooleanLiteral: p.EnterOuterAlt(localctx, 3) { - p.SetState(388) + p.SetState(391) p.BooleanLiteral() } case FqlParserStringLiteral: p.EnterOuterAlt(localctx, 4) { - p.SetState(389) + p.SetState(392) p.StringLiteral() } case FqlParserFloatLiteral: p.EnterOuterAlt(localctx, 5) { - p.SetState(390) + p.SetState(393) p.FloatLiteral() } case FqlParserIntegerLiteral: p.EnterOuterAlt(localctx, 6) { - p.SetState(391) + p.SetState(394) p.IntegerLiteral() } case FqlParserNone, FqlParserNull: p.EnterOuterAlt(localctx, 7) { - p.SetState(392) + p.SetState(395) p.NoneLiteral() } @@ -6083,7 +6713,13 @@ func (s *ArrayLiteralContext) CloseBracket() antlr.TerminalNode { } func (s *ArrayLiteralContext) ArgumentList() IArgumentListContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IArgumentListContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentListContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -6148,22 +6784,22 @@ func (p *FqlParser) ArrayLiteral() (localctx IArrayLiteralContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(395) + p.SetState(398) p.Match(FqlParserOpenBracket) } - p.SetState(397) + p.SetState(400) p.GetErrorHandler().Sync(p) _la = p.GetTokenStream().LA(1) - if (((_la-9)&-(0x1f+1)) == 0 && ((1< 1 { + if err := core.ValidateType(args[1], types.String); err != nil { + return values.None, err + } + + layout = values.ToString(args[1]).String() + } + + t, err := time.Parse(layout, str.String()) - t, err := time.Parse(values.DefaultTimeLayout, timeStrings.String()) if err != nil { return values.None, err } diff --git a/pkg/stdlib/datetime/date_test.go b/pkg/stdlib/datetime/date_test.go index ab4298e37..fd88c61a2 100644 --- a/pkg/stdlib/datetime/date_test.go +++ b/pkg/stdlib/datetime/date_test.go @@ -2,6 +2,7 @@ package datetime_test import ( "testing" + "time" "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" @@ -10,29 +11,32 @@ import ( ) func TestDate(t *testing.T) { + now := time.Now() + tcs := []*testCase{ - &testCase{ - Name: "When more than 1 arguments", + { + Name: "When more than 2 arguments", Expected: values.None, Args: []core.Value{ - values.NewString("string"), - values.NewInt(0), + values.NewString(time.Now().Format(time.RFC3339)), + values.NewString(time.RFC3339), + values.NewString("foo"), }, ShouldErr: true, }, - &testCase{ + { Name: "When 0 arguments", Expected: values.None, Args: []core.Value{}, ShouldErr: true, }, - &testCase{ - Name: "When argument isn't DateTime", + { + Name: "When first argument isn't string", Expected: values.None, Args: []core.Value{values.NewInt(0)}, ShouldErr: true, }, - &testCase{ + { Name: "When incorrect timeStrings", Expected: values.None, Args: []core.Value{ @@ -40,13 +44,31 @@ func TestDate(t *testing.T) { }, ShouldErr: true, }, - &testCase{ - Name: "When correct timeString in RFC3339 format", + { + Name: "When string is in default format", Expected: mustDefaultLayoutDt("1999-02-07T15:04:05Z"), Args: []core.Value{ values.NewString("1999-02-07T15:04:05Z"), }, }, + { + Name: "When second argument isn't string", + Expected: values.None, + Args: []core.Value{ + values.NewString("1999-02-07T15:04:05Z"), + values.NewInt(1), + }, + ShouldErr: true, + }, + { + Name: "When string is in custom format", + Expected: mustLayoutDt(time.RFC822, now.Format(time.RFC822)), + Args: []core.Value{ + values.NewString(now.Format(time.RFC822)), + values.NewString(time.RFC822), + }, + ShouldErr: false, + }, } for _, tc := range tcs { diff --git a/pkg/stdlib/datetime/format.go b/pkg/stdlib/datetime/format.go index 68e4f76ed..9ed21bc59 100644 --- a/pkg/stdlib/datetime/format.go +++ b/pkg/stdlib/datetime/format.go @@ -10,6 +10,7 @@ import ( // DATE_FORMAT format date according to the given format string. // @param {DateTime} date - Source DateTime object. +// @param {String} format - String format. // @return {String} - Formatted date. func DateFormat(_ context.Context, args ...core.Value) (core.Value, error) { err := core.ValidateArgs(args, 2, 2) diff --git a/pkg/stdlib/html/attr_set.go b/pkg/stdlib/html/attr_set.go index 728d4a9e0..138050ba6 100644 --- a/pkg/stdlib/html/attr_set.go +++ b/pkg/stdlib/html/attr_set.go @@ -2,6 +2,7 @@ package html import ( "context" + "github.com/MontFerret/ferret/pkg/drivers/common" "github.com/MontFerret/ferret/pkg/drivers" diff --git a/pkg/stdlib/html/blur.go b/pkg/stdlib/html/blur.go index f46ad985f..991d1a489 100644 --- a/pkg/stdlib/html/blur.go +++ b/pkg/stdlib/html/blur.go @@ -2,6 +2,7 @@ package html import ( "context" + "github.com/MontFerret/ferret/pkg/drivers" "github.com/MontFerret/ferret/pkg/runtime/values" diff --git a/pkg/stdlib/html/download.go b/pkg/stdlib/html/download.go index 702488ab1..314c352f7 100644 --- a/pkg/stdlib/html/download.go +++ b/pkg/stdlib/html/download.go @@ -2,7 +2,7 @@ package html import ( "context" - "io/ioutil" + "io" "net/http" "github.com/MontFerret/ferret/pkg/runtime/core" @@ -35,7 +35,7 @@ func Download(_ context.Context, args ...core.Value) (core.Value, error) { defer resp.Body.Close() - data, err := ioutil.ReadAll(resp.Body) + data, err := io.ReadAll(resp.Body) if err != nil { return values.None, err diff --git a/pkg/stdlib/html/find_frames.go b/pkg/stdlib/html/find_frames.go index 14e9129d0..77af5540a 100644 --- a/pkg/stdlib/html/find_frames.go +++ b/pkg/stdlib/html/find_frames.go @@ -2,10 +2,11 @@ package html import ( "context" + "regexp" + "github.com/MontFerret/ferret/pkg/drivers" "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" - "regexp" ) // FRAMES finds HTML frames by a given property selector. diff --git a/pkg/stdlib/html/input.go b/pkg/stdlib/html/input.go index 915a544a1..7f5c0f105 100644 --- a/pkg/stdlib/html/input.go +++ b/pkg/stdlib/html/input.go @@ -2,6 +2,7 @@ package html import ( "context" + "github.com/MontFerret/ferret/pkg/drivers" "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" diff --git a/pkg/stdlib/html/pagination.go b/pkg/stdlib/html/pagination.go index af9bec7d4..491918403 100644 --- a/pkg/stdlib/html/pagination.go +++ b/pkg/stdlib/html/pagination.go @@ -2,11 +2,13 @@ package html import ( "context" + + "github.com/rs/zerolog" + "github.com/MontFerret/ferret/pkg/drivers" "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/logging" "github.com/MontFerret/ferret/pkg/runtime/values" - "github.com/rs/zerolog" ) // PAGINATION creates an iterator that goes through pages using CSS selector. diff --git a/pkg/stdlib/html/parse.go b/pkg/stdlib/html/parse.go index 110999ef1..83c5b7a92 100644 --- a/pkg/stdlib/html/parse.go +++ b/pkg/stdlib/html/parse.go @@ -2,9 +2,11 @@ package html import ( "context" + + "github.com/pkg/errors" + "github.com/MontFerret/ferret/pkg/drivers" "github.com/MontFerret/ferret/pkg/runtime/values/types" - "github.com/pkg/errors" "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" diff --git a/pkg/stdlib/html/pdf.go b/pkg/stdlib/html/pdf.go index da84661a4..5fdedeae2 100644 --- a/pkg/stdlib/html/pdf.go +++ b/pkg/stdlib/html/pdf.go @@ -35,7 +35,6 @@ func ValidatePageRanges(pageRanges string) (bool, error) { // @param {Float} [params.marginLeft=1] - Left margin in inches. // @param {Float} [params.marginRight=1] - Right margin in inches. // @param {String} [params.pageRanges] - Paper ranges to print, e.g., '1-5, 8, 11-13'. -// @param {Bool} [params.ignoreInvalidPageRanges=False] - to silently ignore invalid but successfully parsed page ranges, such as '3-2'. // @param {String} [params.headerTemplate] - HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: - `date`: formatted print date - `title`: document title - `url`: document location - `pageNumber`: current page number - `totalPages`: total pages in the document For example, `` would generate span containing the title. // @param {String} [params.footerTemplate] - HTML template for the print footer. Should use the same format as the `headerTemplate`. // @param {Bool} [params.preferCSSPageSize=False] - Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size. * @@ -246,18 +245,6 @@ func PDF(ctx context.Context, args ...core.Value) (core.Value, error) { pdfParams.PageRanges = pageRanges.(values.String) } - ignoreInvalidPageRanges, found := params.Get("ignoreInvalidPageRanges") - - if found { - err = core.ValidateType(ignoreInvalidPageRanges, types.Boolean) - - if err != nil { - return values.None, err - } - - pdfParams.IgnoreInvalidPageRanges = ignoreInvalidPageRanges.(values.Boolean) - } - headerTemplate, found := params.Get("headerTemplate") if found { diff --git a/pkg/stdlib/html/press.go b/pkg/stdlib/html/press.go index 18531929a..1bb2fc1bf 100644 --- a/pkg/stdlib/html/press.go +++ b/pkg/stdlib/html/press.go @@ -2,6 +2,7 @@ package html import ( "context" + "github.com/MontFerret/ferret/pkg/drivers" "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" diff --git a/pkg/stdlib/html/press_selector.go b/pkg/stdlib/html/press_selector.go index 4e17b8837..16ebad1ad 100644 --- a/pkg/stdlib/html/press_selector.go +++ b/pkg/stdlib/html/press_selector.go @@ -2,6 +2,7 @@ package html import ( "context" + "github.com/MontFerret/ferret/pkg/runtime/values/types" "github.com/MontFerret/ferret/pkg/drivers" diff --git a/pkg/stdlib/html/wait_navigation.go b/pkg/stdlib/html/wait_navigation.go index b0cbe9ca2..d864d7b16 100644 --- a/pkg/stdlib/html/wait_navigation.go +++ b/pkg/stdlib/html/wait_navigation.go @@ -2,6 +2,7 @@ package html import ( "context" + "github.com/pkg/errors" "github.com/MontFerret/ferret/pkg/drivers" diff --git a/pkg/stdlib/html/xpath_selector.go b/pkg/stdlib/html/xpath_selector.go index 05ce21be7..e85c93597 100644 --- a/pkg/stdlib/html/xpath_selector.go +++ b/pkg/stdlib/html/xpath_selector.go @@ -2,6 +2,7 @@ package html import ( "context" + "github.com/MontFerret/ferret/pkg/drivers" "github.com/MontFerret/ferret/pkg/runtime/core" diff --git a/pkg/stdlib/io/net/http/delete.go b/pkg/stdlib/io/net/http/delete.go index aa2382932..6d5489de0 100644 --- a/pkg/stdlib/io/net/http/delete.go +++ b/pkg/stdlib/io/net/http/delete.go @@ -7,7 +7,7 @@ import ( "github.com/MontFerret/ferret/pkg/runtime/core" ) -// DELETE makes a HTTP DELETE request. +// DELETE makes a DELETE request. // @param {Object} params - Request parameters. // @param {String} params.url - Target url // @param {Binary} params.body - Request data diff --git a/pkg/stdlib/io/net/http/delete_test.go b/pkg/stdlib/io/net/http/delete_test.go index ed962b231..47f8155f3 100644 --- a/pkg/stdlib/io/net/http/delete_test.go +++ b/pkg/stdlib/io/net/http/delete_test.go @@ -3,12 +3,12 @@ package http_test import ( "context" "encoding/json" - "fmt" - "io/ioutil" - "math/rand" + "io" h "net/http" "testing" + "github.com/jarcoal/httpmock" + "github.com/pkg/errors" . "github.com/smartystreets/goconvey/convey" @@ -17,44 +17,24 @@ import ( "github.com/MontFerret/ferret/pkg/stdlib/io/net/http" ) -func randPort() string { - min := 8000 - max := 8999 - return fmt.Sprintf(":%d", rand.Intn(max-min)+min) -} - func TestDELETE(t *testing.T) { - SkipConvey("Should successfully make request", t, func() { - type User struct { - FirstName string `json:"first_name"` - LastName string `json:"last_name"` - } - - port := randPort() - - server := &h.Server{ - Addr: port, - Handler: h.HandlerFunc(func(w h.ResponseWriter, r *h.Request) { - var err error - - defer func() { - if err != nil { - w.Write([]byte(err.Error())) - } else { - w.Write([]byte("OK")) - } - }() - - if r.Method != "DELETE" { - err = errors.Errorf("Expected method to be DELETE, but got %s", r.Method) - - return - } + url := "https://api.montferret.io/users" + + type User struct { + FirstName string `json:"first_name"` + LastName string `json:"last_name"` + } - data, err := ioutil.ReadAll(r.Body) + Convey("Should successfully make request", t, func() { + httpmock.Activate() + defer httpmock.DeactivateAndReset() + + httpmock.RegisterResponder("DELETE", url, + func(req *h.Request) (*h.Response, error) { + data, err := io.ReadAll(req.Body) if err != nil { - return + return nil, err } user := User{} @@ -62,33 +42,21 @@ func TestDELETE(t *testing.T) { err = json.Unmarshal(data, &user) if err != nil { - return + return nil, err } if user.FirstName != "Rob" { - err = errors.Errorf("Expected FirstName to be Rob, but got %s", user.FirstName) - - return + return nil, errors.Errorf("Expected FirstName to be Rob, but got %s", user.FirstName) } if user.LastName != "Pike" { - err = errors.Errorf("Expected LastName to be Pike, but got %s", user.LastName) - - return + return nil, errors.Errorf("Expected LastName to be Pike, but got %s", user.LastName) } - }), - } - - ctx, cancel := context.WithCancel(context.Background()) - go func() { - server.ListenAndServe() - }() + return httpmock.NewStringResponse(200, "OK"), nil + }) - defer func() { - cancel() - server.Shutdown(ctx) - }() + ctx := context.Background() b, err := json.Marshal(User{ FirstName: "Rob", @@ -98,7 +66,7 @@ func TestDELETE(t *testing.T) { So(err, ShouldBeNil) out, err := http.DELETE(ctx, values.NewObjectWith( - values.NewObjectProperty("url", values.NewString("http://127.0.0.1"+port)), + values.NewObjectProperty("url", values.NewString(url)), values.NewObjectProperty("body", values.NewBinary(b)), )) diff --git a/pkg/stdlib/io/net/http/get.go b/pkg/stdlib/io/net/http/get.go index cf0ef57a2..f2e051ccb 100644 --- a/pkg/stdlib/io/net/http/get.go +++ b/pkg/stdlib/io/net/http/get.go @@ -9,7 +9,7 @@ import ( "github.com/MontFerret/ferret/pkg/runtime/values/types" ) -// GET makes a HTTP GET request. +// GET makes a GET request. // @param {Object | String} urlOrParam - Target url or parameters. // @param {String} [param.url] - Target url or parameters. // @param {Object} [param.headers] - HTTP headers diff --git a/pkg/stdlib/io/net/http/get_test.go b/pkg/stdlib/io/net/http/get_test.go index df82d026f..6a2718726 100644 --- a/pkg/stdlib/io/net/http/get_test.go +++ b/pkg/stdlib/io/net/http/get_test.go @@ -2,103 +2,63 @@ package http_test import ( "context" - "github.com/MontFerret/ferret/pkg/runtime/values" - "github.com/MontFerret/ferret/pkg/runtime/values/types" - "github.com/pkg/errors" h "net/http" "testing" + "github.com/jarcoal/httpmock" + + "github.com/pkg/errors" + + "github.com/MontFerret/ferret/pkg/runtime/values" + "github.com/MontFerret/ferret/pkg/runtime/values/types" + . "github.com/smartystreets/goconvey/convey" "github.com/MontFerret/ferret/pkg/stdlib/io/net/http" ) func TestGET(t *testing.T) { - SkipConvey("Should successfully make request", t, func() { - port := randPort() - - server := &h.Server{ - Addr: port, - Handler: h.HandlerFunc(func(w h.ResponseWriter, r *h.Request) { - if r.Method == "GET" { - w.Write([]byte("OK")) - } else { - w.Write([]byte("Expected method to be GET")) - } - }), - } + url := "https://api.montferret.io/users" - ctx, cancel := context.WithCancel(context.Background()) + Convey("Should successfully make request", t, func() { + httpmock.Activate() + defer httpmock.DeactivateAndReset() - go func() { - server.ListenAndServe() - }() + httpmock.RegisterResponder("GET", url, + func(req *h.Request) (*h.Response, error) { + return httpmock.NewStringResponse(200, "OK"), nil + }) - defer func() { - cancel() - server.Shutdown(ctx) - }() + ctx := context.Background() - out, err := http.GET(ctx, values.NewString("http://localhost"+port)) + out, err := http.GET(ctx, values.NewString(url)) So(err, ShouldBeNil) So(out.Type().ID(), ShouldEqual, types.Binary.ID()) So(out.String(), ShouldEqual, "OK") }) - SkipConvey("Should add headers to a request", t, func() { - port := randPort() + Convey("Should add headers to a request", t, func() { + httpmock.Activate() + defer httpmock.DeactivateAndReset() - server := &h.Server{ - Addr: port, - Handler: h.HandlerFunc(func(w h.ResponseWriter, r *h.Request) { - var err error - - defer func() { - if err != nil { - w.Write([]byte(err.Error())) - } else { - w.Write([]byte("OK")) - } - }() - - if r.Method != "GET" { - err = errors.Errorf("Expected method to be GET, but got %s", r.Method) - - return - } - - token := r.Header.Get("X-Token") - - if token != "Ferret" { - err = errors.Errorf("Expected X-Token header to equal to Ferret, but got %s", token) - - return + httpmock.RegisterResponder("GET", url, + func(req *h.Request) (*h.Response, error) { + if req.Header.Get("X-Token") != "Ferret" { + return nil, errors.Errorf("Expected X-Token to be Ferret, but got %s", req.Header.Get("X-Token")) } - from := r.Header.Get("X-From") - - if from != "localhost" { - err = errors.Errorf("Expected X-From header to equal to localhost, but got %s", from) - - return + if req.Header.Get("X-From") != "localhost" { + return nil, errors.Errorf("Expected X-From to be localhost, but got %s", req.Header.Get("X-From")) } - }), - } - - ctx, cancel := context.WithCancel(context.Background()) - go func() { - server.ListenAndServe() - }() + return httpmock.NewStringResponse(200, "OK"), nil + }) - defer func() { - cancel() - server.Shutdown(ctx) - }() + ctx := context.Background() out, err := http.GET(ctx, values.NewObjectWith( - values.NewObjectProperty("url", values.NewString("http://127.0.0.1"+port)), + values.NewObjectProperty("url", values.NewString(url)), values.NewObjectProperty("headers", values.NewObjectWith( values.NewObjectProperty("X-Token", values.NewString("Ferret")), values.NewObjectProperty("X-From", values.NewString("localhost")), diff --git a/pkg/stdlib/io/net/http/post.go b/pkg/stdlib/io/net/http/post.go index 9b4f0a6bc..3fa02ef28 100644 --- a/pkg/stdlib/io/net/http/post.go +++ b/pkg/stdlib/io/net/http/post.go @@ -10,7 +10,7 @@ import ( // POST makes a POST request. // @param {Object} params - Request parameters. // @param {String} params.url - Target url -// @param {Binary} params.body - Request data +// @param {Any} params.body - Request data // @param {Object} [params.headers] - HTTP headers // @return {Binary} - Response in binary format func POST(ctx context.Context, args ...core.Value) (core.Value, error) { diff --git a/pkg/stdlib/io/net/http/post_test.go b/pkg/stdlib/io/net/http/post_test.go index 99c2be618..a10611519 100644 --- a/pkg/stdlib/io/net/http/post_test.go +++ b/pkg/stdlib/io/net/http/post_test.go @@ -3,10 +3,12 @@ package http_test import ( "context" "encoding/json" - "io/ioutil" + "io" h "net/http" "testing" + "github.com/jarcoal/httpmock" + "github.com/pkg/errors" . "github.com/smartystreets/goconvey/convey" @@ -16,37 +18,23 @@ import ( ) func TestPOST(t *testing.T) { - SkipConvey("Should successfully make request", t, func() { - type User struct { - FirstName string `json:"first_name"` - LastName string `json:"last_name"` - } - - port := randPort() - - server := &h.Server{ - Addr: port, - Handler: h.HandlerFunc(func(w h.ResponseWriter, r *h.Request) { - var err error - - defer func() { - if err != nil { - w.Write([]byte(err.Error())) - } else { - w.Write([]byte("OK")) - } - }() - - if r.Method != "POST" { - err = errors.Errorf("Expected method to be POST, but got %s", r.Method) - - return - } + url := "https://api.montferret.io/users" + + type User struct { + FirstName string `json:"first_name"` + LastName string `json:"last_name"` + } - data, err := ioutil.ReadAll(r.Body) + Convey("Should successfully make request", t, func() { + httpmock.Activate() + defer httpmock.DeactivateAndReset() + + httpmock.RegisterResponder("POST", url, + func(req *h.Request) (*h.Response, error) { + data, err := io.ReadAll(req.Body) if err != nil { - return + return nil, err } user := User{} @@ -54,33 +42,21 @@ func TestPOST(t *testing.T) { err = json.Unmarshal(data, &user) if err != nil { - return + return nil, err } if user.FirstName != "Rob" { - err = errors.Errorf("Expected FirstName to be Rob, but got %s", user.FirstName) - - return + return nil, errors.Errorf("Expected FirstName to be Rob, but got %s", user.FirstName) } if user.LastName != "Pike" { - err = errors.Errorf("Expected LastName to be Pike, but got %s", user.LastName) - - return + return nil, errors.Errorf("Expected LastName to be Pike, but got %s", user.LastName) } - }), - } - - ctx, cancel := context.WithCancel(context.Background()) - go func() { - server.ListenAndServe() - }() + return httpmock.NewStringResponse(200, "OK"), nil + }) - defer func() { - cancel() - server.Shutdown(ctx) - }() + ctx := context.Background() b, err := json.Marshal(User{ FirstName: "Rob", @@ -90,7 +66,7 @@ func TestPOST(t *testing.T) { So(err, ShouldBeNil) out, err := http.POST(ctx, values.NewObjectWith( - values.NewObjectProperty("url", values.NewString("http://127.0.0.1"+port)), + values.NewObjectProperty("url", values.NewString(url)), values.NewObjectProperty("body", values.NewBinary(b)), )) @@ -98,4 +74,52 @@ func TestPOST(t *testing.T) { So(out.Type().ID(), ShouldEqual, types.Binary.ID()) So(out.String(), ShouldEqual, "OK") }) + + Convey("Should successfully make request with auto-marshalling to JSON", t, func() { + httpmock.Activate() + defer httpmock.DeactivateAndReset() + + httpmock.RegisterResponder("POST", url, + func(req *h.Request) (*h.Response, error) { + data, err := io.ReadAll(req.Body) + + if err != nil { + return nil, err + } + + user := User{} + + err = json.Unmarshal(data, &user) + + if err != nil { + return nil, err + } + + if user.FirstName != "Rob" { + return nil, errors.Errorf("Expected FirstName to be Rob, but got %s", user.FirstName) + } + + if user.LastName != "Pike" { + return nil, errors.Errorf("Expected LastName to be Pike, but got %s", user.LastName) + } + + return httpmock.NewStringResponse(200, "OK"), nil + }) + + ctx := context.Background() + + j := values.NewObjectWith( + values.NewObjectProperty("first_name", values.NewString("Rob")), + values.NewObjectProperty("last_name", values.NewString("Pike")), + ) + + out, err := http.POST(ctx, values.NewObjectWith( + values.NewObjectProperty("url", values.NewString(url)), + values.NewObjectProperty("body", j), + )) + + So(err, ShouldBeNil) + So(out.Type().ID(), ShouldEqual, types.Binary.ID()) + So(out.String(), ShouldEqual, "OK") + }) } diff --git a/pkg/stdlib/io/net/http/put.go b/pkg/stdlib/io/net/http/put.go index 224cd5678..e8a398a65 100644 --- a/pkg/stdlib/io/net/http/put.go +++ b/pkg/stdlib/io/net/http/put.go @@ -10,7 +10,7 @@ import ( // PUT makes a PUT HTTP request. // @param {Object} params - Request parameters. // @param {String} params.url - Target url -// @param {Binary} params.body - Request data +// @param {Any} params.body - Request data // @param {Object} [params.headers] - HTTP headers // @return {Binary} - Response in binary format func PUT(ctx context.Context, args ...core.Value) (core.Value, error) { diff --git a/pkg/stdlib/io/net/http/put_test.go b/pkg/stdlib/io/net/http/put_test.go index 3f798233d..3b922c6b0 100644 --- a/pkg/stdlib/io/net/http/put_test.go +++ b/pkg/stdlib/io/net/http/put_test.go @@ -3,10 +3,12 @@ package http_test import ( "context" "encoding/json" - "io/ioutil" + "io" h "net/http" "testing" + "github.com/jarcoal/httpmock" + "github.com/pkg/errors" . "github.com/smartystreets/goconvey/convey" @@ -16,37 +18,23 @@ import ( ) func TestPUT(t *testing.T) { - SkipConvey("Should successfully make request", t, func() { - type User struct { - FirstName string `json:"first_name"` - LastName string `json:"last_name"` - } - - port := randPort() - - server := &h.Server{ - Addr: port, - Handler: h.HandlerFunc(func(w h.ResponseWriter, r *h.Request) { - var err error - - defer func() { - if err != nil { - w.Write([]byte(err.Error())) - } else { - w.Write([]byte("OK")) - } - }() - - if r.Method != "PUT" { - err = errors.Errorf("Expected method to be PUT, but got %s", r.Method) - - return - } + url := "https://api.montferret.io/users" + + type User struct { + FirstName string `json:"first_name"` + LastName string `json:"last_name"` + } + + Convey("Should successfully make request", t, func() { + httpmock.Activate() + defer httpmock.DeactivateAndReset() - data, err := ioutil.ReadAll(r.Body) + httpmock.RegisterResponder("PUT", url, + func(req *h.Request) (*h.Response, error) { + data, err := io.ReadAll(req.Body) if err != nil { - return + return nil, err } user := User{} @@ -54,33 +42,21 @@ func TestPUT(t *testing.T) { err = json.Unmarshal(data, &user) if err != nil { - return + return nil, err } if user.FirstName != "Rob" { - err = errors.Errorf("Expected FirstName to be Rob, but got %s", user.FirstName) - - return + return nil, errors.Errorf("Expected FirstName to be Rob, but got %s", user.FirstName) } if user.LastName != "Pike" { - err = errors.Errorf("Expected LastName to be Pike, but got %s", user.LastName) - - return + return nil, errors.Errorf("Expected LastName to be Pike, but got %s", user.LastName) } - }), - } - - ctx, cancel := context.WithCancel(context.Background()) - go func() { - server.ListenAndServe() - }() + return httpmock.NewStringResponse(200, "OK"), nil + }) - defer func() { - cancel() - server.Shutdown(ctx) - }() + ctx := context.Background() b, err := json.Marshal(User{ FirstName: "Rob", @@ -90,7 +66,7 @@ func TestPUT(t *testing.T) { So(err, ShouldBeNil) out, err := http.PUT(ctx, values.NewObjectWith( - values.NewObjectProperty("url", values.NewString("http://127.0.0.1"+port)), + values.NewObjectProperty("url", values.NewString(url)), values.NewObjectProperty("body", values.NewBinary(b)), )) diff --git a/pkg/stdlib/io/net/http/request.go b/pkg/stdlib/io/net/http/request.go index 7abd0026c..a404416b8 100644 --- a/pkg/stdlib/io/net/http/request.go +++ b/pkg/stdlib/io/net/http/request.go @@ -3,7 +3,7 @@ package http import ( "bytes" "context" - "io/ioutil" + "io" h "net/http" "github.com/MontFerret/ferret/pkg/runtime/core" @@ -77,7 +77,7 @@ func makeRequest(ctx context.Context, params Params) (core.Value, error) { return values.None, err } - data, err := ioutil.ReadAll(resp.Body) + data, err := io.ReadAll(resp.Body) if err != nil { return values.None, err @@ -118,11 +118,23 @@ func newParamsFrom(obj *values.Object) (Params, error) { body, exists := obj.Get("body") if exists { - if err := core.ValidateType(body, types.Binary); err != nil { - return Params{}, core.Error(err, ".body") - } + if core.IsTypeOf(body, types.Binary) { + p.Body = body.(values.Binary) + } else { + j, err := body.MarshalJSON() + + if err != nil { + return Params{}, core.Error(err, ".body") + } + + p.Body = values.NewBinary(j) - p.Body = body.(values.Binary) + if p.Headers == nil { + p.Headers = values.NewObject() + } + + p.Headers.Set("Content-Type", values.NewString("application/json")) + } } return p, nil diff --git a/pkg/stdlib/math/abs_test.go b/pkg/stdlib/math/abs_test.go index 8b13a1669..fe936a707 100644 --- a/pkg/stdlib/math/abs_test.go +++ b/pkg/stdlib/math/abs_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/acos_test.go b/pkg/stdlib/math/acos_test.go index 526ac7196..c2592515b 100644 --- a/pkg/stdlib/math/acos_test.go +++ b/pkg/stdlib/math/acos_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/asin_test.go b/pkg/stdlib/math/asin_test.go index dd84a3105..e29b7c175 100644 --- a/pkg/stdlib/math/asin_test.go +++ b/pkg/stdlib/math/asin_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/atan2_test.go b/pkg/stdlib/math/atan2_test.go index 29e421e11..6f71cd24f 100644 --- a/pkg/stdlib/math/atan2_test.go +++ b/pkg/stdlib/math/atan2_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/atan_test.go b/pkg/stdlib/math/atan_test.go index 54323fabb..4109c7276 100644 --- a/pkg/stdlib/math/atan_test.go +++ b/pkg/stdlib/math/atan_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/average_test.go b/pkg/stdlib/math/average_test.go index 49d4a592f..66e250d7a 100644 --- a/pkg/stdlib/math/average_test.go +++ b/pkg/stdlib/math/average_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/ceil_test.go b/pkg/stdlib/math/ceil_test.go index bea494133..2db37cca0 100644 --- a/pkg/stdlib/math/ceil_test.go +++ b/pkg/stdlib/math/ceil_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/cos_test.go b/pkg/stdlib/math/cos_test.go index 9d577acd2..1b19f179d 100644 --- a/pkg/stdlib/math/cos_test.go +++ b/pkg/stdlib/math/cos_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/degrees_test.go b/pkg/stdlib/math/degrees_test.go index 37ede9e43..5a6ee9566 100644 --- a/pkg/stdlib/math/degrees_test.go +++ b/pkg/stdlib/math/degrees_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/exp2_test.go b/pkg/stdlib/math/exp2_test.go index 67536b01a..7da4307bd 100644 --- a/pkg/stdlib/math/exp2_test.go +++ b/pkg/stdlib/math/exp2_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/exp_test.go b/pkg/stdlib/math/exp_test.go index 23a921404..7a744e4a7 100644 --- a/pkg/stdlib/math/exp_test.go +++ b/pkg/stdlib/math/exp_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/floor_test.go b/pkg/stdlib/math/floor_test.go index a215642c7..eeccdc4ed 100644 --- a/pkg/stdlib/math/floor_test.go +++ b/pkg/stdlib/math/floor_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/log10_test.go b/pkg/stdlib/math/log10_test.go index 10c147624..b8ad45fe4 100644 --- a/pkg/stdlib/math/log10_test.go +++ b/pkg/stdlib/math/log10_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/log2_test.go b/pkg/stdlib/math/log2_test.go index 61b674bde..051959e70 100644 --- a/pkg/stdlib/math/log2_test.go +++ b/pkg/stdlib/math/log2_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/log_test.go b/pkg/stdlib/math/log_test.go index a999e82c3..74309fbd4 100644 --- a/pkg/stdlib/math/log_test.go +++ b/pkg/stdlib/math/log_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/max_test.go b/pkg/stdlib/math/max_test.go index fc3b19a36..acc22e4ca 100644 --- a/pkg/stdlib/math/max_test.go +++ b/pkg/stdlib/math/max_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/median_test.go b/pkg/stdlib/math/median_test.go index 6ba8c698d..e0d9c3b4c 100644 --- a/pkg/stdlib/math/median_test.go +++ b/pkg/stdlib/math/median_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/min_test.go b/pkg/stdlib/math/min_test.go index d5b7a732e..351a612df 100644 --- a/pkg/stdlib/math/min_test.go +++ b/pkg/stdlib/math/min_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/percentile.go b/pkg/stdlib/math/percentile.go index 28469a4f5..63f63fb2a 100644 --- a/pkg/stdlib/math/percentile.go +++ b/pkg/stdlib/math/percentile.go @@ -4,10 +4,11 @@ import ( "context" "math" + "github.com/pkg/errors" + "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/runtime/values/types" - "github.com/pkg/errors" ) // PERCENTILE returns the nth percentile of the values in a given array. diff --git a/pkg/stdlib/math/percentile_test.go b/pkg/stdlib/math/percentile_test.go index 52641e42a..30be990c0 100644 --- a/pkg/stdlib/math/percentile_test.go +++ b/pkg/stdlib/math/percentile_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/pi_test.go b/pkg/stdlib/math/pi_test.go index 5acdcc102..25eb02dd5 100644 --- a/pkg/stdlib/math/pi_test.go +++ b/pkg/stdlib/math/pi_test.go @@ -2,10 +2,12 @@ package math_test import ( "context" - "github.com/MontFerret/ferret/pkg/stdlib/math" - . "github.com/smartystreets/goconvey/convey" m "math" "testing" + + . "github.com/smartystreets/goconvey/convey" + + "github.com/MontFerret/ferret/pkg/stdlib/math" ) func TestPi(t *testing.T) { diff --git a/pkg/stdlib/math/pow_test.go b/pkg/stdlib/math/pow_test.go index 3abee4709..fa1ed64e7 100644 --- a/pkg/stdlib/math/pow_test.go +++ b/pkg/stdlib/math/pow_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/radians_test.go b/pkg/stdlib/math/radians_test.go index 264f14cf8..9f17b8ebd 100644 --- a/pkg/stdlib/math/radians_test.go +++ b/pkg/stdlib/math/radians_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/rand_test.go b/pkg/stdlib/math/rand_test.go index 85ecf8a3f..ba6618c53 100644 --- a/pkg/stdlib/math/rand_test.go +++ b/pkg/stdlib/math/rand_test.go @@ -2,9 +2,11 @@ package math_test import ( "context" - "github.com/MontFerret/ferret/pkg/stdlib/math" - . "github.com/smartystreets/goconvey/convey" "testing" + + . "github.com/smartystreets/goconvey/convey" + + "github.com/MontFerret/ferret/pkg/stdlib/math" ) func TestRand(t *testing.T) { diff --git a/pkg/stdlib/math/range_test.go b/pkg/stdlib/math/range_test.go index 539caef0e..7f99ca390 100644 --- a/pkg/stdlib/math/range_test.go +++ b/pkg/stdlib/math/range_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/round_test.go b/pkg/stdlib/math/round_test.go index 8a6c068ba..d225bee24 100644 --- a/pkg/stdlib/math/round_test.go +++ b/pkg/stdlib/math/round_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/sin_test.go b/pkg/stdlib/math/sin_test.go index d8298b19d..d58a3a182 100644 --- a/pkg/stdlib/math/sin_test.go +++ b/pkg/stdlib/math/sin_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/sqrt_test.go b/pkg/stdlib/math/sqrt_test.go index 5bcfaa7c0..cbbd4e243 100644 --- a/pkg/stdlib/math/sqrt_test.go +++ b/pkg/stdlib/math/sqrt_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/stddev_population_test.go b/pkg/stdlib/math/stddev_population_test.go index f3165bcf6..326f4430d 100644 --- a/pkg/stdlib/math/stddev_population_test.go +++ b/pkg/stdlib/math/stddev_population_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/stddev_sample_test.go b/pkg/stdlib/math/stddev_sample_test.go index c026c5cf0..3d56b1914 100644 --- a/pkg/stdlib/math/stddev_sample_test.go +++ b/pkg/stdlib/math/stddev_sample_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/sum_test.go b/pkg/stdlib/math/sum_test.go index 679ac9332..f83af8532 100644 --- a/pkg/stdlib/math/sum_test.go +++ b/pkg/stdlib/math/sum_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/tan_test.go b/pkg/stdlib/math/tan_test.go index 1e0a9fa63..88b9e8bc3 100644 --- a/pkg/stdlib/math/tan_test.go +++ b/pkg/stdlib/math/tan_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/variance_population_test.go b/pkg/stdlib/math/variance_population_test.go index 86d0a7a64..1a25315a5 100644 --- a/pkg/stdlib/math/variance_population_test.go +++ b/pkg/stdlib/math/variance_population_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/math/variance_sample_test.go b/pkg/stdlib/math/variance_sample_test.go index 0ac12996f..409c7edd8 100644 --- a/pkg/stdlib/math/variance_sample_test.go +++ b/pkg/stdlib/math/variance_sample_test.go @@ -2,9 +2,10 @@ package math_test import ( "context" + "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/math" - "testing" . "github.com/smartystreets/goconvey/convey" ) diff --git a/pkg/stdlib/objects/keep_keys_test.go b/pkg/stdlib/objects/keep_keys_test.go index 54d6946bf..e3ecc6e9a 100644 --- a/pkg/stdlib/objects/keep_keys_test.go +++ b/pkg/stdlib/objects/keep_keys_test.go @@ -4,10 +4,11 @@ import ( "context" "testing" + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/objects" - . "github.com/smartystreets/goconvey/convey" ) func TestKeepKeys(t *testing.T) { diff --git a/pkg/stdlib/objects/keys_test.go b/pkg/stdlib/objects/keys_test.go index 266749ba0..2f9353c66 100644 --- a/pkg/stdlib/objects/keys_test.go +++ b/pkg/stdlib/objects/keys_test.go @@ -2,9 +2,10 @@ package objects_test import ( "context" - "github.com/MontFerret/ferret/pkg/runtime/values/types" "testing" + "github.com/MontFerret/ferret/pkg/runtime/values/types" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/objects" diff --git a/pkg/stdlib/path/base_test.go b/pkg/stdlib/path/base_test.go index 53269dacd..695656072 100644 --- a/pkg/stdlib/path/base_test.go +++ b/pkg/stdlib/path/base_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/path" - . "github.com/smartystreets/goconvey/convey" ) func TestBase(t *testing.T) { diff --git a/pkg/stdlib/path/clean_test.go b/pkg/stdlib/path/clean_test.go index 1ac483646..5937fdf12 100644 --- a/pkg/stdlib/path/clean_test.go +++ b/pkg/stdlib/path/clean_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/path" - . "github.com/smartystreets/goconvey/convey" ) func TestClean(t *testing.T) { diff --git a/pkg/stdlib/path/dir_test.go b/pkg/stdlib/path/dir_test.go index 1defa7cea..25a245410 100644 --- a/pkg/stdlib/path/dir_test.go +++ b/pkg/stdlib/path/dir_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/path" - . "github.com/smartystreets/goconvey/convey" ) func TestDir(t *testing.T) { diff --git a/pkg/stdlib/path/ext_test.go b/pkg/stdlib/path/ext_test.go index a030e70c6..dcf3eec99 100644 --- a/pkg/stdlib/path/ext_test.go +++ b/pkg/stdlib/path/ext_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/path" - . "github.com/smartystreets/goconvey/convey" ) func TestExt(t *testing.T) { diff --git a/pkg/stdlib/path/is_abs_test.go b/pkg/stdlib/path/is_abs_test.go index a8dd92457..bd78b0e06 100644 --- a/pkg/stdlib/path/is_abs_test.go +++ b/pkg/stdlib/path/is_abs_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/path" - . "github.com/smartystreets/goconvey/convey" ) func TestIsAbs(t *testing.T) { diff --git a/pkg/stdlib/path/join_test.go b/pkg/stdlib/path/join_test.go index b2f6912bb..679d1bda2 100644 --- a/pkg/stdlib/path/join_test.go +++ b/pkg/stdlib/path/join_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/path" - . "github.com/smartystreets/goconvey/convey" ) func TestJoin(t *testing.T) { diff --git a/pkg/stdlib/path/match_test.go b/pkg/stdlib/path/match_test.go index c43126f61..c9f5a54cb 100644 --- a/pkg/stdlib/path/match_test.go +++ b/pkg/stdlib/path/match_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/path" - . "github.com/smartystreets/goconvey/convey" ) func TestMatch(t *testing.T) { diff --git a/pkg/stdlib/path/separate_test.go b/pkg/stdlib/path/separate_test.go index 8beeb45af..14bb29bdf 100644 --- a/pkg/stdlib/path/separate_test.go +++ b/pkg/stdlib/path/separate_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/path" - . "github.com/smartystreets/goconvey/convey" ) func TestSeparate(t *testing.T) { diff --git a/pkg/stdlib/strings/case_test.go b/pkg/stdlib/strings/case_test.go index 390ce58a5..b653524db 100644 --- a/pkg/stdlib/strings/case_test.go +++ b/pkg/stdlib/strings/case_test.go @@ -2,10 +2,12 @@ package strings_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/strings" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestLower(t *testing.T) { diff --git a/pkg/stdlib/strings/concat_test.go b/pkg/stdlib/strings/concat_test.go index b6a9547d7..bd0a0e7ee 100644 --- a/pkg/stdlib/strings/concat_test.go +++ b/pkg/stdlib/strings/concat_test.go @@ -2,10 +2,12 @@ package strings_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/strings" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestConcat(t *testing.T) { diff --git a/pkg/stdlib/strings/contains_test.go b/pkg/stdlib/strings/contains_test.go index d8d545aea..1509f3895 100644 --- a/pkg/stdlib/strings/contains_test.go +++ b/pkg/stdlib/strings/contains_test.go @@ -2,10 +2,12 @@ package strings_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/strings" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestContains(t *testing.T) { diff --git a/pkg/stdlib/strings/encode_test.go b/pkg/stdlib/strings/encode_test.go index 16490310c..6e659e19b 100644 --- a/pkg/stdlib/strings/encode_test.go +++ b/pkg/stdlib/strings/encode_test.go @@ -2,10 +2,12 @@ package strings_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/strings" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestEncodedURIComponent(t *testing.T) { diff --git a/pkg/stdlib/strings/escape_test.go b/pkg/stdlib/strings/escape_test.go index 07824d6d8..5dce98cf5 100644 --- a/pkg/stdlib/strings/escape_test.go +++ b/pkg/stdlib/strings/escape_test.go @@ -2,9 +2,10 @@ package strings_test import ( "context" - "github.com/MontFerret/ferret/pkg/runtime/values" "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" + "github.com/MontFerret/ferret/pkg/stdlib/strings" . "github.com/smartystreets/goconvey/convey" diff --git a/pkg/stdlib/strings/find_test.go b/pkg/stdlib/strings/find_test.go index 483a383b5..433d51c0a 100644 --- a/pkg/stdlib/strings/find_test.go +++ b/pkg/stdlib/strings/find_test.go @@ -2,10 +2,12 @@ package strings_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/strings" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestFindFirst(t *testing.T) { diff --git a/pkg/stdlib/strings/fmt.go b/pkg/stdlib/strings/fmt.go index 244b2a796..6128b0aca 100644 --- a/pkg/stdlib/strings/fmt.go +++ b/pkg/stdlib/strings/fmt.go @@ -6,10 +6,11 @@ import ( "strconv" "strings" + "github.com/pkg/errors" + "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/runtime/values/types" - "github.com/pkg/errors" ) // FMT formats the template using these arguments. diff --git a/pkg/stdlib/strings/fmt_test.go b/pkg/stdlib/strings/fmt_test.go index 1d527722b..6b602d929 100644 --- a/pkg/stdlib/strings/fmt_test.go +++ b/pkg/stdlib/strings/fmt_test.go @@ -4,10 +4,11 @@ import ( "context" "testing" + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/strings" - . "github.com/smartystreets/goconvey/convey" ) type testCase struct { diff --git a/pkg/stdlib/strings/json_test.go b/pkg/stdlib/strings/json_test.go index 114f62c59..8d872a3d8 100644 --- a/pkg/stdlib/strings/json_test.go +++ b/pkg/stdlib/strings/json_test.go @@ -4,10 +4,11 @@ import ( "context" "testing" + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/runtime/values/types" "github.com/MontFerret/ferret/pkg/stdlib/strings" - . "github.com/smartystreets/goconvey/convey" ) func TestJSONParse(t *testing.T) { diff --git a/pkg/stdlib/strings/like_test.go b/pkg/stdlib/strings/like_test.go index 99ea900b9..d91c506b0 100644 --- a/pkg/stdlib/strings/like_test.go +++ b/pkg/stdlib/strings/like_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/strings" - . "github.com/smartystreets/goconvey/convey" ) func TestLike(t *testing.T) { diff --git a/pkg/stdlib/strings/random_test.go b/pkg/stdlib/strings/random_test.go index c8418ec3f..29f6dddb7 100644 --- a/pkg/stdlib/strings/random_test.go +++ b/pkg/stdlib/strings/random_test.go @@ -2,10 +2,12 @@ package strings_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/strings" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestRandomToken(t *testing.T) { diff --git a/pkg/stdlib/strings/regex_test.go b/pkg/stdlib/strings/regex_test.go index 2d82e3464..20b644a50 100644 --- a/pkg/stdlib/strings/regex_test.go +++ b/pkg/stdlib/strings/regex_test.go @@ -2,10 +2,12 @@ package strings_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/strings" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestRegexMatch(t *testing.T) { diff --git a/pkg/stdlib/strings/split_test.go b/pkg/stdlib/strings/split_test.go index 96bc55d77..ac9ea7f6d 100644 --- a/pkg/stdlib/strings/split_test.go +++ b/pkg/stdlib/strings/split_test.go @@ -2,10 +2,12 @@ package strings_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/strings" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestSplit(t *testing.T) { diff --git a/pkg/stdlib/strings/substitute_test.go b/pkg/stdlib/strings/substitute_test.go index 0d5f78269..786d058cb 100644 --- a/pkg/stdlib/strings/substitute_test.go +++ b/pkg/stdlib/strings/substitute_test.go @@ -2,10 +2,12 @@ package strings_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/strings" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestSubstitute(t *testing.T) { diff --git a/pkg/stdlib/strings/substr_test.go b/pkg/stdlib/strings/substr_test.go index abaf784b6..8634eef7a 100644 --- a/pkg/stdlib/strings/substr_test.go +++ b/pkg/stdlib/strings/substr_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/strings" - . "github.com/smartystreets/goconvey/convey" ) func TestSubstring(t *testing.T) { diff --git a/pkg/stdlib/strings/trim_test.go b/pkg/stdlib/strings/trim_test.go index baebcd14c..d514127ea 100644 --- a/pkg/stdlib/strings/trim_test.go +++ b/pkg/stdlib/strings/trim_test.go @@ -2,10 +2,12 @@ package strings_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/strings" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestLTrim(t *testing.T) { diff --git a/pkg/stdlib/strings/unescape_test.go b/pkg/stdlib/strings/unescape_test.go index 0543ad8a6..acba0be3d 100644 --- a/pkg/stdlib/strings/unescape_test.go +++ b/pkg/stdlib/strings/unescape_test.go @@ -2,9 +2,10 @@ package strings_test import ( "context" - "github.com/MontFerret/ferret/pkg/runtime/values" "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" + "github.com/MontFerret/ferret/pkg/stdlib/strings" . "github.com/smartystreets/goconvey/convey" diff --git a/pkg/stdlib/testing/len_test.go b/pkg/stdlib/testing/len_test.go index 855a3824d..b8a8fc2c8 100644 --- a/pkg/stdlib/testing/len_test.go +++ b/pkg/stdlib/testing/len_test.go @@ -2,9 +2,10 @@ package testing_test import ( "context" - "github.com/MontFerret/ferret/pkg/stdlib/testing/base" t "testing" + "github.com/MontFerret/ferret/pkg/stdlib/testing/base" + . "github.com/smartystreets/goconvey/convey" "github.com/MontFerret/ferret/pkg/runtime/core" diff --git a/pkg/stdlib/testing/none_test.go b/pkg/stdlib/testing/none_test.go index 434c5abe8..bee834d3b 100644 --- a/pkg/stdlib/testing/none_test.go +++ b/pkg/stdlib/testing/none_test.go @@ -2,9 +2,10 @@ package testing_test import ( "context" + t "testing" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/testing/base" - t "testing" . "github.com/smartystreets/goconvey/convey" diff --git a/pkg/stdlib/types/to_array.go b/pkg/stdlib/types/to_array.go index a65cb7bb2..fb93b1d0a 100644 --- a/pkg/stdlib/types/to_array.go +++ b/pkg/stdlib/types/to_array.go @@ -2,6 +2,7 @@ package types import ( "context" + "github.com/MontFerret/ferret/pkg/runtime/core" "github.com/MontFerret/ferret/pkg/runtime/values" ) diff --git a/pkg/stdlib/types/to_binary.go b/pkg/stdlib/types/to_binary.go index 114a9b9d8..6ab09c9c1 100644 --- a/pkg/stdlib/types/to_binary.go +++ b/pkg/stdlib/types/to_binary.go @@ -7,10 +7,10 @@ import ( "github.com/MontFerret/ferret/pkg/runtime/values" ) -// ToBinary takes an input value of any type and convert it into a binary value. -// @param value (Value) - Input value of arbitrary type. -// @return (Binary) - String representation of a given value. -func ToBinary(ctx context.Context, args ...core.Value) (core.Value, error) { +// ToBinary takes an input value of any type and converts it into a binary value. +// @param {Any} value - Input value of arbitrary type. +// @return {Binary} - A binary value. +func ToBinary(_ context.Context, args ...core.Value) (core.Value, error) { err := core.ValidateArgs(args, 1, 1) if err != nil { diff --git a/pkg/stdlib/types/to_binary_test.go b/pkg/stdlib/types/to_binary_test.go index 9f555d333..5777aad78 100644 --- a/pkg/stdlib/types/to_binary_test.go +++ b/pkg/stdlib/types/to_binary_test.go @@ -1,20 +1,26 @@ -package types +package types_test import ( "context" "testing" - "github.com/MontFerret/ferret/pkg/runtime/values" . "github.com/smartystreets/goconvey/convey" + + "github.com/MontFerret/ferret/pkg/runtime/values" + "github.com/MontFerret/ferret/pkg/stdlib/types" ) func TestToBinary(t *testing.T) { Convey("TestToBinary", t, func() { - expected := "some data" + value := "abc" - result, err := ToBinary(context.Background(), values.NewString("some data")) + result, err := types.ToBinary(context.Background(), values.NewString(value)) + So(err, ShouldBeNil) + wasBinary, err := types.IsBinary(context.Background(), result) So(err, ShouldBeNil) - So(result.String(), ShouldEqual, expected) + So(wasBinary, ShouldEqual, values.True) + + So(result.String(), ShouldEqual, value) }) } diff --git a/pkg/stdlib/types/to_boolean_test.go b/pkg/stdlib/types/to_boolean_test.go index 5eb904d0c..bc17beb14 100644 --- a/pkg/stdlib/types/to_boolean_test.go +++ b/pkg/stdlib/types/to_boolean_test.go @@ -2,10 +2,12 @@ package types_test import ( "context" + "testing" + + . "github.com/smartystreets/goconvey/convey" + "github.com/MontFerret/ferret/pkg/runtime/values" "github.com/MontFerret/ferret/pkg/stdlib/types" - . "github.com/smartystreets/goconvey/convey" - "testing" ) func TestToBool(t *testing.T) {