From 0e7c5b2a1d449f52f1820a45e8e037ea691be216 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Sun, 10 Dec 2023 12:10:46 +0100 Subject: [PATCH] hello nimph --- .github/workflows/ci.yml | 47 + .gitignore | 2 + README.md | 257 + config.nims | 7 + copying.txt | 28 + nimble.paths | 1 + nimph.nimble | 40 + src/astcmp.nim | 86 + src/astcmp.nim.nimph.yaml | 2720 + src/nim.cfg | 1 + src/nimph.nim | 172 + src/nimph.nim.nimph.yaml | 3196 ++ src/phast.nim | 2657 + src/phast.nim.nimph.yaml | 45530 +++++++++++++++++ src/phastalgo.nim | 1381 + src/phastalgo.nim.nimph.yaml | 36265 ++++++++++++++ src/phlexer.nim | 1644 + src/phlexer.nim.nimph.yaml | 38688 +++++++++++++++ src/phlineinfos.nim | 413 + src/phlineinfos.nim.nimph.yaml | 5911 +++ src/phmsgs.nim | 972 + src/phmsgs.nim.nimph.yaml | 23616 +++++++++ src/phoptions.nim | 1297 + src/phoptions.nim.nimph.yaml | 25131 ++++++++++ src/phparser.nim | 3375 ++ src/phparser.nim.nimph.yaml | 65695 +++++++++++++++++++++++++ src/phrenderer.nim | 2542 + src/phrenderer.nim.nimph.yaml | 61076 +++++++++++++++++++++++ tests/after/comments | Bin 0 -> 85536 bytes tests/after/comments.nim | 253 + tests/after/comments.nim.nimph.yaml | 2306 + tests/after/empty.nim | 1 + tests/after/empty.nim.nimph.yaml | 3 + tests/after/exprs.nim | 59 + tests/after/exprs.nim.nimph.yaml | 709 + tests/after/import.nim | 20 + tests/after/import.nim.nimph.yaml | 232 + tests/after/procs.nim | 113 + tests/after/procs.nim.nimph.yaml | 1778 + tests/before/comments.nim | 278 + tests/before/comments.nim.nimph.yaml | 2295 + tests/before/empty.nim | 0 tests/before/empty.nim.nimph.yaml | 3 + tests/before/exprs.nim | 57 + tests/before/exprs.nim.nimph.yaml | 711 + tests/before/import.nim | 14 + tests/before/import.nim.nimph.yaml | 232 + tests/before/procs.nim | 42 + tests/before/procs.nim.nimph.yaml | 1778 + 49 files changed, 333634 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .gitignore create mode 100644 README.md create mode 100644 config.nims create mode 100644 copying.txt create mode 100644 nimble.paths create mode 100644 nimph.nimble create mode 100644 src/astcmp.nim create mode 100644 src/astcmp.nim.nimph.yaml create mode 100644 src/nim.cfg create mode 100644 src/nimph.nim create mode 100644 src/nimph.nim.nimph.yaml create mode 100644 src/phast.nim create mode 100644 src/phast.nim.nimph.yaml create mode 100644 src/phastalgo.nim create mode 100644 src/phastalgo.nim.nimph.yaml create mode 100644 src/phlexer.nim create mode 100644 src/phlexer.nim.nimph.yaml create mode 100644 src/phlineinfos.nim create mode 100644 src/phlineinfos.nim.nimph.yaml create mode 100644 src/phmsgs.nim create mode 100644 src/phmsgs.nim.nimph.yaml create mode 100644 src/phoptions.nim create mode 100644 src/phoptions.nim.nimph.yaml create mode 100644 src/phparser.nim create mode 100644 src/phparser.nim.nimph.yaml create mode 100644 src/phrenderer.nim create mode 100644 src/phrenderer.nim.nimph.yaml create mode 100755 tests/after/comments create mode 100644 tests/after/comments.nim create mode 100644 tests/after/comments.nim.nimph.yaml create mode 100644 tests/after/empty.nim create mode 100644 tests/after/empty.nim.nimph.yaml create mode 100644 tests/after/exprs.nim create mode 100644 tests/after/exprs.nim.nimph.yaml create mode 100644 tests/after/import.nim create mode 100644 tests/after/import.nim.nimph.yaml create mode 100644 tests/after/procs.nim create mode 100644 tests/after/procs.nim.nimph.yaml create mode 100644 tests/before/comments.nim create mode 100644 tests/before/comments.nim.nimph.yaml create mode 100644 tests/before/empty.nim create mode 100644 tests/before/empty.nim.nimph.yaml create mode 100644 tests/before/exprs.nim create mode 100644 tests/before/exprs.nim.nimph.yaml create mode 100644 tests/before/import.nim create mode 100644 tests/before/import.nim.nimph.yaml create mode 100644 tests/before/procs.nim create mode 100644 tests/before/procs.nim.nimph.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8b77e2d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +name: CI +on: [push, pull_request] + +concurrency: # Cancel stale PR builds (but not push builds) + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +jobs: + build: + strategy: + fail-fast: false + matrix: + target: + - os: linux + cpu: amd64 + TEST_LANG: c + include: + - target: + os: linux + builder: ubuntu-20.04 + shell: bash + defaults: + run: + shell: ${{ matrix.shell }} + + name: '${{ matrix.target.os }}-${{ matrix.target.cpu }}-${{ matrix.target.TEST_LANG }}' + runs-on: ${{ matrix.builder }} + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Fetch nimble + run: | + wget https://github.com/nim-lang/nimble/releases/download/latest/nimble-linux_x64.tar.gz + tar xvf nimble-linux_x64.tar.gz + echo "$PWD" >> $GITHUB_PATH + + - name: Build nimph + run: | + nimble setup -l + nimble build + + - name: Check formatting + run: | + find -name "*.nim" ! -path "./tests/before" ! -path "./nimbledeps/*" -print0 | xargs -0 -n1 ./nimph + git diff --exit-code + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9b39f3c --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +nimbledeps +/nimph diff --git a/README.md b/README.md new file mode 100644 index 0000000..3f60f6d --- /dev/null +++ b/README.md @@ -0,0 +1,257 @@ +# Nimph + +Nimph is an opinionated source code formatter for the Nim language, aiming to +take the drudgery of manual formatting out of your coding day. + +Following the great tradition of [`black`](https://github.com/psf/black/), +[`prettier`](https://prettier.io/), [`clang-format`](https://clang.llvm.org/docs/ClangFormat.html) +and other AST-based formatters, it discards existing styling to create a +consistent and beautiful codebase. + +## Usage + +Install `nimph`, then run it on some files: + +```sh +# Format the given files in-place +nimph file0.nim file1.nim + +# Format the given files, writing the formatted code to /tmp +nimph file0.nim file1.nim --outdir:/tmp + +# Use --check to verify that a file is formatted correctly - useful in CI +nimph --check somefile.nim || echo "Not formatted!" + +# You can format stuff as part of a pipe using `-` as input: +echo "echo 1" | nimph - +``` + +For bonus points, replace `nimpretty` with a symlink to `nimph` - similar +command line options are supported ;) + +## Installation + +`nimph` can be compiled or installed using `nimble` version `v0.14.2`+: + +```sh +nimble -l setup +nimble build +``` + +## Priorities + +`nimph` aims to format code in such way that: + +* it remains semantically unchanged, aka correct (!) + * the AST is checked for equivalence before writing the formatted code to + disk - on mismatch, the code is left untouched +* it remains simple, consistent and pleasant to read + * _most_ code should look as good as or better than its hand-formatted + counterpart +* diffs are kept at a minimum + * diff-inducing constructs such as vertical alignment are avoided, for more + productive merges +* it broadly follows the [Status Nim style guide](https://status-im.github.io/nim-style-guide/) + and [NEP1](https://nim-lang.org/docs/nep1.html) + * this is tool aimed at making collaboration easier, with others and your + future self + * where NEP1 contradicts itself, see above + +The formatting rules are loosely derived from other formatters that already have +gone through the journey of debating what "pleasing to read" might mean while +making adaptations for both features and quirks of the Nim parser. + +If in doubt, formatting that works well for descriptive identifiers and avoids +putting too much information in a single like will be preferred. + +## FAQ + +### Why use a formatter? + +A formatter removes the tedium of manually adding structure to code to make it +more readable - overlong lines, inconsistent indentation, lack of visual +structure and other small distractions quickly nibble away at the mental budget +available for writing code while a formatter solves this many many other things +at the press of a button. + +When you work with others, debates and nitpicking over style go away and +collaborative efforts can focus on substance instead. + +Finally, the code is likely to look better - manually formatting code takes a +lot of effort which ultimately can be spent better elsewhere - as such, poorly +formatted code ends up being more common than not. + +### But I've spent a significant part of my life realigning code and now it's lost! + +https://en.wikipedia.org/wiki/Sunk_cost + +### How do I introduce `nimph` in an existing codebase? + +Assuming `git` is used, format all code using `nimph`, put it in a single commit +and add a CI rule to ensure that future commits are all formatted using the same +`nimph` version. + +Formatting commits can be ignored for the purpose of `git blame` by adding a +file named `.git-blame-ignore-revs` containing the formatted source code to the +root of the project: + +```sh +cd myproject + +# Format all source code with nimph +find -name "*.nim" -exec nimph {} \; + +# Create a single commit with all changes +git add -A && git commit -m "Formatted code with nimph" + +# Record the commit hash in the blame file +echo "# Formatted code with nimph" >> .git-blame-ignore-revs +echo $(git rev-parse HEAD) >> .git-blame-ignore-revs +``` + +then configure git to use it: +```sh +git --global config blame.ignoreRevsFile .git-blame-ignore-revs +``` + +The same strategy can be used when upgrading `nimph` to a new version that +introduces formatting changes. + +### `nimph` complains about my code! + +One of several things could have happened: + +* The code was not valid enough - `nimph` can only parse valid Nim grammar and + while it would be nice to handle partially formatted stuff gracefully, we're + not there yet. +* The parser has a bug and is unable to parse valid Nim code + * Probably you can move some comments around to make it work! +* the formatter has a bug and the resulting formatting is invalid + * Probably you can move some comments around to make it work! +* the AST equivalence checker complains + * This often happens in complex expressions such as `do` and parenthesis used + for indent purposes where the Nim grammar has ambiguities and parsing + complexity - it can usually be worked around by simplifying complex + expressions, introducing a template or similar + * It could also be that the AST checker is too strict - the Nim parser will + generate different AST:s depending on whitespace even if semantically there + is no difference + +Regardless of what happened, `nimph` takes the conservative approach and retains +the original formatting! + +If you have time, try to find the offending code snippet and submit an issue. + +### Why the cited formatters in particular? + +* `black` because of our syntactic similarity with Python and its + [stability policy](https://black.readthedocs.io/en/stable/the_black_code_style/index.html#stability-policy) +* `prettier` for its wisdom in how formatting [options](https://prettier.io/docs/en/option-philosophy) + are approached and for the closeness to user experience of its developers +* `clang-format` for being the formatter that made me stop worrying about + formatting + * its secret sauce was treating formatting as a balancing of priorities rather + than a mechanical stringification using a [lowest-penalty](https://youtu.be/s7JmdCfI__c?t=640) + algorithm + +### What is meant by consistency? + +* Similar constructs are formatted with similar rules + * Does it look like a list? Format it with list-like rules regardless if + its a parameter list, array of values or import list +* Original styling is generally not preserved - instead, the formatting is based + on the semantic structure of the program +* Spacing emphasizes structure and control flow to help you read the code + +`nimph` makes your code consistent without introducing hobgoblins in your mind! + +### Why are there no options? + +The aim of `nimph` is to create a single consistent style that allows you to +focus on programming while `nimph` takes care of the formatting, even across +different codebases and authors. + +Consistency helps reading speed by removing unique and elaborate formatting +distractions, allowing you, the experienced programmer, to derive structural +information about the codebase at a glance. + +The style might feel unfamiliar in the beginning - this is fine and not a reason +to panic - a few weeks from now, you'll forget you ever used another one. + +### Do you accept style suggestions and changes? + +Yes! The project is still in its early phase meaning that the style is not yet +set in stone. + +To submit a proposal, include some existing code, how you'd like it to be +formatted and an option-free algorithm detailing how to achieve it and how the +outcome relates to the above styling priorities. + +When in doubt, look at what other opinionated formatters have done and link to +it! + +Eventually, the plan is to adopt a [stability policy](https://black.readthedocs.io/en/stable/the_black_code_style/index.html#stability-policy) +similar to `black`, meaning that style changes will still be accepted, but +introduced only rarely so that you don't have to worry about massive PR-breaking +formatting diffs all the time. + +### Why does the formatting code look an awful lot like the Nim compiler renderer? + +Because it is based on it, of course! As a starting point this is fine but the +code would benefit greatly from being rewritten with a dedicated formatting +AST. + +In particular, the comment handling is done in a hand-wavy manner with bits and +pieces of the old code mixed with new heuristics resulting in quite the mess. + +### Should it be upstreamed? + +Maybe parts - feel free to make PR:s to the Nim repo from this codebase! That +said, the aim of a compiler is to compile while a formatter formats - we are not +the same. + +### What about `nimpretty`? + +`nimpretty` formats tokens, not the AST. Use whichever you like better, but keep +a backup if you don't use `nimph` :) + +### Why 88 characters? + +This is an experiment. + +Astute and experienced programmers have noticed two things: longer variable +names aren't that bad and monitors have gotten bigger since the 80 standard was +set. + +Going beyond allows code that uses descriptive names to look better - how much +extra is needed here is an open question but 10% seems like a good start for a +language like Nim which defaults to 2-space significant indent and a naive +module system that encourages globally unique identifiers with longer names. + +### What about comments? + +`nimph` currently touches comments as little as possible - specifically, they +are not re-flowed or re-aligned and the aim is to make them sticky to where they +were originally written. + +Improvements in this area are much welcome - the compiler AST was not really +written with comment preservation in mind and `nimph`'s handling is not great. + +### What features will likely not be added? + +* formatting options - things that change the way the formatting is done for + aesthetic reasons - exceptions here might include options that increase + compatiblity (for example with older Nim versions) +* semantic refactoring - reordings of imports etc - the focus is on style only + +### What's with the semicolons? + +Nim's grammar unfortunately allows the use of either `,` or `;` in some places +with a subtly different AST being produced which _sometimes_ has a semantic +impact - `nimph` takes a conservative approach here and uses `;` to avoid +ambiguity. + +Future versions may try to identify where `,` can be used safely - very few +programmers _really_ want `;` judging from the frequency with which it is used. + +Regardless, you can usually type either and `nimph` will clean it up. diff --git a/config.nims b/config.nims new file mode 100644 index 0000000..ccedc2d --- /dev/null +++ b/config.nims @@ -0,0 +1,7 @@ +# begin Nimble config (version 2) +when withDir(thisDir(), system.fileExists("nimble.paths")): + include "nimble.paths" +# end Nimble config + +switch("p", "$projectDir/nimbledeps/pkgs2/nim-2.0.0-35b9d926d314ce8c3326902c138f5c2247cfd390/compiler") +switch("p", "$projectDir/../nimbledeps/pkgs2/nim-2.0.0-35b9d926d314ce8c3326902c138f5c2247cfd390/compiler") diff --git a/copying.txt b/copying.txt new file mode 100644 index 0000000..693cf28 --- /dev/null +++ b/copying.txt @@ -0,0 +1,28 @@ +===================================================== +nimph code formatter + +Copyright (C) 2023 Jacek Sieka. All rights reserved. + + +Based in large parts on code from the Nim compiler, which is: +Copyright (C) 2006-2023 Andreas Rumpf. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +[ MIT license: http://www.opensource.org/licenses/mit-license.php ] diff --git a/nimble.paths b/nimble.paths new file mode 100644 index 0000000..48e67c1 --- /dev/null +++ b/nimble.paths @@ -0,0 +1 @@ +--noNimblePath diff --git a/nimph.nimble b/nimph.nimble new file mode 100644 index 0000000..3cf1e8f --- /dev/null +++ b/nimph.nimble @@ -0,0 +1,40 @@ +# Package + +version = "0.1" +author = "Jacek Sieka" +description = "Nim code formatter" +license = "MIT" +srcDir = "src" +bin = @["nimph"] + +# Dependencies + +# TODO https://github.com/nim-lang/nimble/issues/1166 +# Using exact version here and adding path manually :facepalm: +# run `nimble setup -l` to hopefully make it work +requires "nim == 2.0.0", + "compiler" + +proc build() = + exec "nim c --debuginfo -o:nimph src/nimph" + +task self, "Format nimph itself": + build() + + # Stage changes before doing self-formatting! + exec "git diff --staged --no-ext-diff --quiet --exit-code" + exec "git add -A" + + for file in listFiles("src"): + if file.len > 4 and file[^4..^1] == ".nim": + echo file + exec "./nimph " & file & " --debug" + +task f, "Format": + build() + + cd "tests/before" + for file in listFiles("."): + if file.len > 4 and file[^4..^1] == ".nim": + echo file + exec "../../nimph " & file & " --outDir:../after --debug" diff --git a/src/astcmp.nim b/src/astcmp.nim new file mode 100644 index 0000000..b46c346 --- /dev/null +++ b/src/astcmp.nim @@ -0,0 +1,86 @@ +# nimph +# (c) Copyright 2023 Jacek Sieka +## Compare two AST's for semantic equivalence - aka undo whitespace bugs in the +## Nim parser / grammar + +import ast, parser, idents, options, sequtils + +type + Equivalence* = enum + Same + Different + + Outcome* = object + case kind*: Equivalence + of Same: + discard + of Different: + a*, b*: PNode + +proc similarKinds(ak, bk: TNodeKind): bool = + ak == bk or (ak in {nkElseExpr, nkElse} and bk in {nkElseExpr, nkElse}) or ( + ak in {nkElifExpr, nkElifBranch} and bk in {nkElifExpr, nkElifBranch} + ) + +proc equivalent*(a, b: PNode): Outcome = + if not similarKinds(a.kind, b.kind): + # Semantically equivalent ways of representing the same tree - difference + # lies in how much whitespace we introduce (unfortunately) + if b.kind in {nkFormalParams, nkRecList, nkStmtList, nkStmtListExpr} and b.sons.len == 1: + return equivalent(a, b.sons[0]) + if a.kind in {nkFormalParams, nkRecList, nkStmtList, nkStmtListExpr} and a.sons.len == 1: + return equivalent(a.sons[0], b) + if b.kind in {nkFormalParams, nkRecList, nkStmtList, nkStmtListExpr} and b.sons.len == 0 and a.kind == nkEmpty: + return Outcome(kind: Same) + if a.kind in {nkFormalParams, nkRecList, nkStmtList, nkStmtListExpr} and a.sons.len == 0 and b.kind == nkEmpty: + return Outcome(kind: Same) + if a.kind == nkPrefix and a.len == 2 and a[0].kind == nkIdent and a[0].ident.s == "-" and b.kind == a[ + 1].kind: + # `- 1` is transformed to `-1` which semantically is not exactly the same but close enough + # TODO the positive and negative ranges of integers are not the same - is this a problem? + # what about more complex expressions? + return Outcome(kind: Same) + # runnableExamples: static: ... turns into a staticStmt when broken up in + # lines (!) + if a.kind == nkCall and b.kind == nkStaticStmt and a.sons.len > 1 and a.sons[0].kind == nkIdent and a.sons[ + 0].ident.s == "static": + return equivalent(a.sons[1], b.sons[0]) + + return Outcome(kind: Different, a: a, b: b) + + let eq = + case a.kind + of nkCharLit .. nkUInt64Lit: + a.intVal == b.intVal + of nkFloatLit .. nkFloat128Lit: + a.floatVal == b.floatVal + of nkStrLit .. nkTripleStrLit: + a.strVal == b.strVal + of nkSym: + raiseAssert "Shouldn't eixst in parser" + of nkIdent: + a.ident.s == b.ident.s + else: + # TODO don't break comments! + let + af = a.sons.filterIt(it.kind != nkCommentStmt) + bf = b.sons.filterIt(it.kind != nkCommentStmt) + if af.len() != bf.len(): + false + else: + for (aa, bb) in zip(af, bf): + let eq = equivalent(aa, bb) + if eq.kind == Different: + return eq + + true + if not eq: + Outcome(kind: Different, a: a, b: b) + else: + Outcome(kind: Same) + +proc equivalent*(a, afile, b, bfile: string): Outcome = + equivalent( + parseString(a, newIdentCache(), newConfigRef(), afile), + parseString(b, newIdentCache(), newConfigRef(), bfile) + ) diff --git a/src/astcmp.nim.nimph.yaml b/src/astcmp.nim.nimph.yaml new file mode 100644 index 0000000..ab174fa --- /dev/null +++ b/src/astcmp.nim.nimph.yaml @@ -0,0 +1,2720 @@ +{ + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommentStmt", + "comment": "# nimph" + }, + { + "kind": "nkCommentStmt", + "comment": "# (c) Copyright 2023 Jacek Sieka" + }, + { + "kind": "nkCommentStmt", + "comment": "## Compare two AST\'s for semantic equivalence - aka undo whitespace bugs in the" + }, + { + "kind": "nkCommentStmt", + "comment": "## Nim parser / grammar" + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "ast" + }, + { + "kind": "nkIdent", + "ident": "parser" + }, + { + "kind": "nkIdent", + "ident": "idents" + }, + { + "kind": "nkIdent", + "ident": "options" + }, + { + "kind": "nkIdent", + "ident": "sequtils" + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "Equivalence" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "Same" + }, + { + "kind": "nkIdent", + "ident": "Different" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "Outcome" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkRecCase", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "Equivalence" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "Same" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "Different" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "similarKinds" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ak" + }, + { + "kind": "nkIdent", + "ident": "bk" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "ak" + }, + { + "kind": "nkIdent", + "ident": "bk" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "ak" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkElseExpr" + }, + { + "kind": "nkIdent", + "ident": "nkElse" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "bk" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkElseExpr" + }, + { + "kind": "nkIdent", + "ident": "nkElse" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "ak" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkElifExpr" + }, + { + "kind": "nkIdent", + "ident": "nkElifBranch" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "bk" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkElifExpr" + }, + { + "kind": "nkIdent", + "ident": "nkElifBranch" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "equivalent" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Outcome" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "similarKinds" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Semantically equivalent ways of representing the same tree - difference\", line: 27, col: 4, offsetA: 668, offsetB: 741)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# lies in how much whitespace we introduce (unfortunately)\", line: 28, col: 4, offsetA: 746, offsetB: 804)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkFormalParams" + }, + { + "kind": "nkIdent", + "ident": "nkRecList" + }, + { + "kind": "nkIdent", + "ident": "nkStmtList" + }, + { + "kind": "nkIdent", + "ident": "nkStmtListExpr" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "equivalent" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkFormalParams" + }, + { + "kind": "nkIdent", + "ident": "nkRecList" + }, + { + "kind": "nkIdent", + "ident": "nkStmtList" + }, + { + "kind": "nkIdent", + "ident": "nkStmtListExpr" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "equivalent" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkFormalParams" + }, + { + "kind": "nkIdent", + "ident": "nkRecList" + }, + { + "kind": "nkIdent", + "ident": "nkStmtList" + }, + { + "kind": "nkIdent", + "ident": "nkStmtListExpr" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkObjConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "Outcome" + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "Same" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkFormalParams" + }, + { + "kind": "nkIdent", + "ident": "nkRecList" + }, + { + "kind": "nkIdent", + "ident": "nkStmtList" + }, + { + "kind": "nkIdent", + "ident": "nkStmtListExpr" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkObjConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "Outcome" + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "Same" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkPrefix" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkIdent" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "-" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# `- 1` is transformed to `-1` which semantically is not exactly the same but close enough\", line: 39, col: 6, offsetA: 1499, offsetB: 1589)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO the positive and negative ranges of integers are not the same - is this a problem?\", line: 40, col: 6, offsetA: 1596, offsetB: 1685)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# what about more complex expressions?\", line: 41, col: 6, offsetA: 1692, offsetB: 1735)" + ], + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkObjConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "Outcome" + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "Same" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# runnableExamples: static: ... turns into a staticStmt when broken up in\", line: 43, col: 4, offsetA: 1773, offsetB: 1846)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# lines (!)\", line: 44, col: 4, offsetA: 1851, offsetB: 1862)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkCall" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkStaticStmt" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkIdent" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "static" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "equivalent" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkObjConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "Outcome" + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "Different" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "eq" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkCharLit" + }, + { + "kind": "nkIdent", + "ident": "nkUInt64Lit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkFloatLit" + }, + { + "kind": "nkIdent", + "ident": "nkFloat128Lit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkStrLit" + }, + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkSym" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "raiseAssert" + }, + { + "kind": "nkStrLit", + "strVal": "Shouldn\'t eixst in parser" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIdent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO don\\\'t break comments!\", line: 64, col: 6, offsetA: 2440, offsetB: 2468)" + ], + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "af" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "filterIt" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "it" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkCommentStmt" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "bf" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "filterIt" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "it" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkCommentStmt" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "af" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "bf" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkVarTuple", + "sons": [ + { + "kind": "nkIdent", + "ident": "aa" + }, + { + "kind": "nkIdent", + "ident": "bb" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "zip" + }, + { + "kind": "nkIdent", + "ident": "af" + }, + { + "kind": "nkIdent", + "ident": "bf" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "eq" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "equivalent" + }, + { + "kind": "nkIdent", + "ident": "aa" + }, + { + "kind": "nkIdent", + "ident": "bb" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "eq" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "Different" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "eq" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkIdent", + "ident": "eq" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkObjConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "Outcome" + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "Different" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkObjConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "Outcome" + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "Same" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "equivalent" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Outcome" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "afile" + }, + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "bfile" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "equivalent" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseString" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIdentCache" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newConfigRef" + } + ] + }, + { + "kind": "nkIdent", + "ident": "afile" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseString" + }, + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIdentCache" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newConfigRef" + } + ] + }, + { + "kind": "nkIdent", + "ident": "bfile" + } + ] + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/nim.cfg b/src/nim.cfg new file mode 100644 index 0000000..dd7c832 --- /dev/null +++ b/src/nim.cfg @@ -0,0 +1 @@ +-d:nimph diff --git a/src/nimph.nim b/src/nimph.nim new file mode 100644 index 0000000..dce4ba4 --- /dev/null +++ b/src/nimph.nim @@ -0,0 +1,172 @@ +# nimph +# (c) Copyright 2023 Jacek Sieka +## Opinionated source code formatter + +import + "."/[astcmp, phast, phastalgo, phmsgs, phlineinfos, phoptions, phparser, phrenderer] +import idents + +from astalgo import nil + +import parseopt, strutils, os, sequtils + +const + Version = "0.1" + Usage = + "nimph - Nim formatter " & Version & """ +Usage: + nimph [options] nimfiles... +Options: + --check check the formatting instead of performing it + --out:file set the output file (default: overwrite the input file) + --outDir:dir set the output dir (default: overwrite the input files) + --version show the version + --help show this help +""" + +proc writeHelp() = + stdout.write(Usage) + stdout.flushFile() + quit(0) + +proc writeVersion() = + stdout.write(Version & "\n") + stdout.flushFile() + quit(0) + +proc parse(input, filename: string; printTokens: bool; conf: ConfigRef): PNode = + let fn = + if filename == "-": + "stdin" + else: + filename + + parseString(input, newIdentCache(), conf, fn, printTokens = printTokens) + +proc prettyPrint(infile, outfile: string; debug, check, printTokens: bool): bool = + let + conf = newConfigRef() + input = + if infile == "-": + readAll(stdin) + else: + readFile(infile) + node = parse(input, infile, printTokens, conf) + output = renderTree(node, {}, conf) & "\n" + if infile != "-": + if debug: + # Always write file in debug mode + writeFile(infile & ".nimph.yaml", treeToYaml(nil, node)) + if infile != outfile: + writeFile(outfile, output) + writeFile( + outfile & ".nimph.yaml", + treeToYaml(nil, parse(output, outfile, printTokens, newConfigRef())) + ) + elif fileExists(outFile) and output == readFile(outFile): + # No formatting difference - don't touch file modificuation date + return true + + let eq = + equivalent( + input, + infile, + output, + if infile == "-": + "stdout" + else: + outfile + ) + if eq.kind == Different: + stderr.writeLine "--- Input ---" + stderr.writeLine input + stderr.writeLine "--- Formatted ---" + stderr.writeLine output + stderr.writeLine "--- PRE ---" + stderr.writeLine astalgo.treeToYaml(nil, eq.a) + stderr.writeLine "--- POST ---" + stderr.writeLine astAlgo.treeToYaml(nil, eq.b) + + rawMessage(conf, errGenerated, "Formatted output does not match input, report bug!") + if infile != outfile or infile == "-": + # Write unformatted content + if not check: + if infile == "-": + write(stdout, input) + else: + writeFile(outfile, input) + + quit 2 + if check: + false # We failed the equivalence check above + else: + # Formatting changed the file + if not debug or infile == "-": + if infile == "-": + write(stdout, output) + else: + writeFile(outfile, output) + + true + +proc main() = + var + outfile, outdir: string + infiles = newSeq[string]() + outfiles = newSeq[string]() + debug = false + check = false + printTokens = false + for kind, key, val in getopt(): + case kind + of cmdArgument: + infiles.add(key.addFileExt(".nim")) + of cmdLongOption, cmdShortOption: + case normalize(key) + of "help", "h": + writeHelp() + of "version", "v": + writeVersion() + of "debug": + debug = true + of "print-tokens": + printTokens = true + of "check": + check = true + of "output", "o", "out": + outfile = val + of "outDir", "outdir": + outdir = val + of "": + infiles.add("-") + else: + writeHelp() + of cmdEnd: + assert(false) # cannot happen + if infiles.len == 0: + quit "[Error] no input file.", 3 + if outfile.len != 0 and outdir.len != 0: + quit "[Error] out and outDir cannot both be specified", 3 + if outfile.len == 0 and outdir.len == 0: + outfiles = infiles + elif outfile.len != 0 and infiles.len > 1: + # Take the last file to maintain backwards compatibility + let infile = infiles[^1] + + infiles = @[infile] + outfiles = @[outfile] + elif outfile.len != 0: + outfiles = @[outfile] + elif outdir.len != 0: + outfiles = infiles.mapIt($(joinPath(outdir, it))) + for (infile, outfile) in zip(infiles, outfiles): + let (dir, _, _) = splitFile(outfile) + + createDir(dir) + if not prettyPrint(infile, outfile, debug, check, printTokens): + quit 1 + + quit 0 + +when isMainModule: + main() diff --git a/src/nimph.nim.nimph.yaml b/src/nimph.nim.nimph.yaml new file mode 100644 index 0000000..30cfe10 --- /dev/null +++ b/src/nimph.nim.nimph.yaml @@ -0,0 +1,3196 @@ +{ + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommentStmt", + "comment": "# nimph" + }, + { + "kind": "nkCommentStmt", + "comment": "# (c) Copyright 2023 Jacek Sieka" + }, + { + "kind": "nkCommentStmt", + "comment": "## Opinionated source code formatter" + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkStrLit", + "strVal": "." + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "astcmp" + }, + { + "kind": "nkIdent", + "ident": "phast" + }, + { + "kind": "nkIdent", + "ident": "phastalgo" + }, + { + "kind": "nkIdent", + "ident": "phmsgs" + }, + { + "kind": "nkIdent", + "ident": "phlineinfos" + }, + { + "kind": "nkIdent", + "ident": "phoptions" + }, + { + "kind": "nkIdent", + "ident": "phparser" + }, + { + "kind": "nkIdent", + "ident": "phrenderer" + } + ] + } + ] + } + ] + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "idents" + } + ] + }, + { + "kind": "nkFromStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "astalgo" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseopt" + }, + { + "kind": "nkIdent", + "ident": "strutils" + }, + { + "kind": "nkIdent", + "ident": "os" + }, + { + "kind": "nkIdent", + "ident": "sequtils" + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "Version" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "0.1" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "Usage" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "nimph - Nim formatter " + }, + { + "kind": "nkIdent", + "ident": "Version" + } + ] + }, + { + "kind": "nkTripleStrLit", + "strVal": "Usage:\u000A nimph [options] nimfiles...\u000AOptions:\u000A --check check the formatting instead of performing it\u000A --out:file set the output file (default: overwrite the input file)\u000A --outDir:dir set the output dir (default: overwrite the input files)\u000A --version show the version\u000A --help show this help\u000A" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "writeHelp" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "stdout" + }, + { + "kind": "nkIdent", + "ident": "write" + } + ] + }, + { + "kind": "nkIdent", + "ident": "Usage" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "stdout" + }, + { + "kind": "nkIdent", + "ident": "flushFile" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "quit" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "writeVersion" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "stdout" + }, + { + "kind": "nkIdent", + "ident": "write" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkIdent", + "ident": "Version" + }, + { + "kind": "nkStrLit", + "strVal": "\u000A" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "stdout" + }, + { + "kind": "nkIdent", + "ident": "flushFile" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "quit" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parse" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "input" + }, + { + "kind": "nkIdent", + "ident": "filename" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "printTokens" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "filename" + }, + { + "kind": "nkStrLit", + "strVal": "-" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "stdin" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "filename" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseString" + }, + { + "kind": "nkIdent", + "ident": "input" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIdentCache" + } + ] + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "printTokens" + }, + { + "kind": "nkIdent", + "ident": "printTokens" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "prettyPrint" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "infile" + }, + { + "kind": "nkIdent", + "ident": "outfile" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "debug" + }, + { + "kind": "nkIdent", + "ident": "check" + }, + { + "kind": "nkIdent", + "ident": "printTokens" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newConfigRef" + } + ] + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "input" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "infile" + }, + { + "kind": "nkStrLit", + "strVal": "-" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "readAll" + }, + { + "kind": "nkIdent", + "ident": "stdin" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "readFile" + }, + { + "kind": "nkIdent", + "ident": "infile" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "node" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parse" + }, + { + "kind": "nkIdent", + "ident": "input" + }, + { + "kind": "nkIdent", + "ident": "infile" + }, + { + "kind": "nkIdent", + "ident": "printTokens" + }, + { + "kind": "nkIdent", + "ident": "conf" + } + ] + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "output" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "renderTree" + }, + { + "kind": "nkIdent", + "ident": "node" + }, + { + "kind": "nkCurly" + }, + { + "kind": "nkIdent", + "ident": "conf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\u000A" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "infile" + }, + { + "kind": "nkStrLit", + "strVal": "-" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "debug" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Always write file in debug mode\", line: 58, col: 6, offsetA: 1450, offsetB: 1483)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "writeFile" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkIdent", + "ident": "infile" + }, + { + "kind": "nkStrLit", + "strVal": ".nimph.yaml" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "treeToYaml" + }, + { + "kind": "nkNilLit" + }, + { + "kind": "nkIdent", + "ident": "node" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "infile" + }, + { + "kind": "nkIdent", + "ident": "outfile" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "writeFile" + }, + { + "kind": "nkIdent", + "ident": "outfile" + }, + { + "kind": "nkIdent", + "ident": "output" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "writeFile" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkIdent", + "ident": "outfile" + }, + { + "kind": "nkStrLit", + "strVal": ".nimph.yaml" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "treeToYaml" + }, + { + "kind": "nkNilLit" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parse" + }, + { + "kind": "nkIdent", + "ident": "output" + }, + { + "kind": "nkIdent", + "ident": "outfile" + }, + { + "kind": "nkIdent", + "ident": "printTokens" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newConfigRef" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileExists" + }, + { + "kind": "nkIdent", + "ident": "outFile" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "output" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "readFile" + }, + { + "kind": "nkIdent", + "ident": "outFile" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# No formatting difference - don\\\'t touch file modificuation date\", line: 67, col: 6, offsetA: 1821, offsetB: 1885)" + ], + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "eq" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "equivalent" + }, + { + "kind": "nkIdent", + "ident": "input" + }, + { + "kind": "nkIdent", + "ident": "infile" + }, + { + "kind": "nkIdent", + "ident": "output" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "infile" + }, + { + "kind": "nkStrLit", + "strVal": "-" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "stdout" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "outfile" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "eq" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "Different" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "stderr" + }, + { + "kind": "nkIdent", + "ident": "writeLine" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "--- Input ---" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "stderr" + }, + { + "kind": "nkIdent", + "ident": "writeLine" + } + ] + }, + { + "kind": "nkIdent", + "ident": "input" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "stderr" + }, + { + "kind": "nkIdent", + "ident": "writeLine" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "--- Formatted ---" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "stderr" + }, + { + "kind": "nkIdent", + "ident": "writeLine" + } + ] + }, + { + "kind": "nkIdent", + "ident": "output" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "stderr" + }, + { + "kind": "nkIdent", + "ident": "writeLine" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "--- PRE ---" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "stderr" + }, + { + "kind": "nkIdent", + "ident": "writeLine" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "astalgo" + }, + { + "kind": "nkIdent", + "ident": "treeToYaml" + } + ] + }, + { + "kind": "nkNilLit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "eq" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "stderr" + }, + { + "kind": "nkIdent", + "ident": "writeLine" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "--- POST ---" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "stderr" + }, + { + "kind": "nkIdent", + "ident": "writeLine" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "astAlgo" + }, + { + "kind": "nkIdent", + "ident": "treeToYaml" + } + ] + }, + { + "kind": "nkNilLit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "eq" + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rawMessage" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkStrLit", + "strVal": "Formatted output does not match input, report bug!" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "infile" + }, + { + "kind": "nkIdent", + "ident": "outfile" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "infile" + }, + { + "kind": "nkStrLit", + "strVal": "-" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Write unformatted content\", line: 92, col: 6, offsetA: 2520, offsetB: 2547)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkIdent", + "ident": "check" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "infile" + }, + { + "kind": "nkStrLit", + "strVal": "-" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "write" + }, + { + "kind": "nkIdent", + "ident": "stdout" + }, + { + "kind": "nkIdent", + "ident": "input" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "writeFile" + }, + { + "kind": "nkIdent", + "ident": "outfile" + }, + { + "kind": "nkIdent", + "ident": "input" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "quit" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "check" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "false", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# We failed the equivalence check above\", line: 101, col: 10, offsetA: 2709, offsetB: 2748)" + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Formatting changed the file\", line: 103, col: 4, offsetA: 2761, offsetB: 2790)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkIdent", + "ident": "debug" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "infile" + }, + { + "kind": "nkStrLit", + "strVal": "-" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "infile" + }, + { + "kind": "nkStrLit", + "strVal": "-" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "write" + }, + { + "kind": "nkIdent", + "ident": "stdout" + }, + { + "kind": "nkIdent", + "ident": "output" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "writeFile" + }, + { + "kind": "nkIdent", + "ident": "outfile" + }, + { + "kind": "nkIdent", + "ident": "output" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "main" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "outfile" + }, + { + "kind": "nkIdent", + "ident": "outdir" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "infiles" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSeq" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "outfiles" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSeq" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "debug" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "check" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "printTokens" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "val" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getopt" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "cmdArgument" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "infiles" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "addFileExt" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ".nim" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "cmdLongOption" + }, + { + "kind": "nkIdent", + "ident": "cmdShortOption" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "normalize" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "help" + }, + { + "kind": "nkStrLit", + "strVal": "h" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "writeHelp" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "version" + }, + { + "kind": "nkStrLit", + "strVal": "v" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "writeVersion" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "debug" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "debug" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "print-tokens" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "printTokens" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "check" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "check" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "output" + }, + { + "kind": "nkStrLit", + "strVal": "o" + }, + { + "kind": "nkStrLit", + "strVal": "out" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "outfile" + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "outDir" + }, + { + "kind": "nkStrLit", + "strVal": "outdir" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "outdir" + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "infiles" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "-" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "writeHelp" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "cmdEnd" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# cannot happen\", line: 145, col: 20, offsetA: 3711, offsetB: 3726)" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "infiles" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "quit" + }, + { + "kind": "nkStrLit", + "strVal": "[Error] no input file." + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "outfile" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "outdir" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "quit" + }, + { + "kind": "nkStrLit", + "strVal": "[Error] out and outDir cannot both be specified" + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "outfile" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "outdir" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "outfiles" + }, + { + "kind": "nkIdent", + "ident": "infiles" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "outfile" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "infiles" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Take the last file to maintain backwards compatibility\", line: 153, col: 4, offsetA: 4007, offsetB: 4063)" + ], + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "infile" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "infiles" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "infiles" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "infile" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "outfiles" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "outfile" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "outfile" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "outfiles" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "outfile" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "outdir" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "outfiles" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "infiles" + }, + { + "kind": "nkIdent", + "ident": "mapIt" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "joinPath" + }, + { + "kind": "nkIdent", + "ident": "outdir" + }, + { + "kind": "nkIdent", + "ident": "it" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkVarTuple", + "sons": [ + { + "kind": "nkIdent", + "ident": "infile" + }, + { + "kind": "nkIdent", + "ident": "outfile" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "zip" + }, + { + "kind": "nkIdent", + "ident": "infiles" + }, + { + "kind": "nkIdent", + "ident": "outfiles" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkVarTuple", + "sons": [ + { + "kind": "nkIdent", + "ident": "dir" + }, + { + "kind": "nkIdent", + "ident": "_" + }, + { + "kind": "nkIdent", + "ident": "_" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitFile" + }, + { + "kind": "nkIdent", + "ident": "outfile" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "createDir" + }, + { + "kind": "nkIdent", + "ident": "dir" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "prettyPrint" + }, + { + "kind": "nkIdent", + "ident": "infile" + }, + { + "kind": "nkIdent", + "ident": "outfile" + }, + { + "kind": "nkIdent", + "ident": "debug" + }, + { + "kind": "nkIdent", + "ident": "check" + }, + { + "kind": "nkIdent", + "ident": "printTokens" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "quit" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "quit" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "isMainModule" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "main" + } + ] + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/phast.nim b/src/phast.nim new file mode 100644 index 0000000..b35fa5b --- /dev/null +++ b/src/phast.nim @@ -0,0 +1,2657 @@ +# +# +# nimph +# (c) Copyright 2023 Jacek Sieka +# The Nim compiler +# (c) Copyright 2018 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# +# abstract syntax tree + symbol table +# nimph version: +# * enhanced concrete syntax information + +import hashes, options, ropes, idents, int128, tables + +from strutils import toLowerAscii + +import + "."/phlineinfos +when defined(nimPreviewSlimSystem): + import + std/assertions + +import phlexer + +export int128 + +type + TCallingConvention* = enum + ccNimCall = "nimcall" # nimcall, also the default + ccStdCall = "stdcall" # procedure is stdcall + ccCDecl = "cdecl" # cdecl + ccSafeCall = "safecall" # safecall + ccSysCall = "syscall" # system call + ccInline = "inline" # proc should be inlined + ccNoInline = "noinline" # proc should not be inlined + ccFastCall = "fastcall" # fastcall (pass parameters in registers) + ccThisCall = "thiscall" # thiscall (parameters are pushed right-to-left) + ccClosure = "closure" # proc has a closure + ccNoConvention = "noconv" # needed for generating proper C procs sometimes + +type + TNodeKind* = enum + # order is extremely important, because ranges are used + # to check whether a node belongs to a certain class + nkNone + # unknown node kind: indicates an error + # Expressions: + # Atoms: + nkEmpty # the node is empty + nkIdent # node is an identifier + nkSym # node is a symbol + nkType # node is used for its typ field + nkCharLit # a character literal '' + nkIntLit # an integer literal + nkInt8Lit + nkInt16Lit + nkInt32Lit + nkInt64Lit + nkUIntLit # an unsigned integer literal + nkUInt8Lit + nkUInt16Lit + nkUInt32Lit + nkUInt64Lit + nkFloatLit # a floating point literal + nkFloat32Lit + nkFloat64Lit + nkFloat128Lit + nkStrLit # a string literal "" + nkRStrLit # a raw string literal r"" + nkTripleStrLit # a triple string literal """ + nkNilLit + # the nil literal + # end of atoms + nkComesFrom + # "comes from" template/macro information for + # better stack trace generation + nkDotCall + # used to temporarily flag a nkCall node; + # this is used + # for transforming ``s.len`` to ``len(s)`` + nkCommand # a call like ``p 2, 4`` without parenthesis + nkCall # a call like p(x, y) or an operation like +(a, b) + nkCallStrLit + # a call with a string literal + # x"abc" has two sons: nkIdent, nkRStrLit + # x"""abc""" has two sons: nkIdent, nkTripleStrLit + nkInfix # a call like (a + b) + nkPrefix # a call like !a + nkPostfix # something like a! (also used for visibility) + nkHiddenCallConv # an implicit type conversion via a type converter + nkExprEqExpr # a named parameter with equals: ''expr = expr'' + nkExprColonExpr # a named parameter with colon: ''expr: expr'' + nkIdentDefs + # a definition like `a, b: typeDesc = expr` + # either typeDesc or expr may be nil; used in + # formal parameters, var statements, etc. + nkVarTuple # a ``var (a, b) = expr`` construct + nkPar # syntactic (); may be a tuple constructor + nkObjConstr # object constructor: T(a: 1, b: 2) + nkCurly # syntactic {} + nkCurlyExpr # an expression like a{i} + nkBracket # syntactic [] + nkBracketExpr # an expression like a[i..j, k] + nkPragmaExpr # an expression like a{.pragmas.} + nkRange # an expression like i..j + nkDotExpr # a.b + nkCheckedFieldExpr # a.b, but b is a field that needs to be checked + nkDerefExpr # a^ + nkIfExpr # if as an expression + nkElifExpr + nkElseExpr + nkLambda # lambda expression + nkDo # lambda block appering as trailing proc param + nkAccQuoted # `a` as a node + nkTableConstr # a table constructor {expr: expr} + nkBind # ``bind expr`` node + nkClosedSymChoice # symbol choice node; a list of nkSyms (closed) + nkOpenSymChoice # symbol choice node; a list of nkSyms (open) + nkHiddenStdConv # an implicit standard type conversion + nkHiddenSubConv + # an implicit type conversion from a subtype + # to a supertype + nkConv # a type conversion + nkCast # a type cast + nkStaticExpr # a static expr + nkAddr # a addr expression + nkHiddenAddr # implicit address operator + nkHiddenDeref # implicit ^ operator + nkObjDownConv # down conversion between object types + nkObjUpConv # up conversion between object types + nkChckRangeF # range check for floats + nkChckRange64 # range check for 64 bit ints + nkChckRange # range check for ints + nkStringToCString # string to cstring + nkCStringToString + # cstring to string + # end of expressions + nkAsgn # a = b + nkFastAsgn + # internal node for a fast ``a = b`` + # (no string copy) + nkGenericParams # generic parameters + nkFormalParams # formal parameters + nkOfInherit # inherited from symbol + nkImportAs # a 'as' b in an import statement + nkProcDef # a proc + nkMethodDef # a method + nkConverterDef # a converter + nkMacroDef # a macro + nkTemplateDef # a template + nkIteratorDef # an iterator + nkOfBranch + # used inside case statements + # for (cond, action)-pairs + nkElifBranch # used in if statements + nkExceptBranch # an except section + nkElse # an else part + nkAsmStmt # an assembler block + nkPragma # a pragma statement + nkPragmaBlock # a pragma with a block + nkIfStmt # an if statement + nkWhenStmt # a when expression or statement + nkForStmt # a for statement + nkParForStmt # a parallel for statement + nkWhileStmt # a while statement + nkCaseStmt # a case statement + nkTypeSection # a type section (consists of type definitions) + nkVarSection # a var section + nkLetSection # a let section + nkConstSection # a const section + nkConstDef # a const definition + nkTypeDef # a type definition + nkYieldStmt # the yield statement as a tree + nkDefer # the 'defer' statement + nkTryStmt # a try statement + nkFinally # a finally section + nkRaiseStmt # a raise statement + nkReturnStmt # a return statement + nkBreakStmt # a break statement + nkContinueStmt # a continue statement + nkBlockStmt # a block statement + nkStaticStmt # a static statement + nkDiscardStmt # a discard statement + nkStmtList # a list of statements + nkImportStmt # an import statement + nkImportExceptStmt # an import x except a statement + nkExportStmt # an export statement + nkExportExceptStmt # an 'export except' statement + nkFromStmt # a from * import statement + nkIncludeStmt # an include statement + nkBindStmt # a bind statement + nkMixinStmt # a mixin statement + nkUsingStmt # an using statement + nkCommentStmt # a comment statement + nkStmtListExpr + # a statement list followed by an expr; this is used + # to allow powerful multi-line templates + nkBlockExpr + # a statement block ending in an expr; this is used + # to allow powerful multi-line templates that open a + # temporary scope + nkStmtListType # a statement list ending in a type; for macros + nkBlockType + # a statement block ending in a type; for macros + # types as syntactic trees: + nkWith # distinct with `foo` + nkWithout # distinct without `foo` + nkTypeOfExpr # type(1+2) + nkObjectTy # object body + nkTupleTy # tuple body + nkTupleClassTy # tuple type class + nkTypeClassTy # user-defined type class + nkStaticTy # ``static[T]`` + nkRecList # list of object parts + nkRecCase # case section of object + nkRecWhen # when section of object + nkRefTy # ``ref T`` + nkPtrTy # ``ptr T`` + nkVarTy # ``var T`` + nkConstTy # ``const T`` + nkOutTy # ``out T`` + nkDistinctTy # distinct type + nkProcTy # proc type + nkIteratorTy # iterator type + nkSinkAsgn # '=sink(x, y)' + nkEnumTy # enum body + nkEnumFieldDef # `ident = expr` in an enumeration + nkArgList # argument list + nkPattern # a special pattern; used for matching + nkHiddenTryStmt # a hidden try statement + nkClosure # (prc, env)-pair (internally used for code gen) + nkGotoState # used for the state machine (for iterators) + nkState # give a label to a code section (for iterators) + nkBreakState # special break statement for easier code generation + nkFuncDef # a func + nkTupleConstr # a tuple constructor + nkError # erroneous AST node + nkModuleRef # for .rod file support: A (moduleId, itemId) pair + nkReplayAction # for .rod file support: A replay action + nkNilRodNode # for .rod file support: a 'nil' PNode + + TNodeKinds* = set[TNodeKind] + +type + TSymFlag* = enum # 51 flags! + sfUsed # read access of sym (for warnings) or simply used + sfExported # symbol is exported from module + sfFromGeneric + # symbol is instantiation of a generic; this is needed + # for symbol file generation; such symbols should always + # be written into the ROD file + sfGlobal # symbol is at global scope + sfForward # symbol is forward declared + sfWasForwarded + # symbol had a forward declaration + # (implies it's too dangerous to patch its type signature) + sfImportc # symbol is external; imported + sfExportc # symbol is exported (under a specified name) + sfMangleCpp # mangle as cpp (combines with `sfExportc`) + sfVolatile # variable is volatile + sfRegister # variable should be placed in a register + sfPure + # object is "pure" that means it has no type-information + # enum is "pure", its values need qualified access + # variable is "pure"; it's an explicit "global" + sfNoSideEffect # proc has no side effects + sfSideEffect # proc may have side effects; cannot prove it has none + sfMainModule # module is the main module + sfSystemModule # module is the system module + sfNoReturn # proc never returns (an exit proc) + sfAddrTaken + # the variable's address is taken (ex- or implicitly); + # *OR*: a proc is indirectly called (used as first class) + sfCompilerProc + # proc is a compiler proc, that is a C proc that is + # needed for the code generator + sfEscapes + # param escapes + # currently unimplemented + sfDiscriminant # field is a discriminant in a record/object + sfRequiresInit # field must be initialized during construction + sfDeprecated # symbol is deprecated + sfExplain # provide more diagnostics when this symbol is used + sfError # usage of symbol should trigger a compile-time error + sfShadowed # a symbol that was shadowed in some inner scope + sfThread + # proc will run as a thread + # variable is a thread variable + sfCppNonPod + # tells compiler to treat such types as non-pod's, so that + # `thread_local` is used instead of `__thread` for + # {.threadvar.} + `--threads`. Only makes sense for importcpp types. + # This has a performance impact so isn't set by default. + sfCompileTime # proc can be evaluated at compile time + sfConstructor # proc is a C++ constructor + sfDispatcher + # copied method symbol is the dispatcher + # deprecated and unused, except for the con + sfBorrow # proc is borrowed + sfInfixCall + # symbol needs infix call syntax in target language; + # for interfacing with C++, JS + sfNamedParamCall + # symbol needs named parameter call syntax in target + # language; for interfacing with Objective C + sfDiscardable # returned value may be discarded implicitly + sfOverridden # proc is overridden + sfCallsite + # A flag for template symbols to tell the + # compiler it should use line information from + # the calling side of the macro, not from the + # implementation. + sfGenSym # symbol is 'gensym'ed; do not add to symbol table + sfNonReloadable + # symbol will be left as-is when hot code reloading is on - + # meaning that it won't be renamed and/or changed in any way + sfGeneratedOp + # proc is a generated '='; do not inject destructors in it + # variable is generated closure environment; requires early + # destruction for --newruntime. + sfTemplateParam # symbol is a template parameter + sfCursor # variable/field is a cursor, see RFC 177 for details + sfInjectDestructors # whether the proc needs the 'injectdestructors' transformation + sfNeverRaises + # proc can never raise an exception, not even OverflowDefect + # or out-of-memory + sfSystemRaisesDefect # proc in the system can raise defects + sfUsedInFinallyOrExcept # symbol is used inside an 'except' or 'finally' + sfSingleUsedTemp # For temporaries that we know will only be used once + sfNoalias + # 'noalias' annotation, means C's 'restrict' + # for templates and macros, means cannot be called + # as a lone symbol (cannot use alias syntax) + sfEffectsDelayed # an 'effectsDelayed' parameter + sfGeneratedType + # A anonymous generic type that is generated by the compiler for + # objects that do not have generic parameters in case one of the + # object fields has one. + # + # This is disallowed but can cause the typechecking to go into + # an infinite loop, this flag is used as a sentinel to stop it. + sfVirtual # proc is a C++ virtual function + sfByCopy # param is marked as pass bycopy + sfCodegenDecl # type, proc, global or proc param is marked as codegenDecl + + TSymFlags* = set[TSymFlag] + +const + sfNoInit* = sfMainModule # don't generate code to init the variable + sfAllUntyped* = sfVolatile + # macro or template is immediately expanded \ + # in a generic context + sfDirty* = sfPure + # template is not hygienic (old styled template) + # module, compiled from a dirty-buffer + sfAnon* = sfDiscardable + # symbol name that was generated by the compiler + # the compiler will avoid printing such names + # in user messages. + sfNoForward* = sfRegister # forward declarations are not required (per module) + sfReorder* = sfForward # reordering pass is enabled + sfCompileToCpp* = sfInfixCall # compile the module as C++ code + sfCompileToObjc* = sfNamedParamCall # compile the module as Objective-C code + sfExperimental* = sfOverridden # module uses the .experimental switch + sfGoto* = sfOverridden # var is used for 'goto' code generation + sfWrittenTo* = sfBorrow + # param is assigned to + # currently unimplemented + sfBase* = sfDiscriminant + sfCustomPragma* = sfRegister # symbol is custom pragma template + sfTemplateRedefinition* = sfExportc # symbol is a redefinition of an earlier template +const + # getting ready for the future expr/stmt merge + nkWhen* = nkWhenStmt + nkWhenExpr* = nkWhenStmt + nkEffectList* = nkArgList + # hacks ahead: an nkEffectList is a node with 4 children: + exceptionEffects* = 0 # exceptions at position 0 + requiresEffects* = 1 # 'requires' annotation + ensuresEffects* = 2 # 'ensures' annotation + tagEffects* = 3 # user defined tag ('gc', 'time' etc.) + pragmasEffects* = 4 # not an effect, but a slot for pragmas in proc type + forbiddenEffects* = 5 # list of illegal effects + effectListLen* = 6 # list of effects list + nkLastBlockStmts* = {nkRaiseStmt, nkReturnStmt, nkBreakStmt, nkContinueStmt} # these must be last statements in a block + +type + TTypeKind* = enum + # order is important! + # Don't forget to change hti.nim if you make a change here + # XXX put this into an include file to avoid this issue! + # several types are no longer used (guess which), but a + # spot in the sequence is kept for backwards compatibility + # (apparently something with bootstrapping) + # if you need to add a type, they can apparently be reused + tyNone + tyBool + tyChar + tyEmpty + tyAlias + tyNil + tyUntyped + tyTyped + tyTypeDesc + tyGenericInvocation # ``T[a, b]`` for types to invoke + tyGenericBody # ``T[a, b, body]`` last parameter is the body + tyGenericInst + # ``T[a, b, realInstance]`` instantiated generic type + # realInstance will be a concrete type like tyObject + # unless this is an instance of a generic alias type. + # then realInstance will be the tyGenericInst of the + # completely (recursively) resolved alias. + tyGenericParam # ``a`` in the above patterns + tyDistinct + tyEnum + tyOrdinal # integer types (including enums and boolean) + tyArray + tyObject + tyTuple + tySet + tyRange + tyPtr + tyRef + tyVar + tySequence + tyProc + tyPointer + tyOpenArray + tyString + tyCstring + tyForward + tyInt + tyInt8 + tyInt16 + tyInt32 + tyInt64 # signed integers + tyFloat + tyFloat32 + tyFloat64 + tyFloat128 + tyUInt + tyUInt8 + tyUInt16 + tyUInt32 + tyUInt64 + tyOwned + tySink + tyLent + tyVarargs + tyUncheckedArray # An array with boundaries [0,+∞] + tyProxy # used as errornous type (for idetools) + tyBuiltInTypeClass # Type such as the catch-all object, tuple, seq, etc + tyUserTypeClass # the body of a user-defined type class + tyUserTypeClassInst + # Instance of a parametric user-defined type class. + # Structured similarly to tyGenericInst. + # tyGenericInst represents concrete types, while + # this is still a "generic param" that will bind types + # and resolves them during sigmatch and instantiation. + tyCompositeTypeClass + # Type such as seq[Number] + # The notes for tyUserTypeClassInst apply here as well + # sons[0]: the original expression used by the user. + # sons[1]: fully expanded and instantiated meta type + # (potentially following aliases) + tyInferred + # In the initial state `base` stores a type class constraining + # the types that can be inferred. After a candidate type is + # selected, it's stored in `lastSon`. Between `base` and `lastSon` + # there may be 0, 2 or more types that were also considered as + # possible candidates in the inference process (i.e. lastSon will + # be updated to store a type best conforming to all candidates) + tyAnd + tyOr + tyNot + # boolean type classes such as `string|int`,`not seq`, + # `Sortable and Enumable`, etc + tyAnything # a type class matching any type + tyStatic # a value known at compile type (the underlying type is .base) + tyFromExpr + # This is a type representing an expression that depends + # on generic parameters (the expression is stored in t.n) + # It will be converted to a real type only during generic + # instantiation and prior to this it has the potential to + # be any type. + tyConcept # new style concept. + tyVoid # now different from tyEmpty, hurray! + tyIterable + +static: + # remind us when TTypeKind stops to fit in a single 64-bit word + # assert TTypeKind.high.ord <= 63 + discard + +const + tyPureObject* = tyTuple + GcTypeKinds* = {tyRef, tySequence, tyString} + tyError* = tyProxy # as an errornous node should match everything + tyUnknown* = tyFromExpr + tyUnknownTypes* = {tyError, tyFromExpr} + tyTypeClasses* = + { + tyBuiltInTypeClass, tyCompositeTypeClass, tyUserTypeClass, tyUserTypeClassInst, + tyAnd, tyOr, tyNot, tyAnything + } + tyMetaTypes* = {tyGenericParam, tyTypeDesc, tyUntyped} + tyTypeClasses + tyUserTypeClasses* = {tyUserTypeClass, tyUserTypeClassInst} + # consider renaming as `tyAbstractVarRange` + abstractVarRange* = + { + tyGenericInst, tyRange, tyVar, tyDistinct, tyOrdinal, tyTypeDesc, tyAlias, + tyInferred, tySink, tyOwned + } + abstractInst* = + { + tyGenericInst, tyDistinct, tyOrdinal, tyTypeDesc, tyAlias, tyInferred, tySink, + tyOwned + } # xxx what about tyStatic? + +type + TTypeKinds* = set[TTypeKind] + TNodeFlag* = enum + nfNone + nfBase2 # nfBase10 is default, so not needed + nfBase8 + nfBase16 + nfAllConst + # used to mark complex expressions constant; easy to get rid of + # but unfortunately it has measurable impact for compilation + # efficiency + nfTransf # node has been transformed + nfNoRewrite # node should not be transformed anymore + nfSem # node has been checked for semantics + nfLL # node has gone through lambda lifting + nfDotField # the call can use a dot operator + nfDotSetter # the call can use a setter dot operarator + nfExplicitCall # x.y() was used instead of x.y + nfExprCall # this is an attempt to call a regular expression + nfIsRef # this node is a 'ref' node; used for the VM + nfIsPtr # this node is a 'ptr' node; used for the VM + nfPreventCg # this node should be ignored by the codegen + nfBlockArg # this a stmtlist appearing in a call (e.g. a do block) + nfFromTemplate # a top-level node returned from a template + nfDefaultParam # an automatically inserter default parameter + nfDefaultRefsParam + # a default param value references another parameter + # the flag is applied to proc default values and to calls + nfExecuteOnReload # A top-level statement that will be executed during reloads + nfLastRead # this node is a last read + nfFirstWrite # this node is a first write + nfHasComment # node has a comment + nfSkipFieldChecking # node skips field visable checking + + TNodeFlags* = set[TNodeFlag] + TTypeFlag* = enum # keep below 32 for efficiency reasons (now: 47) + tfVarargs + # procedure has C styled varargs + # tyArray type represeting a varargs list + tfNoSideEffect # procedure type does not allow side effects + tfFinal # is the object final? + tfInheritable # is the object inheritable? + tfHasOwned # type contains an 'owned' type and must be moved + tfEnumHasHoles # enum cannot be mapped into a range + tfShallow # type can be shallow copied on assignment + tfThread # proc type is marked as ``thread``; alias for ``gcsafe`` + tfFromGeneric + # type is an instantiation of a generic; this is needed + # because for instantiations of objects, structural + # type equality has to be used + tfUnresolved + # marks unresolved typedesc/static params: e.g. + # proc foo(T: typedesc, list: seq[T]): var T + # proc foo(L: static[int]): array[L, int] + # can be attached to ranges to indicate that the range + # can be attached to generic procs with free standing + # type parameters: e.g. proc foo[T]() + # depends on unresolved static params. + tfResolved + # marks a user type class, after it has been bound to a + # concrete type (lastSon becomes the concrete type) + tfRetType + # marks return types in proc (used to detect type classes + # used as return types for return type inference) + tfCapturesEnv # whether proc really captures some environment + tfByCopy # pass object/tuple by copy (C backend) + tfByRef # pass object/tuple by reference (C backend) + tfIterator # type is really an iterator, not a tyProc + tfPartial # type is declared as 'partial' + tfNotNil # type cannot be 'nil' + tfRequiresInit + # type constains a "not nil" constraint somewhere or + # a `requiresInit` field, so the default zero init + # is not appropriate + tfNeedsFullInit + # object type marked with {.requiresInit.} + # all fields must be initialized + tfVarIsPtr # 'var' type is translated like 'ptr' even in C++ mode + tfHasMeta + # type contains "wildcard" sub-types such as generic params + # or other type classes + tfHasGCedMem # type contains GC'ed memory + tfPacked + tfHasStatic + tfGenericTypeParam + tfImplicitTypeParam + tfInferrableStatic + tfConceptMatchedTypeSym + tfExplicit + # for typedescs, marks types explicitly prefixed with the + # `type` operator (e.g. type int) + tfWildcard + # consider a proc like foo[T, I](x: Type[T, I]) + # T and I here can bind to both typedesc and static types + # before this is determined, we'll consider them to be a + # wildcard type. + tfHasAsgn # type has overloaded assignment operator + tfBorrowDot # distinct type borrows '.' + tfTriggersCompileTime + # uses the NimNode type which make the proc + # implicitly '.compiletime' + tfRefsAnonObj # used for 'ref object' and 'ptr object' + tfCovariant # covariant generic param mimicking a ptr type + tfWeakCovariant # covariant generic param mimicking a seq/array type + tfContravariant # contravariant generic param + tfCheckedForDestructor + # type was checked for having a destructor. + # If it has one, t.destructor is not nil. + tfAcyclic # object type was annotated as .acyclic + tfIncompleteStruct # treat this type as if it had sizeof(pointer) + tfCompleteStruct + # (for importc types); type is fully specified, allowing to compute + # sizeof, alignof, offsetof at CT + tfExplicitCallConv + tfIsConstructor + tfEffectSystemWorkaround + tfIsOutParam + tfSendable + + TTypeFlags* = set[TTypeFlag] + TSymKind* = enum + # the different symbols (start with the prefix sk); + # order is important for the documentation generator! + skUnknown + # unknown symbol: used for parsing assembler blocks + # and first phase symbol lookup in generics + skConditional # symbol for the preprocessor (may become obsolete) + skDynLib + # symbol represents a dynamic library; this is used + # internally; it does not exist in Nim code + skParam # a parameter + skGenericParam # a generic parameter; eq in ``proc x[eq=`==`]()`` + skTemp # a temporary variable (introduced by compiler) + skModule # module identifier + skType # a type + skVar # a variable + skLet # a 'let' symbol + skConst # a constant + skResult # special 'result' variable + skProc # a proc + skFunc # a func + skMethod # a method + skIterator # an iterator + skConverter # a type converter + skMacro # a macro + skTemplate + # a template; currently also misused for user-defined + # pragmas + skField # a field in a record or object + skEnumField # an identifier in an enum + skForVar # a for loop variable + skLabel # a label (for block statement) + skStub + # symbol is a stub and not yet loaded from the ROD + # file (it is loaded on demand, which may + # mean: never) + skPackage # symbol is a package (used for canonicalization) + + TSymKinds* = set[TSymKind] + +const + routineKinds* = + {skProc, skFunc, skMethod, skIterator, skConverter, skMacro, skTemplate} + ExportableSymKinds* = + {skVar, skLet, skConst, skType, skEnumField, skStub} + routineKinds + tfUnion* = tfNoSideEffect + tfGcSafe* = tfThread + tfObjHasKids* = tfEnumHasHoles + tfReturnsNew* = tfInheritable + skError* = skUnknown + +var eqTypeFlags* = + {tfIterator, tfNotNil, tfVarIsPtr, tfGcSafe, tfNoSideEffect, tfIsOutParam, tfSendable} + ## type flags that are essential for type equality. + ## This is now a variable because for emulation of version:1.0 we + ## might exclude {tfGcSafe, tfNoSideEffect}. + +type + TMagic* = enum # symbols that require compiler magic: + mNone + mDefined + mDeclared + mDeclaredInScope + mCompiles + mArrGet + mArrPut + mAsgn + mLow + mHigh + mSizeOf + mAlignOf + mOffsetOf + mTypeTrait + mIs + mOf + mAddr + mType + mTypeOf + mPlugin + mEcho + mShallowCopy + mSlurp + mStaticExec + mStatic + mParseExprToAst + mParseStmtToAst + mExpandToAst + mQuoteAst + mInc + mDec + mOrd + mNew + mNewFinalize + mNewSeq + mNewSeqOfCap + mLengthOpenArray + mLengthStr + mLengthArray + mLengthSeq + mIncl + mExcl + mCard + mChr + mGCref + mGCunref + mAddI + mSubI + mMulI + mDivI + mModI + mSucc + mPred + mAddF64 + mSubF64 + mMulF64 + mDivF64 + mShrI + mShlI + mAshrI + mBitandI + mBitorI + mBitxorI + mMinI + mMaxI + mAddU + mSubU + mMulU + mDivU + mModU + mEqI + mLeI + mLtI + mEqF64 + mLeF64 + mLtF64 + mLeU + mLtU + mEqEnum + mLeEnum + mLtEnum + mEqCh + mLeCh + mLtCh + mEqB + mLeB + mLtB + mEqRef + mLePtr + mLtPtr + mXor + mEqCString + mEqProc + mUnaryMinusI + mUnaryMinusI64 + mAbsI + mNot + mUnaryPlusI + mBitnotI + mUnaryPlusF64 + mUnaryMinusF64 + mCharToStr + mBoolToStr + mIntToStr + mInt64ToStr + mFloatToStr # for compiling nimStdlibVersion < 1.5.1 (not bootstrapping) + mCStrToStr + mStrToStr + mEnumToStr + mAnd + mOr + mImplies + mIff + mExists + mForall + mOld + mEqStr + mLeStr + mLtStr + mEqSet + mLeSet + mLtSet + mMulSet + mPlusSet + mMinusSet + mConStrStr + mSlice + mDotDot # this one is only necessary to give nice compile time warnings + mFields + mFieldPairs + mOmpParFor + mAppendStrCh + mAppendStrStr + mAppendSeqElem + mInSet + mRepr + mExit + mSetLengthStr + mSetLengthSeq + mIsPartOf + mAstToStr + mParallel + mSwap + mIsNil + mArrToSeq + mOpenArrayToSeq + mNewString + mNewStringOfCap + mParseBiggestFloat + mMove + mEnsureMove + mWasMoved + mDup + mDestroy + mTrace + mDefault + mUnown + mFinished + mIsolate + mAccessEnv + mAccessTypeField + mReset + mArray + mOpenArray + mRange + mSet + mSeq + mVarargs + mRef + mPtr + mVar + mDistinct + mVoid + mTuple + mOrdinal + mIterableType + mInt + mInt8 + mInt16 + mInt32 + mInt64 + mUInt + mUInt8 + mUInt16 + mUInt32 + mUInt64 + mFloat + mFloat32 + mFloat64 + mFloat128 + mBool + mChar + mString + mCstring + mPointer + mNil + mExpr + mStmt + mTypeDesc + mVoidType + mPNimrodNode + mSpawn + mDeepCopy + mIsMainModule + mCompileDate + mCompileTime + mProcCall + mCpuEndian + mHostOS + mHostCPU + mBuildOS + mBuildCPU + mAppType + mCompileOption + mCompileOptionArg + mNLen + mNChild + mNSetChild + mNAdd + mNAddMultiple + mNDel + mNKind + mNSymKind + mNccValue + mNccInc + mNcsAdd + mNcsIncl + mNcsLen + mNcsAt + mNctPut + mNctLen + mNctGet + mNctHasNext + mNctNext + mNIntVal + mNFloatVal + mNSymbol + mNIdent + mNGetType + mNStrVal + mNSetIntVal + mNSetFloatVal + mNSetSymbol + mNSetIdent + mNSetStrVal + mNLineInfo + mNNewNimNode + mNCopyNimNode + mNCopyNimTree + mStrToIdent + mNSigHash + mNSizeOf + mNBindSym + mNCallSite + mEqIdent + mEqNimrodNode + mSameNodeType + mGetImpl + mNGenSym + mNHint + mNWarning + mNError + mInstantiationInfo + mGetTypeInfo + mGetTypeInfoV2 + mNimvm + mIntDefine + mStrDefine + mBoolDefine + mGenericDefine + mRunnableExamples + mException + mBuiltinType + mSymOwner + mUncheckedArray + mGetImplTransf + mSymIsInstantiationOf + mNodeId + mPrivateAccess + mZeroDefault + +const + # things that we can evaluate safely at compile time, even if not asked for it: + ctfeWhitelist* = + { + mNone, mSucc, mPred, mInc, mDec, mOrd, mLengthOpenArray, mLengthStr, mLengthArray, + mLengthSeq, mArrGet, mArrPut, mAsgn, mDestroy, mIncl, mExcl, mCard, mChr, mAddI, + mSubI, mMulI, mDivI, mModI, mAddF64, mSubF64, mMulF64, mDivF64, mShrI, mShlI, + mBitandI, mBitorI, mBitxorI, mMinI, mMaxI, mAddU, mSubU, mMulU, mDivU, mModU, + mEqI, mLeI, mLtI, mEqF64, mLeF64, mLtF64, mLeU, mLtU, mEqEnum, mLeEnum, mLtEnum, + mEqCh, mLeCh, mLtCh, mEqB, mLeB, mLtB, mEqRef, mEqProc, mLePtr, mLtPtr, + mEqCString, mXor, mUnaryMinusI, mUnaryMinusI64, mAbsI, mNot, mUnaryPlusI, + mBitnotI, mUnaryPlusF64, mUnaryMinusF64, mCharToStr, mBoolToStr, mIntToStr, + mInt64ToStr, mFloatToStr, mCStrToStr, mStrToStr, mEnumToStr, mAnd, mOr, mEqStr, + mLeStr, mLtStr, mEqSet, mLeSet, mLtSet, mMulSet, mPlusSet, mMinusSet, mConStrStr, + mAppendStrCh, mAppendStrStr, mAppendSeqElem, mInSet, mRepr, mOpenArrayToSeq + } + generatedMagics* = {mNone, mIsolate, mFinished, mOpenArrayToSeq} ## magics that are generated as normal procs in the backend + +type + ItemId* = object + module*: int32 + item*: int32 + +proc `$`*(x: ItemId): string = + "(module: " & $x.module & ", item: " & $x.item & ")" + +proc `==`*(a, b: ItemId): bool {.inline.} = + a.item == b.item and a.module == b.module + +proc hash*(x: ItemId): Hash = + var h: Hash = hash(x.module) + + h = h !& hash(x.item) + result = !$h + +type + TIdObj* {.acyclic.} = object of RootObj + itemId*: ItemId + + PIdObj* = ref TIdObj + PNode* = ref TNode + TNodeSeq* = seq[PNode] + PType* = ref TType + PSym* = ref TSym + TNode* {.final, acyclic.} = object # on a 32bit machine, this takes 32 bytes + when defined(useNodeIds): + id*: int + typ*: PType + info*: TLineInfo + flags*: TNodeFlags + case kind*: TNodeKind + of nkCharLit .. nkUInt64Lit: + intVal*: BiggestInt + of nkFloatLit .. nkFloat128Lit: + floatVal*: BiggestFloat + of nkStrLit .. nkTripleStrLit: + strVal*: string + of nkSym: + sym*: PSym + of nkIdent: + ident*: PIdent + else: + sons*: TNodeSeq + when defined(nimsuggest): + endInfo*: TLineInfo + prefix*: seq[Token] # comments leading up to this node + mid*: seq[Token] # comments in the middle of the node + postfix*: seq[Token] # comments after the node + + TStrTable* = object # a table[PIdent] of PSym + counter*: int + data*: seq[PSym] + + TLocKind* = enum + locNone # no location + locTemp # temporary location + locLocalVar # location is a local variable + locGlobalVar # location is a global variable + locParam # location is a parameter + locField # location is a record field + locExpr # "location" is really an expression + locProc # location is a proc (an address of a procedure) + locData # location is a constant + locCall # location is a call expression + locOther # location is something other + + TLocFlag* = enum + lfIndirect # backend introduced a pointer + lfNoDeepCopy # no need for a deep copy + lfNoDecl # do not declare it in C + lfDynamicLib # link symbol to dynamic library + lfExportLib # export symbol for dynamic library generation + lfHeader # include header file for symbol + lfImportCompilerProc # ``importc`` of a compilerproc + lfSingleUse # no location yet and will only be used once + lfEnforceDeref + # a copyMem is required to dereference if this a + # ptr array due to C array limitations. + # See #1181, #6422, #11171 + lfPrepareForMutation # string location is about to be mutated (V2) + + TStorageLoc* = enum + OnUnknown # location is unknown (stack, heap or static) + OnStatic # in a static section + OnStack # location is on hardware stack + OnHeap + # location is on heap or global + # (reference counting needed) + + TLocFlags* = set[TLocFlag] + TLoc* = object + k*: TLocKind # kind of location + storage*: TStorageLoc + flags*: TLocFlags # location's flags + lode*: PNode # Node where the location came from; can be faked + r*: Rope # rope value of location (code generators) + + TLibKind* = enum + libHeader + libDynamic + + TLib* = object + # also misused for headers! + # keep in sync with PackedLib + kind*: TLibKind + generated*: bool # needed for the backends: + isOverridden*: bool + name*: Rope + path*: PNode # can be a string literal! + + CompilesId* = int + ## id that is used for the caching logic within + ## ``system.compiles``. See the seminst module. + TInstantiation* = object + sym*: PSym + concreteTypes*: seq[PType] + compilesId*: CompilesId + + PInstantiation* = ref TInstantiation + TScope* {.acyclic.} = object + depthLevel*: int + symbols*: TStrTable + parent*: PScope + allowPrivateAccess*: seq[PSym] # # enable access to private fields + + PScope* = ref TScope + PLib* = ref TLib + TSym* {.acyclic.} = object of TIdObj + # Keep in sync with PackedSym + # proc and type instantiations are cached in the generic symbol + case kind*: TSymKind + of routineKinds: + #procInstCache*: seq[PInstantiation] + #procInstCache*: seq[PInstantiation] + gcUnsafetyReason*: PSym # for better error messages regarding gcsafe + transformedBody*: PNode # cached body after transf pass + of skLet, skVar, skField, skForVar: + guard*: PSym + bitsize*: int + alignment*: int # for alignment + else: + nil + magic*: TMagic + typ*: PType + name*: PIdent + info*: TLineInfo + when defined(nimsuggest): + endInfo*: TLineInfo + owner*: PSym + flags*: TSymFlags + ast*: PNode + # syntax tree of proc, iterator, etc.: + # the whole proc including header; this is used + # for easy generation of proper error messages + # for variant record fields the discriminant + # expression + # for modules, it's a placeholder for compiler + # generated code that will be appended to the + # module after the sem pass (see appendToModule) + options*: TOptions + position*: int + # used for many different things: + # for enum fields its position; + # for fields its offset + # for parameters its position (starting with 0) + # for a conditional: + # 1 iff the symbol is defined, else 0 + # (or not in symbol table) + # for modules, an unique index corresponding + # to the module's fileIdx + # for variables a slot index for the evaluator + offset*: int32 # offset of record field + disamb*: int32 + # disambiguation number; the basic idea is that + # `___` + loc*: TLoc + annex*: PLib + # additional fields (seldom used, so we use a + # reference to another object to save space) + when hasFFI: + cname*: string + # resolved C declaration name in importc decl, e.g.: + # proc fun() {.importc: "$1aux".} => cname = funaux + constraint*: PNode + # additional constraints like 'lit|result'; also + # misused for the codegenDecl and virtual pragmas in the hope + # it won't cause problems + # for skModule the string literal to output for + # deprecated modules. + when defined(nimsuggest): + allUsages*: seq[TLineInfo] + + TTypeSeq* = seq[PType] + TTypeAttachedOp* = enum ## as usual, order is important here + attachedWasMoved + attachedDestructor + attachedAsgn + attachedDup + attachedSink + attachedTrace + attachedDeepCopy + + TType* {.acyclic.} = object of TIdObj + # \ + # types are identical iff they have the + # same id; there may be multiple copies of a type + # in memory! + # Keep in sync with PackedType + kind*: TTypeKind # kind of type + callConv*: TCallingConvention # for procs + flags*: TTypeFlags # flags of the type + sons*: TTypeSeq # base types, etc. + n*: PNode + # node for types: + # for range types a nkRange node + # for record types a nkRecord node + # for enum types a list of symbols + # if kind == tyInt: it is an 'int literal(x)' type + # for procs and tyGenericBody, it's the + # formal param list + # for concepts, the concept body + # else: unused + owner*: PSym # the 'owner' of the type + sym*: PSym + # types have the sym associated with them + # it is used for converting types to strings + size*: BiggestInt + # the size of the type in bytes + # -1 means that the size is unkwown + align*: int16 # the type's alignment requirements + paddingAtEnd*: int16 # + loc*: TLoc + typeInst*: PType + # for generic instantiations the tyGenericInst that led to this + # type. + uniqueId*: ItemId + # due to a design mistake, we need to keep the real ID here as it + # is required by the --incremental:on mode. + + TPair* = object + key*, val*: RootRef + + TPairSeq* = seq[TPair] + TIdPair* = object + key*: PIdObj + val*: RootRef + + TIdPairSeq* = seq[TIdPair] + TIdTable* = object # the same as table[PIdent] of PObject + counter*: int + data*: TIdPairSeq + + TIdNodePair* = object + key*: PIdObj + val*: PNode + + TIdNodePairSeq* = seq[TIdNodePair] + TIdNodeTable* = object # the same as table[PIdObj] of PNode + counter*: int + data*: TIdNodePairSeq + + TNodePair* = object + h*: Hash # because it is expensive to compute! + key*: PNode + val*: int + + TNodePairSeq* = seq[TNodePair] + TNodeTable* = object + # the same as table[PNode] of int; + # nodes are compared by structure! + counter*: int + data*: TNodePairSeq + + TObjectSeq* = seq[RootRef] + TObjectSet* = object + counter*: int + data*: TObjectSeq + + TImplication* = enum + impUnknown + impNo + impYes + +template nodeId(n: PNode): int = + cast[int](n) + +type + Gconfig = object + # we put comments in a side channel to avoid increasing `sizeof(TNode)`, which + # reduces memory usage given that `PNode` is the most allocated type by far. + comments: Table[int, string] # nodeId => comment + useIc*: bool + +var gconfig {.threadvar.}: Gconfig + +proc setUseIc*(useIc: bool) = + gconfig.useIc = useIc + +proc comment*(n: PNode): string = + if nfHasComment in n.flags and not gconfig.useIc: + # IC doesn't track comments, see `packed_ast`, so this could fail + result = gconfig.comments[n.nodeId] + +proc `comment=`*(n: PNode; a: string) = + let id = n.nodeId + if a.len > 0: + # if needed, we could periodically cleanup gconfig.comments when its size increases, + # to ensure only live nodes (and with nfHasComment) have an entry in gconfig.comments; + # for compiling compiler, the waste is very small: + # num calls to newNodeImpl: 14984160 (num of PNode allocations) + # size of gconfig.comments: 33585 + # num of nodes with comments that were deleted and hence wasted: 3081 + n.flags.incl nfHasComment + + gconfig.comments[id] = a + elif nfHasComment in n.flags: + n.flags.excl nfHasComment + + gconfig.comments.del(id) + +# BUGFIX: a module is overloadable so that a proc can have the +# same name as an imported module. This is necessary because of +# the poor naming choices in the standard library. +const + OverloadableSyms* = + { + skProc, skFunc, skMethod, skIterator, skConverter, skModule, skTemplate, skMacro, + skEnumField + } + GenericTypes*: TTypeKinds = {tyGenericInvocation, tyGenericBody, tyGenericParam} + StructuralEquivTypes*: TTypeKinds = + { + tyNil, tyTuple, tyArray, tySet, tyRange, tyPtr, tyRef, tyVar, tyLent, tySequence, + tyProc, tyOpenArray, tyVarargs + } + ConcreteTypes*: TTypeKinds = + { + tyBool, + tyChar, + tyEnum, + tyArray, + tyObject, + tySet, + tyTuple, + tyRange, + tyPtr, + tyRef, + tyVar, + tyLent, + tySequence, + tyProc, + tyPointer, + tyOpenArray, + tyString, + tyCstring, + tyInt .. tyInt64, + tyFloat .. tyFloat128, + tyUInt .. tyUInt64 + } + # types of the expr that may occur in:: + # var x = expr + IntegralTypes* = + { + tyBool, + tyChar, + tyEnum, + tyInt .. tyInt64, + tyFloat .. tyFloat128, + tyUInt .. tyUInt64 + } # weird name because it contains tyFloat + ConstantDataTypes*: TTypeKinds = {tyArray, tySet, tyTuple, tySequence} + NilableTypes*: TTypeKinds = {tyPointer, tyCstring, tyRef, tyPtr, tyProc, tyError} # TODO + PtrLikeKinds*: TTypeKinds = {tyPointer, tyPtr} # for VM + PersistentNodeFlags*: TNodeFlags = + { + nfBase2, nfBase8, nfBase16, nfDotSetter, nfDotField, nfIsRef, nfIsPtr, + nfPreventCg, nfLL, nfFromTemplate, nfDefaultRefsParam, nfExecuteOnReload, + nfLastRead, nfFirstWrite, nfSkipFieldChecking + } + namePos* = 0 + patternPos* = 1 # empty except for term rewriting macros + genericParamsPos* = 2 + paramsPos* = 3 + pragmasPos* = 4 + miscPos* = 5 # used for undocumented and hacky stuff + bodyPos* = 6 # position of body; use rodread.getBody() instead! + resultPos* = 7 + dispatcherPos* = 8 + nfAllFieldsSet* = nfBase2 + nkCallKinds* = + {nkCall, nkInfix, nkPrefix, nkPostfix, nkCommand, nkCallStrLit, nkHiddenCallConv} + nkIdentKinds* = {nkIdent, nkSym, nkAccQuoted, nkOpenSymChoice, nkClosedSymChoice} + nkPragmaCallKinds* = {nkExprColonExpr, nkCall, nkCallStrLit} + nkLiterals* = {nkCharLit .. nkTripleStrLit} + nkFloatLiterals* = {nkFloatLit .. nkFloat128Lit} + nkLambdaKinds* = {nkLambda, nkDo} + declarativeDefs* = {nkProcDef, nkFuncDef, nkMethodDef, nkIteratorDef, nkConverterDef} + routineDefs* = declarativeDefs + {nkMacroDef, nkTemplateDef} + procDefs* = nkLambdaKinds + declarativeDefs + callableDefs* = nkLambdaKinds + routineDefs + nkSymChoices* = {nkClosedSymChoice, nkOpenSymChoice} + nkStrKinds* = {nkStrLit .. nkTripleStrLit} + skLocalVars* = {skVar, skLet, skForVar, skParam, skResult} + skProcKinds* = + {skProc, skFunc, skTemplate, skMacro, skIterator, skMethod, skConverter} + defaultSize = -1 + defaultAlignment = -1 + defaultOffset* = -1 + +proc getPIdent*(a: PNode): PIdent {.inline.} = + ## Returns underlying `PIdent` for `{nkSym, nkIdent}`, or `nil`. + case a.kind + of nkSym: + a.sym.name + of nkIdent: + a.ident + of nkOpenSymChoice, nkClosedSymChoice: + a.sons[0].sym.name + else: + nil + +const + moduleShift = + when defined(cpu32): + 20 + else: + 24 + +template id*(a: PIdObj): int = + let x = a + + (x.itemId.module.int shl moduleShift) + x.itemId.item.int + +type + IdGenerator* = ref object # unfortunately, we really need the 'shared mutable' aspect here. + module*: int32 + symId*: int32 + typeId*: int32 + sealed*: bool + disambTable*: CountTable[PIdent] + +const + PackageModuleId* = -3'i32 + +proc idGeneratorFromModule*(m: PSym): IdGenerator = + assert m.kind == skModule + + result = + IdGenerator( + module: m.itemId.module, + symId: m.itemId.item, + typeId: 0, + disambTable: initCountTable[PIdent]() + ) + +proc idGeneratorForPackage*(nextIdWillBe: int32): IdGenerator = + result = + IdGenerator( + module: PackageModuleId, + symId: nextIdWillBe - 1'i32, + typeId: 0, + disambTable: initCountTable[PIdent]() + ) + +proc nextSymId*(x: IdGenerator): ItemId {.inline.} = + assert(not x.sealed) + + inc x.symId + + result = ItemId(module: x.module, item: x.symId) + +proc nextTypeId*(x: IdGenerator): ItemId {.inline.} = + assert(not x.sealed) + + inc x.typeId + + result = ItemId(module: x.module, item: x.typeId) + +when false: + proc nextId*(x: IdGenerator): ItemId {.inline.} = + inc x.item + + result = x[] + +when false: + proc storeBack*(dest: var IdGenerator; src: IdGenerator) {.inline.} = + assert dest.ItemId.module == src.ItemId.module + if dest.ItemId.item > src.ItemId.item: + echo dest.ItemId.item, " ", src.ItemId.item, " ", src.ItemId.module + + assert dest.ItemId.item <= src.ItemId.item + + dest = src + +var ggDebug* {.deprecated.}: bool ## convenience switch for trying out things + +proc isCallExpr*(n: PNode): bool = + result = n.kind in nkCallKinds + +proc discardSons*(father: PNode) + +type + Indexable = PNode | PType + +proc len*(n: Indexable): int {.inline.} = + result = n.sons.len + +proc safeLen*(n: PNode): int {.inline.} = + ## works even for leaves. + if n.kind in {nkNone .. nkNilLit}: + result = 0 + else: + result = n.len + +proc safeArrLen*(n: PNode): int {.inline.} = + ## works for array-like objects (strings passed as openArray in VM). + if n.kind in {nkStrLit .. nkTripleStrLit}: + result = n.strVal.len + elif n.kind in {nkNone .. nkFloat128Lit}: + result = 0 + else: + result = n.len + +proc add*(father, son: Indexable) = + assert son != nil + + father.sons.add(son) + +proc addAllowNil*(father, son: Indexable) {.inline.} = + father.sons.add(son) + +template `[]`*(n: Indexable; i: int): Indexable = + n.sons[i] + +template `[]=`*(n: Indexable; i: int; x: Indexable) = + n.sons[i] = x + +template `[]`*(n: Indexable; i: BackwardsIndex): Indexable = + n[n.len - i.int] + +template `[]=`*(n: Indexable; i: BackwardsIndex; x: Indexable) = + n[n.len - i.int] = x + +proc getDeclPragma*(n: PNode): PNode = + ## return the `nkPragma` node for declaration `n`, or `nil` if no pragma was found. + ## Currently only supports routineDefs + {nkTypeDef}. + case n.kind + of routineDefs: + if n[pragmasPos].kind != nkEmpty: + result = n[pragmasPos] + of nkTypeDef: + #[ + type F3*{.deprecated: "x3".} = int + + TypeSection + TypeDef + PragmaExpr + Postfix + Ident "*" + Ident "F3" + Pragma + ExprColonExpr + Ident "deprecated" + StrLit "x3" + Empty + Ident "int" + ]# + if n[0].kind == nkPragmaExpr: + result = n[0][1] + else: + # support as needed for `nkIdentDefs` etc. + result = nil + if result != nil: + assert result.kind == nkPragma, $(result.kind, n.kind) + +proc extractPragma*(s: PSym): PNode = + ## gets the pragma node of routine/type/var/let/const symbol `s` + if s.kind in routineKinds: + result = s.ast[pragmasPos] + elif s.kind in {skType, skVar, skLet, skConst}: + if s.ast != nil and s.ast.len > 0: + if s.ast[0].kind == nkPragmaExpr and s.ast[0].len > 1: + # s.ast = nkTypedef / nkPragmaExpr / [nkSym, nkPragma] + result = s.ast[0][1] + + assert result == nil or result.kind == nkPragma + +proc skipPragmaExpr*(n: PNode): PNode = + ## if pragma expr, give the node the pragmas are applied to, + ## otherwise give node itself + if n.kind == nkPragmaExpr: + result = n[0] + else: + result = n + +proc setInfoRecursive*(n: PNode; info: TLineInfo) = + ## set line info recursively + if n != nil: + for i in 0 ..< n.safeLen: + setInfoRecursive(n[i], info) + + n.info = info + +when defined(useNodeIds): + const + nodeIdToDebug* = -1 # 2322968 + + var gNodeId: int + +template newNodeImpl(info2) = + result = PNode(kind: kind, info: info2) + when false: + # this would add overhead, so we skip it; it results in a small amount of leaked entries + # for old PNode that gets re-allocated at the same address as a PNode that + # has `nfHasComment` set (and an entry in that table). Only `nfHasComment` + # should be used to test whether a PNode has a comment; gconfig.comments + # can contain extra entries for deleted PNode's with comments. + gconfig.comments.del(cast[int](result)) + +template setIdMaybe() = + when defined(useNodeIds): + result.id = gNodeId + if result.id == nodeIdToDebug: + echo "KIND ", result.kind + + writeStackTrace() + + inc gNodeId + +proc newNode*(kind: TNodeKind): PNode = + ## new node with unknown line info, no type, and no children + newNodeImpl(unknownLineInfo) + setIdMaybe() + +proc newNodeI*(kind: TNodeKind; info: TLineInfo): PNode = + ## new node with line info, no type, and no children + newNodeImpl(info) + setIdMaybe() + +proc newNodeI*(kind: TNodeKind; info: TLineInfo; children: int): PNode = + ## new node with line info, type, and children + newNodeImpl(info) + if children > 0: + newSeq(result.sons, children) + + setIdMaybe() + +proc newNodeIT*(kind: TNodeKind; info: TLineInfo; typ: PType): PNode = + ## new node with line info, type, and no children + result = newNode(kind) + result.info = info + result.typ = typ + +proc newTree*(kind: TNodeKind; children: varargs[PNode]): PNode = + result = newNode(kind) + if children.len > 0: + result.info = children[0].info + + result.sons = @children + +proc newTreeI*(kind: TNodeKind; info: TLineInfo; children: varargs[PNode]): PNode = + result = newNodeI(kind, info) + if children.len > 0: + result.info = children[0].info + + result.sons = @children + +proc newTreeIT*( + kind: TNodeKind; info: TLineInfo; typ: PType; children: varargs[PNode] +): PNode = + result = newNodeIT(kind, info, typ) + if children.len > 0: + result.info = children[0].info + + result.sons = @children + +template previouslyInferred*(t: PType): PType = + if t.sons.len > 1: + t.lastSon + else: + nil + +when false: + import tables, strutils + + var x: CountTable[string] + + addQuitProc proc () {.noconv.} = + for k, v in pairs(x): + echo k + echo v + +proc newSym*( + symKind: TSymKind; + name: PIdent; + idgen: IdGenerator; + owner: PSym; + info: TLineInfo; + options: TOptions = {} +): PSym = + # generates a symbol and initializes the hash field too + assert not name.isNil + + let id = nextSymId idgen + + result = + PSym( + name: name, + kind: symKind, + flags: {}, + info: info, + itemId: id, + options: options, + owner: owner, + offset: defaultOffset, + disamb: getOrDefault(idgen.disambTable, name).int32 + ) + + idgen.disambTable.inc name + when false: + if id.module == 48 and id.item == 39: + writeStackTrace() + + echo "kind ", symKind, " ", name.s + if owner != nil: + echo owner.name.s + +proc astdef*(s: PSym): PNode = + # get only the definition (initializer) portion of the ast + if s.ast != nil and s.ast.kind in {nkIdentDefs, nkConstDef}: + s.ast[2] + else: + s.ast + +proc isMetaType*(t: PType): bool = + return t.kind in tyMetaTypes or (t.kind == tyStatic and t.n == nil) or tfHasMeta in t.flags + +proc isUnresolvedStatic*(t: PType): bool = + return t.kind == tyStatic and t.n == nil + +proc linkTo*(t: PType; s: PSym): PType {.discardable.} = + t.sym = s + s.typ = t + result = t + +proc linkTo*(s: PSym; t: PType): PSym {.discardable.} = + t.sym = s + s.typ = t + result = s + +template fileIdx*(c: PSym): FileIndex = + # XXX: this should be used only on module symbols + c.position.FileIndex + +template filename*(c: PSym): string = + # XXX: this should be used only on module symbols + c.position.FileIndex.toFilename + +proc appendToModule*(m: PSym; n: PNode) = + ## The compiler will use this internally to add nodes that will be + ## appended to the module after the sem pass + if m.ast == nil: + m.ast = newNode(nkStmtList) + m.ast.sons = @[n] + else: + assert m.ast.kind == nkStmtList + + m.ast.sons.add(n) + +const + # for all kind of hash tables: + GrowthFactor* = 2 # must be power of 2, > 0 + StartSize* = 8 # must be power of 2, > 0 + +proc copyStrTable*(dest: var TStrTable; src: TStrTable) = + dest.counter = src.counter + + setLen(dest.data, src.data.len) + for i in 0 .. high(src.data): + dest.data[i] = src.data[i] + +proc copyIdTable*(dest: var TIdTable; src: TIdTable) = + dest.counter = src.counter + + newSeq(dest.data, src.data.len) + for i in 0 .. high(src.data): + dest.data[i] = src.data[i] + +proc copyObjectSet*(dest: var TObjectSet; src: TObjectSet) = + dest.counter = src.counter + + setLen(dest.data, src.data.len) + for i in 0 .. high(src.data): + dest.data[i] = src.data[i] + +proc discardSons*(father: PNode) = + father.sons = @[] + +proc withInfo*(n: PNode; info: TLineInfo): PNode = + n.info = info + + return n + +proc newIdentNode*(ident: PIdent; info: TLineInfo): PNode = + result = newNode(nkIdent) + result.ident = ident + result.info = info + +proc newSymNode*(sym: PSym): PNode = + result = newNode(nkSym) + result.sym = sym + result.typ = sym.typ + result.info = sym.info + +proc newSymNode*(sym: PSym; info: TLineInfo): PNode = + result = newNode(nkSym) + result.sym = sym + result.typ = sym.typ + result.info = info + +proc newIntNode*(kind: TNodeKind; intVal: BiggestInt): PNode = + result = newNode(kind) + result.intVal = intVal + +proc newIntNode*(kind: TNodeKind; intVal: Int128): PNode = + result = newNode(kind) + result.intVal = castToInt64(intVal) + +proc lastSon*(n: Indexable): Indexable = + n.sons[^1] + +proc skipTypes*(t: PType; kinds: TTypeKinds): PType = + ## Used throughout the compiler code to test whether a type tree contains or + ## doesn't contain a specific type/types - it is often the case that only the + ## last child nodes of a type tree need to be searched. This is a really hot + ## path within the compiler! + result = t + while result.kind in kinds: + result = lastSon(result) + +proc newIntTypeNode*(intVal: BiggestInt; typ: PType): PNode = + let kind = skipTypes(typ, abstractVarRange).kind + case kind + of tyInt: + result = newNode(nkIntLit) + of tyInt8: + result = newNode(nkInt8Lit) + of tyInt16: + result = newNode(nkInt16Lit) + of tyInt32: + result = newNode(nkInt32Lit) + of tyInt64: + result = newNode(nkInt64Lit) + of tyChar: + result = newNode(nkCharLit) + of tyUInt: + result = newNode(nkUIntLit) + of tyUInt8: + result = newNode(nkUInt8Lit) + of tyUInt16: + result = newNode(nkUInt16Lit) + of tyUInt32: + result = newNode(nkUInt32Lit) + of tyUInt64: + result = newNode(nkUInt64Lit) + of tyBool, tyEnum: + # XXX: does this really need to be the kind nkIntLit? + result = newNode(nkIntLit) + of tyStatic: # that's a pre-existing bug, will fix in another PR + result = newNode(nkIntLit) + else: + doAssert false, $kind + + result.intVal = intVal + result.typ = typ + +proc newIntTypeNode*(intVal: Int128; typ: PType): PNode = + # XXX: introduce range check + newIntTypeNode(castToInt64(intVal), typ) + +proc newFloatNode*(kind: TNodeKind; floatVal: BiggestFloat): PNode = + result = newNode(kind) + result.floatVal = floatVal + +proc newStrNode*(kind: TNodeKind; strVal: string): PNode = + result = newNode(kind) + result.strVal = strVal + +proc newStrNode*(strVal: string; info: TLineInfo): PNode = + result = newNodeI(nkStrLit, info) + result.strVal = strVal + +proc newProcNode*( + kind: TNodeKind; + info: TLineInfo; + body: PNode; + params, name, pattern, genericParams, pragmas, exceptions: PNode +): PNode = + result = newNodeI(kind, info) + result.sons = @[name, pattern, genericParams, params, pragmas, exceptions, body] + +const + AttachedOpToStr*: array[TTypeAttachedOp, string] = + ["=wasMoved", "=destroy", "=copy", "=dup", "=sink", "=trace", "=deepcopy"] + +proc `$`*(s: PSym): string = + if s != nil: + result = s.name.s & "@" & $s.id + else: + result = "" + +proc newType*(kind: TTypeKind; id: ItemId; owner: PSym): PType = + result = + PType( + kind: kind, + owner: owner, + size: defaultSize, + align: defaultAlignment, + itemId: id, + uniqueId: id + ) + when false: + if result.itemId.module == 55 and result.itemId.item == 2: + echo "KNID ", kind + + writeStackTrace() + +proc mergeLoc(a: var TLoc; b: TLoc) = + if a.k == low(typeof(a.k)): + a.k = b.k + if a.storage == low(typeof(a.storage)): + a.storage = b.storage + + a.flags.incl b.flags + if a.lode == nil: + a.lode = b.lode + if a.r == "": + a.r = b.r + +proc newSons*(father: Indexable; length: int) = + setLen(father.sons, length) + +proc assignType*(dest, src: PType) = + dest.kind = src.kind + dest.flags = src.flags + dest.callConv = src.callConv + dest.n = src.n + dest.size = src.size + dest.align = src.align + # this fixes 'type TLock = TSysLock': + if src.sym != nil: + if dest.sym != nil: + dest.sym.flags.incl src.sym.flags - {sfUsed, sfExported} + if dest.sym.annex == nil: + dest.sym.annex = src.sym.annex + + mergeLoc(dest.sym.loc, src.sym.loc) + else: + dest.sym = src.sym + + newSons(dest, src.len) + for i in 0 ..< src.len: + dest[i] = src[i] + +proc copyType*(t: PType; id: ItemId; owner: PSym): PType = + result = newType(t.kind, id, owner) + + assignType(result, t) + + result.sym = t.sym # backend-info should not be copied + +proc exactReplica*(t: PType): PType = + result = copyType(t, t.itemId, t.owner) + +proc copySym*(s: PSym; idgen: IdGenerator): PSym = + result = newSym(s.kind, s.name, idgen, s.owner, s.info, s.options) + #result.ast = nil # BUGFIX; was: s.ast which made problems + result.typ = s.typ + result.flags = s.flags + result.magic = s.magic + result.options = s.options + result.position = s.position + result.loc = s.loc + result.annex = s.annex # BUGFIX + result.constraint = s.constraint + if result.kind in {skVar, skLet, skField}: + result.guard = s.guard + result.bitsize = s.bitsize + result.alignment = s.alignment + +proc createModuleAlias*( + s: PSym; idgen: IdGenerator; newIdent: PIdent; info: TLineInfo; options: TOptions +): PSym = + result = newSym(s.kind, newIdent, idgen, s.owner, info, options) + # keep ID! + result.ast = s.ast + #result.id = s.id # XXX figure out what to do with the ID. + result.flags = s.flags + result.options = s.options + result.position = s.position + result.loc = s.loc + result.annex = s.annex + +proc initStrTable*(x: var TStrTable) = + x.counter = 0 + + newSeq(x.data, StartSize) + +proc newStrTable*(): TStrTable = + initStrTable(result) + +proc initIdTable*(x: var TIdTable) = + x.counter = 0 + + newSeq(x.data, StartSize) + +proc newIdTable*(): TIdTable = + initIdTable(result) + +proc resetIdTable*(x: var TIdTable) = + x.counter = 0 + + # clear and set to old initial size: + setLen(x.data, 0) + setLen(x.data, StartSize) + +proc initObjectSet*(x: var TObjectSet) = + x.counter = 0 + + newSeq(x.data, StartSize) + +proc initIdNodeTable*(x: var TIdNodeTable) = + x.counter = 0 + + newSeq(x.data, StartSize) + +proc initNodeTable*(x: var TNodeTable) = + x.counter = 0 + + newSeq(x.data, StartSize) + +proc skipTypes*(t: PType; kinds: TTypeKinds; maxIters: int): PType = + result = t + + var i = maxIters + while result.kind in kinds: + result = lastSon(result) + + dec i + if i == 0: + return nil + +proc skipTypesOrNil*(t: PType; kinds: TTypeKinds): PType = + ## same as skipTypes but handles 'nil' + result = t + while result != nil and result.kind in kinds: + if result.len == 0: + return nil + + result = lastSon(result) + +proc isGCedMem*(t: PType): bool {.inline.} = + result = + t.kind in {tyString, tyRef, tySequence} or t.kind == tyProc and t.callConv == ccClosure + +proc propagateToOwner*(owner, elem: PType; propagateHasAsgn = true) = + owner.flags.incl elem.flags * {tfHasMeta, tfTriggersCompileTime} + if tfNotNil in elem.flags: + if owner.kind in {tyGenericInst, tyGenericBody, tyGenericInvocation}: + owner.flags.incl tfNotNil + if elem.isMetaType: + owner.flags.incl tfHasMeta + + let mask = elem.flags * {tfHasAsgn, tfHasOwned} + if mask != {} and propagateHasAsgn: + let o2 = owner.skipTypes({tyGenericInst, tyAlias, tySink}) + if o2.kind in {tyTuple, tyObject, tyArray, tySequence, tySet, tyDistinct}: + o2.flags.incl mask + owner.flags.incl mask + if owner.kind notin {tyProc, tyGenericInst, tyGenericBody, tyGenericInvocation, tyPtr}: + let elemB = elem.skipTypes({tyGenericInst, tyAlias, tySink}) + if elemB.isGCedMem or tfHasGCedMem in elemB.flags: + # for simplicity, we propagate this flag even to generics. We then + # ensure this doesn't bite us in sempass2. + owner.flags.incl tfHasGCedMem + +proc rawAddSon*(father, son: PType; propagateHasAsgn = true) = + father.sons.add(son) + if not son.isNil: + propagateToOwner(father, son, propagateHasAsgn) + +proc rawAddSonNoPropagationOfTypeFlags*(father, son: PType) = + father.sons.add(son) + +proc addSonNilAllowed*(father, son: PNode) = + father.sons.add(son) + +proc delSon*(father: PNode; idx: int) = + if father.len == 0: + return + for i in idx ..< father.len - 1: + father[i] = father[i + 1] + + father.sons.setLen(father.len - 1) + +proc copyNode*(src: PNode): PNode = + # does not copy its sons! + if src == nil: + return nil + + result = newNode(src.kind) + result.info = src.info + result.typ = src.typ + result.flags = src.flags * PersistentNodeFlags + result.comment = src.comment + when defined(useNodeIds): + if result.id == nodeIdToDebug: + echo "COMES FROM ", src.id + case src.kind + of nkCharLit .. nkUInt64Lit: + result.intVal = src.intVal + of nkFloatLiterals: + result.floatVal = src.floatVal + of nkSym: + result.sym = src.sym + of nkIdent: + result.ident = src.ident + of nkStrLit .. nkTripleStrLit: + result.strVal = src.strVal + else: + discard + when defined(nimsuggest): + result.endInfo = src.endInfo + +template transitionNodeKindCommon(k: TNodeKind) = + let obj {.inject.} = n[] + + n[] = + TNode( + kind: k, + typ: obj.typ, + info: obj.info, + flags: obj.flags, + prefix: obj.prefix, + mid: obj.mid, + postfix: obj.postfix + ) + # n.comment = obj.comment # shouldn't be needed, the address doesnt' change + when defined(useNodeIds): + n.id = obj.id + +proc transitionSonsKind*(n: PNode; kind: range[nkComesFrom .. nkTupleConstr]) = + transitionNodeKindCommon(kind) + + n.sons = obj.sons + +proc transitionIntKind*(n: PNode; kind: range[nkCharLit .. nkUInt64Lit]) = + transitionNodeKindCommon(kind) + + n.intVal = obj.intVal + +proc transitionIntToFloatKind*(n: PNode; kind: range[nkFloatLit .. nkFloat128Lit]) = + transitionNodeKindCommon(kind) + + n.floatVal = BiggestFloat(obj.intVal) + +proc transitionNoneToSym*(n: PNode) = + transitionNodeKindCommon(nkSym) + +template transitionSymKindCommon*(k: TSymKind) = + let obj {.inject.} = s[] + + s[] = + TSym( + kind: k, + itemId: obj.itemId, + magic: obj.magic, + typ: obj.typ, + name: obj.name, + info: obj.info, + owner: obj.owner, + flags: obj.flags, + ast: obj.ast, + options: obj.options, + position: obj.position, + offset: obj.offset, + loc: obj.loc, + annex: obj.annex, + constraint: obj.constraint + ) + when hasFFI: + s.cname = obj.cname + when defined(nimsuggest): + s.allUsages = obj.allUsages + +proc transitionGenericParamToType*(s: PSym) = + transitionSymKindCommon(skType) + +proc transitionRoutineSymKind*(s: PSym; kind: range[skProc .. skTemplate]) = + transitionSymKindCommon(kind) + + s.gcUnsafetyReason = obj.gcUnsafetyReason + s.transformedBody = obj.transformedBody + +proc transitionToLet*(s: PSym) = + transitionSymKindCommon(skLet) + + s.guard = obj.guard + s.bitsize = obj.bitsize + s.alignment = obj.alignment + +template copyNodeImpl(dst, src, processSonsStmt) = + if src == nil: + return + + dst = newNode(src.kind) + dst.info = src.info + when defined(nimsuggest): + result.endInfo = src.endInfo + + dst.typ = src.typ + dst.flags = src.flags * PersistentNodeFlags + dst.comment = src.comment + when defined(useNodeIds): + if dst.id == nodeIdToDebug: + echo "COMES FROM ", src.id + case src.kind + of nkCharLit .. nkUInt64Lit: + dst.intVal = src.intVal + of nkFloatLiterals: + dst.floatVal = src.floatVal + of nkSym: + dst.sym = src.sym + of nkIdent: + dst.ident = src.ident + of nkStrLit .. nkTripleStrLit: + dst.strVal = src.strVal + else: + processSonsStmt + +proc shallowCopy*(src: PNode): PNode = + # does not copy its sons, but provides space for them: + copyNodeImpl(result, src): + newSeq(result.sons, src.len) + +proc copyTree*(src: PNode): PNode = + # copy a whole syntax tree; performs deep copying + copyNodeImpl(result, src): + newSeq(result.sons, src.len) + for i in 0 ..< src.len: + result[i] = copyTree(src[i]) + +proc copyTreeWithoutNode*(src, skippedNode: PNode): PNode = + copyNodeImpl(result, src): + result.sons = newSeqOfCap[PNode](src.len) + for n in src.sons: + if n != skippedNode: + result.sons.add copyTreeWithoutNode(n, skippedNode) + +proc hasSonWith*(n: PNode; kind: TNodeKind): bool = + for i in 0 ..< n.len: + if n[i].kind == kind: + return true + + result = false + +proc hasNilSon*(n: PNode): bool = + for i in 0 ..< n.safeLen: + if n[i] == nil: + return true + elif hasNilSon(n[i]): + return true + + result = false + +proc containsNode*(n: PNode; kinds: TNodeKinds): bool = + if n == nil: + return + case n.kind + of nkEmpty .. nkNilLit: + result = n.kind in kinds + else: + for i in 0 ..< n.len: + if n.kind in kinds or containsNode(n[i], kinds): + return true + +proc hasSubnodeWith*(n: PNode; kind: TNodeKind): bool = + case n.kind + of nkEmpty .. nkNilLit, nkFormalParams: + result = n.kind == kind + else: + for i in 0 ..< n.len: + if (n[i].kind == kind) or hasSubnodeWith(n[i], kind): + return true + + result = false + +proc getInt*(a: PNode): Int128 = + case a.kind + of nkCharLit, nkUIntLit .. nkUInt64Lit: + result = toInt128(cast[uint64](a.intVal)) + of nkInt8Lit .. nkInt64Lit: + result = toInt128(a.intVal) + of nkIntLit: + # XXX: enable this assert + # assert a.typ.kind notin {tyChar, tyUint..tyUInt64} + result = toInt128(a.intVal) + else: + raiseRecoverableError("cannot extract number from invalid AST node") + +proc getInt64*(a: PNode): int64 {.deprecated: "use getInt".} = + case a.kind + of nkCharLit, nkUIntLit .. nkUInt64Lit, nkIntLit .. nkInt64Lit: + result = a.intVal + else: + raiseRecoverableError("cannot extract number from invalid AST node") + +proc getFloat*(a: PNode): BiggestFloat = + case a.kind + of nkFloatLiterals: + result = a.floatVal + of nkCharLit, nkUIntLit .. nkUInt64Lit, nkIntLit .. nkInt64Lit: + result = BiggestFloat a.intVal + else: + raiseRecoverableError("cannot extract number from invalid AST node") + #doAssert false, "getFloat" + #internalError(a.info, "getFloat") + #result = 0.0 + +proc getStr*(a: PNode): string = + case a.kind + of nkStrLit .. nkTripleStrLit: + result = a.strVal + of nkNilLit: + # let's hope this fixes more problems than it creates: + result = "" + else: + raiseRecoverableError("cannot extract string from invalid AST node") + #doAssert false, "getStr" + #internalError(a.info, "getStr") + #result = "" + +proc getStrOrChar*(a: PNode): string = + case a.kind + of nkStrLit .. nkTripleStrLit: + result = a.strVal + of nkCharLit .. nkUInt64Lit: + result = $chr(int(a.intVal)) + else: + raiseRecoverableError("cannot extract string from invalid AST node") + #doAssert false, "getStrOrChar" + #internalError(a.info, "getStrOrChar") + #result = "" + +proc isGenericParams*(n: PNode): bool {.inline.} = + ## used to judge whether a node is generic params. + n != nil and n.kind == nkGenericParams + +proc isGenericRoutine*(n: PNode): bool {.inline.} = + n != nil and n.kind in callableDefs and n[genericParamsPos].isGenericParams + +proc isGenericRoutineStrict*(s: PSym): bool {.inline.} = + ## determines if this symbol represents a generic routine + ## the unusual name is so it doesn't collide and eventually replaces + ## `isGenericRoutine` + s.kind in skProcKinds and s.ast.isGenericRoutine + +proc isGenericRoutine*(s: PSym): bool {.inline.} = + ## determines if this symbol represents a generic routine or an instance of + ## one. This should be renamed accordingly and `isGenericRoutineStrict` + ## should take this name instead. + ## + ## Warning/XXX: Unfortunately, it considers a proc kind symbol flagged with + ## sfFromGeneric as a generic routine. Instead this should likely not be the + ## case and the concepts should be teased apart: + ## - generic definition + ## - generic instance + ## - either generic definition or instance + s.kind in skProcKinds and (sfFromGeneric in s.flags or s.ast.isGenericRoutine) + +proc skipGenericOwner*(s: PSym): PSym = + ## Generic instantiations are owned by their originating generic + ## symbol. This proc skips such owners and goes straight to the owner + ## of the generic itself (the module or the enclosing proc). + result = + if s.kind in skProcKinds and sfFromGeneric in s.flags: + s.owner.owner + else: + s.owner + +proc originatingModule*(s: PSym): PSym = + result = s.owner + while result.kind != skModule: + result = result.owner + +proc isRoutine*(s: PSym): bool {.inline.} = + result = s.kind in skProcKinds + +proc isCompileTimeProc*(s: PSym): bool {.inline.} = + result = s.kind == skMacro or s.kind in {skProc, skFunc} and sfCompileTime in s.flags + +proc hasPattern*(s: PSym): bool {.inline.} = + result = isRoutine(s) and s.ast[patternPos].kind != nkEmpty + +iterator items*(n: PNode): PNode = + for i in 0 ..< n.safeLen: + yield n[i] + +iterator pairs*(n: PNode): tuple[i: int, n: PNode] = + for i in 0 ..< n.safeLen: + yield (i, n[i]) + +proc isAtom*(n: PNode): bool {.inline.} = + result = n.kind >= nkNone and n.kind <= nkNilLit + +proc isEmptyType*(t: PType): bool {.inline.} = + ## 'void' and 'typed' types are often equivalent to 'nil' these days: + result = t == nil or t.kind in {tyVoid, tyTyped} + +proc makeStmtList*(n: PNode): PNode = + if n.kind == nkStmtList: + result = n + else: + result = newNodeI(nkStmtList, n.info) + + result.add n + +proc skipStmtList*(n: PNode): PNode = + if n.kind in {nkStmtList, nkStmtListExpr}: + for i in 0 ..< n.len - 1: + if n[i].kind notin {nkEmpty, nkCommentStmt}: + return n + + result = n.lastSon + else: + result = n + +proc toVar*(typ: PType; kind: TTypeKind; idgen: IdGenerator): PType = + ## If ``typ`` is not a tyVar then it is converted into a `var ` and + ## returned. Otherwise ``typ`` is simply returned as-is. + result = typ + if typ.kind != kind: + result = newType(kind, nextTypeId(idgen), typ.owner) + + rawAddSon(result, typ) + +proc toRef*(typ: PType; idgen: IdGenerator): PType = + ## If ``typ`` is a tyObject then it is converted into a `ref ` and + ## returned. Otherwise ``typ`` is simply returned as-is. + result = typ + if typ.skipTypes({tyAlias, tyGenericInst}).kind == tyObject: + result = newType(tyRef, nextTypeId(idgen), typ.owner) + + rawAddSon(result, typ) + +proc toObject*(typ: PType): PType = + ## If ``typ`` is a tyRef then its immediate son is returned (which in many + ## cases should be a ``tyObject``). + ## Otherwise ``typ`` is simply returned as-is. + let t = typ.skipTypes({tyAlias, tyGenericInst}) + if t.kind == tyRef: + t.lastSon + else: + typ + +proc toObjectFromRefPtrGeneric*(typ: PType): PType = + #[ + See also `toObject`. + Finds the underlying `object`, even in cases like these: + type + B[T] = object f0: int + A1[T] = ref B[T] + A2[T] = ref object f1: int + A3 = ref object f2: int + A4 = object f3: int + ]# + result = typ + while true: + case result.kind + of tyGenericBody: + result = result.lastSon + of tyRef, tyPtr, tyGenericInst, tyGenericInvocation, tyAlias: + result = result[0] + # automatic dereferencing is deep, refs #18298. + else: + break + +proc isImportedException*(t: PType; conf: ConfigRef): bool = + assert t != nil + if conf.exc != excCpp: + return false + + let base = t.skipTypes({tyAlias, tyPtr, tyDistinct, tyGenericInst}) + if base.sym != nil and {sfCompileToCpp, sfImportc} * base.sym.flags != {}: + result = true + +proc isInfixAs*(n: PNode): bool = + return n.kind == nkInfix and n[0].kind == nkIdent and n[0].ident.s == "as" + +proc skipColon*(n: PNode): PNode = + result = n + if n.kind == nkExprColonExpr: + result = n[1] + +proc findUnresolvedStatic*(n: PNode): PNode = + # n.typ == nil: see issue #14802 + if n.kind == nkSym and n.typ != nil and n.typ.kind == tyStatic and n.typ.n == nil: + return n + for son in n: + let n = son.findUnresolvedStatic + if n != nil: + return n + + return nil + +when false: + proc containsNil*(n: PNode): bool = + # only for debugging + if n.isNil: + return true + for i in 0 ..< n.safeLen: + if n[i].containsNil: + return true + +template hasDestructor*(t: PType): bool = + {tfHasAsgn, tfHasOwned} * t.flags != {} + +template incompleteType*(t: PType): bool = + t.sym != nil and {sfForward, sfNoForward} * t.sym.flags == {sfForward} + +template typeCompleted*(s: PSym) = + incl s.flags, sfNoForward + +template detailedInfo*(sym: PSym): string = + sym.name.s + +proc isInlineIterator*(typ: PType): bool {.inline.} = + typ.kind == tyProc and tfIterator in typ.flags and typ.callConv != ccClosure + +proc isIterator*(typ: PType): bool {.inline.} = + typ.kind == tyProc and tfIterator in typ.flags + +proc isClosureIterator*(typ: PType): bool {.inline.} = + typ.kind == tyProc and tfIterator in typ.flags and typ.callConv == ccClosure + +proc isClosure*(typ: PType): bool {.inline.} = + typ.kind == tyProc and typ.callConv == ccClosure + +proc isSinkParam*(s: PSym): bool {.inline.} = + s.kind == skParam and (s.typ.kind == tySink or tfHasOwned in s.typ.flags) + +proc isSinkType*(t: PType): bool {.inline.} = + t.kind == tySink or tfHasOwned in t.flags + +proc newProcType*(info: TLineInfo; id: ItemId; owner: PSym): PType = + result = newType(tyProc, id, owner) + result.n = newNodeI(nkFormalParams, info) + + rawAddSon(result, nil) # return type + + # result.n[0] used to be `nkType`, but now it's `nkEffectList` because + # the effects are now stored in there too ... this is a bit hacky, but as + # usual we desperately try to save memory: + result.n.add newNodeI(nkEffectList, info) + +proc addParam*(procType: PType; param: PSym) = + param.position = procType.len - 1 + + procType.n.add newSymNode(param) + + rawAddSon(procType, param.typ) + +const + magicsThatCanRaise = + {mNone, mSlurp, mStaticExec, mParseExprToAst, mParseStmtToAst, mEcho} + +proc canRaiseConservative*(fn: PNode): bool = + if fn.kind == nkSym and fn.sym.magic notin magicsThatCanRaise: + result = false + else: + result = true + +proc canRaise*(fn: PNode): bool = + if fn.kind == nkSym and ( + fn.sym.magic notin magicsThatCanRaise or {sfImportc, sfInfixCall} * fn.sym.flags == { + sfImportc + } or sfGeneratedOp in fn.sym.flags + ): + result = false + elif fn.kind == nkSym and fn.sym.magic == mEcho: + result = true + else: + # TODO check for n having sons? or just return false for now if not + if fn.typ != nil and fn.typ.n != nil and fn.typ.n[0].kind == nkSym: + result = false + else: + result = + fn.typ != nil and fn.typ.n != nil and ( + (fn.typ.n[0].len < effectListLen) or ( + fn.typ.n[0][exceptionEffects] != nil and fn.typ.n[0][exceptionEffects].safeLen > 0 + ) + ) + +proc toHumanStrImpl[T](kind: T; num: static int): string = + result = $kind + result = result[num ..^ 1] + result[0] = result[0].toLowerAscii + +proc toHumanStr*(kind: TSymKind): string = + ## strips leading `sk` + result = toHumanStrImpl(kind, 2) + +proc toHumanStr*(kind: TTypeKind): string = + ## strips leading `tk` + result = toHumanStrImpl(kind, 2) + +proc skipAddr*(n: PNode): PNode {.inline.} = + if n.kind == nkHiddenAddr: + n[0] + else: n + +proc isNewStyleConcept*(n: PNode): bool {.inline.} = + assert n.kind == nkTypeClassTy + + result = n[0].kind == nkEmpty + +proc isOutParam*(t: PType): bool {.inline.} = + tfIsOutParam in t.flags + +const + nodesToIgnoreSet* = + { + nkNone .. pred(nkSym), + succ(nkSym) .. nkNilLit, + nkTypeSection, + nkProcDef, + nkConverterDef, + nkMethodDef, + nkIteratorDef, + nkMacroDef, + nkTemplateDef, + nkLambda, + nkDo, + nkFuncDef, + nkConstSection, + nkConstDef, + nkIncludeStmt, + nkImportStmt, + nkExportStmt, + nkPragma, + nkCommentStmt, + nkBreakState, + nkTypeOfExpr, + nkMixinStmt, + nkBindStmt + } diff --git a/src/phast.nim.nimph.yaml b/src/phast.nim.nimph.yaml new file mode 100644 index 0000000..0147db2 --- /dev/null +++ b/src/phast.nim.nimph.yaml @@ -0,0 +1,45530 @@ +{ + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# nimph" + }, + { + "kind": "nkCommentStmt", + "comment": "# (c) Copyright 2023 Jacek Sieka" + }, + { + "kind": "nkCommentStmt", + "comment": "# The Nim compiler" + }, + { + "kind": "nkCommentStmt", + "comment": "# (c) Copyright 2018 Andreas Rumpf" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# See the file \"copying.txt\", included in this" + }, + { + "kind": "nkCommentStmt", + "comment": "# distribution, for details about the copyright." + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# abstract syntax tree + symbol table" + }, + { + "kind": "nkCommentStmt", + "comment": "# nimph version:" + }, + { + "kind": "nkCommentStmt", + "comment": "# * enhanced concrete syntax information" + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "hashes" + }, + { + "kind": "nkIdent", + "ident": "options" + }, + { + "kind": "nkIdent", + "ident": "ropes" + }, + { + "kind": "nkIdent", + "ident": "idents" + }, + { + "kind": "nkIdent", + "ident": "int128" + }, + { + "kind": "nkIdent", + "ident": "tables" + } + ] + }, + { + "kind": "nkFromStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "strutils" + }, + { + "kind": "nkIdent", + "ident": "toLowerAscii" + } + ] + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkStrLit", + "strVal": "." + }, + { + "kind": "nkIdent", + "ident": "phlineinfos" + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "nimPreviewSlimSystem" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkIdent", + "ident": "std" + }, + { + "kind": "nkIdent", + "ident": "assertions" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "phlexer" + } + ] + }, + { + "kind": "nkExportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "int128" + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TCallingConvention" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "ccNimCall" + }, + { + "kind": "nkStrLit", + "strVal": "nimcall" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# nimcall, also the default\", line: 31, col: 26, offsetA: 607, offsetB: 634)" + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "ccStdCall" + }, + { + "kind": "nkStrLit", + "strVal": "stdcall" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# procedure is stdcall\", line: 32, col: 26, offsetA: 661, offsetB: 683)" + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "ccCDecl" + }, + { + "kind": "nkStrLit", + "strVal": "cdecl" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# cdecl\", line: 33, col: 22, offsetA: 706, offsetB: 713)" + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "ccSafeCall" + }, + { + "kind": "nkStrLit", + "strVal": "safecall" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# safecall\", line: 34, col: 28, offsetA: 742, offsetB: 752)" + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "ccSysCall" + }, + { + "kind": "nkStrLit", + "strVal": "syscall" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# system call\", line: 35, col: 26, offsetA: 779, offsetB: 792)" + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "ccInline" + }, + { + "kind": "nkStrLit", + "strVal": "inline" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc should be inlined\", line: 36, col: 24, offsetA: 817, offsetB: 841)" + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "ccNoInline" + }, + { + "kind": "nkStrLit", + "strVal": "noinline" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc should not be inlined\", line: 37, col: 28, offsetA: 870, offsetB: 898)" + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "ccFastCall" + }, + { + "kind": "nkStrLit", + "strVal": "fastcall" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# fastcall (pass parameters in registers)\", line: 38, col: 28, offsetA: 927, offsetB: 968)" + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "ccThisCall" + }, + { + "kind": "nkStrLit", + "strVal": "thiscall" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# thiscall (parameters are pushed right-to-left)\", line: 39, col: 28, offsetA: 997, offsetB: 1045)" + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "ccClosure" + }, + { + "kind": "nkStrLit", + "strVal": "closure" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc has a closure\", line: 40, col: 26, offsetA: 1072, offsetB: 1092)" + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "ccNoConvention" + }, + { + "kind": "nkStrLit", + "strVal": "noconv" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# needed for generating proper C procs sometimes\", line: 41, col: 30, offsetA: 1123, offsetB: 1171)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# order is extremely important, because ranges are used\", line: 45, col: 4, offsetA: 1202, offsetB: 1257)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# to check whether a node belongs to a certain class\", line: 46, col: 4, offsetA: 1262, offsetB: 1314)" + ], + "ident": "nkNone", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# unknown node kind: indicates an error\", line: 48, col: 6, offsetA: 1332, offsetB: 1371)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Expressions:\", line: 49, col: 6, offsetA: 1378, offsetB: 1392)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Atoms:\", line: 50, col: 6, offsetA: 1399, offsetB: 1407)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the node is empty\", line: 51, col: 12, offsetA: 1420, offsetB: 1439)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkIdent", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# node is an identifier\", line: 52, col: 12, offsetA: 1452, offsetB: 1475)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkSym", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# node is a symbol\", line: 53, col: 10, offsetA: 1486, offsetB: 1504)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkType", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# node is used for its typ field\", line: 54, col: 11, offsetA: 1516, offsetB: 1548)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkCharLit", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a character literal \\\'\\\'\", line: 55, col: 14, offsetA: 1563, offsetB: 1587)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkIntLit", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an integer literal\", line: 56, col: 13, offsetA: 1601, offsetB: 1621)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkInt8Lit" + }, + { + "kind": "nkIdent", + "ident": "nkInt16Lit" + }, + { + "kind": "nkIdent", + "ident": "nkInt32Lit" + }, + { + "kind": "nkIdent", + "ident": "nkInt64Lit" + }, + { + "kind": "nkIdent", + "ident": "nkUIntLit", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an unsigned integer literal\", line: 61, col: 14, offsetA: 1695, offsetB: 1724)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkUInt8Lit" + }, + { + "kind": "nkIdent", + "ident": "nkUInt16Lit" + }, + { + "kind": "nkIdent", + "ident": "nkUInt32Lit" + }, + { + "kind": "nkIdent", + "ident": "nkUInt64Lit" + }, + { + "kind": "nkIdent", + "ident": "nkFloatLit", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a floating point literal\", line: 66, col: 15, offsetA: 1803, offsetB: 1829)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkFloat32Lit" + }, + { + "kind": "nkIdent", + "ident": "nkFloat64Lit" + }, + { + "kind": "nkIdent", + "ident": "nkFloat128Lit" + }, + { + "kind": "nkIdent", + "ident": "nkStrLit", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a string literal \\\"\\\"\", line: 70, col: 13, offsetA: 1895, offsetB: 1916)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkRStrLit", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a raw string literal r\\\"\\\"\", line: 71, col: 14, offsetA: 1931, offsetB: 1957)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkTripleStrLit", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a triple string literal \\\"\\\"\\\"\", line: 72, col: 19, offsetA: 1977, offsetB: 2006)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkNilLit", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the nil literal\", line: 74, col: 6, offsetA: 2026, offsetB: 2043)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# end of atoms\", line: 75, col: 6, offsetA: 2050, offsetB: 2064)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkComesFrom", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \\\"comes from\\\" template/macro information for\", line: 77, col: 6, offsetA: 2087, offsetB: 2132)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# better stack trace generation\", line: 78, col: 6, offsetA: 2139, offsetB: 2170)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkDotCall", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# used to temporarily flag a nkCall node;\", line: 80, col: 6, offsetA: 2191, offsetB: 2232)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# this is used\", line: 81, col: 6, offsetA: 2239, offsetB: 2253)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for transforming ``s.len`` to ``len(s)``\", line: 82, col: 6, offsetA: 2260, offsetB: 2302)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkCommand", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a call like ``p 2, 4`` without parenthesis\", line: 83, col: 14, offsetA: 2317, offsetB: 2361)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkCall", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a call like p(x, y) or an operation like +(a, b)\", line: 84, col: 11, offsetA: 2373, offsetB: 2423)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkCallStrLit", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a call with a string literal\", line: 86, col: 6, offsetA: 2447, offsetB: 2477)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# x\\\"abc\\\" has two sons: nkIdent, nkRStrLit\", line: 87, col: 6, offsetA: 2484, offsetB: 2525)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# x\\\"\\\"\\\"abc\\\"\\\"\\\" has two sons: nkIdent, nkTripleStrLit\", line: 88, col: 6, offsetA: 2532, offsetB: 2582)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkInfix", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a call like (a + b)\", line: 89, col: 12, offsetA: 2595, offsetB: 2616)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkPrefix", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a call like !a\", line: 90, col: 13, offsetA: 2630, offsetB: 2646)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkPostfix", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# something like a! (also used for visibility)\", line: 91, col: 14, offsetA: 2661, offsetB: 2707)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkHiddenCallConv", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an implicit type conversion via a type converter\", line: 92, col: 21, offsetA: 2729, offsetB: 2779)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkExprEqExpr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a named parameter with equals: \\\'\\\'expr = expr\\\'\\\'\", line: 93, col: 17, offsetA: 2797, offsetB: 2845)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkExprColonExpr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a named parameter with colon: \\\'\\\'expr: expr\\\'\\\'\", line: 94, col: 20, offsetA: 2866, offsetB: 2912)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkIdentDefs", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a definition like `a, b: typeDesc = expr`\", line: 96, col: 6, offsetA: 2935, offsetB: 2978)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# either typeDesc or expr may be nil; used in\", line: 97, col: 6, offsetA: 2985, offsetB: 3030)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# formal parameters, var statements, etc.\", line: 98, col: 6, offsetA: 3037, offsetB: 3078)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkVarTuple", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a ``var (a, b) = expr`` construct\", line: 99, col: 15, offsetA: 3094, offsetB: 3129)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkPar", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# syntactic (); may be a tuple constructor\", line: 100, col: 10, offsetA: 3140, offsetB: 3182)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkObjConstr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# object constructor: T(a: 1, b: 2)\", line: 101, col: 16, offsetA: 3199, offsetB: 3234)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkCurly", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# syntactic {}\", line: 102, col: 12, offsetA: 3247, offsetB: 3261)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkCurlyExpr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an expression like a{i}\", line: 103, col: 16, offsetA: 3278, offsetB: 3303)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkBracket", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# syntactic []\", line: 104, col: 14, offsetA: 3318, offsetB: 3332)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkBracketExpr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an expression like a[i..j, k]\", line: 105, col: 18, offsetA: 3351, offsetB: 3382)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkPragmaExpr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an expression like a{.pragmas.}\", line: 106, col: 17, offsetA: 3400, offsetB: 3433)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkRange", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an expression like i..j\", line: 107, col: 12, offsetA: 3446, offsetB: 3471)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkDotExpr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a.b\", line: 108, col: 14, offsetA: 3486, offsetB: 3491)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkCheckedFieldExpr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a.b, but b is a field that needs to be checked\", line: 109, col: 23, offsetA: 3515, offsetB: 3563)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkDerefExpr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a^\", line: 110, col: 16, offsetA: 3580, offsetB: 3584)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkIfExpr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if as an expression\", line: 111, col: 13, offsetA: 3598, offsetB: 3619)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkElifExpr" + }, + { + "kind": "nkIdent", + "ident": "nkElseExpr" + }, + { + "kind": "nkIdent", + "ident": "nkLambda", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# lambda expression\", line: 114, col: 13, offsetA: 3663, offsetB: 3682)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkDo", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# lambda block appering as trailing proc param\", line: 115, col: 9, offsetA: 3692, offsetB: 3738)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkAccQuoted", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# `a` as a node\", line: 116, col: 16, offsetA: 3755, offsetB: 3770)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkTableConstr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a table constructor {expr: expr}\", line: 117, col: 18, offsetA: 3789, offsetB: 3823)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkBind", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ``bind expr`` node\", line: 118, col: 11, offsetA: 3835, offsetB: 3855)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkClosedSymChoice", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol choice node; a list of nkSyms (closed)\", line: 119, col: 22, offsetA: 3878, offsetB: 3925)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkOpenSymChoice", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol choice node; a list of nkSyms (open)\", line: 120, col: 20, offsetA: 3946, offsetB: 3991)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkHiddenStdConv", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an implicit standard type conversion\", line: 121, col: 20, offsetA: 4012, offsetB: 4050)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkHiddenSubConv", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an implicit type conversion from a subtype\", line: 123, col: 6, offsetA: 4077, offsetB: 4121)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# to a supertype\", line: 124, col: 6, offsetA: 4128, offsetB: 4144)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkConv", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a type conversion\", line: 125, col: 11, offsetA: 4156, offsetB: 4175)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkCast", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a type cast\", line: 126, col: 11, offsetA: 4187, offsetB: 4200)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkStaticExpr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a static expr\", line: 127, col: 17, offsetA: 4218, offsetB: 4233)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkAddr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a addr expression\", line: 128, col: 11, offsetA: 4245, offsetB: 4264)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkHiddenAddr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# implicit address operator\", line: 129, col: 17, offsetA: 4282, offsetB: 4309)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkHiddenDeref", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# implicit ^ operator\", line: 130, col: 18, offsetA: 4328, offsetB: 4349)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkObjDownConv", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# down conversion between object types\", line: 131, col: 18, offsetA: 4368, offsetB: 4406)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkObjUpConv", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# up conversion between object types\", line: 132, col: 16, offsetA: 4423, offsetB: 4459)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkChckRangeF", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# range check for floats\", line: 133, col: 17, offsetA: 4477, offsetB: 4501)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkChckRange64", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# range check for 64 bit ints\", line: 134, col: 18, offsetA: 4520, offsetB: 4549)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkChckRange", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# range check for ints\", line: 135, col: 16, offsetA: 4566, offsetB: 4588)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkStringToCString", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# string to cstring\", line: 136, col: 22, offsetA: 4611, offsetB: 4630)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkCStringToString", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# cstring to string\", line: 138, col: 6, offsetA: 4659, offsetB: 4678)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# end of expressions\", line: 139, col: 6, offsetA: 4685, offsetB: 4705)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkAsgn", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a = b\", line: 140, col: 11, offsetA: 4717, offsetB: 4724)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkFastAsgn", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# internal node for a fast ``a = b``\", line: 142, col: 6, offsetA: 4746, offsetB: 4782)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# (no string copy)\", line: 143, col: 6, offsetA: 4789, offsetB: 4807)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkGenericParams", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# generic parameters\", line: 144, col: 20, offsetA: 4828, offsetB: 4848)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkFormalParams", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# formal parameters\", line: 145, col: 19, offsetA: 4868, offsetB: 4887)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkOfInherit", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# inherited from symbol\", line: 146, col: 16, offsetA: 4904, offsetB: 4927)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkImportAs", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a \\\'as\\\' b in an import statement\", line: 147, col: 15, offsetA: 4943, offsetB: 4976)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkProcDef", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a proc\", line: 148, col: 14, offsetA: 4991, offsetB: 4999)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkMethodDef", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a method\", line: 149, col: 16, offsetA: 5016, offsetB: 5026)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkConverterDef", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a converter\", line: 150, col: 19, offsetA: 5046, offsetB: 5059)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkMacroDef", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a macro\", line: 151, col: 15, offsetA: 5075, offsetB: 5084)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkTemplateDef", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a template\", line: 152, col: 18, offsetA: 5103, offsetB: 5115)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkIteratorDef", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an iterator\", line: 153, col: 18, offsetA: 5134, offsetB: 5147)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkOfBranch", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# used inside case statements\", line: 155, col: 6, offsetA: 5169, offsetB: 5198)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for (cond, action)-pairs\", line: 156, col: 6, offsetA: 5205, offsetB: 5231)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkElifBranch", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# used in if statements\", line: 157, col: 17, offsetA: 5249, offsetB: 5272)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkExceptBranch", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an except section\", line: 158, col: 19, offsetA: 5292, offsetB: 5311)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkElse", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an else part\", line: 159, col: 11, offsetA: 5323, offsetB: 5337)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkAsmStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an assembler block\", line: 160, col: 14, offsetA: 5352, offsetB: 5372)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkPragma", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a pragma statement\", line: 161, col: 13, offsetA: 5386, offsetB: 5406)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkPragmaBlock", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a pragma with a block\", line: 162, col: 18, offsetA: 5425, offsetB: 5448)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkIfStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an if statement\", line: 163, col: 13, offsetA: 5462, offsetB: 5479)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkWhenStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a when expression or statement\", line: 164, col: 15, offsetA: 5495, offsetB: 5527)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkForStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a for statement\", line: 165, col: 14, offsetA: 5542, offsetB: 5559)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkParForStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a parallel for statement\", line: 166, col: 17, offsetA: 5577, offsetB: 5603)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkWhileStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a while statement\", line: 167, col: 16, offsetA: 5620, offsetB: 5639)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkCaseStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a case statement\", line: 168, col: 15, offsetA: 5655, offsetB: 5673)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkTypeSection", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a type section (consists of type definitions)\", line: 169, col: 18, offsetA: 5692, offsetB: 5739)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkVarSection", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a var section\", line: 170, col: 17, offsetA: 5757, offsetB: 5772)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkLetSection", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a let section\", line: 171, col: 17, offsetA: 5790, offsetB: 5805)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkConstSection", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a const section\", line: 172, col: 19, offsetA: 5825, offsetB: 5842)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkConstDef", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a const definition\", line: 173, col: 15, offsetA: 5858, offsetB: 5878)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkTypeDef", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a type definition\", line: 174, col: 14, offsetA: 5893, offsetB: 5912)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkYieldStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the yield statement as a tree\", line: 175, col: 16, offsetA: 5929, offsetB: 5960)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkDefer", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the \\\'defer\\\' statement\", line: 176, col: 12, offsetA: 5973, offsetB: 5996)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkTryStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a try statement\", line: 177, col: 14, offsetA: 6011, offsetB: 6028)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkFinally", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a finally section\", line: 178, col: 14, offsetA: 6043, offsetB: 6062)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkRaiseStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a raise statement\", line: 179, col: 16, offsetA: 6079, offsetB: 6098)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkReturnStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a return statement\", line: 180, col: 17, offsetA: 6116, offsetB: 6136)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkBreakStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a break statement\", line: 181, col: 16, offsetA: 6153, offsetB: 6172)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkContinueStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a continue statement\", line: 182, col: 19, offsetA: 6192, offsetB: 6214)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkBlockStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a block statement\", line: 183, col: 16, offsetA: 6231, offsetB: 6250)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkStaticStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a static statement\", line: 184, col: 17, offsetA: 6268, offsetB: 6288)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkDiscardStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a discard statement\", line: 185, col: 18, offsetA: 6307, offsetB: 6328)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkStmtList", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a list of statements\", line: 186, col: 15, offsetA: 6344, offsetB: 6366)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkImportStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an import statement\", line: 187, col: 17, offsetA: 6384, offsetB: 6405)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkImportExceptStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an import x except a statement\", line: 188, col: 23, offsetA: 6429, offsetB: 6461)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkExportStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an export statement\", line: 189, col: 17, offsetA: 6479, offsetB: 6500)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkExportExceptStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an \\\'export except\\\' statement\", line: 190, col: 23, offsetA: 6524, offsetB: 6554)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkFromStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a from * import statement\", line: 191, col: 15, offsetA: 6570, offsetB: 6597)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkIncludeStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an include statement\", line: 192, col: 18, offsetA: 6616, offsetB: 6638)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkBindStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a bind statement\", line: 193, col: 15, offsetA: 6654, offsetB: 6672)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkMixinStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a mixin statement\", line: 194, col: 16, offsetA: 6689, offsetB: 6708)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkUsingStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an using statement\", line: 195, col: 16, offsetA: 6725, offsetB: 6745)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkCommentStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a comment statement\", line: 196, col: 18, offsetA: 6764, offsetB: 6785)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkStmtListExpr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a statement list followed by an expr; this is used\", line: 198, col: 6, offsetA: 6811, offsetB: 6863)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# to allow powerful multi-line templates\", line: 199, col: 6, offsetA: 6870, offsetB: 6910)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkBlockExpr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a statement block ending in an expr; this is used\", line: 201, col: 6, offsetA: 6933, offsetB: 6984)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# to allow powerful multi-line templates that open a\", line: 202, col: 6, offsetA: 6991, offsetB: 7043)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# temporary scope\", line: 203, col: 6, offsetA: 7050, offsetB: 7067)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkStmtListType", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a statement list ending in a type; for macros\", line: 204, col: 19, offsetA: 7087, offsetB: 7134)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkBlockType", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a statement block ending in a type; for macros\", line: 206, col: 6, offsetA: 7157, offsetB: 7205)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# types as syntactic trees:\", line: 207, col: 6, offsetA: 7212, offsetB: 7239)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkWith", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# distinct with `foo`\", line: 208, col: 11, offsetA: 7251, offsetB: 7272)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkWithout", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# distinct without `foo`\", line: 209, col: 14, offsetA: 7287, offsetB: 7311)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkTypeOfExpr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# type(1+2)\", line: 210, col: 17, offsetA: 7329, offsetB: 7340)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkObjectTy", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# object body\", line: 211, col: 15, offsetA: 7356, offsetB: 7369)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkTupleTy", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# tuple body\", line: 212, col: 14, offsetA: 7384, offsetB: 7396)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkTupleClassTy", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# tuple type class\", line: 213, col: 19, offsetA: 7416, offsetB: 7434)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkTypeClassTy", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# user-defined type class\", line: 214, col: 18, offsetA: 7453, offsetB: 7478)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkStaticTy", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ``static[T]``\", line: 215, col: 15, offsetA: 7494, offsetB: 7509)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkRecList", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# list of object parts\", line: 216, col: 14, offsetA: 7524, offsetB: 7546)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkRecCase", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# case section of object\", line: 217, col: 14, offsetA: 7561, offsetB: 7585)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkRecWhen", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# when section of object\", line: 218, col: 14, offsetA: 7600, offsetB: 7624)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkRefTy", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ``ref T``\", line: 219, col: 12, offsetA: 7637, offsetB: 7648)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkPtrTy", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ``ptr T``\", line: 220, col: 12, offsetA: 7661, offsetB: 7672)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkVarTy", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ``var T``\", line: 221, col: 12, offsetA: 7685, offsetB: 7696)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkConstTy", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ``const T``\", line: 222, col: 14, offsetA: 7711, offsetB: 7724)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkOutTy", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ``out T``\", line: 223, col: 12, offsetA: 7737, offsetB: 7748)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkDistinctTy", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# distinct type\", line: 224, col: 17, offsetA: 7766, offsetB: 7781)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkProcTy", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc type\", line: 225, col: 13, offsetA: 7795, offsetB: 7806)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkIteratorTy", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# iterator type\", line: 226, col: 17, offsetA: 7824, offsetB: 7839)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkSinkAsgn", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \\\'=sink(x, y)\\\'\", line: 227, col: 15, offsetA: 7855, offsetB: 7870)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkEnumTy", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# enum body\", line: 228, col: 13, offsetA: 7884, offsetB: 7895)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkEnumFieldDef", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# `ident = expr` in an enumeration\", line: 229, col: 19, offsetA: 7915, offsetB: 7949)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkArgList", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# argument list\", line: 230, col: 14, offsetA: 7964, offsetB: 7979)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkPattern", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a special pattern; used for matching\", line: 231, col: 14, offsetA: 7994, offsetB: 8032)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkHiddenTryStmt", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a hidden try statement\", line: 232, col: 20, offsetA: 8053, offsetB: 8077)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkClosure", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# (prc, env)-pair (internally used for code gen)\", line: 233, col: 14, offsetA: 8092, offsetB: 8140)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkGotoState", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# used for the state machine (for iterators)\", line: 234, col: 16, offsetA: 8157, offsetB: 8201)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkState", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# give a label to a code section (for iterators)\", line: 235, col: 12, offsetA: 8214, offsetB: 8262)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkBreakState", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# special break statement for easier code generation\", line: 236, col: 17, offsetA: 8280, offsetB: 8332)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkFuncDef", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a func\", line: 237, col: 14, offsetA: 8347, offsetB: 8355)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkTupleConstr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a tuple constructor\", line: 238, col: 18, offsetA: 8374, offsetB: 8395)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkError", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# erroneous AST node\", line: 239, col: 12, offsetA: 8408, offsetB: 8428)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkModuleRef", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for .rod file support: A (moduleId, itemId) pair\", line: 240, col: 16, offsetA: 8445, offsetB: 8495)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkReplayAction", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for .rod file support: A replay action\", line: 241, col: 19, offsetA: 8515, offsetB: 8555)" + ] + }, + { + "kind": "nkIdent", + "ident": "nkNilRodNode", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for .rod file support: a \\\'nil\\\' PNode\", line: 242, col: 17, offsetA: 8573, offsetB: 8611)" + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TNodeKinds" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TSymFlag" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# 51 flags!\", line: 247, col: 19, offsetA: 8669, offsetB: 8680)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "sfUsed", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# read access of sym (for warnings) or simply used\", line: 248, col: 11, offsetA: 8692, offsetB: 8742)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfExported", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol is exported from module\", line: 249, col: 15, offsetA: 8758, offsetB: 8790)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfFromGeneric", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol is instantiation of a generic; this is needed\", line: 251, col: 6, offsetA: 8815, offsetB: 8869)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for symbol file generation; such symbols should always\", line: 252, col: 6, offsetA: 8876, offsetB: 8932)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# be written into the ROD file\", line: 253, col: 6, offsetA: 8939, offsetB: 8969)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfGlobal", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol is at global scope\", line: 254, col: 13, offsetA: 8983, offsetB: 9010)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfForward", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol is forward declared\", line: 255, col: 14, offsetA: 9025, offsetB: 9053)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfWasForwarded", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol had a forward declaration\", line: 257, col: 6, offsetA: 9079, offsetB: 9113)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# (implies it\\\'s too dangerous to patch its type signature)\", line: 258, col: 6, offsetA: 9120, offsetB: 9178)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfImportc", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol is external; imported\", line: 259, col: 14, offsetA: 9193, offsetB: 9223)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfExportc", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol is exported (under a specified name)\", line: 260, col: 14, offsetA: 9238, offsetB: 9283)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfMangleCpp", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# mangle as cpp (combines with `sfExportc`)\", line: 261, col: 16, offsetA: 9300, offsetB: 9343)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfVolatile", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# variable is volatile\", line: 262, col: 15, offsetA: 9359, offsetB: 9381)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfRegister", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# variable should be placed in a register\", line: 263, col: 15, offsetA: 9397, offsetB: 9438)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfPure", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# object is \\\"pure\\\" that means it has no type-information\", line: 265, col: 6, offsetA: 9456, offsetB: 9512)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# enum is \\\"pure\\\", its values need qualified access\", line: 266, col: 6, offsetA: 9519, offsetB: 9569)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# variable is \\\"pure\\\"; it\\\'s an explicit \\\"global\\\"\", line: 267, col: 6, offsetA: 9576, offsetB: 9623)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfNoSideEffect", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc has no side effects\", line: 268, col: 19, offsetA: 9643, offsetB: 9669)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfSideEffect", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc may have side effects; cannot prove it has none\", line: 269, col: 17, offsetA: 9687, offsetB: 9741)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfMainModule", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# module is the main module\", line: 270, col: 17, offsetA: 9759, offsetB: 9786)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfSystemModule", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# module is the system module\", line: 271, col: 19, offsetA: 9806, offsetB: 9835)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfNoReturn", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc never returns (an exit proc)\", line: 272, col: 15, offsetA: 9851, offsetB: 9886)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfAddrTaken", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the variable\\\'s address is taken (ex- or implicitly);\", line: 274, col: 6, offsetA: 9909, offsetB: 9963)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# *OR*: a proc is indirectly called (used as first class)\", line: 275, col: 6, offsetA: 9970, offsetB: 10027)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfCompilerProc", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc is a compiler proc, that is a C proc that is\", line: 277, col: 6, offsetA: 10053, offsetB: 10104)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# needed for the code generator\", line: 278, col: 6, offsetA: 10111, offsetB: 10142)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfEscapes", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# param escapes\", line: 280, col: 6, offsetA: 10163, offsetB: 10178)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# currently unimplemented\", line: 281, col: 6, offsetA: 10185, offsetB: 10210)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfDiscriminant", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# field is a discriminant in a record/object\", line: 282, col: 19, offsetA: 10230, offsetB: 10274)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfRequiresInit", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# field must be initialized during construction\", line: 283, col: 19, offsetA: 10294, offsetB: 10341)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfDeprecated", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol is deprecated\", line: 284, col: 17, offsetA: 10359, offsetB: 10381)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfExplain", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# provide more diagnostics when this symbol is used\", line: 285, col: 14, offsetA: 10396, offsetB: 10447)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfError", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# usage of symbol should trigger a compile-time error\", line: 286, col: 12, offsetA: 10460, offsetB: 10513)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfShadowed", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a symbol that was shadowed in some inner scope\", line: 287, col: 15, offsetA: 10529, offsetB: 10577)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfThread", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc will run as a thread\", line: 289, col: 6, offsetA: 10597, offsetB: 10624)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# variable is a thread variable\", line: 290, col: 6, offsetA: 10631, offsetB: 10662)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfCppNonPod", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# tells compiler to treat such types as non-pod\\\'s, so that\", line: 292, col: 6, offsetA: 10685, offsetB: 10743)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# `thread_local` is used instead of `__thread` for\", line: 293, col: 6, offsetA: 10750, offsetB: 10800)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# {.threadvar.} + `--threads`. Only makes sense for importcpp types.\", line: 294, col: 6, offsetA: 10807, offsetB: 10875)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# This has a performance impact so isn\\\'t set by default.\", line: 295, col: 6, offsetA: 10882, offsetB: 10938)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfCompileTime", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc can be evaluated at compile time\", line: 296, col: 18, offsetA: 10957, offsetB: 10996)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfConstructor", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc is a C++ constructor\", line: 297, col: 18, offsetA: 11015, offsetB: 11042)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfDispatcher", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# copied method symbol is the dispatcher\", line: 299, col: 6, offsetA: 11066, offsetB: 11106)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# deprecated and unused, except for the con\", line: 300, col: 6, offsetA: 11113, offsetB: 11156)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfBorrow", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc is borrowed\", line: 301, col: 13, offsetA: 11170, offsetB: 11188)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfInfixCall", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol needs infix call syntax in target language;\", line: 303, col: 6, offsetA: 11211, offsetB: 11263)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for interfacing with C++, JS\", line: 304, col: 6, offsetA: 11270, offsetB: 11300)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfNamedParamCall", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol needs named parameter call syntax in target\", line: 306, col: 6, offsetA: 11328, offsetB: 11380)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# language; for interfacing with Objective C\", line: 307, col: 6, offsetA: 11387, offsetB: 11431)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfDiscardable", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# returned value may be discarded implicitly\", line: 308, col: 18, offsetA: 11450, offsetB: 11494)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfOverridden", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc is overridden\", line: 309, col: 17, offsetA: 11512, offsetB: 11532)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfCallsite", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# A flag for template symbols to tell the\", line: 311, col: 6, offsetA: 11554, offsetB: 11595)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# compiler it should use line information from\", line: 312, col: 6, offsetA: 11602, offsetB: 11648)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the calling side of the macro, not from the\", line: 313, col: 6, offsetA: 11655, offsetB: 11700)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# implementation.\", line: 314, col: 6, offsetA: 11707, offsetB: 11724)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfGenSym", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol is \\\'gensym\\\'ed; do not add to symbol table\", line: 315, col: 13, offsetA: 11738, offsetB: 11788)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfNonReloadable", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol will be left as-is when hot code reloading is on -\", line: 317, col: 6, offsetA: 11815, offsetB: 11874)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# meaning that it won\\\'t be renamed and/or changed in any way\", line: 318, col: 6, offsetA: 11881, offsetB: 11941)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfGeneratedOp", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc is a generated \\\'=\\\'; do not inject destructors in it\", line: 320, col: 6, offsetA: 11966, offsetB: 12024)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# variable is generated closure environment; requires early\", line: 321, col: 6, offsetA: 12031, offsetB: 12090)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# destruction for --newruntime.\", line: 322, col: 6, offsetA: 12097, offsetB: 12128)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfTemplateParam", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol is a template parameter\", line: 323, col: 20, offsetA: 12149, offsetB: 12181)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfCursor", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# variable/field is a cursor, see RFC 177 for details\", line: 324, col: 13, offsetA: 12195, offsetB: 12248)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfInjectDestructors", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# whether the proc needs the \\\'injectdestructors\\\' transformation\", line: 325, col: 24, offsetA: 12273, offsetB: 12336)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfNeverRaises", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc can never raise an exception, not even OverflowDefect\", line: 327, col: 6, offsetA: 12361, offsetB: 12421)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# or out-of-memory\", line: 328, col: 6, offsetA: 12428, offsetB: 12446)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfSystemRaisesDefect", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc in the system can raise defects\", line: 329, col: 25, offsetA: 12472, offsetB: 12510)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfUsedInFinallyOrExcept", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol is used inside an \\\'except\\\' or \\\'finally\\\'\", line: 330, col: 28, offsetA: 12539, offsetB: 12587)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfSingleUsedTemp", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# For temporaries that we know will only be used once\", line: 331, col: 21, offsetA: 12609, offsetB: 12662)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfNoalias", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \\\'noalias\\\' annotation, means C\\\'s \\\'restrict\\\'\", line: 333, col: 6, offsetA: 12683, offsetB: 12727)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for templates and macros, means cannot be called\", line: 334, col: 6, offsetA: 12734, offsetB: 12784)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# as a lone symbol (cannot use alias syntax)\", line: 335, col: 6, offsetA: 12791, offsetB: 12835)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfEffectsDelayed", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an \\\'effectsDelayed\\\' parameter\", line: 336, col: 21, offsetA: 12857, offsetB: 12888)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfGeneratedType", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# A anonymous generic type that is generated by the compiler for\", line: 338, col: 6, offsetA: 12915, offsetB: 12979)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# objects that do not have generic parameters in case one of the\", line: 339, col: 6, offsetA: 12986, offsetB: 13050)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# object fields has one.\", line: 340, col: 6, offsetA: 13057, offsetB: 13081)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#\", line: 341, col: 6, offsetA: 13088, offsetB: 13089)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# This is disallowed but can cause the typechecking to go into\", line: 342, col: 6, offsetA: 13096, offsetB: 13158)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an infinite loop, this flag is used as a sentinel to stop it.\", line: 343, col: 6, offsetA: 13165, offsetB: 13228)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfVirtual", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc is a C++ virtual function\", line: 344, col: 14, offsetA: 13243, offsetB: 13275)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfByCopy", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# param is marked as pass bycopy\", line: 345, col: 13, offsetA: 13289, offsetB: 13321)" + ] + }, + { + "kind": "nkIdent", + "ident": "sfCodegenDecl", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# type, proc, global or proc param is marked as codegenDecl\", line: 346, col: 18, offsetA: 13340, offsetB: 13399)" + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TSymFlags" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "TSymFlag" + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sfNoInit" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "sfMainModule" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# don\\\'t generate code to init the variable\", line: 351, col: 27, offsetA: 13464, offsetB: 13506)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sfAllUntyped" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "sfVolatile" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# macro or template is immediately expanded \\\\\", line: 353, col: 4, offsetA: 13540, offsetB: 13585)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# in a generic context\", line: 354, col: 4, offsetA: 13590, offsetB: 13612)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sfDirty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "sfPure" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# template is not hygienic (old styled template)\", line: 356, col: 4, offsetA: 13637, offsetB: 13685)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# module, compiled from a dirty-buffer\", line: 357, col: 4, offsetA: 13690, offsetB: 13728)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sfAnon" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "sfDiscardable" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol name that was generated by the compiler\", line: 359, col: 4, offsetA: 13759, offsetB: 13807)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the compiler will avoid printing such names\", line: 360, col: 4, offsetA: 13812, offsetB: 13857)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# in user messages.\", line: 361, col: 4, offsetA: 13862, offsetB: 13881)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sfNoForward" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "sfRegister" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# forward declarations are not required (per module)\", line: 362, col: 28, offsetA: 13910, offsetB: 13962)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sfReorder" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "sfForward" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# reordering pass is enabled\", line: 363, col: 25, offsetA: 13988, offsetB: 14016)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sfCompileToCpp" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "sfInfixCall" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# compile the module as C++ code\", line: 364, col: 32, offsetA: 14049, offsetB: 14081)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sfCompileToObjc" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "sfNamedParamCall" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# compile the module as Objective-C code\", line: 365, col: 38, offsetA: 14120, offsetB: 14160)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sfExperimental" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "sfOverridden" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# module uses the .experimental switch\", line: 366, col: 33, offsetA: 14194, offsetB: 14232)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sfGoto" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "sfOverridden" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# var is used for \\\'goto\\\' code generation\", line: 367, col: 25, offsetA: 14258, offsetB: 14298)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sfWrittenTo" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "sfBorrow" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# param is assigned to\", line: 369, col: 4, offsetA: 14329, offsetB: 14351)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# currently unimplemented\", line: 370, col: 4, offsetA: 14356, offsetB: 14381)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sfBase" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "sfDiscriminant" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sfCustomPragma" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "sfRegister" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol is custom pragma template\", line: 372, col: 31, offsetA: 14440, offsetB: 14474)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sfTemplateRedefinition" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "sfExportc" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol is a redefinition of an earlier template\", line: 373, col: 38, offsetA: 14513, offsetB: 14562)" + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# getting ready for the future expr/stmt merge\", line: 375, col: 2, offsetA: 14571, offsetB: 14617)" + ], + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nkWhen" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "nkWhenStmt" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nkWhenExpr" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "nkWhenStmt" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nkEffectList" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "nkArgList" + } + ] + }, + { + "kind": "nkConstDef", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# hacks ahead: an nkEffectList is a node with 4 children:\", line: 379, col: 2, offsetA: 14698, offsetB: 14755)" + ], + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "exceptionEffects" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# exceptions at position 0\", line: 380, col: 24, offsetA: 14780, offsetB: 14806)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "requiresEffects" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \\\'requires\\\' annotation\", line: 381, col: 23, offsetA: 14830, offsetB: 14853)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "ensuresEffects" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \\\'ensures\\\' annotation\", line: 382, col: 22, offsetA: 14876, offsetB: 14898)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "tagEffects" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# user defined tag (\\\'gc\\\', \\\'time\\\' etc.)\", line: 383, col: 18, offsetA: 14917, offsetB: 14955)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "pragmasEffects" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# not an effect, but a slot for pragmas in proc type\", line: 384, col: 22, offsetA: 14978, offsetB: 15030)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "forbiddenEffects" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 5 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# list of illegal effects\", line: 385, col: 24, offsetA: 15055, offsetB: 15080)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "effectListLen" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# list of effects list\", line: 386, col: 21, offsetA: 15102, offsetB: 15124)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nkLastBlockStmts" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkRaiseStmt" + }, + { + "kind": "nkIdent", + "ident": "nkReturnStmt" + }, + { + "kind": "nkIdent", + "ident": "nkBreakStmt" + }, + { + "kind": "nkIdent", + "ident": "nkContinueStmt" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# these must be last statements in a block\", line: 387, col: 79, offsetA: 15204, offsetB: 15246)" + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TTypeKind" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# order is important!\", line: 391, col: 4, offsetA: 15277, offsetB: 15298)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Don\\\'t forget to change hti.nim if you make a change here\", line: 392, col: 4, offsetA: 15303, offsetB: 15361)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# XXX put this into an include file to avoid this issue!\", line: 393, col: 4, offsetA: 15366, offsetB: 15422)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# several types are no longer used (guess which), but a\", line: 394, col: 4, offsetA: 15427, offsetB: 15482)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# spot in the sequence is kept for backwards compatibility\", line: 395, col: 4, offsetA: 15487, offsetB: 15545)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# (apparently something with bootstrapping)\", line: 396, col: 4, offsetA: 15550, offsetB: 15593)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if you need to add a type, they can apparently be reused\", line: 397, col: 4, offsetA: 15598, offsetB: 15656)" + ], + "ident": "tyNone" + }, + { + "kind": "nkIdent", + "ident": "tyBool" + }, + { + "kind": "nkIdent", + "ident": "tyChar" + }, + { + "kind": "nkIdent", + "ident": "tyEmpty" + }, + { + "kind": "nkIdent", + "ident": "tyAlias" + }, + { + "kind": "nkIdent", + "ident": "tyNil" + }, + { + "kind": "nkIdent", + "ident": "tyUntyped" + }, + { + "kind": "nkIdent", + "ident": "tyTyped" + }, + { + "kind": "nkIdent", + "ident": "tyTypeDesc" + }, + { + "kind": "nkIdent", + "ident": "tyGenericInvocation", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ``T[a, b]`` for types to invoke\", line: 407, col: 24, offsetA: 15789, offsetB: 15822)" + ] + }, + { + "kind": "nkIdent", + "ident": "tyGenericBody", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ``T[a, b, body]`` last parameter is the body\", line: 408, col: 18, offsetA: 15841, offsetB: 15887)" + ] + }, + { + "kind": "nkIdent", + "ident": "tyGenericInst", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ``T[a, b, realInstance]`` instantiated generic type\", line: 410, col: 6, offsetA: 15912, offsetB: 15965)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# realInstance will be a concrete type like tyObject\", line: 411, col: 6, offsetA: 15972, offsetB: 16024)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# unless this is an instance of a generic alias type.\", line: 412, col: 6, offsetA: 16031, offsetB: 16084)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# then realInstance will be the tyGenericInst of the\", line: 413, col: 6, offsetA: 16091, offsetB: 16143)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# completely (recursively) resolved alias.\", line: 414, col: 6, offsetA: 16150, offsetB: 16192)" + ] + }, + { + "kind": "nkIdent", + "ident": "tyGenericParam", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ``a`` in the above patterns\", line: 415, col: 19, offsetA: 16212, offsetB: 16241)" + ] + }, + { + "kind": "nkIdent", + "ident": "tyDistinct" + }, + { + "kind": "nkIdent", + "ident": "tyEnum" + }, + { + "kind": "nkIdent", + "ident": "tyOrdinal", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# integer types (including enums and boolean)\", line: 418, col: 14, offsetA: 16282, offsetB: 16327)" + ] + }, + { + "kind": "nkIdent", + "ident": "tyArray" + }, + { + "kind": "nkIdent", + "ident": "tyObject" + }, + { + "kind": "nkIdent", + "ident": "tyTuple" + }, + { + "kind": "nkIdent", + "ident": "tySet" + }, + { + "kind": "nkIdent", + "ident": "tyRange" + }, + { + "kind": "nkIdent", + "ident": "tyPtr" + }, + { + "kind": "nkIdent", + "ident": "tyRef" + }, + { + "kind": "nkIdent", + "ident": "tyVar" + }, + { + "kind": "nkIdent", + "ident": "tySequence" + }, + { + "kind": "nkIdent", + "ident": "tyProc" + }, + { + "kind": "nkIdent", + "ident": "tyPointer" + }, + { + "kind": "nkIdent", + "ident": "tyOpenArray" + }, + { + "kind": "nkIdent", + "ident": "tyString" + }, + { + "kind": "nkIdent", + "ident": "tyCstring" + }, + { + "kind": "nkIdent", + "ident": "tyForward" + }, + { + "kind": "nkIdent", + "ident": "tyInt" + }, + { + "kind": "nkIdent", + "ident": "tyInt8" + }, + { + "kind": "nkIdent", + "ident": "tyInt16" + }, + { + "kind": "nkIdent", + "ident": "tyInt32" + }, + { + "kind": "nkIdent", + "ident": "tyInt64", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# signed integers\", line: 438, col: 12, offsetA: 16571, offsetB: 16588)" + ] + }, + { + "kind": "nkIdent", + "ident": "tyFloat" + }, + { + "kind": "nkIdent", + "ident": "tyFloat32" + }, + { + "kind": "nkIdent", + "ident": "tyFloat64" + }, + { + "kind": "nkIdent", + "ident": "tyFloat128" + }, + { + "kind": "nkIdent", + "ident": "tyUInt" + }, + { + "kind": "nkIdent", + "ident": "tyUInt8" + }, + { + "kind": "nkIdent", + "ident": "tyUInt16" + }, + { + "kind": "nkIdent", + "ident": "tyUInt32" + }, + { + "kind": "nkIdent", + "ident": "tyUInt64" + }, + { + "kind": "nkIdent", + "ident": "tyOwned" + }, + { + "kind": "nkIdent", + "ident": "tySink" + }, + { + "kind": "nkIdent", + "ident": "tyLent" + }, + { + "kind": "nkIdent", + "ident": "tyVarargs" + }, + { + "kind": "nkIdent", + "ident": "tyUncheckedArray", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# An array with boundaries [0,+\u00E2\u0088\u009E]\", line: 452, col: 21, offsetA: 16775, offsetB: 16810)" + ] + }, + { + "kind": "nkIdent", + "ident": "tyProxy", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# used as errornous type (for idetools)\", line: 453, col: 12, offsetA: 16823, offsetB: 16862)" + ] + }, + { + "kind": "nkIdent", + "ident": "tyBuiltInTypeClass", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Type such as the catch-all object, tuple, seq, etc\", line: 454, col: 23, offsetA: 16886, offsetB: 16938)" + ] + }, + { + "kind": "nkIdent", + "ident": "tyUserTypeClass", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the body of a user-defined type class\", line: 455, col: 20, offsetA: 16959, offsetB: 16998)" + ] + }, + { + "kind": "nkIdent", + "ident": "tyUserTypeClassInst", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Instance of a parametric user-defined type class.\", line: 457, col: 6, offsetA: 17029, offsetB: 17080)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Structured similarly to tyGenericInst.\", line: 458, col: 6, offsetA: 17087, offsetB: 17127)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# tyGenericInst represents concrete types, while\", line: 459, col: 6, offsetA: 17134, offsetB: 17182)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# this is still a \\\"generic param\\\" that will bind types\", line: 460, col: 6, offsetA: 17189, offsetB: 17243)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# and resolves them during sigmatch and instantiation.\", line: 461, col: 6, offsetA: 17250, offsetB: 17304)" + ] + }, + { + "kind": "nkIdent", + "ident": "tyCompositeTypeClass", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Type such as seq[Number]\", line: 463, col: 6, offsetA: 17336, offsetB: 17362)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# The notes for tyUserTypeClassInst apply here as well\", line: 464, col: 6, offsetA: 17369, offsetB: 17423)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# sons[0]: the original expression used by the user.\", line: 465, col: 6, offsetA: 17430, offsetB: 17482)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# sons[1]: fully expanded and instantiated meta type\", line: 466, col: 6, offsetA: 17489, offsetB: 17541)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# (potentially following aliases)\", line: 467, col: 6, offsetA: 17548, offsetB: 17581)" + ] + }, + { + "kind": "nkIdent", + "ident": "tyInferred", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# In the initial state `base` stores a type class constraining\", line: 469, col: 6, offsetA: 17603, offsetB: 17665)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the types that can be inferred. After a candidate type is\", line: 470, col: 6, offsetA: 17672, offsetB: 17731)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# selected, it\\\'s stored in `lastSon`. Between `base` and `lastSon`\", line: 471, col: 6, offsetA: 17738, offsetB: 17804)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# there may be 0, 2 or more types that were also considered as\", line: 472, col: 6, offsetA: 17811, offsetB: 17873)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# possible candidates in the inference process (i.e. lastSon will\", line: 473, col: 6, offsetA: 17880, offsetB: 17945)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# be updated to store a type best conforming to all candidates)\", line: 474, col: 6, offsetA: 17952, offsetB: 18015)" + ] + }, + { + "kind": "nkIdent", + "ident": "tyAnd" + }, + { + "kind": "nkIdent", + "ident": "tyOr" + }, + { + "kind": "nkIdent", + "ident": "tyNot", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# boolean type classes such as `string|int`,`not seq`,\", line: 478, col: 6, offsetA: 18051, offsetB: 18105)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# `Sortable and Enumable`, etc\", line: 479, col: 6, offsetA: 18112, offsetB: 18142)" + ] + }, + { + "kind": "nkIdent", + "ident": "tyAnything", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a type class matching any type\", line: 480, col: 15, offsetA: 18158, offsetB: 18190)" + ] + }, + { + "kind": "nkIdent", + "ident": "tyStatic", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a value known at compile type (the underlying type is .base)\", line: 481, col: 13, offsetA: 18204, offsetB: 18266)" + ] + }, + { + "kind": "nkIdent", + "ident": "tyFromExpr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# This is a type representing an expression that depends\", line: 483, col: 6, offsetA: 18288, offsetB: 18344)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# on generic parameters (the expression is stored in t.n)\", line: 484, col: 6, offsetA: 18351, offsetB: 18408)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# It will be converted to a real type only during generic\", line: 485, col: 6, offsetA: 18415, offsetB: 18472)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# instantiation and prior to this it has the potential to\", line: 486, col: 6, offsetA: 18479, offsetB: 18536)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# be any type.\", line: 487, col: 6, offsetA: 18543, offsetB: 18557)" + ] + }, + { + "kind": "nkIdent", + "ident": "tyConcept", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# new style concept.\", line: 488, col: 14, offsetA: 18572, offsetB: 18592)" + ] + }, + { + "kind": "nkIdent", + "ident": "tyVoid", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# now different from tyEmpty, hurray!\", line: 489, col: 11, offsetA: 18604, offsetB: 18641)" + ] + }, + { + "kind": "nkIdent", + "ident": "tyIterable" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStaticStmt", + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# remind us when TTypeKind stops to fit in a single 64-bit word\", line: 493, col: 2, offsetA: 18668, offsetB: 18731)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# assert TTypeKind.high.ord <= 63\", line: 494, col: 2, offsetA: 18734, offsetB: 18767)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "tyPureObject" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "tyTuple" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "GcTypeKinds" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyRef" + }, + { + "kind": "nkIdent", + "ident": "tySequence" + }, + { + "kind": "nkIdent", + "ident": "tyString" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "tyError" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "tyProxy" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# as an errornous node should match everything\", line: 500, col: 21, offsetA: 18879, offsetB: 18925)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "tyUnknown" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "tyFromExpr" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "tyUnknownTypes" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyError" + }, + { + "kind": "nkIdent", + "ident": "tyFromExpr" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "tyTypeClasses" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyBuiltInTypeClass" + }, + { + "kind": "nkIdent", + "ident": "tyCompositeTypeClass" + }, + { + "kind": "nkIdent", + "ident": "tyUserTypeClass" + }, + { + "kind": "nkIdent", + "ident": "tyUserTypeClassInst" + }, + { + "kind": "nkIdent", + "ident": "tyAnd" + }, + { + "kind": "nkIdent", + "ident": "tyOr" + }, + { + "kind": "nkIdent", + "ident": "tyNot" + }, + { + "kind": "nkIdent", + "ident": "tyAnything" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "tyMetaTypes" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyGenericParam" + }, + { + "kind": "nkIdent", + "ident": "tyTypeDesc" + }, + { + "kind": "nkIdent", + "ident": "tyUntyped" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tyTypeClasses" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "tyUserTypeClasses" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyUserTypeClass" + }, + { + "kind": "nkIdent", + "ident": "tyUserTypeClassInst" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# consider renaming as `tyAbstractVarRange`\", line: 510, col: 2, offsetA: 19285, offsetB: 19328)" + ], + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "abstractVarRange" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyGenericInst" + }, + { + "kind": "nkIdent", + "ident": "tyRange" + }, + { + "kind": "nkIdent", + "ident": "tyVar" + }, + { + "kind": "nkIdent", + "ident": "tyDistinct" + }, + { + "kind": "nkIdent", + "ident": "tyOrdinal" + }, + { + "kind": "nkIdent", + "ident": "tyTypeDesc" + }, + { + "kind": "nkIdent", + "ident": "tyAlias" + }, + { + "kind": "nkIdent", + "ident": "tyInferred" + }, + { + "kind": "nkIdent", + "ident": "tySink" + }, + { + "kind": "nkIdent", + "ident": "tyOwned" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "abstractInst" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyGenericInst" + }, + { + "kind": "nkIdent", + "ident": "tyDistinct" + }, + { + "kind": "nkIdent", + "ident": "tyOrdinal" + }, + { + "kind": "nkIdent", + "ident": "tyTypeDesc" + }, + { + "kind": "nkIdent", + "ident": "tyAlias" + }, + { + "kind": "nkIdent", + "ident": "tyInferred" + }, + { + "kind": "nkIdent", + "ident": "tySink" + }, + { + "kind": "nkIdent", + "ident": "tyOwned" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# xxx what about tyStatic?\", line: 520, col: 6, offsetA: 19607, offsetB: 19633)" + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TTypeKinds" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "TTypeKind" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TNodeFlag" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "nfNone" + }, + { + "kind": "nkIdent", + "ident": "nfBase2", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# nfBase10 is default, so not needed\", line: 526, col: 12, offsetA: 19714, offsetB: 19750)" + ] + }, + { + "kind": "nkIdent", + "ident": "nfBase8" + }, + { + "kind": "nkIdent", + "ident": "nfBase16" + }, + { + "kind": "nkIdent", + "ident": "nfAllConst", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# used to mark complex expressions constant; easy to get rid of\", line: 530, col: 6, offsetA: 19797, offsetB: 19860)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# but unfortunately it has measurable impact for compilation\", line: 531, col: 6, offsetA: 19867, offsetB: 19927)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# efficiency\", line: 532, col: 6, offsetA: 19934, offsetB: 19946)" + ] + }, + { + "kind": "nkIdent", + "ident": "nfTransf", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# node has been transformed\", line: 533, col: 13, offsetA: 19960, offsetB: 19987)" + ] + }, + { + "kind": "nkIdent", + "ident": "nfNoRewrite", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# node should not be transformed anymore\", line: 534, col: 16, offsetA: 20004, offsetB: 20044)" + ] + }, + { + "kind": "nkIdent", + "ident": "nfSem", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# node has been checked for semantics\", line: 535, col: 10, offsetA: 20055, offsetB: 20092)" + ] + }, + { + "kind": "nkIdent", + "ident": "nfLL", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# node has gone through lambda lifting\", line: 536, col: 9, offsetA: 20102, offsetB: 20140)" + ] + }, + { + "kind": "nkIdent", + "ident": "nfDotField", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the call can use a dot operator\", line: 537, col: 15, offsetA: 20156, offsetB: 20189)" + ] + }, + { + "kind": "nkIdent", + "ident": "nfDotSetter", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the call can use a setter dot operarator\", line: 538, col: 16, offsetA: 20206, offsetB: 20248)" + ] + }, + { + "kind": "nkIdent", + "ident": "nfExplicitCall", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# x.y() was used instead of x.y\", line: 539, col: 19, offsetA: 20268, offsetB: 20299)" + ] + }, + { + "kind": "nkIdent", + "ident": "nfExprCall", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# this is an attempt to call a regular expression\", line: 540, col: 15, offsetA: 20315, offsetB: 20364)" + ] + }, + { + "kind": "nkIdent", + "ident": "nfIsRef", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# this node is a \\\'ref\\\' node; used for the VM\", line: 541, col: 12, offsetA: 20377, offsetB: 20421)" + ] + }, + { + "kind": "nkIdent", + "ident": "nfIsPtr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# this node is a \\\'ptr\\\' node; used for the VM\", line: 542, col: 12, offsetA: 20434, offsetB: 20478)" + ] + }, + { + "kind": "nkIdent", + "ident": "nfPreventCg", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# this node should be ignored by the codegen\", line: 543, col: 16, offsetA: 20495, offsetB: 20539)" + ] + }, + { + "kind": "nkIdent", + "ident": "nfBlockArg", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# this a stmtlist appearing in a call (e.g. a do block)\", line: 544, col: 15, offsetA: 20555, offsetB: 20610)" + ] + }, + { + "kind": "nkIdent", + "ident": "nfFromTemplate", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a top-level node returned from a template\", line: 545, col: 19, offsetA: 20630, offsetB: 20673)" + ] + }, + { + "kind": "nkIdent", + "ident": "nfDefaultParam", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an automatically inserter default parameter\", line: 546, col: 19, offsetA: 20693, offsetB: 20738)" + ] + }, + { + "kind": "nkIdent", + "ident": "nfDefaultRefsParam", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a default param value references another parameter\", line: 548, col: 6, offsetA: 20768, offsetB: 20820)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the flag is applied to proc default values and to calls\", line: 549, col: 6, offsetA: 20827, offsetB: 20884)" + ] + }, + { + "kind": "nkIdent", + "ident": "nfExecuteOnReload", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# A top-level statement that will be executed during reloads\", line: 550, col: 22, offsetA: 20907, offsetB: 20967)" + ] + }, + { + "kind": "nkIdent", + "ident": "nfLastRead", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# this node is a last read\", line: 551, col: 15, offsetA: 20983, offsetB: 21009)" + ] + }, + { + "kind": "nkIdent", + "ident": "nfFirstWrite", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# this node is a first write\", line: 552, col: 17, offsetA: 21027, offsetB: 21055)" + ] + }, + { + "kind": "nkIdent", + "ident": "nfHasComment", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# node has a comment\", line: 553, col: 17, offsetA: 21073, offsetB: 21093)" + ] + }, + { + "kind": "nkIdent", + "ident": "nfSkipFieldChecking", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# node skips field visable checking\", line: 554, col: 24, offsetA: 21118, offsetB: 21153)" + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TNodeFlags" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "TNodeFlag" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TTypeFlag" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# keep below 32 for efficiency reasons (now: 47)\", line: 557, col: 20, offsetA: 21206, offsetB: 21254)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "tfVarargs", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# procedure has C styled varargs\", line: 559, col: 6, offsetA: 21275, offsetB: 21307)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# tyArray type represeting a varargs list\", line: 560, col: 6, offsetA: 21314, offsetB: 21355)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfNoSideEffect", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# procedure type does not allow side effects\", line: 561, col: 19, offsetA: 21375, offsetB: 21419)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfFinal", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# is the object final?\", line: 562, col: 12, offsetA: 21432, offsetB: 21454)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfInheritable", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# is the object inheritable?\", line: 563, col: 18, offsetA: 21473, offsetB: 21501)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfHasOwned", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# type contains an \\\'owned\\\' type and must be moved\", line: 564, col: 15, offsetA: 21517, offsetB: 21566)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfEnumHasHoles", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# enum cannot be mapped into a range\", line: 565, col: 19, offsetA: 21586, offsetB: 21622)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfShallow", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# type can be shallow copied on assignment\", line: 566, col: 14, offsetA: 21637, offsetB: 21679)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfThread", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc type is marked as ``thread``; alias for ``gcsafe``\", line: 567, col: 13, offsetA: 21693, offsetB: 21750)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfFromGeneric", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# type is an instantiation of a generic; this is needed\", line: 569, col: 6, offsetA: 21775, offsetB: 21830)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# because for instantiations of objects, structural\", line: 570, col: 6, offsetA: 21837, offsetB: 21888)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# type equality has to be used\", line: 571, col: 6, offsetA: 21895, offsetB: 21925)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfUnresolved", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# marks unresolved typedesc/static params: e.g.\", line: 573, col: 6, offsetA: 21949, offsetB: 21996)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc foo(T: typedesc, list: seq[T]): var T\", line: 574, col: 6, offsetA: 22003, offsetB: 22047)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc foo(L: static[int]): array[L, int]\", line: 575, col: 6, offsetA: 22054, offsetB: 22095)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# can be attached to ranges to indicate that the range\", line: 576, col: 6, offsetA: 22102, offsetB: 22156)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# can be attached to generic procs with free standing\", line: 577, col: 6, offsetA: 22163, offsetB: 22216)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# type parameters: e.g. proc foo[T]()\", line: 578, col: 6, offsetA: 22223, offsetB: 22260)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# depends on unresolved static params.\", line: 579, col: 6, offsetA: 22267, offsetB: 22305)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfResolved", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# marks a user type class, after it has been bound to a\", line: 581, col: 6, offsetA: 22327, offsetB: 22382)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# concrete type (lastSon becomes the concrete type)\", line: 582, col: 6, offsetA: 22389, offsetB: 22440)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfRetType", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# marks return types in proc (used to detect type classes\", line: 584, col: 6, offsetA: 22461, offsetB: 22518)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# used as return types for return type inference)\", line: 585, col: 6, offsetA: 22525, offsetB: 22574)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfCapturesEnv", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# whether proc really captures some environment\", line: 586, col: 18, offsetA: 22593, offsetB: 22640)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfByCopy", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# pass object/tuple by copy (C backend)\", line: 587, col: 13, offsetA: 22654, offsetB: 22693)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfByRef", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# pass object/tuple by reference (C backend)\", line: 588, col: 12, offsetA: 22706, offsetB: 22750)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfIterator", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# type is really an iterator, not a tyProc\", line: 589, col: 15, offsetA: 22766, offsetB: 22808)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfPartial", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# type is declared as \\\'partial\\\'\", line: 590, col: 14, offsetA: 22823, offsetB: 22854)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfNotNil", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# type cannot be \\\'nil\\\'\", line: 591, col: 13, offsetA: 22868, offsetB: 22890)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfRequiresInit", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# type constains a \\\"not nil\\\" constraint somewhere or\", line: 593, col: 6, offsetA: 22916, offsetB: 22968)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a `requiresInit` field, so the default zero init\", line: 594, col: 6, offsetA: 22975, offsetB: 23025)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# is not appropriate\", line: 595, col: 6, offsetA: 23032, offsetB: 23052)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfNeedsFullInit", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# object type marked with {.requiresInit.}\", line: 597, col: 6, offsetA: 23079, offsetB: 23121)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# all fields must be initialized\", line: 598, col: 6, offsetA: 23128, offsetB: 23160)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfVarIsPtr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \\\'var\\\' type is translated like \\\'ptr\\\' even in C++ mode\", line: 599, col: 15, offsetA: 23176, offsetB: 23230)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfHasMeta", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# type contains \\\"wildcard\\\" sub-types such as generic params\", line: 601, col: 6, offsetA: 23251, offsetB: 23310)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# or other type classes\", line: 602, col: 6, offsetA: 23317, offsetB: 23340)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfHasGCedMem", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# type contains GC\\\'ed memory\", line: 603, col: 17, offsetA: 23358, offsetB: 23386)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfPacked" + }, + { + "kind": "nkIdent", + "ident": "tfHasStatic" + }, + { + "kind": "nkIdent", + "ident": "tfGenericTypeParam" + }, + { + "kind": "nkIdent", + "ident": "tfImplicitTypeParam" + }, + { + "kind": "nkIdent", + "ident": "tfInferrableStatic" + }, + { + "kind": "nkIdent", + "ident": "tfConceptMatchedTypeSym" + }, + { + "kind": "nkIdent", + "ident": "tfExplicit", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for typedescs, marks types explicitly prefixed with the\", line: 611, col: 6, offsetA: 23535, offsetB: 23592)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# `type` operator (e.g. type int)\", line: 612, col: 6, offsetA: 23599, offsetB: 23632)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfWildcard", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# consider a proc like foo[T, I](x: Type[T, I])\", line: 614, col: 6, offsetA: 23654, offsetB: 23701)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# T and I here can bind to both typedesc and static types\", line: 615, col: 6, offsetA: 23708, offsetB: 23765)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# before this is determined, we\\\'ll consider them to be a\", line: 616, col: 6, offsetA: 23772, offsetB: 23828)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# wildcard type.\", line: 617, col: 6, offsetA: 23835, offsetB: 23851)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfHasAsgn", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# type has overloaded assignment operator\", line: 618, col: 14, offsetA: 23866, offsetB: 23907)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfBorrowDot", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# distinct type borrows \\\'.\\\'\", line: 619, col: 16, offsetA: 23924, offsetB: 23951)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfTriggersCompileTime", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# uses the NimNode type which make the proc\", line: 621, col: 6, offsetA: 23984, offsetB: 24027)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# implicitly \\\'.compiletime\\\'\", line: 622, col: 6, offsetA: 24034, offsetB: 24061)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfRefsAnonObj", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# used for \\\'ref object\\\' and \\\'ptr object\\\'\", line: 623, col: 18, offsetA: 24080, offsetB: 24120)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfCovariant", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# covariant generic param mimicking a ptr type\", line: 624, col: 16, offsetA: 24137, offsetB: 24183)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfWeakCovariant", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# covariant generic param mimicking a seq/array type\", line: 625, col: 20, offsetA: 24204, offsetB: 24256)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfContravariant", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# contravariant generic param\", line: 626, col: 20, offsetA: 24277, offsetB: 24306)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfCheckedForDestructor", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# type was checked for having a destructor.\", line: 628, col: 6, offsetA: 24340, offsetB: 24383)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# If it has one, t.destructor is not nil.\", line: 629, col: 6, offsetA: 24390, offsetB: 24431)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfAcyclic", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# object type was annotated as .acyclic\", line: 630, col: 14, offsetA: 24446, offsetB: 24485)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfIncompleteStruct", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# treat this type as if it had sizeof(pointer)\", line: 631, col: 23, offsetA: 24509, offsetB: 24555)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfCompleteStruct", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# (for importc types); type is fully specified, allowing to compute\", line: 633, col: 6, offsetA: 24583, offsetB: 24650)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# sizeof, alignof, offsetof at CT\", line: 634, col: 6, offsetA: 24657, offsetB: 24690)" + ] + }, + { + "kind": "nkIdent", + "ident": "tfExplicitCallConv" + }, + { + "kind": "nkIdent", + "ident": "tfIsConstructor" + }, + { + "kind": "nkIdent", + "ident": "tfEffectSystemWorkaround" + }, + { + "kind": "nkIdent", + "ident": "tfIsOutParam" + }, + { + "kind": "nkIdent", + "ident": "tfSendable" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TTypeFlags" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "TTypeFlag" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TSymKind" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the different symbols (start with the prefix sk);\", line: 643, col: 4, offsetA: 24850, offsetB: 24901)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# order is important for the documentation generator!\", line: 644, col: 4, offsetA: 24906, offsetB: 24959)" + ], + "ident": "skUnknown", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# unknown symbol: used for parsing assembler blocks\", line: 646, col: 6, offsetA: 24980, offsetB: 25031)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# and first phase symbol lookup in generics\", line: 647, col: 6, offsetA: 25038, offsetB: 25081)" + ] + }, + { + "kind": "nkIdent", + "ident": "skConditional", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol for the preprocessor (may become obsolete)\", line: 648, col: 18, offsetA: 25100, offsetB: 25151)" + ] + }, + { + "kind": "nkIdent", + "ident": "skDynLib", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol represents a dynamic library; this is used\", line: 650, col: 6, offsetA: 25171, offsetB: 25222)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# internally; it does not exist in Nim code\", line: 651, col: 6, offsetA: 25229, offsetB: 25272)" + ] + }, + { + "kind": "nkIdent", + "ident": "skParam", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a parameter\", line: 652, col: 12, offsetA: 25285, offsetB: 25298)" + ] + }, + { + "kind": "nkIdent", + "ident": "skGenericParam", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a generic parameter; eq in ``proc x[eq=`==`]()``\", line: 653, col: 19, offsetA: 25318, offsetB: 25368)" + ] + }, + { + "kind": "nkIdent", + "ident": "skTemp", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a temporary variable (introduced by compiler)\", line: 654, col: 11, offsetA: 25380, offsetB: 25427)" + ] + }, + { + "kind": "nkIdent", + "ident": "skModule", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# module identifier\", line: 655, col: 13, offsetA: 25441, offsetB: 25460)" + ] + }, + { + "kind": "nkIdent", + "ident": "skType", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a type\", line: 656, col: 11, offsetA: 25472, offsetB: 25480)" + ] + }, + { + "kind": "nkIdent", + "ident": "skVar", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a variable\", line: 657, col: 10, offsetA: 25491, offsetB: 25503)" + ] + }, + { + "kind": "nkIdent", + "ident": "skLet", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a \\\'let\\\' symbol\", line: 658, col: 10, offsetA: 25514, offsetB: 25530)" + ] + }, + { + "kind": "nkIdent", + "ident": "skConst", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a constant\", line: 659, col: 12, offsetA: 25543, offsetB: 25555)" + ] + }, + { + "kind": "nkIdent", + "ident": "skResult", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# special \\\'result\\\' variable\", line: 660, col: 13, offsetA: 25569, offsetB: 25596)" + ] + }, + { + "kind": "nkIdent", + "ident": "skProc", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a proc\", line: 661, col: 11, offsetA: 25608, offsetB: 25616)" + ] + }, + { + "kind": "nkIdent", + "ident": "skFunc", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a func\", line: 662, col: 11, offsetA: 25628, offsetB: 25636)" + ] + }, + { + "kind": "nkIdent", + "ident": "skMethod", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a method\", line: 663, col: 13, offsetA: 25650, offsetB: 25660)" + ] + }, + { + "kind": "nkIdent", + "ident": "skIterator", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an iterator\", line: 664, col: 15, offsetA: 25676, offsetB: 25689)" + ] + }, + { + "kind": "nkIdent", + "ident": "skConverter", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a type converter\", line: 665, col: 16, offsetA: 25706, offsetB: 25724)" + ] + }, + { + "kind": "nkIdent", + "ident": "skMacro", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a macro\", line: 666, col: 12, offsetA: 25737, offsetB: 25746)" + ] + }, + { + "kind": "nkIdent", + "ident": "skTemplate", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a template; currently also misused for user-defined\", line: 668, col: 6, offsetA: 25768, offsetB: 25821)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# pragmas\", line: 669, col: 6, offsetA: 25828, offsetB: 25837)" + ] + }, + { + "kind": "nkIdent", + "ident": "skField", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a field in a record or object\", line: 670, col: 12, offsetA: 25850, offsetB: 25881)" + ] + }, + { + "kind": "nkIdent", + "ident": "skEnumField", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an identifier in an enum\", line: 671, col: 16, offsetA: 25898, offsetB: 25924)" + ] + }, + { + "kind": "nkIdent", + "ident": "skForVar", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a for loop variable\", line: 672, col: 13, offsetA: 25938, offsetB: 25959)" + ] + }, + { + "kind": "nkIdent", + "ident": "skLabel", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a label (for block statement)\", line: 673, col: 12, offsetA: 25972, offsetB: 26003)" + ] + }, + { + "kind": "nkIdent", + "ident": "skStub", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol is a stub and not yet loaded from the ROD\", line: 675, col: 6, offsetA: 26021, offsetB: 26071)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# file (it is loaded on demand, which may\", line: 676, col: 6, offsetA: 26078, offsetB: 26119)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# mean: never)\", line: 677, col: 6, offsetA: 26126, offsetB: 26140)" + ] + }, + { + "kind": "nkIdent", + "ident": "skPackage", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbol is a package (used for canonicalization)\", line: 678, col: 14, offsetA: 26155, offsetB: 26204)" + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TSymKinds" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "TSymKind" + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "routineKinds" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "skProc" + }, + { + "kind": "nkIdent", + "ident": "skFunc" + }, + { + "kind": "nkIdent", + "ident": "skMethod" + }, + { + "kind": "nkIdent", + "ident": "skIterator" + }, + { + "kind": "nkIdent", + "ident": "skConverter" + }, + { + "kind": "nkIdent", + "ident": "skMacro" + }, + { + "kind": "nkIdent", + "ident": "skTemplate" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "ExportableSymKinds" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "skVar" + }, + { + "kind": "nkIdent", + "ident": "skLet" + }, + { + "kind": "nkIdent", + "ident": "skConst" + }, + { + "kind": "nkIdent", + "ident": "skType" + }, + { + "kind": "nkIdent", + "ident": "skEnumField" + }, + { + "kind": "nkIdent", + "ident": "skStub" + } + ] + }, + { + "kind": "nkIdent", + "ident": "routineKinds" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "tfUnion" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "tfNoSideEffect" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "tfGcSafe" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "tfThread" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "tfObjHasKids" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "tfEnumHasHoles" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "tfReturnsNew" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "tfInheritable" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "skError" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "skUnknown" + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "eqTypeFlags" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tfIterator" + }, + { + "kind": "nkIdent", + "ident": "tfNotNil" + }, + { + "kind": "nkIdent", + "ident": "tfVarIsPtr" + }, + { + "kind": "nkIdent", + "ident": "tfGcSafe" + }, + { + "kind": "nkIdent", + "ident": "tfNoSideEffect" + }, + { + "kind": "nkIdent", + "ident": "tfIsOutParam" + }, + { + "kind": "nkIdent", + "ident": "tfSendable" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## type flags that are essential for type equality.\", line: 695, col: 2, offsetA: 26683, offsetB: 26734)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## This is now a variable because for emulation of version:1.0 we\", line: 696, col: 2, offsetA: 26737, offsetB: 26802)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## might exclude {tfGcSafe, tfNoSideEffect}.\", line: 697, col: 2, offsetA: 26805, offsetB: 26849)" + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TMagic" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# symbols that require compiler magic:\", line: 700, col: 17, offsetA: 26873, offsetB: 26911)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "mNone" + }, + { + "kind": "nkIdent", + "ident": "mDefined" + }, + { + "kind": "nkIdent", + "ident": "mDeclared" + }, + { + "kind": "nkIdent", + "ident": "mDeclaredInScope" + }, + { + "kind": "nkIdent", + "ident": "mCompiles" + }, + { + "kind": "nkIdent", + "ident": "mArrGet" + }, + { + "kind": "nkIdent", + "ident": "mArrPut" + }, + { + "kind": "nkIdent", + "ident": "mAsgn" + }, + { + "kind": "nkIdent", + "ident": "mLow" + }, + { + "kind": "nkIdent", + "ident": "mHigh" + }, + { + "kind": "nkIdent", + "ident": "mSizeOf" + }, + { + "kind": "nkIdent", + "ident": "mAlignOf" + }, + { + "kind": "nkIdent", + "ident": "mOffsetOf" + }, + { + "kind": "nkIdent", + "ident": "mTypeTrait" + }, + { + "kind": "nkIdent", + "ident": "mIs" + }, + { + "kind": "nkIdent", + "ident": "mOf" + }, + { + "kind": "nkIdent", + "ident": "mAddr" + }, + { + "kind": "nkIdent", + "ident": "mType" + }, + { + "kind": "nkIdent", + "ident": "mTypeOf" + }, + { + "kind": "nkIdent", + "ident": "mPlugin" + }, + { + "kind": "nkIdent", + "ident": "mEcho" + }, + { + "kind": "nkIdent", + "ident": "mShallowCopy" + }, + { + "kind": "nkIdent", + "ident": "mSlurp" + }, + { + "kind": "nkIdent", + "ident": "mStaticExec" + }, + { + "kind": "nkIdent", + "ident": "mStatic" + }, + { + "kind": "nkIdent", + "ident": "mParseExprToAst" + }, + { + "kind": "nkIdent", + "ident": "mParseStmtToAst" + }, + { + "kind": "nkIdent", + "ident": "mExpandToAst" + }, + { + "kind": "nkIdent", + "ident": "mQuoteAst" + }, + { + "kind": "nkIdent", + "ident": "mInc" + }, + { + "kind": "nkIdent", + "ident": "mDec" + }, + { + "kind": "nkIdent", + "ident": "mOrd" + }, + { + "kind": "nkIdent", + "ident": "mNew" + }, + { + "kind": "nkIdent", + "ident": "mNewFinalize" + }, + { + "kind": "nkIdent", + "ident": "mNewSeq" + }, + { + "kind": "nkIdent", + "ident": "mNewSeqOfCap" + }, + { + "kind": "nkIdent", + "ident": "mLengthOpenArray" + }, + { + "kind": "nkIdent", + "ident": "mLengthStr" + }, + { + "kind": "nkIdent", + "ident": "mLengthArray" + }, + { + "kind": "nkIdent", + "ident": "mLengthSeq" + }, + { + "kind": "nkIdent", + "ident": "mIncl" + }, + { + "kind": "nkIdent", + "ident": "mExcl" + }, + { + "kind": "nkIdent", + "ident": "mCard" + }, + { + "kind": "nkIdent", + "ident": "mChr" + }, + { + "kind": "nkIdent", + "ident": "mGCref" + }, + { + "kind": "nkIdent", + "ident": "mGCunref" + }, + { + "kind": "nkIdent", + "ident": "mAddI" + }, + { + "kind": "nkIdent", + "ident": "mSubI" + }, + { + "kind": "nkIdent", + "ident": "mMulI" + }, + { + "kind": "nkIdent", + "ident": "mDivI" + }, + { + "kind": "nkIdent", + "ident": "mModI" + }, + { + "kind": "nkIdent", + "ident": "mSucc" + }, + { + "kind": "nkIdent", + "ident": "mPred" + }, + { + "kind": "nkIdent", + "ident": "mAddF64" + }, + { + "kind": "nkIdent", + "ident": "mSubF64" + }, + { + "kind": "nkIdent", + "ident": "mMulF64" + }, + { + "kind": "nkIdent", + "ident": "mDivF64" + }, + { + "kind": "nkIdent", + "ident": "mShrI" + }, + { + "kind": "nkIdent", + "ident": "mShlI" + }, + { + "kind": "nkIdent", + "ident": "mAshrI" + }, + { + "kind": "nkIdent", + "ident": "mBitandI" + }, + { + "kind": "nkIdent", + "ident": "mBitorI" + }, + { + "kind": "nkIdent", + "ident": "mBitxorI" + }, + { + "kind": "nkIdent", + "ident": "mMinI" + }, + { + "kind": "nkIdent", + "ident": "mMaxI" + }, + { + "kind": "nkIdent", + "ident": "mAddU" + }, + { + "kind": "nkIdent", + "ident": "mSubU" + }, + { + "kind": "nkIdent", + "ident": "mMulU" + }, + { + "kind": "nkIdent", + "ident": "mDivU" + }, + { + "kind": "nkIdent", + "ident": "mModU" + }, + { + "kind": "nkIdent", + "ident": "mEqI" + }, + { + "kind": "nkIdent", + "ident": "mLeI" + }, + { + "kind": "nkIdent", + "ident": "mLtI" + }, + { + "kind": "nkIdent", + "ident": "mEqF64" + }, + { + "kind": "nkIdent", + "ident": "mLeF64" + }, + { + "kind": "nkIdent", + "ident": "mLtF64" + }, + { + "kind": "nkIdent", + "ident": "mLeU" + }, + { + "kind": "nkIdent", + "ident": "mLtU" + }, + { + "kind": "nkIdent", + "ident": "mEqEnum" + }, + { + "kind": "nkIdent", + "ident": "mLeEnum" + }, + { + "kind": "nkIdent", + "ident": "mLtEnum" + }, + { + "kind": "nkIdent", + "ident": "mEqCh" + }, + { + "kind": "nkIdent", + "ident": "mLeCh" + }, + { + "kind": "nkIdent", + "ident": "mLtCh" + }, + { + "kind": "nkIdent", + "ident": "mEqB" + }, + { + "kind": "nkIdent", + "ident": "mLeB" + }, + { + "kind": "nkIdent", + "ident": "mLtB" + }, + { + "kind": "nkIdent", + "ident": "mEqRef" + }, + { + "kind": "nkIdent", + "ident": "mLePtr" + }, + { + "kind": "nkIdent", + "ident": "mLtPtr" + }, + { + "kind": "nkIdent", + "ident": "mXor" + }, + { + "kind": "nkIdent", + "ident": "mEqCString" + }, + { + "kind": "nkIdent", + "ident": "mEqProc" + }, + { + "kind": "nkIdent", + "ident": "mUnaryMinusI" + }, + { + "kind": "nkIdent", + "ident": "mUnaryMinusI64" + }, + { + "kind": "nkIdent", + "ident": "mAbsI" + }, + { + "kind": "nkIdent", + "ident": "mNot" + }, + { + "kind": "nkIdent", + "ident": "mUnaryPlusI" + }, + { + "kind": "nkIdent", + "ident": "mBitnotI" + }, + { + "kind": "nkIdent", + "ident": "mUnaryPlusF64" + }, + { + "kind": "nkIdent", + "ident": "mUnaryMinusF64" + }, + { + "kind": "nkIdent", + "ident": "mCharToStr" + }, + { + "kind": "nkIdent", + "ident": "mBoolToStr" + }, + { + "kind": "nkIdent", + "ident": "mIntToStr" + }, + { + "kind": "nkIdent", + "ident": "mInt64ToStr" + }, + { + "kind": "nkIdent", + "ident": "mFloatToStr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for compiling nimStdlibVersion < 1.5.1 (not bootstrapping)\", line: 806, col: 16, offsetA: 28195, offsetB: 28255)" + ] + }, + { + "kind": "nkIdent", + "ident": "mCStrToStr" + }, + { + "kind": "nkIdent", + "ident": "mStrToStr" + }, + { + "kind": "nkIdent", + "ident": "mEnumToStr" + }, + { + "kind": "nkIdent", + "ident": "mAnd" + }, + { + "kind": "nkIdent", + "ident": "mOr" + }, + { + "kind": "nkIdent", + "ident": "mImplies" + }, + { + "kind": "nkIdent", + "ident": "mIff" + }, + { + "kind": "nkIdent", + "ident": "mExists" + }, + { + "kind": "nkIdent", + "ident": "mForall" + }, + { + "kind": "nkIdent", + "ident": "mOld" + }, + { + "kind": "nkIdent", + "ident": "mEqStr" + }, + { + "kind": "nkIdent", + "ident": "mLeStr" + }, + { + "kind": "nkIdent", + "ident": "mLtStr" + }, + { + "kind": "nkIdent", + "ident": "mEqSet" + }, + { + "kind": "nkIdent", + "ident": "mLeSet" + }, + { + "kind": "nkIdent", + "ident": "mLtSet" + }, + { + "kind": "nkIdent", + "ident": "mMulSet" + }, + { + "kind": "nkIdent", + "ident": "mPlusSet" + }, + { + "kind": "nkIdent", + "ident": "mMinusSet" + }, + { + "kind": "nkIdent", + "ident": "mConStrStr" + }, + { + "kind": "nkIdent", + "ident": "mSlice" + }, + { + "kind": "nkIdent", + "ident": "mDotDot", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# this one is only necessary to give nice compile time warnings\", line: 828, col: 12, offsetA: 28515, offsetB: 28578)" + ] + }, + { + "kind": "nkIdent", + "ident": "mFields" + }, + { + "kind": "nkIdent", + "ident": "mFieldPairs" + }, + { + "kind": "nkIdent", + "ident": "mOmpParFor" + }, + { + "kind": "nkIdent", + "ident": "mAppendStrCh" + }, + { + "kind": "nkIdent", + "ident": "mAppendStrStr" + }, + { + "kind": "nkIdent", + "ident": "mAppendSeqElem" + }, + { + "kind": "nkIdent", + "ident": "mInSet" + }, + { + "kind": "nkIdent", + "ident": "mRepr" + }, + { + "kind": "nkIdent", + "ident": "mExit" + }, + { + "kind": "nkIdent", + "ident": "mSetLengthStr" + }, + { + "kind": "nkIdent", + "ident": "mSetLengthSeq" + }, + { + "kind": "nkIdent", + "ident": "mIsPartOf" + }, + { + "kind": "nkIdent", + "ident": "mAstToStr" + }, + { + "kind": "nkIdent", + "ident": "mParallel" + }, + { + "kind": "nkIdent", + "ident": "mSwap" + }, + { + "kind": "nkIdent", + "ident": "mIsNil" + }, + { + "kind": "nkIdent", + "ident": "mArrToSeq" + }, + { + "kind": "nkIdent", + "ident": "mOpenArrayToSeq" + }, + { + "kind": "nkIdent", + "ident": "mNewString" + }, + { + "kind": "nkIdent", + "ident": "mNewStringOfCap" + }, + { + "kind": "nkIdent", + "ident": "mParseBiggestFloat" + }, + { + "kind": "nkIdent", + "ident": "mMove" + }, + { + "kind": "nkIdent", + "ident": "mEnsureMove" + }, + { + "kind": "nkIdent", + "ident": "mWasMoved" + }, + { + "kind": "nkIdent", + "ident": "mDup" + }, + { + "kind": "nkIdent", + "ident": "mDestroy" + }, + { + "kind": "nkIdent", + "ident": "mTrace" + }, + { + "kind": "nkIdent", + "ident": "mDefault" + }, + { + "kind": "nkIdent", + "ident": "mUnown" + }, + { + "kind": "nkIdent", + "ident": "mFinished" + }, + { + "kind": "nkIdent", + "ident": "mIsolate" + }, + { + "kind": "nkIdent", + "ident": "mAccessEnv" + }, + { + "kind": "nkIdent", + "ident": "mAccessTypeField" + }, + { + "kind": "nkIdent", + "ident": "mReset" + }, + { + "kind": "nkIdent", + "ident": "mArray" + }, + { + "kind": "nkIdent", + "ident": "mOpenArray" + }, + { + "kind": "nkIdent", + "ident": "mRange" + }, + { + "kind": "nkIdent", + "ident": "mSet" + }, + { + "kind": "nkIdent", + "ident": "mSeq" + }, + { + "kind": "nkIdent", + "ident": "mVarargs" + }, + { + "kind": "nkIdent", + "ident": "mRef" + }, + { + "kind": "nkIdent", + "ident": "mPtr" + }, + { + "kind": "nkIdent", + "ident": "mVar" + }, + { + "kind": "nkIdent", + "ident": "mDistinct" + }, + { + "kind": "nkIdent", + "ident": "mVoid" + }, + { + "kind": "nkIdent", + "ident": "mTuple" + }, + { + "kind": "nkIdent", + "ident": "mOrdinal" + }, + { + "kind": "nkIdent", + "ident": "mIterableType" + }, + { + "kind": "nkIdent", + "ident": "mInt" + }, + { + "kind": "nkIdent", + "ident": "mInt8" + }, + { + "kind": "nkIdent", + "ident": "mInt16" + }, + { + "kind": "nkIdent", + "ident": "mInt32" + }, + { + "kind": "nkIdent", + "ident": "mInt64" + }, + { + "kind": "nkIdent", + "ident": "mUInt" + }, + { + "kind": "nkIdent", + "ident": "mUInt8" + }, + { + "kind": "nkIdent", + "ident": "mUInt16" + }, + { + "kind": "nkIdent", + "ident": "mUInt32" + }, + { + "kind": "nkIdent", + "ident": "mUInt64" + }, + { + "kind": "nkIdent", + "ident": "mFloat" + }, + { + "kind": "nkIdent", + "ident": "mFloat32" + }, + { + "kind": "nkIdent", + "ident": "mFloat64" + }, + { + "kind": "nkIdent", + "ident": "mFloat128" + }, + { + "kind": "nkIdent", + "ident": "mBool" + }, + { + "kind": "nkIdent", + "ident": "mChar" + }, + { + "kind": "nkIdent", + "ident": "mString" + }, + { + "kind": "nkIdent", + "ident": "mCstring" + }, + { + "kind": "nkIdent", + "ident": "mPointer" + }, + { + "kind": "nkIdent", + "ident": "mNil" + }, + { + "kind": "nkIdent", + "ident": "mExpr" + }, + { + "kind": "nkIdent", + "ident": "mStmt" + }, + { + "kind": "nkIdent", + "ident": "mTypeDesc" + }, + { + "kind": "nkIdent", + "ident": "mVoidType" + }, + { + "kind": "nkIdent", + "ident": "mPNimrodNode" + }, + { + "kind": "nkIdent", + "ident": "mSpawn" + }, + { + "kind": "nkIdent", + "ident": "mDeepCopy" + }, + { + "kind": "nkIdent", + "ident": "mIsMainModule" + }, + { + "kind": "nkIdent", + "ident": "mCompileDate" + }, + { + "kind": "nkIdent", + "ident": "mCompileTime" + }, + { + "kind": "nkIdent", + "ident": "mProcCall" + }, + { + "kind": "nkIdent", + "ident": "mCpuEndian" + }, + { + "kind": "nkIdent", + "ident": "mHostOS" + }, + { + "kind": "nkIdent", + "ident": "mHostCPU" + }, + { + "kind": "nkIdent", + "ident": "mBuildOS" + }, + { + "kind": "nkIdent", + "ident": "mBuildCPU" + }, + { + "kind": "nkIdent", + "ident": "mAppType" + }, + { + "kind": "nkIdent", + "ident": "mCompileOption" + }, + { + "kind": "nkIdent", + "ident": "mCompileOptionArg" + }, + { + "kind": "nkIdent", + "ident": "mNLen" + }, + { + "kind": "nkIdent", + "ident": "mNChild" + }, + { + "kind": "nkIdent", + "ident": "mNSetChild" + }, + { + "kind": "nkIdent", + "ident": "mNAdd" + }, + { + "kind": "nkIdent", + "ident": "mNAddMultiple" + }, + { + "kind": "nkIdent", + "ident": "mNDel" + }, + { + "kind": "nkIdent", + "ident": "mNKind" + }, + { + "kind": "nkIdent", + "ident": "mNSymKind" + }, + { + "kind": "nkIdent", + "ident": "mNccValue" + }, + { + "kind": "nkIdent", + "ident": "mNccInc" + }, + { + "kind": "nkIdent", + "ident": "mNcsAdd" + }, + { + "kind": "nkIdent", + "ident": "mNcsIncl" + }, + { + "kind": "nkIdent", + "ident": "mNcsLen" + }, + { + "kind": "nkIdent", + "ident": "mNcsAt" + }, + { + "kind": "nkIdent", + "ident": "mNctPut" + }, + { + "kind": "nkIdent", + "ident": "mNctLen" + }, + { + "kind": "nkIdent", + "ident": "mNctGet" + }, + { + "kind": "nkIdent", + "ident": "mNctHasNext" + }, + { + "kind": "nkIdent", + "ident": "mNctNext" + }, + { + "kind": "nkIdent", + "ident": "mNIntVal" + }, + { + "kind": "nkIdent", + "ident": "mNFloatVal" + }, + { + "kind": "nkIdent", + "ident": "mNSymbol" + }, + { + "kind": "nkIdent", + "ident": "mNIdent" + }, + { + "kind": "nkIdent", + "ident": "mNGetType" + }, + { + "kind": "nkIdent", + "ident": "mNStrVal" + }, + { + "kind": "nkIdent", + "ident": "mNSetIntVal" + }, + { + "kind": "nkIdent", + "ident": "mNSetFloatVal" + }, + { + "kind": "nkIdent", + "ident": "mNSetSymbol" + }, + { + "kind": "nkIdent", + "ident": "mNSetIdent" + }, + { + "kind": "nkIdent", + "ident": "mNSetStrVal" + }, + { + "kind": "nkIdent", + "ident": "mNLineInfo" + }, + { + "kind": "nkIdent", + "ident": "mNNewNimNode" + }, + { + "kind": "nkIdent", + "ident": "mNCopyNimNode" + }, + { + "kind": "nkIdent", + "ident": "mNCopyNimTree" + }, + { + "kind": "nkIdent", + "ident": "mStrToIdent" + }, + { + "kind": "nkIdent", + "ident": "mNSigHash" + }, + { + "kind": "nkIdent", + "ident": "mNSizeOf" + }, + { + "kind": "nkIdent", + "ident": "mNBindSym" + }, + { + "kind": "nkIdent", + "ident": "mNCallSite" + }, + { + "kind": "nkIdent", + "ident": "mEqIdent" + }, + { + "kind": "nkIdent", + "ident": "mEqNimrodNode" + }, + { + "kind": "nkIdent", + "ident": "mSameNodeType" + }, + { + "kind": "nkIdent", + "ident": "mGetImpl" + }, + { + "kind": "nkIdent", + "ident": "mNGenSym" + }, + { + "kind": "nkIdent", + "ident": "mNHint" + }, + { + "kind": "nkIdent", + "ident": "mNWarning" + }, + { + "kind": "nkIdent", + "ident": "mNError" + }, + { + "kind": "nkIdent", + "ident": "mInstantiationInfo" + }, + { + "kind": "nkIdent", + "ident": "mGetTypeInfo" + }, + { + "kind": "nkIdent", + "ident": "mGetTypeInfoV2" + }, + { + "kind": "nkIdent", + "ident": "mNimvm" + }, + { + "kind": "nkIdent", + "ident": "mIntDefine" + }, + { + "kind": "nkIdent", + "ident": "mStrDefine" + }, + { + "kind": "nkIdent", + "ident": "mBoolDefine" + }, + { + "kind": "nkIdent", + "ident": "mGenericDefine" + }, + { + "kind": "nkIdent", + "ident": "mRunnableExamples" + }, + { + "kind": "nkIdent", + "ident": "mException" + }, + { + "kind": "nkIdent", + "ident": "mBuiltinType" + }, + { + "kind": "nkIdent", + "ident": "mSymOwner" + }, + { + "kind": "nkIdent", + "ident": "mUncheckedArray" + }, + { + "kind": "nkIdent", + "ident": "mGetImplTransf" + }, + { + "kind": "nkIdent", + "ident": "mSymIsInstantiationOf" + }, + { + "kind": "nkIdent", + "ident": "mNodeId" + }, + { + "kind": "nkIdent", + "ident": "mPrivateAccess" + }, + { + "kind": "nkIdent", + "ident": "mZeroDefault" + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# things that we can evaluate safely at compile time, even if not asked for it:\", line: 983, col: 2, offsetA: 30711, offsetB: 30790)" + ], + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "ctfeWhitelist" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "mNone" + }, + { + "kind": "nkIdent", + "ident": "mSucc" + }, + { + "kind": "nkIdent", + "ident": "mPred" + }, + { + "kind": "nkIdent", + "ident": "mInc" + }, + { + "kind": "nkIdent", + "ident": "mDec" + }, + { + "kind": "nkIdent", + "ident": "mOrd" + }, + { + "kind": "nkIdent", + "ident": "mLengthOpenArray" + }, + { + "kind": "nkIdent", + "ident": "mLengthStr" + }, + { + "kind": "nkIdent", + "ident": "mLengthArray" + }, + { + "kind": "nkIdent", + "ident": "mLengthSeq" + }, + { + "kind": "nkIdent", + "ident": "mArrGet" + }, + { + "kind": "nkIdent", + "ident": "mArrPut" + }, + { + "kind": "nkIdent", + "ident": "mAsgn" + }, + { + "kind": "nkIdent", + "ident": "mDestroy" + }, + { + "kind": "nkIdent", + "ident": "mIncl" + }, + { + "kind": "nkIdent", + "ident": "mExcl" + }, + { + "kind": "nkIdent", + "ident": "mCard" + }, + { + "kind": "nkIdent", + "ident": "mChr" + }, + { + "kind": "nkIdent", + "ident": "mAddI" + }, + { + "kind": "nkIdent", + "ident": "mSubI" + }, + { + "kind": "nkIdent", + "ident": "mMulI" + }, + { + "kind": "nkIdent", + "ident": "mDivI" + }, + { + "kind": "nkIdent", + "ident": "mModI" + }, + { + "kind": "nkIdent", + "ident": "mAddF64" + }, + { + "kind": "nkIdent", + "ident": "mSubF64" + }, + { + "kind": "nkIdent", + "ident": "mMulF64" + }, + { + "kind": "nkIdent", + "ident": "mDivF64" + }, + { + "kind": "nkIdent", + "ident": "mShrI" + }, + { + "kind": "nkIdent", + "ident": "mShlI" + }, + { + "kind": "nkIdent", + "ident": "mBitandI" + }, + { + "kind": "nkIdent", + "ident": "mBitorI" + }, + { + "kind": "nkIdent", + "ident": "mBitxorI" + }, + { + "kind": "nkIdent", + "ident": "mMinI" + }, + { + "kind": "nkIdent", + "ident": "mMaxI" + }, + { + "kind": "nkIdent", + "ident": "mAddU" + }, + { + "kind": "nkIdent", + "ident": "mSubU" + }, + { + "kind": "nkIdent", + "ident": "mMulU" + }, + { + "kind": "nkIdent", + "ident": "mDivU" + }, + { + "kind": "nkIdent", + "ident": "mModU" + }, + { + "kind": "nkIdent", + "ident": "mEqI" + }, + { + "kind": "nkIdent", + "ident": "mLeI" + }, + { + "kind": "nkIdent", + "ident": "mLtI" + }, + { + "kind": "nkIdent", + "ident": "mEqF64" + }, + { + "kind": "nkIdent", + "ident": "mLeF64" + }, + { + "kind": "nkIdent", + "ident": "mLtF64" + }, + { + "kind": "nkIdent", + "ident": "mLeU" + }, + { + "kind": "nkIdent", + "ident": "mLtU" + }, + { + "kind": "nkIdent", + "ident": "mEqEnum" + }, + { + "kind": "nkIdent", + "ident": "mLeEnum" + }, + { + "kind": "nkIdent", + "ident": "mLtEnum" + }, + { + "kind": "nkIdent", + "ident": "mEqCh" + }, + { + "kind": "nkIdent", + "ident": "mLeCh" + }, + { + "kind": "nkIdent", + "ident": "mLtCh" + }, + { + "kind": "nkIdent", + "ident": "mEqB" + }, + { + "kind": "nkIdent", + "ident": "mLeB" + }, + { + "kind": "nkIdent", + "ident": "mLtB" + }, + { + "kind": "nkIdent", + "ident": "mEqRef" + }, + { + "kind": "nkIdent", + "ident": "mEqProc" + }, + { + "kind": "nkIdent", + "ident": "mLePtr" + }, + { + "kind": "nkIdent", + "ident": "mLtPtr" + }, + { + "kind": "nkIdent", + "ident": "mEqCString" + }, + { + "kind": "nkIdent", + "ident": "mXor" + }, + { + "kind": "nkIdent", + "ident": "mUnaryMinusI" + }, + { + "kind": "nkIdent", + "ident": "mUnaryMinusI64" + }, + { + "kind": "nkIdent", + "ident": "mAbsI" + }, + { + "kind": "nkIdent", + "ident": "mNot" + }, + { + "kind": "nkIdent", + "ident": "mUnaryPlusI" + }, + { + "kind": "nkIdent", + "ident": "mBitnotI" + }, + { + "kind": "nkIdent", + "ident": "mUnaryPlusF64" + }, + { + "kind": "nkIdent", + "ident": "mUnaryMinusF64" + }, + { + "kind": "nkIdent", + "ident": "mCharToStr" + }, + { + "kind": "nkIdent", + "ident": "mBoolToStr" + }, + { + "kind": "nkIdent", + "ident": "mIntToStr" + }, + { + "kind": "nkIdent", + "ident": "mInt64ToStr" + }, + { + "kind": "nkIdent", + "ident": "mFloatToStr" + }, + { + "kind": "nkIdent", + "ident": "mCStrToStr" + }, + { + "kind": "nkIdent", + "ident": "mStrToStr" + }, + { + "kind": "nkIdent", + "ident": "mEnumToStr" + }, + { + "kind": "nkIdent", + "ident": "mAnd" + }, + { + "kind": "nkIdent", + "ident": "mOr" + }, + { + "kind": "nkIdent", + "ident": "mEqStr" + }, + { + "kind": "nkIdent", + "ident": "mLeStr" + }, + { + "kind": "nkIdent", + "ident": "mLtStr" + }, + { + "kind": "nkIdent", + "ident": "mEqSet" + }, + { + "kind": "nkIdent", + "ident": "mLeSet" + }, + { + "kind": "nkIdent", + "ident": "mLtSet" + }, + { + "kind": "nkIdent", + "ident": "mMulSet" + }, + { + "kind": "nkIdent", + "ident": "mPlusSet" + }, + { + "kind": "nkIdent", + "ident": "mMinusSet" + }, + { + "kind": "nkIdent", + "ident": "mConStrStr" + }, + { + "kind": "nkIdent", + "ident": "mAppendStrCh" + }, + { + "kind": "nkIdent", + "ident": "mAppendStrStr" + }, + { + "kind": "nkIdent", + "ident": "mAppendSeqElem" + }, + { + "kind": "nkIdent", + "ident": "mInSet" + }, + { + "kind": "nkIdent", + "ident": "mRepr" + }, + { + "kind": "nkIdent", + "ident": "mOpenArrayToSeq" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "generatedMagics" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "mNone" + }, + { + "kind": "nkIdent", + "ident": "mIsolate" + }, + { + "kind": "nkIdent", + "ident": "mFinished" + }, + { + "kind": "nkIdent", + "ident": "mOpenArrayToSeq" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## magics that are generated as normal procs in the backend\", line: 998, col: 67, offsetA: 31816, offsetB: 31875)" + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "ItemId" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int32" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "item" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int32" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "ItemId" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "(module: " + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ", item: " + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "item" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ")" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "ItemId" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "item" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "item" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "hash" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "ItemId" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "hash" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!&" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "hash" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "item" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!$" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPragmaExpr", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TIdObj" + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "acyclic" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkOfInherit", + "sons": [ + { + "kind": "nkIdent", + "ident": "RootObj" + } + ] + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "itemId" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ItemId" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "PIdObj" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRefTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIdObj" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "PNode" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRefTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TNode" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TNodeSeq" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "PNode" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "PType" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRefTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TType" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "PSym" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRefTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSym" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPragmaExpr", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TNode" + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "final" + }, + { + "kind": "nkIdent", + "ident": "acyclic" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# on a 32bit machine, this takes 32 bytes\", line: 1026, col: 37, offsetA: 32430, offsetB: 32471)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkRecWhen", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "useNodeIds" + } + ] + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TNodeFlags" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkRecCase", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkCharLit" + }, + { + "kind": "nkIdent", + "ident": "nkUInt64Lit" + } + ] + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "BiggestInt" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkFloatLit" + }, + { + "kind": "nkIdent", + "ident": "nkFloat128Lit" + } + ] + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "BiggestFloat" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkStrLit" + }, + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + } + ] + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkSym" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIdent" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PIdent" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TNodeSeq" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkRecWhen", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "nimsuggest" + } + ] + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "endInfo" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "prefix" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# comments leading up to this node\", line: 1047, col: 24, offsetA: 32981, offsetB: 33015)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "mid" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# comments in the middle of the node\", line: 1048, col: 21, offsetA: 33037, offsetB: 33073)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "postfix" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# comments after the node\", line: 1049, col: 25, offsetA: 33099, offsetB: 33124)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TStrTable" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a table[PIdent] of PSym\", line: 1051, col: 22, offsetA: 33148, offsetB: 33173)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "PSym" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TLocKind" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "locNone", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# no location\", line: 1056, col: 12, offsetA: 33245, offsetB: 33258)" + ] + }, + { + "kind": "nkIdent", + "ident": "locTemp", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# temporary location\", line: 1057, col: 12, offsetA: 33271, offsetB: 33291)" + ] + }, + { + "kind": "nkIdent", + "ident": "locLocalVar", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# location is a local variable\", line: 1058, col: 16, offsetA: 33308, offsetB: 33338)" + ] + }, + { + "kind": "nkIdent", + "ident": "locGlobalVar", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# location is a global variable\", line: 1059, col: 17, offsetA: 33356, offsetB: 33387)" + ] + }, + { + "kind": "nkIdent", + "ident": "locParam", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# location is a parameter\", line: 1060, col: 13, offsetA: 33401, offsetB: 33426)" + ] + }, + { + "kind": "nkIdent", + "ident": "locField", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# location is a record field\", line: 1061, col: 13, offsetA: 33440, offsetB: 33468)" + ] + }, + { + "kind": "nkIdent", + "ident": "locExpr", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \\\"location\\\" is really an expression\", line: 1062, col: 12, offsetA: 33481, offsetB: 33517)" + ] + }, + { + "kind": "nkIdent", + "ident": "locProc", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# location is a proc (an address of a procedure)\", line: 1063, col: 12, offsetA: 33530, offsetB: 33578)" + ] + }, + { + "kind": "nkIdent", + "ident": "locData", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# location is a constant\", line: 1064, col: 12, offsetA: 33591, offsetB: 33615)" + ] + }, + { + "kind": "nkIdent", + "ident": "locCall", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# location is a call expression\", line: 1065, col: 12, offsetA: 33628, offsetB: 33659)" + ] + }, + { + "kind": "nkIdent", + "ident": "locOther", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# location is something other\", line: 1066, col: 13, offsetA: 33673, offsetB: 33702)" + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TLocFlag" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "lfIndirect", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# backend introduced a pointer\", line: 1069, col: 15, offsetA: 33738, offsetB: 33768)" + ] + }, + { + "kind": "nkIdent", + "ident": "lfNoDeepCopy", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# no need for a deep copy\", line: 1070, col: 17, offsetA: 33786, offsetB: 33811)" + ] + }, + { + "kind": "nkIdent", + "ident": "lfNoDecl", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# do not declare it in C\", line: 1071, col: 13, offsetA: 33825, offsetB: 33849)" + ] + }, + { + "kind": "nkIdent", + "ident": "lfDynamicLib", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# link symbol to dynamic library\", line: 1072, col: 17, offsetA: 33867, offsetB: 33899)" + ] + }, + { + "kind": "nkIdent", + "ident": "lfExportLib", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# export symbol for dynamic library generation\", line: 1073, col: 16, offsetA: 33916, offsetB: 33962)" + ] + }, + { + "kind": "nkIdent", + "ident": "lfHeader", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# include header file for symbol\", line: 1074, col: 13, offsetA: 33976, offsetB: 34008)" + ] + }, + { + "kind": "nkIdent", + "ident": "lfImportCompilerProc", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ``importc`` of a compilerproc\", line: 1075, col: 25, offsetA: 34034, offsetB: 34065)" + ] + }, + { + "kind": "nkIdent", + "ident": "lfSingleUse", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# no location yet and will only be used once\", line: 1076, col: 16, offsetA: 34082, offsetB: 34126)" + ] + }, + { + "kind": "nkIdent", + "ident": "lfEnforceDeref", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a copyMem is required to dereference if this a\", line: 1078, col: 6, offsetA: 34152, offsetB: 34200)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ptr array due to C array limitations.\", line: 1079, col: 6, offsetA: 34207, offsetB: 34246)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# See #1181, #6422, #11171\", line: 1080, col: 6, offsetA: 34253, offsetB: 34279)" + ] + }, + { + "kind": "nkIdent", + "ident": "lfPrepareForMutation", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# string location is about to be mutated (V2)\", line: 1081, col: 25, offsetA: 34305, offsetB: 34350)" + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TStorageLoc" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "OnUnknown", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# location is unknown (stack, heap or static)\", line: 1084, col: 14, offsetA: 34388, offsetB: 34433)" + ] + }, + { + "kind": "nkIdent", + "ident": "OnStatic", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# in a static section\", line: 1085, col: 13, offsetA: 34447, offsetB: 34468)" + ] + }, + { + "kind": "nkIdent", + "ident": "OnStack", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# location is on hardware stack\", line: 1086, col: 12, offsetA: 34481, offsetB: 34512)" + ] + }, + { + "kind": "nkIdent", + "ident": "OnHeap", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# location is on heap or global\", line: 1088, col: 6, offsetA: 34530, offsetB: 34561)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# (reference counting needed)\", line: 1089, col: 6, offsetA: 34568, offsetB: 34597)" + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TLocFlags" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "TLocFlag" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TLoc" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "k" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TLocKind" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# kind of location\", line: 1093, col: 17, offsetA: 34662, offsetB: 34680)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "storage" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TStorageLoc" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TLocFlags" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# location\\\'s flags\", line: 1095, col: 22, offsetA: 34729, offsetB: 34747)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "lode" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Node where the location came from; can be faked\", line: 1096, col: 17, offsetA: 34765, offsetB: 34814)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "r" + } + ] + }, + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# rope value of location (code generators)\", line: 1097, col: 13, offsetA: 34828, offsetB: 34870)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TLibKind" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "libHeader" + }, + { + "kind": "nkIdent", + "ident": "libDynamic" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TLib" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# also misused for headers!\", line: 1104, col: 4, offsetA: 34942, offsetB: 34969)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# keep in sync with PackedLib\", line: 1105, col: 4, offsetA: 34974, offsetB: 35003)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TLibKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "generated" + } + ] + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# needed for the backends:\", line: 1107, col: 21, offsetA: 35045, offsetB: 35071)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isOverridden" + } + ] + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "path" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# can be a string literal!\", line: 1110, col: 17, offsetA: 35129, offsetB: 35155)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "CompilesId" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "int", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## id that is used for the caching logic within\", line: 1113, col: 6, offsetA: 35183, offsetB: 35230)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## ``system.compiles``. See the seminst module.\", line: 1114, col: 6, offsetA: 35237, offsetB: 35284)" + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TInstantiation" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "concreteTypes" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "PType" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "compilesId" + } + ] + }, + { + "kind": "nkIdent", + "ident": "CompilesId" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "PInstantiation" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRefTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TInstantiation" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPragmaExpr", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TScope" + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "acyclic" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "depthLevel" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "symbols" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TStrTable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "parent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PScope" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "allowPrivateAccess" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "PSym" + } + ] + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# # enable access to private fields\", line: 1125, col: 35, offsetA: 35557, offsetB: 35593)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "PScope" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRefTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TScope" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "PLib" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRefTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TLib" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPragmaExpr", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TSym" + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "acyclic" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Keep in sync with PackedSym\", line: 1130, col: 4, offsetA: 35680, offsetB: 35709)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc and type instantiations are cached in the generic symbol\", line: 1131, col: 4, offsetA: 35714, offsetB: 35777)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkOfInherit", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIdObj" + } + ] + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkRecCase", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TSymKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "routineKinds" + }, + { + "kind": "nkRecList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#procInstCache*: seq[PInstantiation]\", line: 1134, col: 6, offsetA: 35830, offsetB: 35866)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#procInstCache*: seq[PInstantiation]\", line: 1135, col: 6, offsetA: 35873, offsetB: 35909)" + ], + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "gcUnsafetyReason" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for better error messages regarding gcsafe\", line: 1136, col: 32, offsetA: 35942, offsetB: 35986)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "transformedBody" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# cached body after transf pass\", line: 1137, col: 32, offsetA: 36019, offsetB: 36050)" + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "skLet" + }, + { + "kind": "nkIdent", + "ident": "skVar" + }, + { + "kind": "nkIdent", + "ident": "skField" + }, + { + "kind": "nkIdent", + "ident": "skForVar" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "guard" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "bitsize" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "alignment" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for alignment\", line: 1141, col: 24, offsetA: 36158, offsetB: 36173)" + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "magic" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TMagic" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PIdent" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkRecWhen", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "nimsuggest" + } + ] + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "endInfo" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "owner" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TSymFlags" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# syntax tree of proc, iterator, etc.:\", line: 1153, col: 6, offsetA: 36387, offsetB: 36425)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the whole proc including header; this is used\", line: 1154, col: 6, offsetA: 36432, offsetB: 36479)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for easy generation of proper error messages\", line: 1155, col: 6, offsetA: 36486, offsetB: 36532)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for variant record fields the discriminant\", line: 1156, col: 6, offsetA: 36539, offsetB: 36583)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# expression\", line: 1157, col: 6, offsetA: 36590, offsetB: 36602)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for modules, it\\\'s a placeholder for compiler\", line: 1158, col: 6, offsetA: 36609, offsetB: 36655)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# generated code that will be appended to the\", line: 1159, col: 6, offsetA: 36662, offsetB: 36707)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# module after the sem pass (see appendToModule)\", line: 1160, col: 6, offsetA: 36714, offsetB: 36762)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "options" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TOptions" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "position" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# used for many different things:\", line: 1163, col: 6, offsetA: 36811, offsetB: 36844)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for enum fields its position;\", line: 1164, col: 6, offsetA: 36851, offsetB: 36882)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for fields its offset\", line: 1165, col: 6, offsetA: 36889, offsetB: 36912)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for parameters its position (starting with 0)\", line: 1166, col: 6, offsetA: 36919, offsetB: 36966)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for a conditional:\", line: 1167, col: 6, offsetA: 36973, offsetB: 36993)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# 1 iff the symbol is defined, else 0\", line: 1168, col: 6, offsetA: 37000, offsetB: 37037)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# (or not in symbol table)\", line: 1169, col: 6, offsetA: 37044, offsetB: 37070)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for modules, an unique index corresponding\", line: 1170, col: 6, offsetA: 37077, offsetB: 37121)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# to the module\\\'s fileIdx\", line: 1171, col: 6, offsetA: 37128, offsetB: 37153)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for variables a slot index for the evaluator\", line: 1172, col: 6, offsetA: 37160, offsetB: 37206)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "offset" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int32" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# offset of record field\", line: 1173, col: 19, offsetA: 37226, offsetB: 37250)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "disamb" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int32" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# disambiguation number; the basic idea is that\", line: 1175, col: 6, offsetA: 37276, offsetB: 37323)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# `___`\", line: 1176, col: 6, offsetA: 37330, offsetB: 37363)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "loc" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TLoc" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "annex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PLib" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# additional fields (seldom used, so we use a\", line: 1179, col: 6, offsetA: 37402, offsetB: 37447)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# reference to another object to save space)\", line: 1180, col: 6, offsetA: 37454, offsetB: 37498)" + ] + }, + { + "kind": "nkRecWhen", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "hasFFI" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "cname" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 10, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# resolved C declaration name in importc decl, e.g.:\", line: 1183, col: 10, offsetA: 37549, offsetB: 37601)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 10, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc fun() {.importc: \\\"$1aux\\\".} => cname = funaux\", line: 1184, col: 10, offsetA: 37612, offsetB: 37663)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "constraint" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# additional constraints like \\\'lit|result\\\'; also\", line: 1186, col: 6, offsetA: 37693, offsetB: 37741)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# misused for the codegenDecl and virtual pragmas in the hope\", line: 1187, col: 6, offsetA: 37748, offsetB: 37809)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# it won\\\'t cause problems\", line: 1188, col: 6, offsetA: 37816, offsetB: 37841)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for skModule the string literal to output for\", line: 1189, col: 6, offsetA: 37848, offsetB: 37895)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# deprecated modules.\", line: 1190, col: 6, offsetA: 37902, offsetB: 37923)" + ] + }, + { + "kind": "nkRecWhen", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "nimsuggest" + } + ] + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "allUsages" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TTypeSeq" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "PType" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TTypeAttachedOp" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## as usual, order is important here\", line: 1195, col: 26, offsetA: 38041, offsetB: 38077)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "attachedWasMoved" + }, + { + "kind": "nkIdent", + "ident": "attachedDestructor" + }, + { + "kind": "nkIdent", + "ident": "attachedAsgn" + }, + { + "kind": "nkIdent", + "ident": "attachedDup" + }, + { + "kind": "nkIdent", + "ident": "attachedSink" + }, + { + "kind": "nkIdent", + "ident": "attachedTrace" + }, + { + "kind": "nkIdent", + "ident": "attachedDeepCopy" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPragmaExpr", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TType" + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "acyclic" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \\\\\", line: 1205, col: 4, offsetA: 38256, offsetB: 38259)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# types are identical iff they have the\", line: 1206, col: 4, offsetA: 38264, offsetB: 38303)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# same id; there may be multiple copies of a type\", line: 1207, col: 4, offsetA: 38308, offsetB: 38357)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# in memory!\", line: 1208, col: 4, offsetA: 38362, offsetB: 38374)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Keep in sync with PackedType\", line: 1209, col: 4, offsetA: 38379, offsetB: 38409)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkOfInherit", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIdObj" + } + ] + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TTypeKind" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# kind of type\", line: 1210, col: 21, offsetA: 38431, offsetB: 38445)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "callConv" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TCallingConvention" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for procs\", line: 1211, col: 34, offsetA: 38480, offsetB: 38491)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TTypeFlags" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# flags of the type\", line: 1212, col: 23, offsetA: 38515, offsetB: 38534)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TTypeSeq" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# base types, etc.\", line: 1213, col: 20, offsetA: 38555, offsetB: 38573)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# node for types:\", line: 1215, col: 6, offsetA: 38594, offsetB: 38611)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for range types a nkRange node\", line: 1216, col: 6, offsetA: 38618, offsetB: 38650)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for record types a nkRecord node\", line: 1217, col: 6, offsetA: 38657, offsetB: 38691)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for enum types a list of symbols\", line: 1218, col: 6, offsetA: 38698, offsetB: 38732)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if kind == tyInt: it is an \\\'int literal(x)\\\' type\", line: 1219, col: 6, offsetA: 38739, offsetB: 38789)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for procs and tyGenericBody, it\\\'s the\", line: 1220, col: 6, offsetA: 38796, offsetB: 38835)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# formal param list\", line: 1221, col: 6, offsetA: 38842, offsetB: 38861)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for concepts, the concept body\", line: 1222, col: 6, offsetA: 38868, offsetB: 38900)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# else: unused\", line: 1223, col: 6, offsetA: 38907, offsetB: 38921)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "owner" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the \\\'owner\\\' of the type\", line: 1224, col: 17, offsetA: 38939, offsetB: 38964)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# types have the sym associated with them\", line: 1226, col: 6, offsetA: 38986, offsetB: 39027)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# it is used for converting types to strings\", line: 1227, col: 6, offsetA: 39034, offsetB: 39078)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "size" + } + ] + }, + { + "kind": "nkIdent", + "ident": "BiggestInt" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the size of the type in bytes\", line: 1229, col: 6, offsetA: 39107, offsetB: 39138)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# -1 means that the size is unkwown\", line: 1230, col: 6, offsetA: 39145, offsetB: 39180)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "align" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int16" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the type\\\'s alignment requirements\", line: 1231, col: 18, offsetA: 39199, offsetB: 39234)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "paddingAtEnd" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int16" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#\", line: 1232, col: 25, offsetA: 39260, offsetB: 39261)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "loc" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TLoc" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "typeInst" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for generic instantiations the tyGenericInst that led to this\", line: 1235, col: 6, offsetA: 39304, offsetB: 39367)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# type.\", line: 1236, col: 6, offsetA: 39374, offsetB: 39381)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "uniqueId" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ItemId" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# due to a design mistake, we need to keep the real ID here as it\", line: 1238, col: 6, offsetA: 39410, offsetB: 39475)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# is required by the --incremental:on mode.\", line: 1239, col: 6, offsetA: 39482, offsetB: 39525)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TPair" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + }, + { + "kind": "nkIdent", + "ident": "RootRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TPairSeq" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "TPair" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TIdPair" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PIdObj" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + }, + { + "kind": "nkIdent", + "ident": "RootRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TIdPairSeq" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "TIdPair" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TIdTable" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the same as table[PIdent] of PObject\", line: 1250, col: 21, offsetA: 39701, offsetB: 39739)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TIdPairSeq" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TIdNodePair" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PIdObj" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TIdNodePairSeq" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "TIdNodePair" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TIdNodeTable" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the same as table[PIdObj] of PNode\", line: 1259, col: 25, offsetA: 39901, offsetB: 39937)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TIdNodePairSeq" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TNodePair" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# because it is expensive to compute!\", line: 1264, col: 13, offsetA: 40018, offsetB: 40055)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TNodePairSeq" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "TNodePair" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TNodeTable" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the same as table[PNode] of int;\", line: 1270, col: 4, offsetA: 40147, offsetB: 40181)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# nodes are compared by structure!\", line: 1271, col: 4, offsetA: 40186, offsetB: 40220)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TNodePairSeq" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TObjectSeq" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "RootRef" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TObjectSet" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TObjectSeq" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TImplication" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "impUnknown" + }, + { + "kind": "nkIdent", + "ident": "impNo" + }, + { + "kind": "nkIdent", + "ident": "impYes" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "nodeId" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCast", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "Gconfig" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# we put comments in a side channel to avoid increasing `sizeof(TNode)`, which\", line: 1290, col: 4, offsetA: 40494, offsetB: 40572)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# reduces memory usage given that `PNode` is the most allocated type by far.\", line: 1291, col: 4, offsetA: 40577, offsetB: 40653)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "comments" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "Table" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# nodeId => comment\", line: 1292, col: 33, offsetA: 40687, offsetB: 40706)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "useIc" + } + ] + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPragmaExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "gconfig" + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "threadvar" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "Gconfig" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "setUseIc" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "useIc" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "gconfig" + }, + { + "kind": "nkIdent", + "ident": "useIc" + } + ] + }, + { + "kind": "nkIdent", + "ident": "useIc" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "comment" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "nfHasComment" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "gconfig" + }, + { + "kind": "nkIdent", + "ident": "useIc" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# IC doesn\\\'t track comments, see `packed_ast`, so this could fail\", line: 1302, col: 4, offsetA: 40906, offsetB: 40971)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "gconfig" + }, + { + "kind": "nkIdent", + "ident": "comments" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "nodeId" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "comment" + }, + { + "kind": "nkIdent", + "ident": "=" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "id" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "nodeId" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if needed, we could periodically cleanup gconfig.comments when its size increases,\", line: 1308, col: 4, offsetA: 41093, offsetB: 41177)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# to ensure only live nodes (and with nfHasComment) have an entry in gconfig.comments;\", line: 1309, col: 4, offsetA: 41182, offsetB: 41268)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for compiling compiler, the waste is very small:\", line: 1310, col: 4, offsetA: 41273, offsetB: 41323)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# num calls to newNodeImpl: 14984160 (num of PNode allocations)\", line: 1311, col: 4, offsetA: 41328, offsetB: 41391)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# size of gconfig.comments: 33585\", line: 1312, col: 4, offsetA: 41396, offsetB: 41429)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# num of nodes with comments that were deleted and hence wasted: 3081\", line: 1313, col: 4, offsetA: 41434, offsetB: 41503)" + ], + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "incl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nfHasComment" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "gconfig" + }, + { + "kind": "nkIdent", + "ident": "comments" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "nfHasComment" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "excl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nfHasComment" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "gconfig" + }, + { + "kind": "nkIdent", + "ident": "comments" + } + ] + }, + { + "kind": "nkIdent", + "ident": "del" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# BUGFIX: a module is overloadable so that a proc can have the\", line: 1322, col: 0, offsetA: 41657, offsetB: 41719)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# same name as an imported module. This is necessary because of\", line: 1323, col: 0, offsetA: 41720, offsetB: 41783)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the poor naming choices in the standard library.\", line: 1324, col: 0, offsetA: 41784, offsetB: 41834)" + ], + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "OverloadableSyms" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "skProc" + }, + { + "kind": "nkIdent", + "ident": "skFunc" + }, + { + "kind": "nkIdent", + "ident": "skMethod" + }, + { + "kind": "nkIdent", + "ident": "skIterator" + }, + { + "kind": "nkIdent", + "ident": "skConverter" + }, + { + "kind": "nkIdent", + "ident": "skModule" + }, + { + "kind": "nkIdent", + "ident": "skTemplate" + }, + { + "kind": "nkIdent", + "ident": "skMacro" + }, + { + "kind": "nkIdent", + "ident": "skEnumField" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "GenericTypes" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TTypeKinds" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyGenericInvocation" + }, + { + "kind": "nkIdent", + "ident": "tyGenericBody" + }, + { + "kind": "nkIdent", + "ident": "tyGenericParam" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "StructuralEquivTypes" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TTypeKinds" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyNil" + }, + { + "kind": "nkIdent", + "ident": "tyTuple" + }, + { + "kind": "nkIdent", + "ident": "tyArray" + }, + { + "kind": "nkIdent", + "ident": "tySet" + }, + { + "kind": "nkIdent", + "ident": "tyRange" + }, + { + "kind": "nkIdent", + "ident": "tyPtr" + }, + { + "kind": "nkIdent", + "ident": "tyRef" + }, + { + "kind": "nkIdent", + "ident": "tyVar" + }, + { + "kind": "nkIdent", + "ident": "tyLent" + }, + { + "kind": "nkIdent", + "ident": "tySequence" + }, + { + "kind": "nkIdent", + "ident": "tyProc" + }, + { + "kind": "nkIdent", + "ident": "tyOpenArray" + }, + { + "kind": "nkIdent", + "ident": "tyVarargs" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "ConcreteTypes" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TTypeKinds" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyBool" + }, + { + "kind": "nkIdent", + "ident": "tyChar" + }, + { + "kind": "nkIdent", + "ident": "tyEnum" + }, + { + "kind": "nkIdent", + "ident": "tyArray" + }, + { + "kind": "nkIdent", + "ident": "tyObject" + }, + { + "kind": "nkIdent", + "ident": "tySet" + }, + { + "kind": "nkIdent", + "ident": "tyTuple" + }, + { + "kind": "nkIdent", + "ident": "tyRange" + }, + { + "kind": "nkIdent", + "ident": "tyPtr" + }, + { + "kind": "nkIdent", + "ident": "tyRef" + }, + { + "kind": "nkIdent", + "ident": "tyVar" + }, + { + "kind": "nkIdent", + "ident": "tyLent" + }, + { + "kind": "nkIdent", + "ident": "tySequence" + }, + { + "kind": "nkIdent", + "ident": "tyProc" + }, + { + "kind": "nkIdent", + "ident": "tyPointer" + }, + { + "kind": "nkIdent", + "ident": "tyOpenArray" + }, + { + "kind": "nkIdent", + "ident": "tyString" + }, + { + "kind": "nkIdent", + "ident": "tyCstring" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "tyInt" + }, + { + "kind": "nkIdent", + "ident": "tyInt64" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "tyFloat" + }, + { + "kind": "nkIdent", + "ident": "tyFloat128" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "tyUInt" + }, + { + "kind": "nkIdent", + "ident": "tyUInt64" + } + ] + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# types of the expr that may occur in::\", line: 1361, col: 6, offsetA: 42636, offsetB: 42675)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# var x = expr\", line: 1362, col: 6, offsetA: 42682, offsetB: 42696)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "IntegralTypes" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyBool" + }, + { + "kind": "nkIdent", + "ident": "tyChar" + }, + { + "kind": "nkIdent", + "ident": "tyEnum" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "tyInt" + }, + { + "kind": "nkIdent", + "ident": "tyInt64" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "tyFloat" + }, + { + "kind": "nkIdent", + "ident": "tyFloat128" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "tyUInt" + }, + { + "kind": "nkIdent", + "ident": "tyUInt64" + } + ] + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# weird name because it contains tyFloat\", line: 1371, col: 6, offsetA: 42848, offsetB: 42888)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "ConstantDataTypes" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TTypeKinds" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyArray" + }, + { + "kind": "nkIdent", + "ident": "tySet" + }, + { + "kind": "nkIdent", + "ident": "tyTuple" + }, + { + "kind": "nkIdent", + "ident": "tySequence" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "NilableTypes" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TTypeKinds" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyPointer" + }, + { + "kind": "nkIdent", + "ident": "tyCstring" + }, + { + "kind": "nkIdent", + "ident": "tyRef" + }, + { + "kind": "nkIdent", + "ident": "tyPtr" + }, + { + "kind": "nkIdent", + "ident": "tyProc" + }, + { + "kind": "nkIdent", + "ident": "tyError" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO\", line: 1373, col: 84, offsetA: 43046, offsetB: 43052)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "PtrLikeKinds" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TTypeKinds" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyPointer" + }, + { + "kind": "nkIdent", + "ident": "tyPtr" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for VM\", line: 1374, col: 49, offsetA: 43102, offsetB: 43110)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "PersistentNodeFlags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TNodeFlags" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nfBase2" + }, + { + "kind": "nkIdent", + "ident": "nfBase8" + }, + { + "kind": "nkIdent", + "ident": "nfBase16" + }, + { + "kind": "nkIdent", + "ident": "nfDotSetter" + }, + { + "kind": "nkIdent", + "ident": "nfDotField" + }, + { + "kind": "nkIdent", + "ident": "nfIsRef" + }, + { + "kind": "nkIdent", + "ident": "nfIsPtr" + }, + { + "kind": "nkIdent", + "ident": "nfPreventCg" + }, + { + "kind": "nkIdent", + "ident": "nfLL" + }, + { + "kind": "nkIdent", + "ident": "nfFromTemplate" + }, + { + "kind": "nkIdent", + "ident": "nfDefaultRefsParam" + }, + { + "kind": "nkIdent", + "ident": "nfExecuteOnReload" + }, + { + "kind": "nkIdent", + "ident": "nfLastRead" + }, + { + "kind": "nkIdent", + "ident": "nfFirstWrite" + }, + { + "kind": "nkIdent", + "ident": "nfSkipFieldChecking" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "namePos" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "patternPos" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# empty except for term rewriting macros\", line: 1382, col: 18, offsetA: 43402, offsetB: 43442)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "genericParamsPos" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "paramsPos" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "pragmasPos" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "miscPos" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 5 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# used for undocumented and hacky stuff\", line: 1386, col: 15, offsetA: 43517, offsetB: 43556)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "bodyPos" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# position of body; use rodread.getBody() instead!\", line: 1387, col: 15, offsetA: 43572, offsetB: 43622)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "resultPos" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 7 + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "dispatcherPos" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 8 + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nfAllFieldsSet" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "nfBase2" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nkCallKinds" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCall" + }, + { + "kind": "nkIdent", + "ident": "nkInfix" + }, + { + "kind": "nkIdent", + "ident": "nkPrefix" + }, + { + "kind": "nkIdent", + "ident": "nkPostfix" + }, + { + "kind": "nkIdent", + "ident": "nkCommand" + }, + { + "kind": "nkIdent", + "ident": "nkCallStrLit" + }, + { + "kind": "nkIdent", + "ident": "nkHiddenCallConv" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nkIdentKinds" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIdent" + }, + { + "kind": "nkIdent", + "ident": "nkSym" + }, + { + "kind": "nkIdent", + "ident": "nkAccQuoted" + }, + { + "kind": "nkIdent", + "ident": "nkOpenSymChoice" + }, + { + "kind": "nkIdent", + "ident": "nkClosedSymChoice" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nkPragmaCallKinds" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkExprColonExpr" + }, + { + "kind": "nkIdent", + "ident": "nkCall" + }, + { + "kind": "nkIdent", + "ident": "nkCallStrLit" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nkLiterals" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkCharLit" + }, + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nkFloatLiterals" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkFloatLit" + }, + { + "kind": "nkIdent", + "ident": "nkFloat128Lit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nkLambdaKinds" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkLambda" + }, + { + "kind": "nkIdent", + "ident": "nkDo" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "declarativeDefs" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkProcDef" + }, + { + "kind": "nkIdent", + "ident": "nkFuncDef" + }, + { + "kind": "nkIdent", + "ident": "nkMethodDef" + }, + { + "kind": "nkIdent", + "ident": "nkIteratorDef" + }, + { + "kind": "nkIdent", + "ident": "nkConverterDef" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "routineDefs" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "declarativeDefs" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkMacroDef" + }, + { + "kind": "nkIdent", + "ident": "nkTemplateDef" + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "procDefs" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "nkLambdaKinds" + }, + { + "kind": "nkIdent", + "ident": "declarativeDefs" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "callableDefs" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "nkLambdaKinds" + }, + { + "kind": "nkIdent", + "ident": "routineDefs" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nkSymChoices" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkClosedSymChoice" + }, + { + "kind": "nkIdent", + "ident": "nkOpenSymChoice" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nkStrKinds" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkStrLit" + }, + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "skLocalVars" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "skVar" + }, + { + "kind": "nkIdent", + "ident": "skLet" + }, + { + "kind": "nkIdent", + "ident": "skForVar" + }, + { + "kind": "nkIdent", + "ident": "skParam" + }, + { + "kind": "nkIdent", + "ident": "skResult" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "skProcKinds" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "skProc" + }, + { + "kind": "nkIdent", + "ident": "skFunc" + }, + { + "kind": "nkIdent", + "ident": "skTemplate" + }, + { + "kind": "nkIdent", + "ident": "skMacro" + }, + { + "kind": "nkIdent", + "ident": "skIterator" + }, + { + "kind": "nkIdent", + "ident": "skMethod" + }, + { + "kind": "nkIdent", + "ident": "skConverter" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "defaultSize" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "defaultAlignment" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "defaultOffset" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getPIdent" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PIdent" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Returns underlying `PIdent` for `{nkSym, nkIdent}`, or `nil`.\", line: 1412, col: 2, offsetA: 44685, offsetB: 44749)" + ], + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkSym" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIdent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkOpenSymChoice" + }, + { + "kind": "nkIdent", + "ident": "nkClosedSymChoice" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "moduleShift" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "cpu32" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 20 + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 24 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "PIdObj" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shl" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "itemId" + } + ] + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + }, + { + "kind": "nkIdent", + "ident": "moduleShift" + } + ] + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "itemId" + } + ] + }, + { + "kind": "nkIdent", + "ident": "item" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "IdGenerator" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRefTy", + "sons": [ + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# unfortunately, we really need the \\\'shared mutable\\\' aspect here.\", line: 1436, col: 28, offsetA: 45112, offsetB: 45177)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int32" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "symId" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int32" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "typeId" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int32" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sealed" + } + ] + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "disambTable" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "CountTable" + }, + { + "kind": "nkIdent", + "ident": "PIdent" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "PackageModuleId" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInt32Lit", + "intVal": -3 + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "idGeneratorFromModule" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "IdGenerator" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "skModule" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkObjConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "IdGenerator" + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "module" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkIdent", + "ident": "itemId" + } + ] + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "symId" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkIdent", + "ident": "itemId" + } + ] + }, + { + "kind": "nkIdent", + "ident": "item" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typeId" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "disambTable" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "initCountTable" + }, + { + "kind": "nkIdent", + "ident": "PIdent" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "idGeneratorForPackage" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "IdGenerator" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextIdWillBe" + }, + { + "kind": "nkIdent", + "ident": "int32" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkObjConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "IdGenerator" + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "module" + }, + { + "kind": "nkIdent", + "ident": "PackageModuleId" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "symId" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "nextIdWillBe" + }, + { + "kind": "nkInt32Lit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typeId" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "disambTable" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "initCountTable" + }, + { + "kind": "nkIdent", + "ident": "PIdent" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nextSymId" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "ItemId" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "IdGenerator" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "sealed" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "symId" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkObjConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ItemId" + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "module" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "item" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "symId" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nextTypeId" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "ItemId" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "IdGenerator" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "sealed" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "typeId" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkObjConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ItemId" + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "module" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "item" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "typeId" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nextId" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "ItemId" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "IdGenerator" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "item" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "storeBack" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "IdGenerator" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "IdGenerator" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "ItemId" + } + ] + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "ItemId" + } + ] + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "ItemId" + } + ] + }, + { + "kind": "nkIdent", + "ident": "item" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "ItemId" + } + ] + }, + { + "kind": "nkIdent", + "ident": "item" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "echo" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "ItemId" + } + ] + }, + { + "kind": "nkIdent", + "ident": "item" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": " " + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "ItemId" + } + ] + }, + { + "kind": "nkIdent", + "ident": "item" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": " " + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "ItemId" + } + ] + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "ItemId" + } + ] + }, + { + "kind": "nkIdent", + "ident": "item" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "ItemId" + } + ] + }, + { + "kind": "nkIdent", + "ident": "item" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "src" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPragmaExpr", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "ggDebug" + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "deprecated" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## convenience switch for trying out things\", line: 1496, col: 34, offsetA: 46527, offsetB: 46570)" + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isCallExpr" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkCallKinds" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "discardSons" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "Indexable" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "|" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdent", + "ident": "PType" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "Indexable" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "safeLen" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## works even for leaves.\", line: 1510, col: 2, offsetA: 46818, offsetB: 46843)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkNone" + }, + { + "kind": "nkIdent", + "ident": "nkNilLit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "safeArrLen" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## works for array-like objects (strings passed as openArray in VM).\", line: 1517, col: 2, offsetA: 46971, offsetB: 47039)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkStrLit" + }, + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkNone" + }, + { + "kind": "nkIdent", + "ident": "nkFloat128Lit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkIdent", + "ident": "son" + }, + { + "kind": "nkIdent", + "ident": "Indexable" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "son" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "son" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "addAllowNil" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkIdent", + "ident": "son" + }, + { + "kind": "nkIdent", + "ident": "Indexable" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "son" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "[]" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Indexable" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "Indexable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "[]=" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "Indexable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "Indexable" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "[]" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Indexable" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "Indexable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "BackwardsIndex" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "[]=" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "Indexable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "BackwardsIndex" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "Indexable" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getDeclPragma" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## return the `nkPragma` node for declaration `n`, or `nil` if no pragma was found.\", line: 1546, col: 2, offsetA: 47703, offsetB: 47786)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Currently only supports routineDefs + {nkTypeDef}.\", line: 1547, col: 2, offsetA: 47789, offsetB: 47842)" + ], + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "routineDefs" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "pragmasPos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "pragmasPos" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkTypeDef" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#[\\n type F3*{.deprecated: \\\"x3\\\".} = int\\n\\n TypeSection\\n TypeDef\\n PragmaExpr\\n Postfix\\n Ident \\\"*\\\"\\n Ident \\\"F3\\\"\\n Pragma\\n ExprColonExpr\\n Ident \\\"deprecated\\\"\\n StrLit \\\"x3\\\"\\n Empty\\n Ident \\\"int\\\"\\n ]#\", line: 1553, col: 4, offsetA: 47962, offsetB: 48258)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkPragmaExpr" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# support as needed for `nkIdentDefs` etc.\", line: 1572, col: 4, offsetA: 48329, offsetB: 48371)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkPragma" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkTupleConstr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "extractPragma" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## gets the pragma node of routine/type/var/let/const symbol `s`\", line: 1578, col: 2, offsetA: 48509, offsetB: 48573)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "routineKinds" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pragmasPos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "skType" + }, + { + "kind": "nkIdent", + "ident": "skVar" + }, + { + "kind": "nkIdent", + "ident": "skLet" + }, + { + "kind": "nkIdent", + "ident": "skConst" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkPragmaExpr" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 8, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# s.ast = nkTypedef / nkPragmaExpr / [nkSym, nkPragma]\", line: 1584, col: 8, offsetA: 48792, offsetB: 48846)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkPragma" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "skipPragmaExpr" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## if pragma expr, give the node the pragmas are applied to,\", line: 1590, col: 2, offsetA: 48970, offsetB: 49030)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## otherwise give node itself\", line: 1591, col: 2, offsetA: 49033, offsetB: 49062)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkPragmaExpr" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "setInfoRecursive" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## set line info recursively\", line: 1598, col: 2, offsetA: 49188, offsetB: 49216)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "safeLen" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setInfoRecursive" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "useNodeIds" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nodeIdToDebug" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# 2322968\", line: 1607, col: 24, offsetA: 49375, offsetB: 49384)" + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "gNodeId" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeImpl" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info2" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkObjConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "info2" + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# this would add overhead, so we skip it; it results in a small amount of leaked entries\", line: 1614, col: 4, offsetA: 49496, offsetB: 49584)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for old PNode that gets re-allocated at the same address as a PNode that\", line: 1615, col: 4, offsetA: 49589, offsetB: 49663)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# has `nfHasComment` set (and an entry in that table). Only `nfHasComment`\", line: 1616, col: 4, offsetA: 49668, offsetB: 49742)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# should be used to test whether a PNode has a comment; gconfig.comments\", line: 1617, col: 4, offsetA: 49747, offsetB: 49819)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# can contain extra entries for deleted PNode\\\'s with comments.\", line: 1618, col: 4, offsetA: 49824, offsetB: 49886)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "gconfig" + }, + { + "kind": "nkIdent", + "ident": "comments" + } + ] + }, + { + "kind": "nkIdent", + "ident": "del" + } + ] + }, + { + "kind": "nkCast", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "setIdMaybe" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "useNodeIds" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkIdent", + "ident": "gNodeId" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nodeIdToDebug" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "echo" + }, + { + "kind": "nkStrLit", + "strVal": "KIND " + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "writeStackTrace" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "gNodeId" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newNode" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## new node with unknown line info, no type, and no children\", line: 1632, col: 2, offsetA: 50160, offsetB: 50220)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeImpl" + }, + { + "kind": "nkIdent", + "ident": "unknownLineInfo" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setIdMaybe" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newNodeI" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## new node with line info, no type, and no children\", line: 1637, col: 2, offsetA: 50328, offsetB: 50380)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeImpl" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setIdMaybe" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newNodeI" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "children" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## new node with line info, type, and children\", line: 1642, col: 2, offsetA: 50492, offsetB: 50538)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeImpl" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "children" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSeq" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "children" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setIdMaybe" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newNodeIT" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## new node with line info, type, and no children\", line: 1650, col: 2, offsetA: 50702, offsetB: 50751)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newTree" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "children" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "varargs" + }, + { + "kind": "nkIdent", + "ident": "PNode" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "children" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "children" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkIdent", + "ident": "children" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newTreeI" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "children" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "varargs" + }, + { + "kind": "nkIdent", + "ident": "PNode" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeI" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "children" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "children" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkIdent", + "ident": "children" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newTreeIT" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "children" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "varargs" + }, + { + "kind": "nkIdent", + "ident": "PNode" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeIT" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "children" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "children" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkIdent", + "ident": "children" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "previouslyInferred" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "lastSon" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "tables" + }, + { + "kind": "nkIdent", + "ident": "strutils" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "CountTable" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "addQuitProc" + }, + { + "kind": "nkLambda", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "noconv" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "k" + }, + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "pairs" + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "echo" + }, + { + "kind": "nkIdent", + "ident": "k" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "echo" + }, + { + "kind": "nkIdent", + "ident": "v" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newSym" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "symKind" + }, + { + "kind": "nkIdent", + "ident": "TSymKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "name" + }, + { + "kind": "nkIdent", + "ident": "PIdent" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "idgen" + }, + { + "kind": "nkIdent", + "ident": "IdGenerator" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "owner" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "options" + }, + { + "kind": "nkIdent", + "ident": "TOptions" + }, + { + "kind": "nkCurly" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# generates a symbol and initializes the hash field too\", line: 1702, col: 2, offsetA: 51848, offsetB: 51903)" + ], + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "name" + }, + { + "kind": "nkIdent", + "ident": "isNil" + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "id" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextSymId" + }, + { + "kind": "nkIdent", + "ident": "idgen" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkObjConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "name" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "symKind" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "flags" + }, + { + "kind": "nkCurly" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "itemId" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "options" + }, + { + "kind": "nkIdent", + "ident": "options" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "owner" + }, + { + "kind": "nkIdent", + "ident": "owner" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "offset" + }, + { + "kind": "nkIdent", + "ident": "defaultOffset" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "disamb" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getOrDefault" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "idgen" + }, + { + "kind": "nkIdent", + "ident": "disambTable" + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "idgen" + }, + { + "kind": "nkIdent", + "ident": "disambTable" + } + ] + }, + { + "kind": "nkIdent", + "ident": "inc" + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "id" + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 48 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "id" + }, + { + "kind": "nkIdent", + "ident": "item" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 39 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "writeStackTrace" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "echo" + }, + { + "kind": "nkStrLit", + "strVal": "kind " + }, + { + "kind": "nkIdent", + "ident": "symKind" + }, + { + "kind": "nkStrLit", + "strVal": " " + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "name" + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "owner" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "echo" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "owner" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "astdef" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# get only the definition (initializer) portion of the ast\", line: 1730, col: 2, offsetA: 52442, offsetB: 52500)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIdentDefs" + }, + { + "kind": "nkIdent", + "ident": "nkConstDef" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isMetaType" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tyMetaTypes" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tyStatic" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "tfHasMeta" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isUnresolvedStatic" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tyStatic" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "linkTo" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "discardable" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "t" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "t" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "linkTo" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "discardable" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "t" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# XXX: this should be used only on module symbols\", line: 1753, col: 2, offsetA: 53044, offsetB: 53093)" + ], + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "position" + } + ] + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "filename" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# XXX: this should be used only on module symbols\", line: 1757, col: 2, offsetA: 53158, offsetB: 53207)" + ], + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "position" + } + ] + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "toFilename" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "appendToModule" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## The compiler will use this internally to add nodes that will be\", line: 1761, col: 2, offsetA: 53287, offsetB: 53353)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## appended to the module after the sem pass\", line: 1762, col: 2, offsetA: 53356, offsetB: 53400)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "nkStmtList" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkStmtList" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for all kind of hash tables:\", line: 1772, col: 2, offsetA: 53550, offsetB: 53580)" + ], + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "GrowthFactor" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# must be power of 2, > 0\", line: 1773, col: 20, offsetA: 53601, offsetB: 53626)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "StartSize" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 8 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# must be power of 2, > 0\", line: 1774, col: 17, offsetA: 53644, offsetB: 53669)" + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "copyStrTable" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TStrTable" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "TStrTable" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setLen" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "copyIdTable" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIdTable" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "TIdTable" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSeq" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "copyObjectSet" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TObjectSet" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "TObjectSet" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setLen" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "discardSons" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "withInfo" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newIdentNode" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ident" + }, + { + "kind": "nkIdent", + "ident": "PIdent" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "nkIdent" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newSymNode" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "sym" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "sym" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "sym" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newSymNode" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "sym" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "sym" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newIntNode" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "intVal" + }, + { + "kind": "nkIdent", + "ident": "BiggestInt" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newIntNode" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "intVal" + }, + { + "kind": "nkIdent", + "ident": "Int128" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "castToInt64" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "lastSon" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Indexable" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "Indexable" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "skipTypes" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kinds" + }, + { + "kind": "nkIdent", + "ident": "TTypeKinds" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Used throughout the compiler code to test whether a type tree contains or\", line: 1834, col: 2, offsetA: 55121, offsetB: 55197)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## doesn\\\'t contain a specific type/types - it is often the case that only the\", line: 1835, col: 2, offsetA: 55200, offsetB: 55277)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## last child nodes of a type tree need to be searched. This is a really hot\", line: 1836, col: 2, offsetA: 55280, offsetB: 55356)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## path within the compiler!\", line: 1837, col: 2, offsetA: 55359, offsetB: 55387)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "t" + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kinds" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lastSon" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newIntTypeNode" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "intVal" + }, + { + "kind": "nkIdent", + "ident": "BiggestInt" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipTypes" + }, + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "abstractVarRange" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyInt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "nkIntLit" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyInt8" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "nkInt8Lit" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyInt16" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "nkInt16Lit" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyInt32" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "nkInt32Lit" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyInt64" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "nkInt64Lit" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyChar" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "nkCharLit" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyUInt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "nkUIntLit" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyUInt8" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "nkUInt8Lit" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyUInt16" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "nkUInt16Lit" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyUInt32" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "nkUInt32Lit" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyUInt64" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "nkUInt64Lit" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyBool" + }, + { + "kind": "nkIdent", + "ident": "tyEnum" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# XXX: does this really need to be the kind nkIntLit?\", line: 1868, col: 4, offsetA: 56124, offsetB: 56177)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "nkIntLit" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# that\\\'s a pre-existing bug, will fix in another PR\", line: 1870, col: 15, offsetA: 56224, offsetB: 56275)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "tyStatic" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "nkIntLit" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "doAssert" + }, + { + "kind": "nkIdent", + "ident": "false" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newIntTypeNode" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "intVal" + }, + { + "kind": "nkIdent", + "ident": "Int128" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# XXX: introduce range check\", line: 1879, col: 2, offsetA: 56447, offsetB: 56475)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIntTypeNode" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "castToInt64" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newFloatNode" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "floatVal" + }, + { + "kind": "nkIdent", + "ident": "BiggestFloat" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newStrNode" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "strVal" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newStrNode" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "strVal" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeI" + }, + { + "kind": "nkIdent", + "ident": "nkStrLit" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newProcNode" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "params" + }, + { + "kind": "nkIdent", + "ident": "name" + }, + { + "kind": "nkIdent", + "ident": "pattern" + }, + { + "kind": "nkIdent", + "ident": "genericParams" + }, + { + "kind": "nkIdent", + "ident": "pragmas" + }, + { + "kind": "nkIdent", + "ident": "exceptions" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeI" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "name" + }, + { + "kind": "nkIdent", + "ident": "pattern" + }, + { + "kind": "nkIdent", + "ident": "genericParams" + }, + { + "kind": "nkIdent", + "ident": "params" + }, + { + "kind": "nkIdent", + "ident": "pragmas" + }, + { + "kind": "nkIdent", + "ident": "exceptions" + }, + { + "kind": "nkIdent", + "ident": "body" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "AttachedOpToStr" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "array" + }, + { + "kind": "nkIdent", + "ident": "TTypeAttachedOp" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "=wasMoved" + }, + { + "kind": "nkStrLit", + "strVal": "=destroy" + }, + { + "kind": "nkStrLit", + "strVal": "=copy" + }, + { + "kind": "nkStrLit", + "strVal": "=dup" + }, + { + "kind": "nkStrLit", + "strVal": "=sink" + }, + { + "kind": "nkStrLit", + "strVal": "=trace" + }, + { + "kind": "nkStrLit", + "strVal": "=deepcopy" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "@" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newType" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TTypeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "id" + }, + { + "kind": "nkIdent", + "ident": "ItemId" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "owner" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkObjConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "owner" + }, + { + "kind": "nkIdent", + "ident": "owner" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "size" + }, + { + "kind": "nkIdent", + "ident": "defaultSize" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "align" + }, + { + "kind": "nkIdent", + "ident": "defaultAlignment" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "itemId" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "uniqueId" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "itemId" + } + ] + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 55 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "itemId" + } + ] + }, + { + "kind": "nkIdent", + "ident": "item" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "echo" + }, + { + "kind": "nkStrLit", + "strVal": "KNID " + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "writeStackTrace" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "mergeLoc" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TLoc" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "TLoc" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "k" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "low" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "typeof" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "k" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "k" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "k" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "storage" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "low" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "typeof" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "storage" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "storage" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "storage" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "incl" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "lode" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "lode" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "lode" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "r" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "r" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "r" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newSons" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkIdent", + "ident": "Indexable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "length" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setLen" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "length" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "assignType" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "callConv" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "callConv" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "size" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "size" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "align" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "align" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# this fixes \\\'type TLock = TSysLock\\\':\", line: 1951, col: 2, offsetA: 58257, offsetB: 58294)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "incl" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "sfUsed" + }, + { + "kind": "nkIdent", + "ident": "sfExported" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "annex" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "annex" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "annex" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "mergeLoc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "loc" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "loc" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSons" + }, + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dest" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "copyType" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "id" + }, + { + "kind": "nkIdent", + "ident": "ItemId" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "owner" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newType" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + }, + { + "kind": "nkIdent", + "ident": "owner" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assignType" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "t" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# backend-info should not be copied\", line: 1971, col: 21, offsetA: 58770, offsetB: 58805)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "exactReplica" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "copyType" + }, + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "itemId" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "owner" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "copySym" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "idgen" + }, + { + "kind": "nkIdent", + "ident": "IdGenerator" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSym" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "idgen" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "owner" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "options" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#result.ast = nil # BUGFIX; was: s.ast which made problems\", line: 1978, col: 2, offsetA: 59010, offsetB: 59079)" + ], + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "magic" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "magic" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "options" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "options" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "position" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "position" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "loc" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "loc" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "annex" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "annex" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# BUGFIX\", line: 1985, col: 25, offsetA: 59257, offsetB: 59265)" + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "constraint" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "constraint" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "skVar" + }, + { + "kind": "nkIdent", + "ident": "skLet" + }, + { + "kind": "nkIdent", + "ident": "skField" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "guard" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "guard" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "bitsize" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "bitsize" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "alignment" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "alignment" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "createModuleAlias" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "idgen" + }, + { + "kind": "nkIdent", + "ident": "IdGenerator" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIdent" + }, + { + "kind": "nkIdent", + "ident": "PIdent" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "options" + }, + { + "kind": "nkIdent", + "ident": "TOptions" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSym" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "newIdent" + }, + { + "kind": "nkIdent", + "ident": "idgen" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "owner" + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "options" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# keep ID!\", line: 1996, col: 2, offsetA: 59630, offsetB: 59640)" + ], + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#result.id = s.id # XXX figure out what to do with the ID.\", line: 1998, col: 2, offsetA: 59664, offsetB: 59722)" + ], + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "options" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "options" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "position" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "position" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "loc" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "loc" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "annex" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "annex" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "initStrTable" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TStrTable" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSeq" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "StartSize" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newStrTable" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "TStrTable" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initStrTable" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "initIdTable" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIdTable" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSeq" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "StartSize" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newIdTable" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIdTable" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initIdTable" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "resetIdTable" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIdTable" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# clear and set to old initial size:\", line: 2024, col: 2, offsetA: 60191, offsetB: 60227)" + ], + "ident": "setLen" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setLen" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "StartSize" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "initObjectSet" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TObjectSet" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSeq" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "StartSize" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "initIdNodeTable" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIdNodeTable" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSeq" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "StartSize" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "initNodeTable" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TNodeTable" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSeq" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "StartSize" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "skipTypes" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kinds" + }, + { + "kind": "nkIdent", + "ident": "TTypeKinds" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "maxIters" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "t" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "maxIters" + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kinds" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lastSon" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "dec" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "skipTypesOrNil" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kinds" + }, + { + "kind": "nkIdent", + "ident": "TTypeKinds" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## same as skipTypes but handles \\\'nil\\\'\", line: 2055, col: 2, offsetA: 60808, offsetB: 60846)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "t" + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kinds" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lastSon" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isGCedMem" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyString" + }, + { + "kind": "nkIdent", + "ident": "tyRef" + }, + { + "kind": "nkIdent", + "ident": "tySequence" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tyProc" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "callConv" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ccClosure" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "propagateToOwner" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "owner" + }, + { + "kind": "nkIdent", + "ident": "elem" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "propagateHasAsgn" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "owner" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "incl" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "elem" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tfHasMeta" + }, + { + "kind": "nkIdent", + "ident": "tfTriggersCompileTime" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "tfNotNil" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "elem" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "owner" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyGenericInst" + }, + { + "kind": "nkIdent", + "ident": "tyGenericBody" + }, + { + "kind": "nkIdent", + "ident": "tyGenericInvocation" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "owner" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "incl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tfNotNil" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "elem" + }, + { + "kind": "nkIdent", + "ident": "isMetaType" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "owner" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "incl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tfHasMeta" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "mask" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "elem" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tfHasAsgn" + }, + { + "kind": "nkIdent", + "ident": "tfHasOwned" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "mask" + }, + { + "kind": "nkCurly" + } + ] + }, + { + "kind": "nkIdent", + "ident": "propagateHasAsgn" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "o2" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "owner" + }, + { + "kind": "nkIdent", + "ident": "skipTypes" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyGenericInst" + }, + { + "kind": "nkIdent", + "ident": "tyAlias" + }, + { + "kind": "nkIdent", + "ident": "tySink" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "o2" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyTuple" + }, + { + "kind": "nkIdent", + "ident": "tyObject" + }, + { + "kind": "nkIdent", + "ident": "tyArray" + }, + { + "kind": "nkIdent", + "ident": "tySequence" + }, + { + "kind": "nkIdent", + "ident": "tySet" + }, + { + "kind": "nkIdent", + "ident": "tyDistinct" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "o2" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "incl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "mask" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "owner" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "incl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "mask" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "owner" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyProc" + }, + { + "kind": "nkIdent", + "ident": "tyGenericInst" + }, + { + "kind": "nkIdent", + "ident": "tyGenericBody" + }, + { + "kind": "nkIdent", + "ident": "tyGenericInvocation" + }, + { + "kind": "nkIdent", + "ident": "tyPtr" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "elemB" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "elem" + }, + { + "kind": "nkIdent", + "ident": "skipTypes" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyGenericInst" + }, + { + "kind": "nkIdent", + "ident": "tyAlias" + }, + { + "kind": "nkIdent", + "ident": "tySink" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "elemB" + }, + { + "kind": "nkIdent", + "ident": "isGCedMem" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "tfHasGCedMem" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "elemB" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for simplicity, we propagate this flag even to generics. We then\", line: 2084, col: 6, offsetA: 61954, offsetB: 62020)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ensure this doesn\\\'t bite us in sempass2.\", line: 2085, col: 6, offsetA: 62027, offsetB: 62069)" + ], + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "owner" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "incl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tfHasGCedMem" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "rawAddSon" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkIdent", + "ident": "son" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "propagateHasAsgn" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "son" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "son" + }, + { + "kind": "nkIdent", + "ident": "isNil" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "propagateToOwner" + }, + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkIdent", + "ident": "son" + }, + { + "kind": "nkIdent", + "ident": "propagateHasAsgn" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "rawAddSonNoPropagationOfTypeFlags" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkIdent", + "ident": "son" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "son" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "addSonNilAllowed" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkIdent", + "ident": "son" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "son" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "delSon" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "idx" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIdent", + "ident": "idx" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "setLen" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "father" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "copyNode" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# does not copy its sons!\", line: 2108, col: 2, offsetA: 62636, offsetB: 62661)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PersistentNodeFlags" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "comment" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "comment" + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "useNodeIds" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nodeIdToDebug" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "echo" + }, + { + "kind": "nkStrLit", + "strVal": "COMES FROM " + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkCharLit" + }, + { + "kind": "nkIdent", + "ident": "nkUInt64Lit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkFloatLiterals" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkSym" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIdent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkStrLit" + }, + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "nimsuggest" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "endInfo" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "endInfo" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "transitionNodeKindCommon" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "k" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPragmaExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inject" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkObjConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "TNode" + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "k" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "flags" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "prefix" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "prefix" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "mid" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "mid" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "postfix" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "postfix" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# n.comment = obj.comment # shouldn\\\'t be needed, the address doesnt\\\' change\", line: 2149, col: 2, offsetA: 63568, offsetB: 63643)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "useNodeIds" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "transitionSonsKind" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "range" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkComesFrom" + }, + { + "kind": "nkIdent", + "ident": "nkTupleConstr" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "transitionNodeKindCommon" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "transitionIntKind" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "range" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkCharLit" + }, + { + "kind": "nkIdent", + "ident": "nkUInt64Lit" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "transitionNodeKindCommon" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "transitionIntToFloatKind" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "range" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkFloatLit" + }, + { + "kind": "nkIdent", + "ident": "nkFloat128Lit" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "transitionNodeKindCommon" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "BiggestFloat" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "transitionNoneToSym" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "transitionNodeKindCommon" + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "transitionSymKindCommon" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "k" + }, + { + "kind": "nkIdent", + "ident": "TSymKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPragmaExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inject" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkObjConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSym" + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "k" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "itemId" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "itemId" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "magic" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "magic" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "name" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "owner" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "owner" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "flags" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ast" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "options" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "options" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "position" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "position" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "offset" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "offset" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "loc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "loc" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "annex" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "annex" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "constraint" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "constraint" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "hasFFI" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "cname" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "cname" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "nimsuggest" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "allUsages" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "allUsages" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "transitionGenericParamToType" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "transitionSymKindCommon" + }, + { + "kind": "nkIdent", + "ident": "skType" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "transitionRoutineSymKind" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "range" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "skProc" + }, + { + "kind": "nkIdent", + "ident": "skTemplate" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "transitionSymKindCommon" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "gcUnsafetyReason" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "gcUnsafetyReason" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "transformedBody" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "transformedBody" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "transitionToLet" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "transitionSymKindCommon" + }, + { + "kind": "nkIdent", + "ident": "skLet" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "guard" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "guard" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "bitsize" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "bitsize" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "alignment" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "alignment" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "copyNodeImpl" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "dst" + }, + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "processSonsStmt" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "dst" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dst" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "nimsuggest" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "endInfo" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "endInfo" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dst" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dst" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PersistentNodeFlags" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dst" + }, + { + "kind": "nkIdent", + "ident": "comment" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "comment" + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "useNodeIds" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dst" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nodeIdToDebug" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "echo" + }, + { + "kind": "nkStrLit", + "strVal": "COMES FROM " + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkCharLit" + }, + { + "kind": "nkIdent", + "ident": "nkUInt64Lit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dst" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkFloatLiterals" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dst" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkSym" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dst" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIdent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dst" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkStrLit" + }, + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dst" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "processSonsStmt" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "shallowCopy" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# does not copy its sons, but provides space for them:\", line: 2243, col: 2, offsetA: 65887, offsetB: 65941)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "copyNodeImpl" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSeq" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "copyTree" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# copy a whole syntax tree; performs deep copying\", line: 2248, col: 2, offsetA: 66043, offsetB: 66092)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "copyNodeImpl" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSeq" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "copyTree" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "copyTreeWithoutNode" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "skippedNode" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "copyNodeImpl" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSeqOfCap" + }, + { + "kind": "nkIdent", + "ident": "PNode" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "src" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "skippedNode" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "copyTreeWithoutNode" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "skippedNode" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "hasSonWith" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "hasNilSon" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "safeLen" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "hasNilSon" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "containsNode" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kinds" + }, + { + "kind": "nkIdent", + "ident": "TNodeKinds" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kinds" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kinds" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "containsNode" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kinds" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "hasSubnodeWith" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "nkNilLit" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkFormalParams" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "hasSubnodeWith" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getInt" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Int128" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCharLit" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkUIntLit" + }, + { + "kind": "nkIdent", + "ident": "nkUInt64Lit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toInt128" + }, + { + "kind": "nkCast", + "sons": [ + { + "kind": "nkIdent", + "ident": "uint64" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkInt8Lit" + }, + { + "kind": "nkIdent", + "ident": "nkInt64Lit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toInt128" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIntLit" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# XXX: enable this assert\", line: 2306, col: 4, offsetA: 67519, offsetB: 67544)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# assert a.typ.kind notin {tyChar, tyUint..tyUInt64}\", line: 2307, col: 4, offsetA: 67549, offsetB: 67601)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toInt128" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "raiseRecoverableError" + }, + { + "kind": "nkStrLit", + "strVal": "cannot extract number from invalid AST node" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getInt64" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int64" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "deprecated" + }, + { + "kind": "nkStrLit", + "strVal": "use getInt" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCharLit" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkUIntLit" + }, + { + "kind": "nkIdent", + "ident": "nkUInt64Lit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkIntLit" + }, + { + "kind": "nkIdent", + "ident": "nkInt64Lit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "raiseRecoverableError" + }, + { + "kind": "nkStrLit", + "strVal": "cannot extract number from invalid AST node" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getFloat" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "BiggestFloat" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkFloatLiterals" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCharLit" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkUIntLit" + }, + { + "kind": "nkIdent", + "ident": "nkUInt64Lit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkIntLit" + }, + { + "kind": "nkIdent", + "ident": "nkInt64Lit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "BiggestFloat" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "raiseRecoverableError" + }, + { + "kind": "nkStrLit", + "strVal": "cannot extract number from invalid AST node" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#doAssert false, \\\"getFloat\\\"\", line: 2327, col: 6, offsetA: 68252, offsetB: 68279)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#internalError(a.info, \\\"getFloat\\\")\", line: 2328, col: 6, offsetA: 68286, offsetB: 68320)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#result = 0.0\", line: 2329, col: 6, offsetA: 68327, offsetB: 68340)" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getStr" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkStrLit" + }, + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkNilLit" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# let\\\'s hope this fixes more problems than it creates:\", line: 2336, col: 4, offsetA: 68463, offsetB: 68517)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "raiseRecoverableError" + }, + { + "kind": "nkStrLit", + "strVal": "cannot extract string from invalid AST node" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#doAssert false, \\\"getStr\\\"\", line: 2340, col: 6, offsetA: 68621, offsetB: 68646)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#internalError(a.info, \\\"getStr\\\")\", line: 2341, col: 6, offsetA: 68653, offsetB: 68685)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#result = \\\"\\\"\", line: 2342, col: 6, offsetA: 68692, offsetB: 68704)" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getStrOrChar" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkStrLit" + }, + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkCharLit" + }, + { + "kind": "nkIdent", + "ident": "nkUInt64Lit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "raiseRecoverableError" + }, + { + "kind": "nkStrLit", + "strVal": "cannot extract string from invalid AST node" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#doAssert false, \\\"getStrOrChar\\\"\", line: 2352, col: 6, offsetA: 68965, offsetB: 68996)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#internalError(a.info, \\\"getStrOrChar\\\")\", line: 2353, col: 6, offsetA: 69003, offsetB: 69041)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#result = \\\"\\\"\", line: 2354, col: 6, offsetA: 69048, offsetB: 69060)" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isGenericParams" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## used to judge whether a node is generic params.\", line: 2357, col: 2, offsetA: 69115, offsetB: 69165)" + ], + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkGenericParams" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isGenericRoutine" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "callableDefs" + } + ] + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "genericParamsPos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "isGenericParams" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isGenericRoutineStrict" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## determines if this symbol represents a generic routine\", line: 2364, col: 2, offsetA: 69398, offsetB: 69455)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## the unusual name is so it doesn\\\'t collide and eventually replaces\", line: 2365, col: 2, offsetA: 69458, offsetB: 69526)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## `isGenericRoutine`\", line: 2366, col: 2, offsetA: 69529, offsetB: 69550)" + ], + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "skProcKinds" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + }, + { + "kind": "nkIdent", + "ident": "isGenericRoutine" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isGenericRoutine" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## determines if this symbol represents a generic routine or an instance of\", line: 2370, col: 2, offsetA: 69656, offsetB: 69731)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## one. This should be renamed accordingly and `isGenericRoutineStrict`\", line: 2371, col: 2, offsetA: 69734, offsetB: 69805)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## should take this name instead.\", line: 2372, col: 2, offsetA: 69808, offsetB: 69841)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"##\", line: 2373, col: 2, offsetA: 69844, offsetB: 69846)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Warning/XXX: Unfortunately, it considers a proc kind symbol flagged with\", line: 2374, col: 2, offsetA: 69849, offsetB: 69924)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## sfFromGeneric as a generic routine. Instead this should likely not be the\", line: 2375, col: 2, offsetA: 69927, offsetB: 70003)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## case and the concepts should be teased apart:\", line: 2376, col: 2, offsetA: 70006, offsetB: 70054)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## - generic definition\", line: 2377, col: 2, offsetA: 70057, offsetB: 70080)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## - generic instance\", line: 2378, col: 2, offsetA: 70083, offsetB: 70104)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## - either generic definition or instance\", line: 2379, col: 2, offsetA: 70107, offsetB: 70149)" + ], + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "skProcKinds" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "sfFromGeneric" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + }, + { + "kind": "nkIdent", + "ident": "isGenericRoutine" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "skipGenericOwner" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Generic instantiations are owned by their originating generic\", line: 2383, col: 2, offsetA: 70274, offsetB: 70338)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## symbol. This proc skips such owners and goes straight to the owner\", line: 2384, col: 2, offsetA: 70341, offsetB: 70410)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## of the generic itself (the module or the enclosing proc).\", line: 2385, col: 2, offsetA: 70413, offsetB: 70473)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "skProcKinds" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "sfFromGeneric" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "owner" + } + ] + }, + { + "kind": "nkIdent", + "ident": "owner" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "owner" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "originatingModule" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "owner" + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "skModule" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "owner" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isRoutine" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "skProcKinds" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isCompileTimeProc" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "skMacro" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "skProc" + }, + { + "kind": "nkIdent", + "ident": "skFunc" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "sfCompileTime" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "hasPattern" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isRoutine" + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + }, + { + "kind": "nkIdent", + "ident": "patternPos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIteratorDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "items" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "safeLen" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkYieldStmt", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIteratorDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "pairs" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkTupleTy", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "safeLen" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkYieldStmt", + "sons": [ + { + "kind": "nkTupleConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isAtom" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkNone" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isEmptyType" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## \\\'void\\\' and \\\'typed\\\' types are often equivalent to \\\'nil\\\' these days:\", line: 2418, col: 2, offsetA: 71360, offsetB: 71429)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyVoid" + }, + { + "kind": "nkIdent", + "ident": "tyTyped" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "makeStmtList" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkStmtList" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeI" + }, + { + "kind": "nkIdent", + "ident": "nkStmtList" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "skipStmtList" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkStmtList" + }, + { + "kind": "nkIdent", + "ident": "nkStmtListExpr" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "nkCommentStmt" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "lastSon" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toVar" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TTypeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "idgen" + }, + { + "kind": "nkIdent", + "ident": "IdGenerator" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## If ``typ`` is not a tyVar then it is converted into a `var ` and\", line: 2440, col: 2, offsetA: 71932, offsetB: 72004)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## returned. Otherwise ``typ`` is simply returned as-is.\", line: 2441, col: 2, offsetA: 72007, offsetB: 72063)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newType" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextTypeId" + }, + { + "kind": "nkIdent", + "ident": "idgen" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "owner" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rawAddSon" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toRef" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "idgen" + }, + { + "kind": "nkIdent", + "ident": "IdGenerator" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## If ``typ`` is a tyObject then it is converted into a `ref ` and\", line: 2449, col: 2, offsetA: 72243, offsetB: 72314)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## returned. Otherwise ``typ`` is simply returned as-is.\", line: 2450, col: 2, offsetA: 72317, offsetB: 72373)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "skipTypes" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyAlias" + }, + { + "kind": "nkIdent", + "ident": "tyGenericInst" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tyObject" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newType" + }, + { + "kind": "nkIdent", + "ident": "tyRef" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextTypeId" + }, + { + "kind": "nkIdent", + "ident": "idgen" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "owner" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rawAddSon" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toObject" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## If ``typ`` is a tyRef then its immediate son is returned (which in many\", line: 2458, col: 2, offsetA: 72577, offsetB: 72651)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## cases should be a ``tyObject``).\", line: 2459, col: 2, offsetA: 72654, offsetB: 72689)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Otherwise ``typ`` is simply returned as-is.\", line: 2460, col: 2, offsetA: 72692, offsetB: 72738)" + ], + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "skipTypes" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyAlias" + }, + { + "kind": "nkIdent", + "ident": "tyGenericInst" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tyRef" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "lastSon" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toObjectFromRefPtrGeneric" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#[\\n See also `toObject`.\\n Finds the underlying `object`, even in cases like these:\\n type\\n B[T] = object f0: int\\n A1[T] = ref B[T]\\n A2[T] = ref object f1: int\\n A3 = ref object f2: int\\n A4 = object f3: int\\n ]#\", line: 2468, col: 2, offsetA: 72897, offsetB: 73122)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyGenericBody" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "lastSon" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyRef" + }, + { + "kind": "nkIdent", + "ident": "tyPtr" + }, + { + "kind": "nkIdent", + "ident": "tyGenericInst" + }, + { + "kind": "nkIdent", + "ident": "tyGenericInvocation" + }, + { + "kind": "nkIdent", + "ident": "tyAlias" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isImportedException" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "exc" + } + ] + }, + { + "kind": "nkIdent", + "ident": "excCpp" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "base" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "skipTypes" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyAlias" + }, + { + "kind": "nkIdent", + "ident": "tyPtr" + }, + { + "kind": "nkIdent", + "ident": "tyDistinct" + }, + { + "kind": "nkIdent", + "ident": "tyGenericInst" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "base" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "sfCompileToCpp" + }, + { + "kind": "nkIdent", + "ident": "sfImportc" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "base" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkCurly" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isInfixAs" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkInfix" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkIdent" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "as" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "skipColon" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkExprColonExpr" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "findUnresolvedStatic" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# n.typ == nil: see issue #14802\", line: 2507, col: 2, offsetA: 73939, offsetB: 73971)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tyStatic" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "son" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "son" + }, + { + "kind": "nkIdent", + "ident": "findUnresolvedStatic" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "containsNil" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# only for debugging\", line: 2519, col: 4, offsetA: 74224, offsetB: 74244)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "isNil" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "safeLen" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "containsNil" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "hasDestructor" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tfHasAsgn" + }, + { + "kind": "nkIdent", + "ident": "tfHasOwned" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkCurly" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "incompleteType" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "sfForward" + }, + { + "kind": "nkIdent", + "ident": "sfNoForward" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "sfForward" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "typeCompleted" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "incl" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "sfNoForward" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "detailedInfo" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "sym" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "sym" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isInlineIterator" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tyProc" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "tfIterator" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "callConv" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ccClosure" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isIterator" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tyProc" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "tfIterator" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isClosureIterator" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tyProc" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "tfIterator" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "callConv" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ccClosure" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isClosure" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tyProc" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "callConv" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ccClosure" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isSinkParam" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "skParam" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tySink" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "tfHasOwned" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isSinkType" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tySink" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "tfHasOwned" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newProcType" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "id" + }, + { + "kind": "nkIdent", + "ident": "ItemId" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "owner" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newType" + }, + { + "kind": "nkIdent", + "ident": "tyProc" + }, + { + "kind": "nkIdent", + "ident": "id" + }, + { + "kind": "nkIdent", + "ident": "owner" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeI" + }, + { + "kind": "nkIdent", + "ident": "nkFormalParams" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rawAddSon" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# return type\", line: 2560, col: 25, offsetA: 75538, offsetB: 75551)" + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# result.n[0] used to be `nkType`, but now it\\\'s `nkEffectList` because\", line: 2562, col: 2, offsetA: 75555, offsetB: 75625)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the effects are now stored in there too ... this is a bit hacky, but as\", line: 2563, col: 2, offsetA: 75628, offsetB: 75701)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# usual we desperately try to save memory:\", line: 2564, col: 2, offsetA: 75704, offsetB: 75746)" + ], + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeI" + }, + { + "kind": "nkIdent", + "ident": "nkEffectList" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "addParam" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "procType" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "param" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "param" + }, + { + "kind": "nkIdent", + "ident": "position" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "procType" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "procType" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSymNode" + }, + { + "kind": "nkIdent", + "ident": "param" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rawAddSon" + }, + { + "kind": "nkIdent", + "ident": "procType" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "param" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "magicsThatCanRaise" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "mNone" + }, + { + "kind": "nkIdent", + "ident": "mSlurp" + }, + { + "kind": "nkIdent", + "ident": "mStaticExec" + }, + { + "kind": "nkIdent", + "ident": "mParseExprToAst" + }, + { + "kind": "nkIdent", + "ident": "mParseStmtToAst" + }, + { + "kind": "nkIdent", + "ident": "mEcho" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "canRaiseConservative" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "magic" + } + ] + }, + { + "kind": "nkIdent", + "ident": "magicsThatCanRaise" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "canRaise" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "magic" + } + ] + }, + { + "kind": "nkIdent", + "ident": "magicsThatCanRaise" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "sfImportc" + }, + { + "kind": "nkIdent", + "ident": "sfInfixCall" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "sfImportc" + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "sfGeneratedOp" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "magic" + } + ] + }, + { + "kind": "nkIdent", + "ident": "mEcho" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO check for n having sons? or just return false for now if not\", line: 2594, col: 4, offsetA: 76535, offsetB: 76602)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIdent", + "ident": "effectListLen" + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "exceptionEffects" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "exceptionEffects" + } + ] + }, + { + "kind": "nkIdent", + "ident": "safeLen" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "toHumanStrImpl" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "T" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "T" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "num" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "static" + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..^" + }, + { + "kind": "nkIdent", + "ident": "num" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "toLowerAscii" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toHumanStr" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TSymKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## strips leading `sk`\", line: 2611, col: 2, offsetA: 77136, offsetB: 77158)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toHumanStrImpl" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toHumanStr" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TTypeKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## strips leading `tk`\", line: 2615, col: 2, offsetA: 77241, offsetB: 77263)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toHumanStrImpl" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "skipAddr" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkHiddenAddr" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isNewStyleConcept" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkTypeClassTy" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isOutParam" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "tfIsOutParam" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nodesToIgnoreSet" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkNone" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "pred" + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "succ" + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkNilLit" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkTypeSection" + }, + { + "kind": "nkIdent", + "ident": "nkProcDef" + }, + { + "kind": "nkIdent", + "ident": "nkConverterDef" + }, + { + "kind": "nkIdent", + "ident": "nkMethodDef" + }, + { + "kind": "nkIdent", + "ident": "nkIteratorDef" + }, + { + "kind": "nkIdent", + "ident": "nkMacroDef" + }, + { + "kind": "nkIdent", + "ident": "nkTemplateDef" + }, + { + "kind": "nkIdent", + "ident": "nkLambda" + }, + { + "kind": "nkIdent", + "ident": "nkDo" + }, + { + "kind": "nkIdent", + "ident": "nkFuncDef" + }, + { + "kind": "nkIdent", + "ident": "nkConstSection" + }, + { + "kind": "nkIdent", + "ident": "nkConstDef" + }, + { + "kind": "nkIdent", + "ident": "nkIncludeStmt" + }, + { + "kind": "nkIdent", + "ident": "nkImportStmt" + }, + { + "kind": "nkIdent", + "ident": "nkExportStmt" + }, + { + "kind": "nkIdent", + "ident": "nkPragma" + }, + { + "kind": "nkIdent", + "ident": "nkCommentStmt" + }, + { + "kind": "nkIdent", + "ident": "nkBreakState" + }, + { + "kind": "nkIdent", + "ident": "nkTypeOfExpr" + }, + { + "kind": "nkIdent", + "ident": "nkMixinStmt" + }, + { + "kind": "nkIdent", + "ident": "nkBindStmt" + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/phastalgo.nim b/src/phastalgo.nim new file mode 100644 index 0000000..c6e7466 --- /dev/null +++ b/src/phastalgo.nim @@ -0,0 +1,1381 @@ +# +# +# nimph +# (c) Copyright 2023 Jacek Sieka +# The Nim compiler +# (c) Copyright 2018 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# +# Algorithms for the abstract syntax tree: hash tables, lists +# and sets of nodes are supported. Efficiency is important as +# the data structures here are used in various places of the compiler. +# nimph version: +# * yaml formatting for the nimph-specific fields + +import phast, hashes, intsets, phoptions, phlineinfos, ropes, idents, rodutils, phmsgs + +import strutils except addf +when defined(nimPreviewSlimSystem): + import + std/assertions + +proc hashNode*(p: RootRef): Hash + +proc treeToYaml*( + conf: ConfigRef; n: PNode; indent: int = 0; maxRecDepth: int = -1 +): Rope + + # Convert a tree into its YAML representation; this is used by the + # YAML code generator and it is invaluable for debugging purposes. + # If maxRecDepht <> -1 then it won't print the whole graph. +proc typeToYaml*( + conf: ConfigRef; n: PType; indent: int = 0; maxRecDepth: int = -1 +): Rope + +proc symToYaml*(conf: ConfigRef; n: PSym; indent: int = 0; maxRecDepth: int = -1): Rope + +proc lineInfoToStr*(conf: ConfigRef; info: TLineInfo): Rope + + # these are for debugging only: They are not really deprecated, but I want + # the warning so that release versions do not contain debugging statements: +proc debug*(n: PSym; conf: ConfigRef = nil) {.deprecated.} + +proc debug*(n: PType; conf: ConfigRef = nil) {.deprecated.} + +proc debug*(n: PNode; conf: ConfigRef = nil) {.deprecated.} + +proc typekinds*(t: PType) {.deprecated.} = + var t = t + var s = "" + while t != nil and t.len > 0: + s.add $t.kind + s.add " " + + t = t.lastSon + + echo s + +template debug*(x: PSym | PType | PNode) {.deprecated.} = + when compiles(c.config): + debug(c.config, x) + elif compiles(c.graph.config): + debug(c.graph.config, x) + else: + error() + +template debug*(x: auto) {.deprecated.} = + echo x + +template mdbg*(): bool {.deprecated.} = + when compiles(c.graph): + c.module.fileIdx == c.graph.config.projectMainIdx + elif compiles(c.module): + c.module.fileIdx == c.config.projectMainIdx + elif compiles(c.c.module): + c.c.module.fileIdx == c.c.config.projectMainIdx + elif compiles(m.c.module): + m.c.module.fileIdx == m.c.config.projectMainIdx + elif compiles(cl.c.module): + cl.c.module.fileIdx == cl.c.config.projectMainIdx + elif compiles(p): + when compiles(p.lex): + p.lex.fileIdx == p.lex.config.projectMainIdx + else: + p.module.module.fileIdx == p.config.projectMainIdx + elif compiles(m.module.fileIdx): + m.module.fileIdx == m.config.projectMainIdx + elif compiles(L.fileIdx): + L.fileIdx == L.config.projectMainIdx + else: + error() + +# --------------------------- ident tables ---------------------------------- +proc idTableGet*(t: TIdTable; key: PIdObj): RootRef + +proc idTableGet*(t: TIdTable; key: int): RootRef + +proc idTablePut*(t: var TIdTable; key: PIdObj; val: RootRef) + +proc idTableHasObjectAsKey*(t: TIdTable; key: PIdObj): bool + + # checks if `t` contains the `key` (compared by the pointer value, not only + # `key`'s id) +proc idNodeTableGet*(t: TIdNodeTable; key: PIdObj): PNode + +proc idNodeTablePut*(t: var TIdNodeTable; key: PIdObj; val: PNode) # --------------------------------------------------------------------------- + +proc lookupInRecord*(n: PNode; field: PIdent): PSym + +proc mustRehash*(length, counter: int): bool + +proc nextTry*(h, maxHash: Hash): Hash {.inline.} # ------------- table[int, int] --------------------------------------------- + +const + InvalidKey* = low(int) + +type + TIIPair* {.final.} = object + key*, val*: int + + TIIPairSeq* = seq[TIIPair] + TIITable* {.final.} = object # table[int, int] + counter*: int + data*: TIIPairSeq + +proc initIiTable*(x: var TIITable) + +proc iiTableGet*(t: TIITable; key: int): int + +proc iiTablePut*(t: var TIITable; key, val: int) # implementation + +proc skipConvCastAndClosure*(n: PNode): PNode = + result = n + while true: + case result.kind + of nkObjUpConv, nkObjDownConv, nkChckRange, nkChckRangeF, nkChckRange64, nkClosure: + result = result[0] + of nkHiddenStdConv, nkHiddenSubConv, nkConv, nkCast: + result = result[1] + else: + break + +proc sameValue*(a, b: PNode): bool = + result = false + case a.kind + of nkCharLit .. nkUInt64Lit: + if b.kind in {nkCharLit .. nkUInt64Lit}: + result = getInt(a) == getInt(b) + of nkFloatLit .. nkFloat64Lit: + if b.kind in {nkFloatLit .. nkFloat64Lit}: + result = a.floatVal == b.floatVal + of nkStrLit .. nkTripleStrLit: + if b.kind in {nkStrLit .. nkTripleStrLit}: + result = a.strVal == b.strVal + else: + # don't raise an internal error for 'nim check': + #InternalError(a.info, "SameValue") + discard + +proc leValue*(a, b: PNode): bool = + # a <= b? + result = false + case a.kind + of nkCharLit .. nkUInt64Lit: + if b.kind in {nkCharLit .. nkUInt64Lit}: + result = getInt(a) <= getInt(b) + of nkFloatLit .. nkFloat64Lit: + if b.kind in {nkFloatLit .. nkFloat64Lit}: + result = a.floatVal <= b.floatVal + of nkStrLit .. nkTripleStrLit: + if b.kind in {nkStrLit .. nkTripleStrLit}: + result = a.strVal <= b.strVal + else: + # don't raise an internal error for 'nim check': + #InternalError(a.info, "leValue") + discard + +proc weakLeValue*(a, b: PNode): TImplication = + if a.kind notin nkLiterals or b.kind notin nkLiterals: + result = impUnknown + else: + result = + if leValue(a, b): + impYes + else: + impNo + +proc lookupInRecord(n: PNode; field: PIdent): PSym = + result = nil + case n.kind + of nkRecList: + for i in 0 ..< n.len: + result = lookupInRecord(n[i], field) + if result != nil: + return + of nkRecCase: + if (n[0].kind != nkSym): + return nil + + result = lookupInRecord(n[0], field) + if result != nil: + return + for i in 1 ..< n.len: + case n[i].kind + of nkOfBranch, nkElse: + result = lookupInRecord(lastSon(n[i]), field) + if result != nil: + return + else: + return nil + of nkSym: + if n.sym.name.id == field.id: + result = n.sym + else: + return nil + +proc getModule*(s: PSym): PSym = + result = s + + assert((result.kind == skModule) or (result.owner != result)) + while result != nil and result.kind != skModule: + result = result.owner + +proc fromSystem*(op: PSym): bool {.inline.} = + sfSystemModule in getModule(op).flags + +proc getSymFromList*(list: PNode; ident: PIdent; start: int = 0): PSym = + for i in start ..< list.len: + if list[i].kind == nkSym: + result = list[i].sym + if result.name.id == ident.id: + return + else: + return nil + + result = nil + +proc sameIgnoreBacktickGensymInfo(a, b: string): bool = + if a[0] != b[0]: + return false + + var alen = a.len - 1 + while alen > 0 and a[alen] != '`': + dec(alen) + if alen <= 0: + alen = a.len + + var i = 1 + var j = 1 + while true: + while i < alen and a[i] == '_': + inc i + while j < b.len and b[j] == '_': + inc j + + var aa = + if i < alen: + toLowerAscii(a[i]) + else: + '\0' + var bb = + if j < b.len: + toLowerAscii(b[j]) + else: + '\0' + if aa != bb: + return false + # the characters are identical: + if i >= alen: + # both cursors at the end: + if j >= b.len: + return true + + # not yet at the end of 'b': + return false + elif j >= b.len: + return false + + inc i + inc j + +proc getNamedParamFromList*(list: PNode; ident: PIdent): PSym = + ## Named parameters are special because a named parameter can be + ## gensym'ed and then they have '\`' suffix that we need to + ## ignore, see compiler / evaltempl.nim, snippet: + ## ``` + ## result.add newIdentNode(getIdent(c.ic, x.name.s & "\`gensym" & $x.id), + ## if c.instLines: actual.info else: templ.info) + ## ``` + for i in 1 ..< list.len: + let it = list[i].sym + if it.name.id == ident.id or sameIgnoreBacktickGensymInfo(it.name.s, ident.s): + return it + +proc hashNode(p: RootRef): Hash = + result = hash(cast[pointer](p)) + +proc mustRehash(length, counter: int): bool = + assert(length > counter) + + result = (length * 2 < counter * 3) or (length - counter < 4) + +proc rspaces(x: int): Rope = + # returns x spaces + result = rope(spaces(x)) + +proc toYamlChar(c: char): string = + case c + of '\0' .. '\x1F', '\x7F' .. '\xFF': + result = "\\u" & strutils.toHex(ord(c), 4) + of '\'', '\"', '\\': + result = '\\' & c + else: + result = $c + +proc makeYamlString*(s: string): Rope = + # We have to split long strings into many ropes. Otherwise + # this could trigger InternalError(111). See the ropes module for + # further information. + const + MaxLineLength = 64000 + + result = "" + + var res = "\"" + for i in 0 ..< s.len: + if (i + 1) mod MaxLineLength == 0: + res.add('\"') + res.add("\n") + result.add(rope(res)) + + res = "\"" # reset + + res.add(toYamlChar(s[i])) + + res.add('\"') + result.add(rope(res)) + +proc flagsToStr[T](flags: set[T]): Rope = + if flags == {}: + result = rope("[]") + else: + result = "" + for x in items(flags): + if result != "": + result.add(", ") + + result.add(makeYamlString($x)) + + result = "[" & result & "]" + +proc lineInfoToStr(conf: ConfigRef; info: TLineInfo): Rope = + result = + "[$1, $2, $3]" % [ + makeYamlString(toFilename(conf, info)), + rope(toLinenumber(info)), + rope(toColumn(info)) + ] + +proc treeToYamlAux( + conf: ConfigRef; n: PNode; marker: var IntSet; indent, maxRecDepth: int +): Rope + +proc symToYamlAux( + conf: ConfigRef; n: PSym; marker: var IntSet; indent, maxRecDepth: int +): Rope + +proc typeToYamlAux( + conf: ConfigRef; n: PType; marker: var IntSet; indent, maxRecDepth: int +): Rope + +proc symToYamlAux( + conf: ConfigRef; n: PSym; marker: var IntSet; indent: int; maxRecDepth: int +): Rope = + if n == nil: + result = rope("null") + elif containsOrIncl(marker, n.id): + result = "\"$1\"" % [rope(n.name.s)] + else: + var ast = treeToYamlAux(conf, n.ast, marker, indent + 2, maxRecDepth - 1) + #rope("typ"), typeToYamlAux(conf, n.typ, marker, + # indent + 2, maxRecDepth - 1), + + let istr = rspaces(indent + 2) + + result = rope("{") + + result.addf("$N$1\"kind\": $2", [istr, makeYamlString($n.kind)]) + result.addf("$N$1\"name\": $2", [istr, makeYamlString(n.name.s)]) + if n.typ != nil: + result.addf( + "$N$1\"typ\": $2", + [istr, typeToYamlAux(conf, n.typ, marker, indent + 2, maxRecDepth - 1)] + ) + if conf != nil: + # if we don't pass the config, we probably don't care about the line info + result.addf("$N$1\"info\": $2", [istr, lineInfoToStr(conf, n.info)]) + if card(n.flags) > 0: + result.addf("$N$1\"flags\": $2", [istr, flagsToStr(n.flags)]) + + result.addf("$N$1\"magic\": $2", [istr, makeYamlString($n.magic)]) + result.addf("$N$1\"ast\": $2", [istr, ast]) + result.addf("$N$1\"options\": $2", [istr, flagsToStr(n.options)]) + result.addf("$N$1\"position\": $2", [istr, rope(n.position)]) + result.addf("$N$1\"k\": $2", [istr, makeYamlString($n.loc.k)]) + result.addf("$N$1\"storage\": $2", [istr, makeYamlString($n.loc.storage)]) + if card(n.loc.flags) > 0: + result.addf("$N$1\"flags\": $2", [istr, makeYamlString($n.loc.flags)]) + + result.addf("$N$1\"r\": $2", [istr, n.loc.r]) + result.addf( + "$N$1\"lode\": $2", + [istr, treeToYamlAux(conf, n.loc.lode, marker, indent + 2, maxRecDepth - 1)] + ) + result.addf("$N$1}", [rspaces(indent)]) + +proc typeToYamlAux( + conf: ConfigRef; n: PType; marker: var IntSet; indent: int; maxRecDepth: int +): Rope = + var sonsRope: Rope + if n == nil: + sonsRope = rope("null") + elif containsOrIncl(marker, n.id): + sonsRope = + "\"$1 @$2\"" % [rope($n.kind), rope(strutils.toHex(cast[int](n), sizeof(n) * 2))] + else: + if n.len > 0: + sonsRope = rope("[") + for i in 0 ..< n.len: + if i > 0: + sonsRope.add(",") + + sonsRope.addf( + "$N$1$2", + [ + rspaces(indent + 4), + typeToYamlAux(conf, n[i], marker, indent + 4, maxRecDepth - 1) + ] + ) + + sonsRope.addf("$N$1]", [rspaces(indent + 2)]) + else: + sonsRope = rope("null") + + let istr = rspaces(indent + 2) + + result = rope("{") + + result.addf("$N$1\"kind\": $2", [istr, makeYamlString($n.kind)]) + result.addf( + "$N$1\"sym\": $2", + [istr, symToYamlAux(conf, n.sym, marker, indent + 2, maxRecDepth - 1)] + ) + result.addf( + "$N$1\"n\": $2", + [istr, treeToYamlAux(conf, n.n, marker, indent + 2, maxRecDepth - 1)] + ) + if card(n.flags) > 0: + result.addf("$N$1\"flags\": $2", [istr, flagsToStr(n.flags)]) + + result.addf("$N$1\"callconv\": $2", [istr, makeYamlString($n.callConv)]) + result.addf("$N$1\"size\": $2", [istr, rope(n.size)]) + result.addf("$N$1\"align\": $2", [istr, rope(n.align)]) + result.addf("$N$1\"sons\": $2", [istr, sonsRope]) + +proc treeToYamlAux( + conf: ConfigRef; n: PNode; marker: var IntSet; indent: int; maxRecDepth: int +): Rope = + if n == nil: + result = rope("null") + else: + var istr = rspaces(indent + 2) + + result = "{$N$1\"kind\": $2" % [istr, makeYamlString($n.kind)] + if maxRecDepth != 0: + if conf != nil: + result.addf(",$N$1\"info\": $2", [istr, lineInfoToStr(conf, n.info)]) + if n.prefix.len > 0: + result.addf(",$N$1\"prefix\": [", [istr]) + for i in 0 ..< n.prefix.len: + if i > 0: + result.add(",") + + result.addf("$N$1$2", [rspaces(indent + 4), makeYamlString($n.prefix[i])]) + + result.addf("$N$1]", [istr]) + if n.mid.len > 0: + result.addf(",$N$1\"mid\": [", [istr]) + for i in 0 ..< n.mid.len: + if i > 0: + result.add(",") + + result.addf("$N$1$2", [rspaces(indent + 4), makeYamlString($n.mid[i])]) + + result.addf("$N$1]", [istr]) + case n.kind + of nkCharLit .. nkUInt64Lit: + result.addf(",$N$1\"intVal\": $2", [istr, rope(n.intVal)]) + of nkFloatLit .. nkFloat128Lit: + result.addf(",$N$1\"floatVal\": $2", [istr, rope(n.floatVal.toStrMaxPrecision)]) + of nkStrLit .. nkTripleStrLit: + result.addf(",$N$1\"strVal\": $2", [istr, makeYamlString(n.strVal)]) + of nkSym: + result.addf( + ",$N$1\"sym\": $2", + [istr, symToYamlAux(conf, n.sym, marker, indent + 2, maxRecDepth)] + ) + of nkIdent: + if n.ident != nil: + result.addf(",$N$1\"ident\": $2", [istr, makeYamlString(n.ident.s)]) + else: + result.addf(",$N$1\"ident\": null", [istr]) + of nkCommentStmt: + result.addf(",$N$1\"comment\": $2", [istr, makeYamlString(n.comment)]) + else: + if n.len > 0: + result.addf(",$N$1\"sons\": [", [istr]) + for i in 0 ..< n.len: + if i > 0: + result.add(",") + + result.addf( + "$N$1$2", + [ + rspaces(indent + 4), + treeToYamlAux(conf, n[i], marker, indent + 4, maxRecDepth - 1) + ] + ) + + result.addf("$N$1]", [istr]) + if n.typ != nil: + result.addf( + ",$N$1\"typ\": $2", + [istr, typeToYamlAux(conf, n.typ, marker, indent + 2, maxRecDepth)] + ) + if n.postfix.len > 0: + result.addf(",$N$1\"postfix\": [", [istr]) + for i in 0 ..< n.postfix.len: + if i > 0: + result.add(",") + + result.addf("$N$1$2", [rspaces(indent + 4), makeYamlString($n.postfix[i])]) + + result.addf("$N$1]", [istr]) + + result.addf("$N$1}", [rspaces(indent)]) + +proc treeToYaml( + conf: ConfigRef; n: PNode; indent: int = 0; maxRecDepth: int = -1 +): Rope = + var marker = initIntSet() + + result = treeToYamlAux(conf, n, marker, indent, maxRecDepth) + +proc typeToYaml( + conf: ConfigRef; n: PType; indent: int = 0; maxRecDepth: int = -1 +): Rope = + var marker = initIntSet() + + result = typeToYamlAux(conf, n, marker, indent, maxRecDepth) + +proc symToYaml(conf: ConfigRef; n: PSym; indent: int = 0; maxRecDepth: int = -1): Rope = + var marker = initIntSet() + + result = symToYamlAux(conf, n, marker, indent, maxRecDepth) + +import tables + +const + backrefStyle = "\e[90m" +const + enumStyle = "\e[34m" +const + numberStyle = "\e[33m" +const + stringStyle = "\e[32m" +const + resetStyle = "\e[0m" + +type + DebugPrinter = object + conf: ConfigRef + visited: Table[pointer, int] + renderSymType: bool + indent: int + currentLine: int + firstItem: bool + useColor: bool + res: string + +proc indentMore(this: var DebugPrinter) = + this.indent += 2 + +proc indentLess(this: var DebugPrinter) = + this.indent -= 2 + +proc newlineAndIndent(this: var DebugPrinter) = + this.res.add "\n" + + this.currentLine += 1 + for i in 0 ..< this.indent: + this.res.add ' ' + +proc openCurly(this: var DebugPrinter) = + this.res.add "{" + + this.indentMore + + this.firstItem = true + +proc closeCurly(this: var DebugPrinter) = + this.indentLess + this.newlineAndIndent + + this.res.add "}" + +proc comma(this: var DebugPrinter) = + this.res.add ", " + +proc openBracket(this: var DebugPrinter) = + this.res.add "[" + +#this.indentMore +proc closeBracket(this: var DebugPrinter) = + #this.indentLess + this.res.add "]" + +proc key(this: var DebugPrinter; key: string) = + if not this.firstItem: + this.res.add "," + + this.firstItem = false + + this.newlineAndIndent + + this.res.add "\"" + this.res.add key + this.res.add "\": " + +proc value(this: var DebugPrinter; value: string) = + if this.useColor: + this.res.add stringStyle + + this.res.add "\"" + this.res.add value + this.res.add "\"" + if this.useColor: + this.res.add resetStyle + +proc value(this: var DebugPrinter; value: BiggestInt) = + if this.useColor: + this.res.add numberStyle + + this.res.addInt value + if this.useColor: + this.res.add resetStyle + +proc value[T: enum](this: var DebugPrinter; value: T) = + if this.useColor: + this.res.add enumStyle + + this.res.add "\"" + this.res.add $value + this.res.add "\"" + if this.useColor: + this.res.add resetStyle + +proc value[T: enum](this: var DebugPrinter; value: set[T]) = + this.openBracket + + let high = card(value) - 1 + + var i = 0 + for v in value: + this.value v + if i != high: + this.comma + + inc i + + this.closeBracket + +template earlyExit(this: var DebugPrinter; n: PType | PNode | PSym) = + if n == nil: + this.res.add "null" + + return + + let index = this.visited.getOrDefault(cast[pointer](n), -1) + if index < 0: + this.visited[cast[pointer](n)] = this.currentLine + else: + if this.useColor: + this.res.add backrefStyle + + this.res.add "" + if this.useColor: + this.res.add resetStyle + + return + +proc value(this: var DebugPrinter; value: PType) + +proc value(this: var DebugPrinter; value: PNode) + +proc value(this: var DebugPrinter; value: PSym) = + earlyExit(this, value) + + this.openCurly + + this.key("kind") + this.value(value.kind) + this.key("name") + this.value(value.name.s) + this.key("id") + this.value(value.id) + if value.kind in {skField, skEnumField, skParam}: + this.key("position") + this.value(value.position) + if card(value.flags) > 0: + this.key("flags") + this.value(value.flags) + if this.renderSymType and value.typ != nil: + this.key "typ" + + this.value(value.typ) + + this.closeCurly + +proc value(this: var DebugPrinter; value: PType) = + earlyExit(this, value) + + this.openCurly + + this.key "kind" + this.value value.kind + this.key "id" + this.value value.id + if value.sym != nil: + this.key "sym" + this.value value.sym #this.value value.sym.name.s + if card(value.flags) > 0: + this.key "flags" + this.value value.flags + if value.kind in IntegralTypes and value.n != nil: + this.key "n" + this.value value.n + if value.len > 0: + this.key "sons" + + this.openBracket + for i in 0 ..< value.len: + this.value value[i] + if i != value.len - 1: + this.comma + + this.closeBracket + if value.n != nil: + this.key "n" + this.value value.n + + this.closeCurly + +proc value(this: var DebugPrinter; value: PNode) = + earlyExit(this, value) + + this.openCurly + + this.key "kind" + this.value value.kind + if value.comment.len > 0: + this.key "comment" + this.value value.comment + when defined(useNodeIds): + this.key "id" + this.value value.id + if this.conf != nil: + this.key "info" + this.value $lineInfoToStr(this.conf, value.info) + if value.flags != {}: + this.key "flags" + this.value value.flags + if value.typ != nil: + this.key "typ" + this.value value.typ.kind + else: + this.key "typ" + this.value "nil" + case value.kind + of nkCharLit .. nkUInt64Lit: + this.key "intVal" + this.value value.intVal + of nkFloatLit, nkFloat32Lit, nkFloat64Lit: + this.key "floatVal" + this.value value.floatVal.toStrMaxPrecision + of nkStrLit .. nkTripleStrLit: + this.key "strVal" + this.value value.strVal + of nkSym: + this.key "sym" + this.value value.sym #this.value value.sym.name.s + of nkIdent: + if value.ident != nil: + this.key "ident" + this.value value.ident.s + else: + if this.renderSymType and value.typ != nil: + this.key "typ" + this.value value.typ + if value.len > 0: + this.key "sons" + + this.openBracket + for i in 0 ..< value.len: + this.value value[i] + if i != value.len - 1: + this.comma + + this.closeBracket + + this.closeCurly + +proc debug(n: PSym; conf: ConfigRef) = + var this: DebugPrinter + + this.visited = initTable[pointer, int]() + this.renderSymType = true + this.useColor = not defined(windows) + + this.value(n) + echo($this.res) + +proc debug(n: PType; conf: ConfigRef) = + var this: DebugPrinter + + this.visited = initTable[pointer, int]() + this.renderSymType = true + this.useColor = not defined(windows) + + this.value(n) + echo($this.res) + +proc debug(n: PNode; conf: ConfigRef) = + var this: DebugPrinter + + this.visited = initTable[pointer, int]() + #this.renderSymType = true + this.useColor = not defined(windows) + + this.value(n) + echo($this.res) + +proc nextTry(h, maxHash: Hash): Hash = + result = ((5 * h) + 1) and maxHash + +# For any initial h in range(maxHash), repeating that maxHash times +# generates each int in range(maxHash) exactly once (see any text on +# random-number generation for proof). +proc objectSetContains*(t: TObjectSet; obj: RootRef): bool = + # returns true whether n is in t + var h: Hash = hashNode(obj) and high(t.data) # start with real hash value + while t.data[h] != nil: + if t.data[h] == obj: + return true + + h = nextTry(h, high(t.data)) + + result = false + +proc objectSetRawInsert(data: var TObjectSeq; obj: RootRef) = + var h: Hash = hashNode(obj) and high(data) + while data[h] != nil: + assert(data[h] != obj) + + h = nextTry(h, high(data)) + + assert(data[h] == nil) + + data[h] = obj + +proc objectSetEnlarge(t: var TObjectSet) = + var n: TObjectSeq + + newSeq(n, t.data.len * GrowthFactor) + for i in 0 .. high(t.data): + if t.data[i] != nil: + objectSetRawInsert(n, t.data[i]) + + swap(t.data, n) + +proc objectSetIncl*(t: var TObjectSet; obj: RootRef) = + if mustRehash(t.data.len, t.counter): + objectSetEnlarge(t) + + objectSetRawInsert(t.data, obj) + inc(t.counter) + +proc objectSetContainsOrIncl*(t: var TObjectSet; obj: RootRef): bool = + # returns true if obj is already in the string table: + var h: Hash = hashNode(obj) and high(t.data) + while true: + var it = t.data[h] + if it == nil: + break + if it == obj: + return true # found it + + h = nextTry(h, high(t.data)) + if mustRehash(t.data.len, t.counter): + objectSetEnlarge(t) + objectSetRawInsert(t.data, obj) + else: + assert(t.data[h] == nil) + + t.data[h] = obj + + inc(t.counter) + + result = false + +proc strTableContains*(t: TStrTable; n: PSym): bool = + var h: Hash = n.name.h and high(t.data) # start with real hash value + while t.data[h] != nil: + if (t.data[h] == n): + return true + + h = nextTry(h, high(t.data)) + + result = false + +proc strTableRawInsert(data: var seq[PSym]; n: PSym) = + var h: Hash = n.name.h and high(data) + while data[h] != nil: + if data[h] == n: + # allowed for 'export' feature: + #InternalError(n.info, "StrTableRawInsert: " & n.name.s) + return + + h = nextTry(h, high(data)) + + assert(data[h] == nil) + + data[h] = n + +proc symTabReplaceRaw(data: var seq[PSym]; prevSym: PSym; newSym: PSym) = + assert prevSym.name.h == newSym.name.h + + var h: Hash = prevSym.name.h and high(data) + while data[h] != nil: + if data[h] == prevSym: + data[h] = newSym + + return + + h = nextTry(h, high(data)) + + assert false + +proc symTabReplace*(t: var TStrTable; prevSym: PSym; newSym: PSym) = + symTabReplaceRaw(t.data, prevSym, newSym) + +proc strTableEnlarge(t: var TStrTable) = + var n: seq[PSym] + + newSeq(n, t.data.len * GrowthFactor) + for i in 0 .. high(t.data): + if t.data[i] != nil: + strTableRawInsert(n, t.data[i]) + + swap(t.data, n) + +proc strTableAdd*(t: var TStrTable; n: PSym) = + if mustRehash(t.data.len, t.counter): + strTableEnlarge(t) + + strTableRawInsert(t.data, n) + inc(t.counter) + +proc strTableInclReportConflict*( + t: var TStrTable; n: PSym; onConflictKeepOld = false +): PSym = + # if `t` has a conflicting symbol (same identifier as `n`), return it + # otherwise return `nil`. Incl `n` to `t` unless `onConflictKeepOld = true` + # and a conflict was found. + assert n.name != nil + + var h: Hash = n.name.h and high(t.data) + var replaceSlot = -1 + while true: + var it = t.data[h] + if it == nil: + break + # Semantic checking can happen multiple times thanks to templates + # and overloading: (var x=@[]; x).mapIt(it). + # So it is possible the very same sym is added multiple + # times to the symbol table which we allow here with the 'it == n' check. + if it.name.id == n.name.id: + if it == n: + return nil + + replaceSlot = h + + h = nextTry(h, high(t.data)) + if replaceSlot >= 0: + result = t.data[replaceSlot] # found it + if not onConflictKeepOld: + t.data[replaceSlot] = n # overwrite it with newer definition! + + return result # but return the old one + elif mustRehash(t.data.len, t.counter): + strTableEnlarge(t) + strTableRawInsert(t.data, n) + else: + assert(t.data[h] == nil) + + t.data[h] = n + + inc(t.counter) + + result = nil + +proc strTableIncl*(t: var TStrTable; n: PSym; onConflictKeepOld = false): bool {. + discardable +.} = + result = strTableInclReportConflict(t, n, onConflictKeepOld) != nil + +proc strTableGet*(t: TStrTable; name: PIdent): PSym = + var h: Hash = name.h and high(t.data) + while true: + result = t.data[h] + if result == nil: + break + if result.name.id == name.id: + break + + h = nextTry(h, high(t.data)) + +type + TIdentIter* = object # iterator over all syms with same identifier + h*: Hash # current hash + name*: PIdent + +proc nextIdentIter*(ti: var TIdentIter; tab: TStrTable): PSym = + # hot spots + var h = ti.h and high(tab.data) + var start = h + var p {.cursor.} = tab.data[h] + while p != nil: + if p.name.id == ti.name.id: + break + + h = nextTry(h, high(tab.data)) + if h == start: + p = nil + + break + + p = tab.data[h] + if p != nil: + result = p # increase the count + else: + result = nil + + ti.h = nextTry(h, high(tab.data)) + +proc initIdentIter*(ti: var TIdentIter; tab: TStrTable; s: PIdent): PSym = + ti.h = s.h + ti.name = s + if tab.counter == 0: + result = nil + else: + result = nextIdentIter(ti, tab) + +proc nextIdentExcluding*(ti: var TIdentIter; tab: TStrTable; excluding: IntSet): PSym = + var h: Hash = ti.h and high(tab.data) + var start = h + + result = tab.data[h] + while result != nil: + if result.name.id == ti.name.id and not contains(excluding, result.id): + break + + h = nextTry(h, high(tab.data)) + if h == start: + result = nil + + break + + result = tab.data[h] + + ti.h = nextTry(h, high(tab.data)) + if result != nil and contains(excluding, result.id): + result = nil + +proc firstIdentExcluding*( + ti: var TIdentIter; tab: TStrTable; s: PIdent; excluding: IntSet +): PSym = + ti.h = s.h + ti.name = s + if tab.counter == 0: + result = nil + else: + result = nextIdentExcluding(ti, tab, excluding) + +type + TTabIter* = object + h: Hash + +proc nextIter*(ti: var TTabIter; tab: TStrTable): PSym = + # usage: + # var + # i: TTabIter + # s: PSym + # s = InitTabIter(i, table) + # while s != nil: + # ... + # s = NextIter(i, table) + # + result = nil + while (ti.h <= high(tab.data)): + result = tab.data[ti.h] + + inc(ti.h) # ... and increment by one always + if result != nil: + break + +proc initTabIter*(ti: var TTabIter; tab: TStrTable): PSym = + ti.h = 0 + if tab.counter == 0: + result = nil + else: + result = nextIter(ti, tab) + +iterator items*(tab: TStrTable): PSym = + var it: TTabIter + var s = initTabIter(it, tab) + while s != nil: + yield s + + s = nextIter(it, tab) + +proc hasEmptySlot(data: TIdPairSeq): bool = + for h in 0 .. high(data): + if data[h].key == nil: + return true + + result = false + +proc idTableRawGet(t: TIdTable; key: int): int = + var h: Hash + + h = key and high(t.data) # start with real hash value + while t.data[h].key != nil: + if t.data[h].key.id == key: + return h + + h = nextTry(h, high(t.data)) + + result = -1 + +proc idTableHasObjectAsKey(t: TIdTable; key: PIdObj): bool = + var index = idTableRawGet(t, key.id) + if index >= 0: + result = t.data[index].key == key + else: + result = false + +proc idTableGet(t: TIdTable; key: PIdObj): RootRef = + var index = idTableRawGet(t, key.id) + if index >= 0: + result = t.data[index].val + else: + result = nil + +proc idTableGet(t: TIdTable; key: int): RootRef = + var index = idTableRawGet(t, key) + if index >= 0: + result = t.data[index].val + else: + result = nil + +iterator pairs*(t: TIdTable): tuple[key: int, value: RootRef] = + for i in 0 .. high(t.data): + if t.data[i].key != nil: + yield (t.data[i].key.id, t.data[i].val) + +proc idTableRawInsert(data: var TIdPairSeq; key: PIdObj; val: RootRef) = + var h: Hash + + h = key.id and high(data) + while data[h].key != nil: + assert(data[h].key.id != key.id) + + h = nextTry(h, high(data)) + + assert(data[h].key == nil) + + data[h].key = key + data[h].val = val + +proc idTablePut(t: var TIdTable; key: PIdObj; val: RootRef) = + var + index: int + n: TIdPairSeq + + index = idTableRawGet(t, key.id) + if index >= 0: + assert(t.data[index].key != nil) + + t.data[index].val = val + else: + if mustRehash(t.data.len, t.counter): + newSeq(n, t.data.len * GrowthFactor) + for i in 0 .. high(t.data): + if t.data[i].key != nil: + idTableRawInsert(n, t.data[i].key, t.data[i].val) + + assert(hasEmptySlot(n)) + swap(t.data, n) + + idTableRawInsert(t.data, key, val) + inc(t.counter) + +iterator idTablePairs*(t: TIdTable): tuple[key: PIdObj, val: RootRef] = + for i in 0 .. high(t.data): + if not isNil(t.data[i].key): + yield (t.data[i].key, t.data[i].val) + +proc idNodeTableRawGet(t: TIdNodeTable; key: PIdObj): int = + var h: Hash + + h = key.id and high(t.data) # start with real hash value + while t.data[h].key != nil: + if t.data[h].key.id == key.id: + return h + + h = nextTry(h, high(t.data)) + + result = -1 + +proc idNodeTableGet(t: TIdNodeTable; key: PIdObj): PNode = + var index: int + + index = idNodeTableRawGet(t, key) + if index >= 0: + result = t.data[index].val + else: + result = nil + +proc idNodeTableRawInsert(data: var TIdNodePairSeq; key: PIdObj; val: PNode) = + var h: Hash + + h = key.id and high(data) + while data[h].key != nil: + assert(data[h].key.id != key.id) + + h = nextTry(h, high(data)) + + assert(data[h].key == nil) + + data[h].key = key + data[h].val = val + +proc idNodeTablePut(t: var TIdNodeTable; key: PIdObj; val: PNode) = + var index = idNodeTableRawGet(t, key) + if index >= 0: + assert(t.data[index].key != nil) + + t.data[index].val = val + else: + if mustRehash(t.data.len, t.counter): + var n: TIdNodePairSeq + + newSeq(n, t.data.len * GrowthFactor) + for i in 0 .. high(t.data): + if t.data[i].key != nil: + idNodeTableRawInsert(n, t.data[i].key, t.data[i].val) + + swap(t.data, n) + + idNodeTableRawInsert(t.data, key, val) + inc(t.counter) + +iterator pairs*(t: TIdNodeTable): tuple[key: PIdObj, val: PNode] = + for i in 0 .. high(t.data): + if not isNil(t.data[i].key): + yield (t.data[i].key, t.data[i].val) + +proc initIITable(x: var TIITable) = + x.counter = 0 + + newSeq(x.data, StartSize) + for i in 0 ..< StartSize: + x.data[i].key = InvalidKey + +proc iiTableRawGet(t: TIITable; key: int): int = + var h: Hash + + h = key and high(t.data) # start with real hash value + while t.data[h].key != InvalidKey: + if t.data[h].key == key: + return h + + h = nextTry(h, high(t.data)) + + result = -1 + +proc iiTableGet(t: TIITable; key: int): int = + var index = iiTableRawGet(t, key) + if index >= 0: + result = t.data[index].val + else: + result = InvalidKey + +proc iiTableRawInsert(data: var TIIPairSeq; key, val: int) = + var h: Hash + + h = key and high(data) + while data[h].key != InvalidKey: + assert(data[h].key != key) + + h = nextTry(h, high(data)) + + assert(data[h].key == InvalidKey) + + data[h].key = key + data[h].val = val + +proc iiTablePut(t: var TIITable; key, val: int) = + var index = iiTableRawGet(t, key) + if index >= 0: + assert(t.data[index].key != InvalidKey) + + t.data[index].val = val + else: + if mustRehash(t.data.len, t.counter): + var n: TIIPairSeq + + newSeq(n, t.data.len * GrowthFactor) + for i in 0 .. high(n): + n[i].key = InvalidKey + for i in 0 .. high(t.data): + if t.data[i].key != InvalidKey: + iiTableRawInsert(n, t.data[i].key, t.data[i].val) + + swap(t.data, n) + + iiTableRawInsert(t.data, key, val) + inc(t.counter) + +proc isAddrNode*(n: PNode): bool = + case n.kind + of nkAddr, nkHiddenAddr: + true + of nkCallKinds: + if n[0].kind == nkSym and n[0].sym.magic == mAddr: + true + else: + false + else: + false + +proc listSymbolNames*(symbols: openArray[PSym]): string = + for sym in symbols: + if result.len > 0: + result.add ", " + + result.add sym.name.s + +proc isDiscriminantField*(n: PNode): bool = + if n.kind == nkCheckedFieldExpr: + sfDiscriminant in n[0][1].sym.flags + elif n.kind == nkDotExpr: + sfDiscriminant in n[1].sym.flags + else: + false diff --git a/src/phastalgo.nim.nimph.yaml b/src/phastalgo.nim.nimph.yaml new file mode 100644 index 0000000..2dd197e --- /dev/null +++ b/src/phastalgo.nim.nimph.yaml @@ -0,0 +1,36265 @@ +{ + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# nimph" + }, + { + "kind": "nkCommentStmt", + "comment": "# (c) Copyright 2023 Jacek Sieka" + }, + { + "kind": "nkCommentStmt", + "comment": "# The Nim compiler" + }, + { + "kind": "nkCommentStmt", + "comment": "# (c) Copyright 2018 Andreas Rumpf" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# See the file \"copying.txt\", included in this" + }, + { + "kind": "nkCommentStmt", + "comment": "# distribution, for details about the copyright." + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# Algorithms for the abstract syntax tree: hash tables, lists" + }, + { + "kind": "nkCommentStmt", + "comment": "# and sets of nodes are supported. Efficiency is important as" + }, + { + "kind": "nkCommentStmt", + "comment": "# the data structures here are used in various places of the compiler." + }, + { + "kind": "nkCommentStmt", + "comment": "# nimph version:" + }, + { + "kind": "nkCommentStmt", + "comment": "# * yaml formatting for the nimph-specific fields" + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "phast" + }, + { + "kind": "nkIdent", + "ident": "hashes" + }, + { + "kind": "nkIdent", + "ident": "intsets" + }, + { + "kind": "nkIdent", + "ident": "phoptions" + }, + { + "kind": "nkIdent", + "ident": "phlineinfos" + }, + { + "kind": "nkIdent", + "ident": "ropes" + }, + { + "kind": "nkIdent", + "ident": "idents" + }, + { + "kind": "nkIdent", + "ident": "rodutils" + }, + { + "kind": "nkIdent", + "ident": "phmsgs" + } + ] + }, + { + "kind": "nkImportExceptStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "strutils" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "nimPreviewSlimSystem" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkIdent", + "ident": "std" + }, + { + "kind": "nkIdent", + "ident": "assertions" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "hashNode" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "RootRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "treeToYaml" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "maxRecDepth" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Convert a tree into its YAML representation; this is used by the\", line: 30, col: 2, offsetA: 816, offsetB: 882)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# YAML code generator and it is invaluable for debugging purposes.\", line: 31, col: 2, offsetA: 885, offsetB: 951)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# If maxRecDepht <> -1 then it won\\\'t print the whole graph.\", line: 32, col: 2, offsetA: 954, offsetB: 1013)" + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "typeToYaml" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "maxRecDepth" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "symToYaml" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "maxRecDepth" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "lineInfoToStr" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# these are for debugging only: They are not really deprecated, but I want\", line: 41, col: 2, offsetA: 1263, offsetB: 1337)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the warning so that release versions do not contain debugging statements:\", line: 42, col: 2, offsetA: 1340, offsetB: 1415)" + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "debug" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "deprecated" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "debug" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "deprecated" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "debug" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "deprecated" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "typekinds" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "deprecated" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "t" + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": " " + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "lastSon" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "echo" + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "debug" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "|" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "|" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkIdent", + "ident": "PType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PNode" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "deprecated" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "compiles" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "debug" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "compiles" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "graph" + } + ] + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "debug" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "graph" + } + ] + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "error" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "debug" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "auto" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "deprecated" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "echo" + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "mdbg" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "deprecated" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "compiles" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "graph" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "graph" + } + ] + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "projectMainIdx" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "compiles" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "projectMainIdx" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "compiles" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "projectMainIdx" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "compiles" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "projectMainIdx" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "compiles" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "cl" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "cl" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "cl" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "projectMainIdx" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "compiles" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "compiles" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "projectMainIdx" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "projectMainIdx" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "compiles" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkIdent", + "ident": "module" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "projectMainIdx" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "compiles" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "projectMainIdx" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "error" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# --------------------------- ident tables ----------------------------------\", line: 94, col: 0, offsetA: 2781, offsetB: 2858)" + ], + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "idTableGet" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "RootRef" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "TIdTable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "PIdObj" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "idTableGet" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "RootRef" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "TIdTable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "idTablePut" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIdTable" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "PIdObj" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "val" + }, + { + "kind": "nkIdent", + "ident": "RootRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "idTableHasObjectAsKey" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "TIdTable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "PIdObj" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# checks if `t` contains the `key` (compared by the pointer value, not only\", line: 103, col: 2, offsetA: 3087, offsetB: 3162)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# `key`\\\'s id)\", line: 104, col: 2, offsetA: 3165, offsetB: 3178)" + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "idNodeTableGet" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "TIdNodeTable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "PIdObj" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "idNodeTablePut" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIdNodeTable" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "PIdObj" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "val" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ---------------------------------------------------------------------------\", line: 107, col: 67, offsetA: 3305, offsetB: 3382)" + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "lookupInRecord" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "field" + }, + { + "kind": "nkIdent", + "ident": "PIdent" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "mustRehash" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "length" + }, + { + "kind": "nkIdent", + "ident": "counter" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nextTry" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "maxHash" + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ------------- table[int, int] ---------------------------------------------\", line: 113, col: 49, offsetA: 3532, offsetB: 3609)" + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "InvalidKey" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "low" + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPragmaExpr", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TIIPair" + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "final" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TIIPairSeq" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "TIIPair" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPragmaExpr", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TIITable" + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "final" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# table[int, int]\", line: 123, col: 31, offsetA: 3759, offsetB: 3776)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TIIPairSeq" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "initIiTable" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIITable" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "iiTableGet" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "TIITable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "iiTablePut" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIITable" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "val" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# implementation\", line: 131, col: 49, offsetA: 3949, offsetB: 3965)" + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "skipConvCastAndClosure" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkObjUpConv" + }, + { + "kind": "nkIdent", + "ident": "nkObjDownConv" + }, + { + "kind": "nkIdent", + "ident": "nkChckRange" + }, + { + "kind": "nkIdent", + "ident": "nkChckRangeF" + }, + { + "kind": "nkIdent", + "ident": "nkChckRange64" + }, + { + "kind": "nkIdent", + "ident": "nkClosure" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkHiddenStdConv" + }, + { + "kind": "nkIdent", + "ident": "nkHiddenSubConv" + }, + { + "kind": "nkIdent", + "ident": "nkConv" + }, + { + "kind": "nkIdent", + "ident": "nkCast" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sameValue" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkCharLit" + }, + { + "kind": "nkIdent", + "ident": "nkUInt64Lit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkCharLit" + }, + { + "kind": "nkIdent", + "ident": "nkUInt64Lit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getInt" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getInt" + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkFloatLit" + }, + { + "kind": "nkIdent", + "ident": "nkFloat64Lit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkFloatLit" + }, + { + "kind": "nkIdent", + "ident": "nkFloat64Lit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkStrLit" + }, + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkStrLit" + }, + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# don\\\'t raise an internal error for \\\'nim check\\\':\", line: 157, col: 4, offsetA: 4711, offsetB: 4759)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#InternalError(a.info, \\\"SameValue\\\")\", line: 158, col: 4, offsetA: 4764, offsetB: 4799)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "leValue" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a <= b?\", line: 162, col: 2, offsetA: 4850, offsetB: 4859)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkCharLit" + }, + { + "kind": "nkIdent", + "ident": "nkUInt64Lit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkCharLit" + }, + { + "kind": "nkIdent", + "ident": "nkUInt64Lit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getInt" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getInt" + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkFloatLit" + }, + { + "kind": "nkIdent", + "ident": "nkFloat64Lit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkFloatLit" + }, + { + "kind": "nkIdent", + "ident": "nkFloat64Lit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkStrLit" + }, + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkStrLit" + }, + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# don\\\'t raise an internal error for \\\'nim check\\\':\", line: 175, col: 4, offsetA: 5253, offsetB: 5301)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#InternalError(a.info, \\\"leValue\\\")\", line: 176, col: 4, offsetA: 5306, offsetB: 5339)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "weakLeValue" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "TImplication" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkLiterals" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkLiterals" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "impUnknown" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "leValue" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "impYes" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "impNo" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "lookupInRecord" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "field" + }, + { + "kind": "nkIdent", + "ident": "PIdent" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkRecList" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lookupInRecord" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "field" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkRecCase" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lookupInRecord" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "field" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 1 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkOfBranch" + }, + { + "kind": "nkIdent", + "ident": "nkElse" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lookupInRecord" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lastSon" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "field" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkSym" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "field" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getModule" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "skModule" + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "owner" + } + ] + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "skModule" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "owner" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "fromSystem" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "op" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "sfSystemModule" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getModule" + }, + { + "kind": "nkIdent", + "ident": "op" + } + ] + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getSymFromList" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "list" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ident" + }, + { + "kind": "nkIdent", + "ident": "PIdent" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "list" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "list" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "list" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ident" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "sameIgnoreBacktickGensymInfo" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "alen" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "alen" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "alen" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 96 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "dec" + }, + { + "kind": "nkIdent", + "ident": "alen" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkIdent", + "ident": "alen" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "alen" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "j" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "alen" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 95 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "j" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "j" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 95 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "j" + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "aa" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "alen" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toLowerAscii" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "bb" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "j" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toLowerAscii" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "j" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "aa" + }, + { + "kind": "nkIdent", + "ident": "bb" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the characters are identical:\", line: 269, col: 4, offsetA: 7287, offsetB: 7318)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "alen" + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# both cursors at the end:\", line: 271, col: 6, offsetA: 7343, offsetB: 7369)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkIdent", + "ident": "j" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkReturnStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# not yet at the end of \\\'b\\\':\", line: 275, col: 6, offsetA: 7418, offsetB: 7446)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkIdent", + "ident": "j" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "j" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getNamedParamFromList" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "list" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ident" + }, + { + "kind": "nkIdent", + "ident": "PIdent" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Named parameters are special because a named parameter can be\", line: 284, col: 2, offsetA: 7594, offsetB: 7658)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## gensym\\\'ed and then they have \\\'\\\\`\\\' suffix that we need to\", line: 285, col: 2, offsetA: 7661, offsetB: 7728)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## ignore, see compiler / evaltempl.nim, snippet:\", line: 286, col: 2, offsetA: 7731, offsetB: 7780)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## ```\", line: 287, col: 2, offsetA: 7783, offsetB: 7791)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## result.add newIdentNode(getIdent(c.ic, x.name.s & \\\"\\\\`gensym\\\" & $x.id),\", line: 288, col: 2, offsetA: 7794, offsetB: 7869)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## if c.instLines: actual.info else: templ.info)\", line: 289, col: 2, offsetA: 7872, offsetB: 7931)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## ```\", line: 290, col: 2, offsetA: 7934, offsetB: 7942)" + ], + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 1 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "list" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "it" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "list" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "it" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ident" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "sameIgnoreBacktickGensymInfo" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "it" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ident" + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "it" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hashNode" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "RootRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "hash" + }, + { + "kind": "nkCast", + "sons": [ + { + "kind": "nkIdent", + "ident": "pointer" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "mustRehash" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "length" + }, + { + "kind": "nkIdent", + "ident": "counter" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "length" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "length" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "counter" + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "length" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "rspaces" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# returns x spaces\", line: 305, col: 2, offsetA: 8334, offsetB: 8352)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rope" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "spaces" + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "toYamlChar" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "char" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 0 + }, + { + "kind": "nkCharLit", + "intVal": 31 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 127 + }, + { + "kind": "nkCharLit", + "intVal": 255 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "\\u" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "strutils" + }, + { + "kind": "nkIdent", + "ident": "toHex" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 39 + }, + { + "kind": "nkCharLit", + "intVal": 34 + }, + { + "kind": "nkCharLit", + "intVal": 92 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkCharLit", + "intVal": 92 + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "makeYamlString" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# We have to split long strings into many ropes. Otherwise\", line: 318, col: 2, offsetA: 8623, offsetB: 8681)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# this could trigger InternalError(111). See the ropes module for\", line: 319, col: 2, offsetA: 8684, offsetB: 8749)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# further information.\", line: 320, col: 2, offsetA: 8752, offsetB: 8774)" + ], + "sons": [ + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "MaxLineLength" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 64000 + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "res" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "\"" + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "mod" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "MaxLineLength" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "res" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 34 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "res" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\u000A" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rope" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "res" + }, + { + "kind": "nkStrLit", + "strVal": "\"" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# reset\", line: 333, col: 17, offsetA: 8991, offsetB: 8998)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "res" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toYamlChar" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "res" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 34 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rope" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "flagsToStr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "T" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "flags" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "T" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "flags" + }, + { + "kind": "nkCurly" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rope" + }, + { + "kind": "nkStrLit", + "strVal": "[]" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "items" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ", " + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "makeYamlString" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "[" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "]" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "lineInfoToStr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkStrLit", + "strVal": "[$1, $2, $3]" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "makeYamlString" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toFilename" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rope" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toLinenumber" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rope" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toColumn" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "treeToYamlAux" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "IntSet" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIdent", + "ident": "maxRecDepth" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "symToYamlAux" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "IntSet" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIdent", + "ident": "maxRecDepth" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "typeToYamlAux" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "IntSet" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIdent", + "ident": "maxRecDepth" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "symToYamlAux" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "IntSet" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "maxRecDepth" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rope" + }, + { + "kind": "nkStrLit", + "strVal": "null" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "containsOrIncl" + }, + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkStrLit", + "strVal": "\"$1\"" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rope" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ast" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "treeToYamlAux" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + }, + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "maxRecDepth" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 8, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#rope(\\\"typ\\\"), typeToYamlAux(conf, n.typ, marker,\", line: 382, col: 8, offsetA: 10177, offsetB: 10225)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 8, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# indent + 2, maxRecDepth - 1),\", line: 383, col: 8, offsetA: 10234, offsetB: 10266)" + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rspaces" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rope" + }, + { + "kind": "nkStrLit", + "strVal": "{" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1\"kind\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "makeYamlString" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1\"name\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "makeYamlString" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1\"typ\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "typeToYamlAux" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "maxRecDepth" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if we don\\\'t pass the config, we probably don\\\'t care about the line info\", line: 397, col: 6, offsetA: 10648, offsetB: 10721)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1\"info\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lineInfoToStr" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "card" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1\"flags\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "flagsToStr" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1\"magic\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "makeYamlString" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "magic" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1\"ast\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkIdent", + "ident": "ast" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1\"options\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "flagsToStr" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "options" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1\"position\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rope" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "position" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1\"k\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "makeYamlString" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "loc" + } + ] + }, + { + "kind": "nkIdent", + "ident": "k" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1\"storage\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "makeYamlString" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "loc" + } + ] + }, + { + "kind": "nkIdent", + "ident": "storage" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "card" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "loc" + } + ] + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1\"flags\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "makeYamlString" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "loc" + } + ] + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1\"r\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "loc" + } + ] + }, + { + "kind": "nkIdent", + "ident": "r" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1\"lode\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "treeToYamlAux" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "loc" + } + ] + }, + { + "kind": "nkIdent", + "ident": "lode" + } + ] + }, + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "maxRecDepth" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1}" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rspaces" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "typeToYamlAux" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "IntSet" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "maxRecDepth" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "sonsRope" + }, + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "sonsRope" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rope" + }, + { + "kind": "nkStrLit", + "strVal": "null" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "containsOrIncl" + }, + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "sonsRope" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkStrLit", + "strVal": "\"$1 @$2\"" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rope" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rope" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "strutils" + }, + { + "kind": "nkIdent", + "ident": "toHex" + } + ] + }, + { + "kind": "nkCast", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "sizeof" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "sonsRope" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rope" + }, + { + "kind": "nkStrLit", + "strVal": "[" + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "sonsRope" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "," + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "sonsRope" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1$2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rspaces" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "typeToYamlAux" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "maxRecDepth" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "sonsRope" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1]" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rspaces" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "sonsRope" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rope" + }, + { + "kind": "nkStrLit", + "strVal": "null" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rspaces" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rope" + }, + { + "kind": "nkStrLit", + "strVal": "{" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1\"kind\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "makeYamlString" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1\"sym\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "symToYamlAux" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "maxRecDepth" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1\"n\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "treeToYamlAux" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "maxRecDepth" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "card" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1\"flags\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "flagsToStr" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1\"callconv\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "makeYamlString" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "callConv" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1\"size\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rope" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "size" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1\"align\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rope" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "align" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1\"sons\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkIdent", + "ident": "sonsRope" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "treeToYamlAux" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "IntSet" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "maxRecDepth" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rope" + }, + { + "kind": "nkStrLit", + "strVal": "null" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rspaces" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkStrLit", + "strVal": "{$N$1\"kind\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "makeYamlString" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "maxRecDepth" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ",$N$1\"info\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lineInfoToStr" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "prefix" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ",$N$1\"prefix\": [" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "prefix" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "," + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1$2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rspaces" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "makeYamlString" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "prefix" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1]" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "mid" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ",$N$1\"mid\": [" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "mid" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "," + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1$2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rspaces" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "makeYamlString" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "mid" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1]" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkCharLit" + }, + { + "kind": "nkIdent", + "ident": "nkUInt64Lit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ",$N$1\"intVal\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rope" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkFloatLit" + }, + { + "kind": "nkIdent", + "ident": "nkFloat128Lit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ",$N$1\"floatVal\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rope" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "toStrMaxPrecision" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkStrLit" + }, + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ",$N$1\"strVal\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "makeYamlString" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkSym" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ",$N$1\"sym\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "symToYamlAux" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkIdent", + "ident": "maxRecDepth" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIdent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ",$N$1\"ident\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "makeYamlString" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ",$N$1\"ident\": null" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCommentStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ",$N$1\"comment\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "makeYamlString" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "comment" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ",$N$1\"sons\": [" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "," + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1$2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rspaces" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "treeToYamlAux" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "maxRecDepth" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1]" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ",$N$1\"typ\": $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "typeToYamlAux" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkIdent", + "ident": "maxRecDepth" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "postfix" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ",$N$1\"postfix\": [" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "postfix" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "," + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1$2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rspaces" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "makeYamlString" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "postfix" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1]" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "istr" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "$N$1}" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rspaces" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "treeToYaml" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "maxRecDepth" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initIntSet" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "treeToYamlAux" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIdent", + "ident": "maxRecDepth" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "typeToYaml" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "maxRecDepth" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initIntSet" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "typeToYamlAux" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIdent", + "ident": "maxRecDepth" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "symToYaml" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "maxRecDepth" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initIntSet" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "symToYamlAux" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "marker" + }, + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIdent", + "ident": "maxRecDepth" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "tables" + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "backrefStyle" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "\u001B[90m" + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "enumStyle" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "\u001B[34m" + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "numberStyle" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "\u001B[33m" + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "stringStyle" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "\u001B[32m" + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "resetStyle" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "\u001B[0m" + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "DebugPrinter" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "visited" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "Table" + }, + { + "kind": "nkIdent", + "ident": "pointer" + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "renderSymType" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "currentLine" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "firstItem" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "useColor" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "res" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentMore" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "DebugPrinter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentLess" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "DebugPrinter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "newlineAndIndent" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "DebugPrinter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\u000A" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "currentLine" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 32 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "openCurly" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "DebugPrinter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "{" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "indentMore" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "firstItem" + } + ] + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "closeCurly" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "DebugPrinter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "indentLess" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "newlineAndIndent" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "}" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "comma" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "DebugPrinter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ", " + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "openBracket" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "DebugPrinter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "[" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#this.indentMore\", line: 624, col: 0, offsetA: 17275, offsetB: 17291)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "closeBracket" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "DebugPrinter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#this.indentLess\", line: 626, col: 2, offsetA: 17338, offsetB: 17354)" + ], + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "]" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "DebugPrinter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "firstItem" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "," + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "firstItem" + } + ] + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "newlineAndIndent" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\"" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\": " + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "DebugPrinter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "useColor" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "stringStyle" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\"" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\"" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "useColor" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "resetStyle" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "DebugPrinter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "BiggestInt" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "useColor" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "numberStyle" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "addInt" + } + ] + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "useColor" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "resetStyle" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "T" + }, + { + "kind": "nkEnumTy" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "DebugPrinter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "T" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "useColor" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "enumStyle" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\"" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\"" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "useColor" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "resetStyle" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "T" + }, + { + "kind": "nkEnumTy" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "DebugPrinter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "T" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "openBracket" + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "card" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkIdent", + "ident": "v" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "high" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "comma" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "closeBracket" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "earlyExit" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "DebugPrinter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "|" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "|" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkIdent", + "ident": "PNode" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PSym" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "null" + } + ] + }, + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "index" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "visited" + } + ] + }, + { + "kind": "nkIdent", + "ident": "getOrDefault" + } + ] + }, + { + "kind": "nkCast", + "sons": [ + { + "kind": "nkIdent", + "ident": "pointer" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "index" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "visited" + } + ] + }, + { + "kind": "nkCast", + "sons": [ + { + "kind": "nkIdent", + "ident": "pointer" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "currentLine" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "useColor" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "backrefStyle" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "useColor" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "resetStyle" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "DebugPrinter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "DebugPrinter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "DebugPrinter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "earlyExit" + }, + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "openCurly" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "kind" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "name" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "id" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "skField" + }, + { + "kind": "nkIdent", + "ident": "skEnumField" + }, + { + "kind": "nkIdent", + "ident": "skParam" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "position" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "position" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "card" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "flags" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "renderSymType" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "typ" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "closeCurly" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "DebugPrinter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "earlyExit" + }, + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "openCurly" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "kind" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "id" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "sym" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "card" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "flags" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "IntegralTypes" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "n" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "sons" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "openBracket" + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "comma" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "closeBracket" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "n" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "closeCurly" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "DebugPrinter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "earlyExit" + }, + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "openCurly" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "kind" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "comment" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "comment" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "comment" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "useNodeIds" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "id" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "conf" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "info" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lineInfoToStr" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "conf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkCurly" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "flags" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "typ" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "typ" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "nil" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkCharLit" + }, + { + "kind": "nkIdent", + "ident": "nkUInt64Lit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "intVal" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkFloatLit" + }, + { + "kind": "nkIdent", + "ident": "nkFloat32Lit" + }, + { + "kind": "nkIdent", + "ident": "nkFloat64Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "floatVal" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "toStrMaxPrecision" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkStrLit" + }, + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "strVal" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkSym" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "sym" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIdent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "ident" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "renderSymType" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "typ" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "sons" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "openBracket" + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "comma" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "closeBracket" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "closeCurly" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "debug" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "DebugPrinter" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "visited" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "initTable" + }, + { + "kind": "nkIdent", + "ident": "pointer" + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "renderSymType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "useColor" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "windows" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "echo" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "debug" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "DebugPrinter" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "visited" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "initTable" + }, + { + "kind": "nkIdent", + "ident": "pointer" + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "renderSymType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "useColor" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "windows" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "echo" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "debug" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "DebugPrinter" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "visited" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "initTable" + }, + { + "kind": "nkIdent", + "ident": "pointer" + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#this.renderSymType = true\", line: 852, col: 2, offsetA: 22158, offsetB: 22184)" + ], + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "useColor" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "windows" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "echo" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "this" + }, + { + "kind": "nkIdent", + "ident": "res" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextTry" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "maxHash" + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIntLit", + "intVal": 5 + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "maxHash" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# For any initial h in range(maxHash), repeating that maxHash times\", line: 861, col: 0, offsetA: 22337, offsetB: 22404)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# generates each int in range(maxHash) exactly once (see any text on\", line: 862, col: 0, offsetA: 22405, offsetB: 22473)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# random-number generation for proof).\", line: 863, col: 0, offsetA: 22474, offsetB: 22512)" + ], + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "objectSetContains" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "TObjectSet" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "RootRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# returns true whether n is in t\", line: 865, col: 2, offsetA: 22576, offsetB: 22608)" + ], + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "hashNode" + }, + { + "kind": "nkIdent", + "ident": "obj" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# start with real hash value\", line: 866, col: 47, offsetA: 22656, offsetB: 22684)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "obj" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextTry" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "objectSetRawInsert" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TObjectSeq" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "RootRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "hashNode" + }, + { + "kind": "nkIdent", + "ident": "obj" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "obj" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextTry" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "obj" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "objectSetEnlarge" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TObjectSet" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "TObjectSeq" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSeq" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIdent", + "ident": "GrowthFactor" + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "objectSetRawInsert" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "swap" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "objectSetIncl" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TObjectSet" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "RootRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "mustRehash" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "objectSetEnlarge" + }, + { + "kind": "nkIdent", + "ident": "t" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "objectSetRawInsert" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "obj" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "objectSetContainsOrIncl" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TObjectSet" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "obj" + }, + { + "kind": "nkIdent", + "ident": "RootRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# returns true if obj is already in the string table:\", line: 904, col: 2, offsetA: 23503, offsetB: 23556)" + ], + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "hashNode" + }, + { + "kind": "nkIdent", + "ident": "obj" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "it" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "it" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "it" + }, + { + "kind": "nkIdent", + "ident": "obj" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# found it\", line: 911, col: 18, offsetA: 23707, offsetB: 23717)" + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextTry" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "mustRehash" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "objectSetEnlarge" + }, + { + "kind": "nkIdent", + "ident": "t" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "objectSetRawInsert" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "obj" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "obj" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "strTableContains" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "TStrTable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# start with real hash value\", line: 927, col: 42, offsetA: 24043, offsetB: 24071)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextTry" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "strTableRawInsert" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "PSym" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# allowed for \\\'export\\\' feature:\", line: 940, col: 6, offsetA: 24340, offsetB: 24371)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#InternalError(n.info, \\\"StrTableRawInsert: \\\" & n.name.s)\", line: 941, col: 6, offsetA: 24378, offsetB: 24434)" + ], + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextTry" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "symTabReplaceRaw" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "PSym" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "prevSym" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSym" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "prevSym" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSym" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "prevSym" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "prevSym" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "newSym" + } + ] + }, + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextTry" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "symTabReplace" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TStrTable" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "prevSym" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSym" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "symTabReplaceRaw" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "prevSym" + }, + { + "kind": "nkIdent", + "ident": "newSym" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "strTableEnlarge" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TStrTable" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "PSym" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSeq" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIdent", + "ident": "GrowthFactor" + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "strTableRawInsert" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "swap" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "strTableAdd" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TStrTable" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "mustRehash" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "strTableEnlarge" + }, + { + "kind": "nkIdent", + "ident": "t" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "strTableRawInsert" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "strTableInclReportConflict" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TStrTable" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "onConflictKeepOld" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if `t` has a conflicting symbol (same identifier as `n`), return it\", line: 987, col: 2, offsetA: 25411, offsetB: 25480)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# otherwise return `nil`. Incl `n` to `t` unless `onConflictKeepOld = true`\", line: 988, col: 2, offsetA: 25483, offsetB: 25558)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# and a conflict was found.\", line: 989, col: 2, offsetA: 25561, offsetB: 25588)" + ], + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "replaceSlot" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "it" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "it" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Semantic checking can happen multiple times thanks to templates\", line: 998, col: 4, offsetA: 25749, offsetB: 25814)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# and overloading: (var x=@[]; x).mapIt(it).\", line: 999, col: 4, offsetA: 25819, offsetB: 25863)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# So it is possible the very same sym is added multiple\", line: 1000, col: 4, offsetA: 25868, offsetB: 25923)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# times to the symbol table which we allow here with the \\\'it == n\\\' check.\", line: 1001, col: 4, offsetA: 25928, offsetB: 26001)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "it" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "it" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "replaceSlot" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextTry" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkIdent", + "ident": "replaceSlot" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "replaceSlot" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# found it\", line: 1010, col: 33, offsetA: 26184, offsetB: 26194)" + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkIdent", + "ident": "onConflictKeepOld" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "replaceSlot" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# overwrite it with newer definition!\", line: 1012, col: 30, offsetA: 26255, offsetB: 26292)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "result", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# but return the old one\", line: 1014, col: 18, offsetA: 26312, offsetB: 26336)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "mustRehash" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "strTableEnlarge" + }, + { + "kind": "nkIdent", + "ident": "t" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "strTableRawInsert" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "strTableIncl" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TStrTable" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "onConflictKeepOld" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "discardable" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "strTableInclReportConflict" + }, + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "onConflictKeepOld" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "strTableGet" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "TStrTable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "name" + }, + { + "kind": "nkIdent", + "ident": "PIdent" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "name" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "name" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextTry" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TIdentIter" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# iterator over all syms with same identifier\", line: 1044, col: 23, offsetA: 26974, offsetB: 27019)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# current hash\", line: 1045, col: 13, offsetA: 27033, offsetB: 27047)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PIdent" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nextIdentIter" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIdentIter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "TStrTable" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# hot spots\", line: 1049, col: 2, offsetA: 27133, offsetB: 27144)" + ], + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPragmaExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "cursor" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextTry" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "start" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# increase the count\", line: 1065, col: 15, offsetA: 27423, offsetB: 27443)" + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextTry" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "initIdentIter" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIdentIter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "TStrTable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PIdent" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextIdentIter" + }, + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkIdent", + "ident": "tab" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nextIdentExcluding" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIdentIter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "TStrTable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "excluding" + }, + { + "kind": "nkIdent", + "ident": "IntSet" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "contains" + }, + { + "kind": "nkIdent", + "ident": "excluding" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextTry" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "start" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextTry" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "contains" + }, + { + "kind": "nkIdent", + "ident": "excluding" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "firstIdentExcluding" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIdentIter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "TStrTable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PIdent" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "excluding" + }, + { + "kind": "nkIdent", + "ident": "IntSet" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextIdentExcluding" + }, + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "excluding" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TTabIter" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nextIter" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TTabIter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "TStrTable" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# usage:\", line: 1115, col: 2, offsetA: 28528, offsetB: 28536)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# var\", line: 1116, col: 2, offsetA: 28539, offsetB: 28544)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# i: TTabIter\", line: 1117, col: 2, offsetA: 28547, offsetB: 28562)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# s: PSym\", line: 1118, col: 2, offsetA: 28565, offsetB: 28576)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# s = InitTabIter(i, table)\", line: 1119, col: 2, offsetA: 28579, offsetB: 28606)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# while s != nil:\", line: 1120, col: 2, offsetA: 28609, offsetB: 28626)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ...\", line: 1121, col: 2, offsetA: 28629, offsetB: 28636)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# s = NextIter(i, table)\", line: 1122, col: 2, offsetA: 28639, offsetB: 28665)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#\", line: 1123, col: 2, offsetA: 28668, offsetB: 28669)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ... and increment by one always\", line: 1128, col: 14, offsetA: 28762, offsetB: 28795)" + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "initTabIter" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TTabIter" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "TStrTable" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextIter" + }, + { + "kind": "nkIdent", + "ident": "ti" + }, + { + "kind": "nkIdent", + "ident": "tab" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIteratorDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "items" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tab" + }, + { + "kind": "nkIdent", + "ident": "TStrTable" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "it" + }, + { + "kind": "nkIdent", + "ident": "TTabIter" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initTabIter" + }, + { + "kind": "nkIdent", + "ident": "it" + }, + { + "kind": "nkIdent", + "ident": "tab" + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkYieldStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextIter" + }, + { + "kind": "nkIdent", + "ident": "it" + }, + { + "kind": "nkIdent", + "ident": "tab" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hasEmptySlot" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "TIdPairSeq" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "idTableRawGet" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "TIdTable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# start with real hash value\", line: 1157, col: 27, offsetA: 29357, offsetB: 29385)" + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextTry" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "idTableHasObjectAsKey" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "TIdTable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "PIdObj" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "index" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "idTableRawGet" + }, + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkIdent", + "ident": "index" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "index" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "idTableGet" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "RootRef" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "TIdTable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "PIdObj" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "index" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "idTableRawGet" + }, + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkIdent", + "ident": "index" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "index" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "idTableGet" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "RootRef" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "TIdTable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "index" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "idTableRawGet" + }, + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkIdent", + "ident": "index" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "index" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIteratorDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "pairs" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkTupleTy", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "RootRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "TIdTable" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkYieldStmt", + "sons": [ + { + "kind": "nkTupleConstr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "idTableRawInsert" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIdPairSeq" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "PIdObj" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "val" + }, + { + "kind": "nkIdent", + "ident": "RootRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextTry" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "idTablePut" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIdTable" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "PIdObj" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "val" + }, + { + "kind": "nkIdent", + "ident": "RootRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "index" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "TIdPairSeq" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "index" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "idTableRawGet" + }, + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkIdent", + "ident": "index" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "index" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "index" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "mustRehash" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSeq" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIdent", + "ident": "GrowthFactor" + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "idTableRawInsert" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "hasEmptySlot" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "swap" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "idTableRawInsert" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIteratorDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "idTablePairs" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkTupleTy", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "PIdObj" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "val" + }, + { + "kind": "nkIdent", + "ident": "RootRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "TIdTable" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isNil" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkYieldStmt", + "sons": [ + { + "kind": "nkTupleConstr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "idNodeTableRawGet" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "TIdNodeTable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "PIdObj" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# start with real hash value\", line: 1237, col: 30, offsetA: 31314, offsetB: 31342)" + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextTry" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "idNodeTableGet" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "TIdNodeTable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "PIdObj" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "index" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "index" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "idNodeTableRawGet" + }, + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkIdent", + "ident": "index" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "index" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "idNodeTableRawInsert" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIdNodePairSeq" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "PIdObj" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "val" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextTry" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "idNodeTablePut" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIdNodeTable" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "PIdObj" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "val" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "index" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "idNodeTableRawGet" + }, + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkIdent", + "ident": "index" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "index" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "index" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "mustRehash" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "TIdNodePairSeq" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSeq" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIdent", + "ident": "GrowthFactor" + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "idNodeTableRawInsert" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "swap" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "idNodeTableRawInsert" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIteratorDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "pairs" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkTupleTy", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "PIdObj" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "val" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "TIdNodeTable" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isNil" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkYieldStmt", + "sons": [ + { + "kind": "nkTupleConstr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "initIITable" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIITable" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSeq" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "StartSize" + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIdent", + "ident": "StartSize" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkIdent", + "ident": "InvalidKey" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "iiTableRawGet" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "TIITable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# start with real hash value\", line: 1304, col: 27, offsetA: 32888, offsetB: 32916)" + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkIdent", + "ident": "InvalidKey" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextTry" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "iiTableGet" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "TIITable" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "index" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "iiTableRawGet" + }, + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkIdent", + "ident": "index" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "index" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "InvalidKey" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "iiTableRawInsert" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIIPairSeq" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "val" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkIdent", + "ident": "InvalidKey" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextTry" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkIdent", + "ident": "InvalidKey" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "iiTablePut" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TIITable" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "val" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "index" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "iiTableRawGet" + }, + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkIdent", + "ident": "index" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "index" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkIdent", + "ident": "InvalidKey" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "index" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "mustRehash" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "TIIPairSeq" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSeq" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIdent", + "ident": "GrowthFactor" + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkIdent", + "ident": "InvalidKey" + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkIdent", + "ident": "InvalidKey" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "iiTableRawInsert" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "swap" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "iiTableRawInsert" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "counter" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isAddrNode" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkAddr" + }, + { + "kind": "nkIdent", + "ident": "nkHiddenAddr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCallKinds" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "magic" + } + ] + }, + { + "kind": "nkIdent", + "ident": "mAddr" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "listSymbolNames" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "symbols" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "openArray" + }, + { + "kind": "nkIdent", + "ident": "PSym" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "sym" + }, + { + "kind": "nkIdent", + "ident": "symbols" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ", " + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "sym" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isDiscriminantField" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkCheckedFieldExpr" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "sfDiscriminant" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkDotExpr" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "sfDiscriminant" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/phlexer.nim b/src/phlexer.nim new file mode 100644 index 0000000..fb9886b --- /dev/null +++ b/src/phlexer.nim @@ -0,0 +1,1644 @@ +# +# +# nimph +# (c) Copyright 2023 Jacek Sieka +# The Nim compiler +# (c) Copyright 2018 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# +# This lexer is handwritten for efficiency. I used an elegant buffering +# scheme which I have not seen anywhere else: +# We guarantee that a whole line is in the buffer. Thus only when scanning +# the \n or \r character we have to check whether we need to read in the next +# chunk. (\n or \r already need special handling for incrementing the line +# counter; choosing both \n and \r allows the lexer to properly read Unix, +# DOS or Macintosh text files, even when it is not the native format. +# nimph version: +# The nimph version has been simplified to not re-flow comments (or indeed do +# anything smart about them) and to include more source information about tokens +# such that they can be reproduced faithfully, similar to how nimpretty does it. +# +# Each comment is treated as a single token starting at the comment marker (`#`) +# and ending at the end of line, with each line of comments being a new token. +# Multiline tokens are similar except they include newlines as well up to the +# end-of-comment marker. + +import + hashes, phoptions, phmsgs, strutils, platform, idents, nimlexbase, llstream, wordrecg, + phlineinfos, pathutils, parseutils +when defined(nimPreviewSlimSystem): + import + std/[assertions, formatfloat] + +const + numChars*: set[char] = {'0' .. '9', 'a' .. 'z', 'A' .. 'Z'} + SymChars*: set[char] = {'a' .. 'z', 'A' .. 'Z', '0' .. '9', '\x80' .. '\xFF'} + SymStartChars*: set[char] = {'a' .. 'z', 'A' .. 'Z', '\x80' .. '\xFF'} + OpChars*: set[char] = + { + '+', + '-', + '*', + '/', + '\\', + '<', + '>', + '!', + '?', + '^', + '.', + '|', + '=', + '%', + '&', + '$', + '@', + '~', + ':' + } + UnaryMinusWhitelist = {' ', '\t', '\n', '\r', ',', ';', '(', '[', '{'} + +# don't forget to update the 'highlite' module if these charsets should change +type + TokType* = enum + tkInvalid = "tkInvalid" + tkEof = "[EOF]" # order is important here! + tkSymbol = "tkSymbol" # keywords: + tkAddr = "addr" + tkAnd = "and" + tkAs = "as" + tkAsm = "asm" + tkBind = "bind" + tkBlock = "block" + tkBreak = "break" + tkCase = "case" + tkCast = "cast" + tkConcept = "concept" + tkConst = "const" + tkContinue = "continue" + tkConverter = "converter" + tkDefer = "defer" + tkDiscard = "discard" + tkDistinct = "distinct" + tkDiv = "div" + tkDo = "do" + tkElif = "elif" + tkElse = "else" + tkEnd = "end" + tkEnum = "enum" + tkExcept = "except" + tkExport = "export" + tkFinally = "finally" + tkFor = "for" + tkFrom = "from" + tkFunc = "func" + tkIf = "if" + tkImport = "import" + tkIn = "in" + tkInclude = "include" + tkInterface = "interface" + tkIs = "is" + tkIsnot = "isnot" + tkIterator = "iterator" + tkLet = "let" + tkMacro = "macro" + tkMethod = "method" + tkMixin = "mixin" + tkMod = "mod" + tkNil = "nil" + tkNot = "not" + tkNotin = "notin" + tkObject = "object" + tkOf = "of" + tkOr = "or" + tkOut = "out" + tkProc = "proc" + tkPtr = "ptr" + tkRaise = "raise" + tkRef = "ref" + tkReturn = "return" + tkShl = "shl" + tkShr = "shr" + tkStatic = "static" + tkTemplate = "template" + tkTry = "try" + tkTuple = "tuple" + tkType = "type" + tkUsing = "using" + tkVar = "var" + tkWhen = "when" + tkWhile = "while" + tkXor = "xor" + tkYield = "yield" # end of keywords + tkIntLit = "tkIntLit" + tkInt8Lit = "tkInt8Lit" + tkInt16Lit = "tkInt16Lit" + tkInt32Lit = "tkInt32Lit" + tkInt64Lit = "tkInt64Lit" + tkUIntLit = "tkUIntLit" + tkUInt8Lit = "tkUInt8Lit" + tkUInt16Lit = "tkUInt16Lit" + tkUInt32Lit = "tkUInt32Lit" + tkUInt64Lit = "tkUInt64Lit" + tkFloatLit = "tkFloatLit" + tkFloat32Lit = "tkFloat32Lit" + tkFloat64Lit = "tkFloat64Lit" + tkFloat128Lit = "tkFloat128Lit" + tkStrLit = "tkStrLit" + tkRStrLit = "tkRStrLit" + tkTripleStrLit = "tkTripleStrLit" + tkGStrLit = "tkGStrLit" + tkGTripleStrLit = "tkGTripleStrLit" + tkCharLit = "tkCharLit" + tkCustomLit = "tkCustomLit" + tkParLe = "(" + tkParRi = ")" + tkBracketLe = "[" + tkBracketRi = "]" + tkCurlyLe = "{" + tkCurlyRi = "}" + tkBracketDotLe = "[." + tkBracketDotRi = ".]" + tkCurlyDotLe = "{." + tkCurlyDotRi = ".}" + tkParDotLe = "(." + tkParDotRi = ".)" + tkComma = "," + tkSemiColon = ";" + tkColon = ":" + tkColonColon = "::" + tkEquals = "=" + tkDot = "." + tkDotDot = ".." + tkBracketLeColon = "[:" + tkOpr + tkComment + tkAccent = "`" # these are fake tokens used by renderer.nim + tkSpaces + tkInfixOpr + tkPrefixOpr + tkPostfixOpr + tkHideableStart + tkHideableEnd + + TokTypes* = set[TokType] + +const + tokKeywordLow* = succ(tkSymbol) + tokKeywordHigh* = pred(tkIntLit) + +type + NumericalBase* = enum + base10 + # base10 is listed as the first element, + # so that it is the correct default value + base2 + base8 + base16 + + TokenSpacing* = enum + tsLeading + tsTrailing + tsEof + + Token* = object # a Nim token + tokType*: TokType # the type of the token + base*: NumericalBase + # the numerical base; only valid for int + # or float literals + spacing*: set[TokenSpacing] # spaces around token + indent*: int + # the indentation; != -1 if the token has been + # preceded with indentation + ident*: PIdent # the parsed identifier + iNumber*: BiggestInt # the parsed integer literal + fNumber*: BiggestFloat # the parsed floating point literal + literal*: string + # the parsed (string) literal; and + # documentation comments are here too + line*, col*: int + offsetA*, offsetB*: int + # used for pretty printing so that literals + # like 0b01 or r"\L" are unaffected + + ErrorHandler* = proc(conf: ConfigRef; info: TLineInfo; msg: TMsgKind; arg: string) + Lexer* = object of TBaseLexer + fileIdx*: FileIndex + indentAhead*: int + # if > 0 an indentation has already been read + # this is needed because scanning comments + # needs so much look-ahead + currLineIndent*: int + errorHandler*: ErrorHandler + cache*: IdentCache + config*: ConfigRef + printTokens: bool + +proc getLineInfo*(L: Lexer; tok: Token): TLineInfo {.inline.} = + result = newLineInfo(L.fileIdx, tok.line, tok.col) + result.offsetA = tok.offsetA + result.offsetB = tok.offsetB + +proc isKeyword*(kind: TokType): bool = + (kind >= tokKeywordLow) and (kind <= tokKeywordHigh) + +template ones(n): untyped = + ((1 shl n) - 1) + +# for utf-8 conversion + +proc isNimIdentifier*(s: string): bool = + let sLen = s.len + if sLen > 0 and s[0] in SymStartChars: + var i = 1 + while i < sLen: + if s[i] == '_': + inc(i) + if i < sLen and s[i] notin SymChars: + return false + + inc(i) + + result = true + else: + result = false + +proc `$`*(tok: Token): string = + case tok.tokType + of tkIntLit .. tkInt64Lit: + $tok.iNumber + of tkFloatLit .. tkFloat64Lit: + $tok.fNumber + of tkInvalid, tkStrLit .. tkCharLit, tkComment: + tok.literal + of tkParLe .. tkColon, tkEof, tkAccent: + $tok.tokType + else: + if tok.ident != nil: + tok.ident.s + else: + "" + +proc prettyTok*(tok: Token): string = + if isKeyword(tok.tokType): + "keyword " & tok.ident.s + else: + $tok + +proc printTok*(conf: ConfigRef; tok: Token) = + # xxx factor with toLocation + msgWriteln( + conf, + $tok.line & ":" & $tok.col & "\t" & $tok.indent & "\t" & $tok.tokType & " " & $tok & " " & $tok.offsetA & ":" & $tok.offsetB + ) + +proc openLexer*( + lex: var Lexer; + fileIdx: FileIndex; + inputstream: PLLStream; + cache: IdentCache; + config: ConfigRef; + printTokens: bool +) = + openBaseLexer(lex, inputstream) + + lex.fileIdx = fileIdx + lex.indentAhead = -1 + lex.currLineIndent = 0 + + inc(lex.lineNumber, inputstream.lineOffset) + + lex.cache = cache + lex.config = config + lex.printTokens = printTokens + +proc openLexer*( + lex: var Lexer; + filename: AbsoluteFile; + inputstream: PLLStream; + cache: IdentCache; + config: ConfigRef; + printTokens: bool +) = + openLexer(lex, fileInfoIdx(config, filename), inputstream, cache, config, printTokens) + +proc closeLexer*(lex: var Lexer) = + if lex.config != nil: + inc(lex.config.linesCompiled, lex.lineNumber) + + closeBaseLexer(lex) + +proc getLineInfo(L: Lexer): TLineInfo = + result = newLineInfo(L.fileIdx, L.lineNumber, getColNumber(L, L.bufpos)) + +proc dispMessage(L: Lexer; info: TLineInfo; msg: TMsgKind; arg: string) = + if L.errorHandler.isNil: + phmsgs.message(L.config, info, msg, arg) + else: + L.errorHandler(L.config, info, msg, arg) + +proc lexMessage*(L: Lexer; msg: TMsgKind; arg = "") = + L.dispMessage(getLineInfo(L), msg, arg) + +proc lexMessageTok*(L: Lexer; msg: TMsgKind; tok: Token; arg = "") = + var info = newLineInfo(L.fileIdx, tok.line, tok.col) + + L.dispMessage(info, msg, arg) + +proc lexMessagePos(L: var Lexer; msg: TMsgKind; pos: int; arg = "") = + var info = newLineInfo(L.fileIdx, L.lineNumber, pos - L.lineStart) + + L.dispMessage(info, msg, arg) + +proc matchTwoChars(L: Lexer; first: char; second: set[char]): bool = + result = (L.buf[L.bufpos] == first) and (L.buf[L.bufpos + 1] in second) + +template tokenBegin(tok, pos) {.dirty.} = + tok.offsetA = L.offsetBase + pos + +template tokenEnd(tok, pos) {.dirty.} = + tok.offsetB = L.offsetBase + pos + +template tokenEndIgnore(tok, pos) = + tok.offsetB = L.offsetBase + pos + +template tokenEndPrevious(tok, pos) = + tok.offsetB = L.offsetBase + pos + +template eatChar(L: var Lexer; t: var Token; replacementChar: char) = + t.literal.add(replacementChar) + inc(L.bufpos) + +template eatChar(L: var Lexer; t: var Token) = + t.literal.add(L.buf[L.bufpos]) + inc(L.bufpos) + +proc getNumber(L: var Lexer; result: var Token) = + proc matchUnderscoreChars(L: var Lexer; tok: var Token; chars: set[char]): Natural = + var pos = L.bufpos # use registers for pos, buf + + result = 0 + while true: + if L.buf[pos] in chars: + tok.literal.add(L.buf[pos]) + inc(pos) + inc(result) + else: + break + if L.buf[pos] == '_': + if L.buf[pos + 1] notin chars: + lexMessage( + L, + errGenerated, + "only single underscores may occur in a token and token may not " & "end with an underscore: e.g. '1__1' and '1_' are invalid" + ) + + break + + tok.literal.add('_') + inc(pos) + + L.bufpos = pos + + proc matchChars(L: var Lexer; tok: var Token; chars: set[char]) = + var pos = L.bufpos # use registers for pos, buf + while L.buf[pos] in chars: + tok.literal.add(L.buf[pos]) + inc(pos) + + L.bufpos = pos + + proc lexMessageLitNum( + L: var Lexer; msg: string; startpos: int; msgKind = errGenerated + ) = + # Used to get slightly human friendlier err messages. + const + literalishChars = {'A' .. 'Z', 'a' .. 'z', '0' .. '9', '_', '.', '\''} + + var msgPos = L.bufpos + var t: Token + + t.literal = "" + L.bufpos = startpos # Use L.bufpos as pos because of matchChars + + matchChars(L, t, literalishChars) + # We must verify +/- specifically so that we're not past the literal + if L.buf[L.bufpos] in {'+', '-'} and L.buf[L.bufpos - 1] in {'e', 'E'}: + t.literal.add(L.buf[L.bufpos]) + inc(L.bufpos) + matchChars(L, t, literalishChars) + if L.buf[L.bufpos] in literalishChars: + t.literal.add(L.buf[L.bufpos]) + inc(L.bufpos) + matchChars(L, t, {'0' .. '9'}) + + L.bufpos = msgPos + + lexMessage(L, msgKind, msg % t.literal) + + var + xi: BiggestInt + isBase10 = true + numDigits = 0 + + const + # 'c', 'C' is deprecated + baseCodeChars = {'X', 'x', 'o', 'b', 'B', 'c', 'C'} + literalishChars = baseCodeChars + {'A' .. 'F', 'a' .. 'f', '0' .. '9', '_', '\''} + floatTypes = {tkFloatLit, tkFloat32Lit, tkFloat64Lit, tkFloat128Lit} + + result.tokType = tkIntLit # int literal until we know better + result.literal = "" + result.base = base10 + + tokenBegin(result, L.bufpos) + + var isPositive = true + if L.buf[L.bufpos] == '-': + eatChar(L, result) + + isPositive = false + + let startpos = L.bufpos + + template setNumber(field, value) = + field = + (if isPositive: + value + else: -value + ) + + # First stage: find out base, make verifications, build token literal string + # {'c', 'C'} is added for deprecation reasons to provide a clear error message + if L.buf[L.bufpos] == '0' and L.buf[L.bufpos + 1] in baseCodeChars + {'c', 'C', 'O'}: + isBase10 = false + + eatChar(L, result, '0') + case L.buf[L.bufpos] + of 'c', 'C': + lexMessageLitNum( + L, + "$1 will soon be invalid for oct literals; Use '0o' " & "for octals. 'c', 'C' prefix", + startpos, + warnDeprecated + ) + eatChar(L, result, 'c') + + numDigits = matchUnderscoreChars(L, result, {'0' .. '7'}) + of 'O': + lexMessageLitNum( + L, + "$1 is an invalid int literal; For octal literals " & "use the '0o' prefix.", + startpos + ) + of 'x', 'X': + eatChar(L, result, 'x') + + numDigits = matchUnderscoreChars(L, result, {'0' .. '9', 'a' .. 'f', 'A' .. 'F'}) + of 'o': + eatChar(L, result, 'o') + + numDigits = matchUnderscoreChars(L, result, {'0' .. '7'}) + of 'b', 'B': + eatChar(L, result, 'b') + + numDigits = matchUnderscoreChars(L, result, {'0' .. '1'}) + else: + internalError(L.config, getLineInfo(L), "getNumber") + if numDigits == 0: + lexMessageLitNum(L, "invalid number: '$1'", startpos) + else: + discard matchUnderscoreChars(L, result, {'0' .. '9'}) + if (L.buf[L.bufpos] == '.') and (L.buf[L.bufpos + 1] in {'0' .. '9'}): + result.tokType = tkFloatLit + + eatChar(L, result, '.') + + discard matchUnderscoreChars(L, result, {'0' .. '9'}) + if L.buf[L.bufpos] in {'e', 'E'}: + result.tokType = tkFloatLit + + eatChar(L, result) + if L.buf[L.bufpos] in {'+', '-'}: + eatChar(L, result) + + discard matchUnderscoreChars(L, result, {'0' .. '9'}) + + let endpos = L.bufpos + + # Second stage, find out if there's a datatype suffix and handle it + var + postPos = endpos + if L.buf[postPos] in {'\'', 'f', 'F', 'd', 'D', 'i', 'I', 'u', 'U'}: + let errPos = postPos + + var customLitPossible = false + if L.buf[postPos] == '\'': + inc(postPos) + + customLitPossible = true + if L.buf[postPos] in SymChars: + var suffix = newStringOfCap(10) + while true: + suffix.add L.buf[postPos] + inc postPos + if L.buf[postPos] notin SymChars + {'_'}: + break + + let suffixAsLower = suffix.toLowerAscii + case suffixAsLower + of "f", "f32": + result.tokType = tkFloat32Lit + of "d", "f64": + result.tokType = tkFloat64Lit + of "f128": + result.tokType = tkFloat128Lit + of "i8": + result.tokType = tkInt8Lit + of "i16": + result.tokType = tkInt16Lit + of "i32": + result.tokType = tkInt32Lit + of "i64": + result.tokType = tkInt64Lit + of "u": + result.tokType = tkUIntLit + of "u8": + result.tokType = tkUInt8Lit + of "u16": + result.tokType = tkUInt16Lit + of "u32": + result.tokType = tkUInt32Lit + of "u64": + result.tokType = tkUInt64Lit + elif customLitPossible: + # remember the position of the `'` so that the parser doesn't + # have to reparse the custom literal: + result.iNumber = len(result.literal) + + result.literal.add '\'' + result.literal.add suffix + + result.tokType = tkCustomLit + else: + lexMessageLitNum(L, "invalid number suffix: '$1'", errPos) + else: + lexMessageLitNum(L, "invalid number suffix: '$1'", errPos) + # Is there still a literalish char awaiting? Then it's an error! + if L.buf[postPos] in literalishChars or ( + L.buf[postPos] == '.' and L.buf[postPos + 1] in {'0' .. '9'} + ): + lexMessageLitNum(L, "invalid number: '$1'", startpos) + if result.tokType != tkCustomLit: + # Third stage, extract actual number + L.bufpos = startpos # restore position + + var pos = startpos + try: + if (L.buf[pos] == '0') and (L.buf[pos + 1] in baseCodeChars): + inc(pos, 2) + + xi = 0 # it is a base prefix + case L.buf[pos - 1] + of 'b', 'B': + result.base = base2 + while pos < endpos: + if L.buf[pos] != '_': + xi = `shl`(xi, 1) or (ord(L.buf[pos]) - ord('0')) + + inc(pos) + of 'o', 'c', 'C': + result.base = base8 + while pos < endpos: + if L.buf[pos] != '_': + xi = `shl`(xi, 3) or (ord(L.buf[pos]) - ord('0')) + + inc(pos) + of 'x', 'X': + result.base = base16 + while pos < endpos: + case L.buf[pos] + of '_': + inc(pos) + of '0' .. '9': + xi = `shl`(xi, 4) or (ord(L.buf[pos]) - ord('0')) + + inc(pos) + of 'a' .. 'f': + xi = `shl`(xi, 4) or (ord(L.buf[pos]) - ord('a') + 10) + + inc(pos) + of 'A' .. 'F': + xi = `shl`(xi, 4) or (ord(L.buf[pos]) - ord('A') + 10) + + inc(pos) + else: + break + else: + internalError(L.config, getLineInfo(L), "getNumber") + case result.tokType + of tkIntLit, tkInt64Lit: + setNumber result.iNumber, xi + of tkInt8Lit: + setNumber result.iNumber, ashr(xi shl 56, 56) + of tkInt16Lit: + setNumber result.iNumber, ashr(xi shl 48, 48) + of tkInt32Lit: + setNumber result.iNumber, ashr(xi shl 32, 32) + of tkUIntLit, tkUInt64Lit: + setNumber result.iNumber, xi + of tkUInt8Lit: + setNumber result.iNumber, xi and 0xff + of tkUInt16Lit: + setNumber result.iNumber, xi and 0xffff + of tkUInt32Lit: + setNumber result.iNumber, xi and 0xffffffff + of tkFloat32Lit: + setNumber result.fNumber, (cast[ptr float32](addr(xi)))[] + of tkFloat64Lit, tkFloatLit: + setNumber result.fNumber, (cast[ptr float64](addr(xi)))[] + else: + internalError(L.config, getLineInfo(L), "getNumber") + if result.tokType notin floatTypes: + let outOfRange = + case result.tokType + of tkUInt8Lit, tkUInt16Lit, tkUInt32Lit: + result.iNumber != xi + of tkInt8Lit: + (xi > BiggestInt(uint8.high)) + of tkInt16Lit: + (xi > BiggestInt(uint16.high)) + of tkInt32Lit: + (xi > BiggestInt(uint32.high)) + else: + false + if outOfRange: + #echo "out of range num: ", result.iNumber, " vs ", xi + lexMessageLitNum(L, "number out of range: '$1'", startpos) + else: + case result.tokType + of floatTypes: + result.fNumber = parseFloat(result.literal) + of tkUInt64Lit, tkUIntLit: + var iNumber: uint64 = uint64(0) + var len: int = 0 + try: + len = parseBiggestUInt(result.literal, iNumber) + except ValueError: + raise newException(OverflowDefect, "number out of range: " & result.literal) + if len != result.literal.len: + raise newException(ValueError, "invalid integer: " & result.literal) + + result.iNumber = cast[int64](iNumber) + else: + var iNumber: int64 = int64(0) + var len: int = 0 + try: + len = parseBiggestInt(result.literal, iNumber) + except ValueError: + raise newException(OverflowDefect, "number out of range: " & result.literal) + if len != result.literal.len: + raise newException(ValueError, "invalid integer: " & result.literal) + + result.iNumber = iNumber + + let outOfRange = + case result.tokType + of tkInt8Lit: + result.iNumber > int8.high or result.iNumber < int8.low + of tkUInt8Lit: + result.iNumber > BiggestInt(uint8.high) or result.iNumber < 0 + of tkInt16Lit: + result.iNumber > int16.high or result.iNumber < int16.low + of tkUInt16Lit: + result.iNumber > BiggestInt(uint16.high) or result.iNumber < 0 + of tkInt32Lit: + result.iNumber > int32.high or result.iNumber < int32.low + of tkUInt32Lit: + result.iNumber > BiggestInt(uint32.high) or result.iNumber < 0 + else: + false + if outOfRange: + lexMessageLitNum(L, "number out of range: '$1'", startpos) + # Promote int literal to int64? Not always necessary, but more consistent + if result.tokType == tkIntLit: + if result.iNumber > high(int32) or result.iNumber < low(int32): + result.tokType = tkInt64Lit + except ValueError: + lexMessageLitNum(L, "invalid number: '$1'", startpos) + except OverflowDefect, RangeDefect: + lexMessageLitNum(L, "number out of range: '$1'", startpos) + + tokenEnd(result, postPos - 1) + + L.bufpos = postPos + +proc handleHexChar(L: var Lexer; xi: var int; position: range[0 .. 4]) = + template invalid() = + lexMessage( + L, + errGenerated, + "expected a hex digit, but found: " & L.buf[L.bufpos] & "; maybe prepend with 0" + ) + + case L.buf[L.bufpos] + of '0' .. '9': + xi = (xi shl 4) or (ord(L.buf[L.bufpos]) - ord('0')) + + inc(L.bufpos) + of 'a' .. 'f': + xi = (xi shl 4) or (ord(L.buf[L.bufpos]) - ord('a') + 10) + + inc(L.bufpos) + of 'A' .. 'F': + xi = (xi shl 4) or (ord(L.buf[L.bufpos]) - ord('A') + 10) + + inc(L.bufpos) + of '"', '\'': + if position <= 1: + invalid() + # do not progress the bufpos here. + if position == 0: + inc(L.bufpos) + else: + invalid() + # Need to progress for `nim check` + inc(L.bufpos) + +proc handleDecChars(L: var Lexer; xi: var int) = + while L.buf[L.bufpos] in {'0' .. '9'}: + xi = (xi * 10) + (ord(L.buf[L.bufpos]) - ord('0')) + + inc(L.bufpos) + +proc addUnicodeCodePoint(s: var string; i: int) = + let i = cast[uint](i) + # inlined toUTF-8 to avoid unicode and strutils dependencies. + let + pos = s.len + if i <= 127: + s.setLen(pos + 1) + + s[pos + 0] = chr(i) + elif i <= 0x07FF: + s.setLen(pos + 2) + + s[pos + 0] = chr((i shr 6) or 0b110_00000) + s[pos + 1] = chr((i and ones(6)) or 0b10_0000_00) + elif i <= 0xFFFF: + s.setLen(pos + 3) + + s[pos + 0] = chr(i shr 12 or 0b1110_0000) + s[pos + 1] = chr(i shr 6 and ones(6) or 0b10_0000_00) + s[pos + 2] = chr(i and ones(6) or 0b10_0000_00) + elif i <= 0x001FFFFF: + s.setLen(pos + 4) + + s[pos + 0] = chr(i shr 18 or 0b1111_0000) + s[pos + 1] = chr(i shr 12 and ones(6) or 0b10_0000_00) + s[pos + 2] = chr(i shr 6 and ones(6) or 0b10_0000_00) + s[pos + 3] = chr(i and ones(6) or 0b10_0000_00) + elif i <= 0x03FFFFFF: + s.setLen(pos + 5) + + s[pos + 0] = chr(i shr 24 or 0b111110_00) + s[pos + 1] = chr(i shr 18 and ones(6) or 0b10_0000_00) + s[pos + 2] = chr(i shr 12 and ones(6) or 0b10_0000_00) + s[pos + 3] = chr(i shr 6 and ones(6) or 0b10_0000_00) + s[pos + 4] = chr(i and ones(6) or 0b10_0000_00) + elif i <= 0x7FFFFFFF: + s.setLen(pos + 6) + + s[pos + 0] = chr(i shr 30 or 0b1111110_0) + s[pos + 1] = chr(i shr 24 and ones(6) or 0b10_0000_00) + s[pos + 2] = chr(i shr 18 and ones(6) or 0b10_0000_00) + s[pos + 3] = chr(i shr 12 and ones(6) or 0b10_0000_00) + s[pos + 4] = chr(i shr 6 and ones(6) or 0b10_0000_00) + s[pos + 5] = chr(i and ones(6) or 0b10_0000_00) + +proc getEscapedChar(L: var Lexer; tok: var Token) = + inc(L.bufpos) # skip '\' + case L.buf[L.bufpos] + of 'n', 'N': + tok.literal.add('\L') + inc(L.bufpos) + of 'p', 'P': + if tok.tokType == tkCharLit: + lexMessage(L, errGenerated, "\\p not allowed in character literal") + + tok.literal.add(L.config.target.tnl) + inc(L.bufpos) + of 'r', 'R', 'c', 'C': + tok.literal.add(CR) + inc(L.bufpos) + of 'l', 'L': + tok.literal.add(LF) + inc(L.bufpos) + of 'f', 'F': + tok.literal.add(FF) + inc(L.bufpos) + of 'e', 'E': + tok.literal.add(ESC) + inc(L.bufpos) + of 'a', 'A': + tok.literal.add(BEL) + inc(L.bufpos) + of 'b', 'B': + tok.literal.add(BACKSPACE) + inc(L.bufpos) + of 'v', 'V': + tok.literal.add(VT) + inc(L.bufpos) + of 't', 'T': + tok.literal.add('\t') + inc(L.bufpos) + of '\'', '\"': + tok.literal.add(L.buf[L.bufpos]) + inc(L.bufpos) + of '\\': + tok.literal.add('\\') + inc(L.bufpos) + of 'x', 'X': + inc(L.bufpos) + + var xi = 0 + + handleHexChar(L, xi, 1) + handleHexChar(L, xi, 2) + tok.literal.add(chr(xi)) + of 'u', 'U': + if tok.tokType == tkCharLit: + lexMessage(L, errGenerated, "\\u not allowed in character literal") + + inc(L.bufpos) + + var xi = 0 + if L.buf[L.bufpos] == '{': + inc(L.bufpos) + + var start = L.bufpos + while L.buf[L.bufpos] != '}': + handleHexChar(L, xi, 0) + if start == L.bufpos: + lexMessage(L, errGenerated, "Unicode codepoint cannot be empty") + + inc(L.bufpos) + if xi > 0x10FFFF: + let hex = ($L.buf)[start .. L.bufpos - 2] + + lexMessage( + L, + errGenerated, + "Unicode codepoint must be lower than 0x10FFFF, but was: " & hex + ) + else: + handleHexChar(L, xi, 1) + handleHexChar(L, xi, 2) + handleHexChar(L, xi, 3) + handleHexChar(L, xi, 4) + + addUnicodeCodePoint(tok.literal, xi) + of '0' .. '9': + if matchTwoChars(L, '0', {'0' .. '9'}): + lexMessage(L, warnOctalEscape) + + var xi = 0 + + handleDecChars(L, xi) + if (xi <= 255): + tok.literal.add(chr(xi)) + else: + lexMessage(L, errGenerated, "invalid character constant") + else: + lexMessage(L, errGenerated, "invalid character constant") + +proc handleCRLF(L: var Lexer; pos: int): int = + case L.buf[pos] + of CR: + result = nimlexbase.handleCR(L, pos) + of LF: + result = nimlexbase.handleLF(L, pos) + else: + result = pos + +type + StringMode = enum + normal + raw + generalized + +proc getString(L: var Lexer; tok: var Token; mode: StringMode) = + var pos = L.bufpos + var line = L.lineNumber # save linenumber for better error message + + tokenBegin(tok, pos - ord(mode == raw)) + + inc pos # skip " + if L.buf[pos] == '\"' and L.buf[pos + 1] == '\"': + tok.tokType = tkTripleStrLit # long string literal: + + inc(pos, 2) # skip "" + # skip leading newline: + if L.buf[pos] in {' ', '\t'}: + var newpos = pos + 1 + while L.buf[newpos] in {' ', '\t'}: + inc newpos + if L.buf[newpos] in {CR, LF}: + pos = newpos + + pos = handleCRLF(L, pos) + while true: + case L.buf[pos] + of '\"': + if L.buf[pos + 1] == '\"' and L.buf[pos + 2] == '\"' and L.buf[pos + 3] != '\"': + tokenEndIgnore(tok, pos + 2) + + L.bufpos = pos + 3 # skip the three """ + + break + + tok.literal.add('\"') + inc(pos) + of CR, LF: + tokenEndIgnore(tok, pos) + + pos = handleCRLF(L, pos) + + tok.literal.add("\n") + of nimlexbase.EndOfFile: + tokenEndIgnore(tok, pos) + + var line2 = L.lineNumber + + L.lineNumber = line + + lexMessagePos( + L, + errGenerated, + L.lineStart, + "closing \"\"\" expected, but end of file reached" + ) + + L.lineNumber = line2 + L.bufpos = pos + + break + else: + tok.literal.add(L.buf[pos]) + inc(pos) + else: + # ordinary string literal + if mode != normal: + tok.tokType = tkRStrLit + else: + tok.tokType = tkStrLit + while true: + var c = L.buf[pos] + if c == '\"': + if mode != normal and L.buf[pos + 1] == '\"': + inc(pos, 2) + tok.literal.add('"') + else: + tokenEndIgnore(tok, pos) + inc(pos) # skip '"' + + break + elif c in {CR, LF, nimlexbase.EndOfFile}: + tokenEndIgnore(tok, pos) + lexMessage(L, errGenerated, "closing \" expected") + + break + elif (c == '\\') and mode == normal: + L.bufpos = pos + + getEscapedChar(L, tok) + + pos = L.bufpos + else: + tok.literal.add(c) + inc(pos) + + L.bufpos = pos + +proc getCharacter(L: var Lexer; tok: var Token) = + tokenBegin(tok, L.bufpos) + + let startPos = L.bufpos + + inc(L.bufpos) # skip ' + + var c = L.buf[L.bufpos] + case c + of '\0' .. pred(' '), '\'': + lexMessage(L, errGenerated, "invalid character literal") + + tok.literal = $c + of '\\': + getEscapedChar(L, tok) + else: + tok.literal = $c + + inc(L.bufpos) + if L.buf[L.bufpos] == '\'': + tokenEndIgnore(tok, L.bufpos) + inc(L.bufpos) # skip ' + else: + if startPos > 0 and L.buf[startPos - 1] == '`': + tok.literal = "'" + L.bufpos = startPos + 1 + else: + lexMessage(L, errGenerated, "missing closing ' for character literal") + + tokenEndIgnore(tok, L.bufpos - 1) + +const + UnicodeOperatorStartChars = {'\226', '\194', '\195'} + # the allowed unicode characters ("∙ ∘ × ★ ⊗ ⊘ ⊙ ⊛ ⊠ ⊡ ∩ ∧ ⊓ ± ⊕ ⊖ ⊞ ⊟ ∪ ∨ ⊔") + # all start with one of these. + +type + UnicodeOprPred = enum + Mul + Add + +proc unicodeOprLen(buf: cstring; pos: int): (int8, UnicodeOprPred) = + template m(len): untyped = + (int8(len), Mul) + + template a(len): untyped = + (int8(len), Add) + + result = 0.m + case buf[pos] + of '\226': + if buf[pos + 1] == '\136': + if buf[pos + 2] == '\152': + result = 3.m # ∘ + elif buf[pos + 2] == '\153': + result = 3.m # ∙ + elif buf[pos + 2] == '\167': + result = 3.m # ∧ + elif buf[pos + 2] == '\168': + result = 3.a # ∨ + elif buf[pos + 2] == '\169': + result = 3.m # ∩ + elif buf[pos + 2] == '\170': + result = 3.a # ∪ + elif buf[pos + 1] == '\138': + if buf[pos + 2] == '\147': + result = 3.m # ⊓ + elif buf[pos + 2] == '\148': + result = 3.a # ⊔ + elif buf[pos + 2] == '\149': + result = 3.a # ⊕ + elif buf[pos + 2] == '\150': + result = 3.a # ⊖ + elif buf[pos + 2] == '\151': + result = 3.m # ⊗ + elif buf[pos + 2] == '\152': + result = 3.m # ⊘ + elif buf[pos + 2] == '\153': + result = 3.m # ⊙ + elif buf[pos + 2] == '\155': + result = 3.m # ⊛ + elif buf[pos + 2] == '\158': + result = 3.a # ⊞ + elif buf[pos + 2] == '\159': + result = 3.a # ⊟ + elif buf[pos + 2] == '\160': + result = 3.m # ⊠ + elif buf[pos + 2] == '\161': + result = 3.m # ⊡ + elif buf[pos + 1] == '\152' and buf[pos + 2] == '\133': + result = 3.m # ★ + of '\194': + if buf[pos + 1] == '\177': + result = 2.a # ± + of '\195': + if buf[pos + 1] == '\151': + result = 2.m # × + else: + discard + +proc getSymbol(L: var Lexer; tok: var Token) = + var h: Hash = 0 + var pos = L.bufpos + + tokenBegin(tok, pos) + + var suspicious = false + while true: + var c = L.buf[pos] + case c + of 'a' .. 'z', '0' .. '9': + h = h !& ord(c) + + inc(pos) + of 'A' .. 'Z': + c = chr(ord(c) + (ord('a') - ord('A'))) # toLower() + h = h !& ord(c) + + inc(pos) + + suspicious = true + of '_': + if L.buf[pos + 1] notin SymChars: + lexMessage(L, errGenerated, "invalid token: trailing underscore") + + break + + inc(pos) + + suspicious = true + of '\x80' .. '\xFF': + if c in UnicodeOperatorStartChars and unicodeOprLen(L.buf, pos)[0] != 0: + break + else: + h = h !& ord(c) + + inc(pos) + else: + break + + tokenEnd(tok, pos - 1) + + h = !$h + tok.ident = L.cache.getIdent(cast[cstring](addr(L.buf[L.bufpos])), pos - L.bufpos, h) + if (tok.ident.id < ord(tokKeywordLow) - ord(tkSymbol)) or ( + tok.ident.id > ord(tokKeywordHigh) - ord(tkSymbol) + ): + tok.tokType = tkSymbol + else: + tok.tokType = TokType(tok.ident.id + ord(tkSymbol)) + if suspicious and {optStyleHint, optStyleError} * L.config.globalOptions != {}: + lintReport(L.config, getLineInfo(L), tok.ident.s.normalize, tok.ident.s) + + L.bufpos = pos + +proc endOperator(L: var Lexer; tok: var Token; pos: int; hash: Hash) {.inline.} = + var h = !$hash + + tok.ident = L.cache.getIdent(cast[cstring](addr(L.buf[L.bufpos])), pos - L.bufpos, h) + if (tok.ident.id < oprLow) or (tok.ident.id > oprHigh): + tok.tokType = tkOpr + else: + tok.tokType = TokType(tok.ident.id - oprLow + ord(tkColon)) + + L.bufpos = pos + +proc getOperator(L: var Lexer; tok: var Token) = + var pos = L.bufpos + + tokenBegin(tok, pos) + + var h: Hash = 0 + while true: + var c = L.buf[pos] + if c in OpChars: + h = h !& ord(c) + + inc(pos) + elif c in UnicodeOperatorStartChars: + let oprLen = unicodeOprLen(L.buf, pos)[0] + if oprLen == 0: + break + for i in 0 ..< oprLen: + h = h !& ord(L.buf[pos]) + + inc pos + else: + break + + endOperator(L, tok, pos, h) + tokenEnd(tok, pos - 1) + + # advance pos but don't store it in L.bufpos so the next token (which might + # be an operator too) gets the preceding spaces: + tok.spacing = tok.spacing - {tsTrailing, tsEof} + + var trailing = false + while L.buf[pos] == ' ': + inc pos + + trailing = true + if L.buf[pos] in {CR, LF, nimlexbase.EndOfFile}: + tok.spacing.incl(tsEof) + elif trailing: + tok.spacing.incl(tsTrailing) + +proc getPrecedence*(tok: Token): int = + ## Calculates the precedence of the given token. + const + MulPred = 9 + PlusPred = 8 + case tok.tokType + of tkOpr: + let relevantChar = tok.ident.s[0] + # arrow like? + if tok.ident.s.len > 1 and tok.ident.s[^1] == '>' and tok.ident.s[^2] in { + '-', '~', '=' + }: + return 0 + + template considerAsgn(value: untyped) = + result = + if tok.ident.s[^1] == '=': + 1 + else: + value + + case relevantChar + of '$', '^': + considerAsgn(10) + of '*', '%', '/', '\\': + considerAsgn(MulPred) + of '~': + result = 8 + of '+', '-', '|': + considerAsgn(PlusPred) + of '&': + considerAsgn(7) + of '=', '<', '>', '!': + result = 5 + of '.': + considerAsgn(6) + of '?': + result = 2 + of UnicodeOperatorStartChars: + if tok.ident.s[^1] == '=': + result = 1 + else: + let (len, pred) = unicodeOprLen(cstring(tok.ident.s), 0) + if len != 0: + result = + if pred == Mul: + MulPred + else: + PlusPred + else: + result = 2 + else: + considerAsgn(2) + of tkDiv, tkMod, tkShl, tkShr: + result = 9 + of tkDotDot: + result = 6 + of tkIn, tkNotin, tkIs, tkIsnot, tkOf, tkAs, tkFrom: + result = 5 + of tkAnd: + result = 4 + of tkOr, tkXor, tkPtr, tkRef: + result = 3 + else: + return -10 + +proc bufMatches(L: Lexer; pos: int; chars: string): bool = + for i, c in chars: + if L.buf[pos + i] != c: + return false + + true + +proc scanMultiLineComment(L: var Lexer; tok: var Token; start: int; isDoc: bool) = + var pos = start + + tokenBegin(tok, pos) + + tok.literal.add L.buf[pos] + + pos += 1 + + var nesting = 0 + while true: + if L.buf[pos] == nimlexbase.EndOfFile: + tokenEndIgnore(tok, pos) + lexMessagePos(L, errGenerated, pos, "end of multiline comment expected") + + break + if isDoc: + if L.bufMatches(pos, "##["): + nesting += 1 + elif L.bufMatches(pos, "]##"): + if nesting == 0: + tok.literal.add "]##" + + pos += 3 + + break + + nesting -= 1 + else: + if L.bufMatches(pos, "#["): + nesting += 1 + elif L.bufMatches(pos, "]#"): + if nesting == 0: + tok.literal.add "]#" + + pos += 2 + + break + + nesting -= 1 + + tok.literal.add L.buf[pos] + if L.buf[pos] in {CR, LF}: + pos = handleCRLF(L, pos) + else: + pos += 1 + + tokenEnd(tok, pos - 1) + + L.bufpos = pos + +proc scanComment(L: var Lexer; tok: var Token) = + var pos = L.bufpos + + tok.tokType = tkComment + if L.buf[pos + 1] == '[': + scanMultiLineComment(L, tok, pos, false) + + return + elif L.buf[pos + 1] == '#' and L.buf[pos + 2] == '[': + scanMultiLineComment(L, tok, pos, true) + + return + + tokenBegin(tok, pos) + while L.buf[pos] notin {CR, LF, nimlexbase.EndOfFile}: + tok.literal.add(L.buf[pos]) + inc(pos) + + tokenEndIgnore(tok, pos) + + L.bufpos = pos + +proc skip(L: var Lexer; tok: var Token) = + var pos = L.bufpos + + tokenBegin(tok, pos) + tok.spacing.excl(tsLeading) + + tok.line = -1 + while true: + case L.buf[pos] + of ' ': + inc(pos) + tok.spacing.incl(tsLeading) + of '\t': + lexMessagePos(L, errGenerated, pos, "tabs are not allowed, use spaces instead") + inc(pos) + of CR, LF: + pos = handleCRLF(L, pos) + + var indent = 0 + while true: + if L.buf[pos] == ' ': + inc(pos) + inc(indent) + else: + break + + tok.spacing.excl(tsLeading) + if L.buf[pos] > ' ': # and (L.buf[pos] != '#' or L.buf[pos+1] == '#'): + tok.indent = indent + L.currLineIndent = indent + + break + else: + break + + tokenEndPrevious(tok, pos - 1) + + L.bufpos = pos + +proc rawGetTok*(L: var Lexer; tok: var Token) = + template atTokenEnd() {.dirty.} = + discard + + # TODO nimsuggest leftover + reset(tok) + + tok.indent = -1 + + skip(L, tok) + + let c = L.buf[L.bufpos] + + tok.line = L.lineNumber + tok.col = getColNumber(L, L.bufpos) + if c in SymStartChars - {'r', 'R'} - UnicodeOperatorStartChars: + getSymbol(L, tok) + else: + case c + of UnicodeOperatorStartChars: + if unicodeOprLen(L.buf, L.bufpos)[0] != 0: + getOperator(L, tok) + else: + getSymbol(L, tok) + of '#': + scanComment(L, tok) + of '*': + # '*:' is unfortunately a special case, because it is two tokens in + # 'var v*: int'. + if L.buf[L.bufpos + 1] == ':' and L.buf[L.bufpos + 2] notin OpChars: + var h = 0 !& ord('*') + + endOperator(L, tok, L.bufpos + 1, h) + else: + getOperator(L, tok) + of ',': + tok.tokType = tkComma + + inc(L.bufpos) + of 'r', 'R': + if L.buf[L.bufpos + 1] == '\"': + inc(L.bufpos) + getString(L, tok, raw) + else: + getSymbol(L, tok) + of '(': + inc(L.bufpos) + if L.buf[L.bufpos] == '.' and L.buf[L.bufpos + 1] != '.': + tok.tokType = tkParDotLe + + inc(L.bufpos) + else: + tok.tokType = tkParLe + of ')': + tok.tokType = tkParRi + + inc(L.bufpos) + of '[': + inc(L.bufpos) + if L.buf[L.bufpos] == '.' and L.buf[L.bufpos + 1] != '.': + tok.tokType = tkBracketDotLe + + inc(L.bufpos) + elif L.buf[L.bufpos] == ':': + tok.tokType = tkBracketLeColon + + inc(L.bufpos) + else: + tok.tokType = tkBracketLe + of ']': + tok.tokType = tkBracketRi + + inc(L.bufpos) + of '.': + if L.buf[L.bufpos + 1] == ']': + tok.tokType = tkBracketDotRi + + inc(L.bufpos, 2) + elif L.buf[L.bufpos + 1] == '}': + tok.tokType = tkCurlyDotRi + + inc(L.bufpos, 2) + elif L.buf[L.bufpos + 1] == ')': + tok.tokType = tkParDotRi + + inc(L.bufpos, 2) + else: + getOperator(L, tok) + of '{': + inc(L.bufpos) + if L.buf[L.bufpos] == '.' and L.buf[L.bufpos + 1] != '.': + tok.tokType = tkCurlyDotLe + + inc(L.bufpos) + else: + tok.tokType = tkCurlyLe + of '}': + tok.tokType = tkCurlyRi + + inc(L.bufpos) + of ';': + tok.tokType = tkSemiColon + + inc(L.bufpos) + of '`': + tok.tokType = tkAccent + + inc(L.bufpos) + of '_': + tokenBegin(tok, L.bufpos) + inc(L.bufpos) + if L.buf[L.bufpos] notin SymChars + {'_'}: + tok.tokType = tkSymbol + tok.ident = L.cache.getIdent("_") + else: + tok.literal = $c + tok.tokType = tkInvalid + + lexMessage(L, errGenerated, "invalid token: " & c & " (\\" & $(ord(c)) & ')') + + tokenEnd(tok, L.bufpos - 1) + of '\"': + # check for generalized raw string literal: + let mode = + if L.bufpos > 0 and L.buf[L.bufpos - 1] in SymChars: + generalized + else: + normal + + getString(L, tok, mode) + if mode == generalized: + # tkRStrLit -> tkGStrLit + # tkTripleStrLit -> tkGTripleStrLit + inc(tok.tokType, 2) + of '\'': + tok.tokType = tkCharLit + + getCharacter(L, tok) + + tok.tokType = tkCharLit + of '0' .. '9': + getNumber(L, tok) + + let c = L.buf[L.bufpos] + if c in SymChars + {'_'}: + if c in UnicodeOperatorStartChars and unicodeOprLen(L.buf, L.bufpos)[0] != 0: + discard + else: + lexMessage( + L, + errGenerated, + "invalid token: no whitespace between number and identifier" + ) + of '-': + if L.buf[L.bufpos + 1] in {'0' .. '9'} and ( + L.bufpos - 1 == 0 or L.buf[L.bufpos - 1] in UnaryMinusWhitelist + ): + # x)-23 # binary minus + # ,-23 # unary minus + # \n-78 # unary minus? Yes. + # =-3 # parsed as `=-` anyway + getNumber(L, tok) + + let c = L.buf[L.bufpos] + if c in SymChars + {'_'}: + if c in UnicodeOperatorStartChars and unicodeOprLen(L.buf, L.bufpos)[0] != 0: + discard + else: + lexMessage( + L, + errGenerated, + "invalid token: no whitespace between number and identifier" + ) + else: + getOperator(L, tok) + else: + if c in OpChars: + getOperator(L, tok) + elif c == nimlexbase.EndOfFile: + tok.tokType = tkEof + tok.indent = 0 + else: + tok.literal = $c + tok.tokType = tkInvalid + + lexMessage(L, errGenerated, "invalid token: " & c & " (\\" & $(ord(c)) & ')') + inc(L.bufpos) + + atTokenEnd() + if L.printTokens: + printTok(L.config, tok) + +proc getIndentWidth*( + fileIdx: FileIndex; inputstream: PLLStream; cache: IdentCache; config: ConfigRef +): int = + result = 0 + + var lex: Lexer = default(Lexer) + var tok: Token = default(Token) + + openLexer(lex, fileIdx, inputstream, cache, config, false) + + var prevToken = tkEof + while tok.tokType != tkEof: + rawGetTok(lex, tok) + if tok.indent > 0 and prevToken in { + tkColon, tkEquals, tkType, tkConst, tkLet, tkVar, tkUsing + }: + result = tok.indent + if result > 0: + break + + prevToken = tok.tokType + + closeLexer(lex) + +proc getPrecedence*(ident: PIdent): int = + ## assumes ident is binary operator already + let + tokType = + if ident.id in ord(tokKeywordLow) - ord(tkSymbol) .. ord(tokKeywordHigh) - ord( + tkSymbol + ): + TokType(ident.id + ord(tkSymbol)) + else: + tkOpr + tok = Token(ident: ident, tokType: tokType) + + getPrecedence(tok) diff --git a/src/phlexer.nim.nimph.yaml b/src/phlexer.nim.nimph.yaml new file mode 100644 index 0000000..f25b867 --- /dev/null +++ b/src/phlexer.nim.nimph.yaml @@ -0,0 +1,38688 @@ +{ + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# nimph" + }, + { + "kind": "nkCommentStmt", + "comment": "# (c) Copyright 2023 Jacek Sieka" + }, + { + "kind": "nkCommentStmt", + "comment": "# The Nim compiler" + }, + { + "kind": "nkCommentStmt", + "comment": "# (c) Copyright 2018 Andreas Rumpf" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# See the file \"copying.txt\", included in this" + }, + { + "kind": "nkCommentStmt", + "comment": "# distribution, for details about the copyright." + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# This lexer is handwritten for efficiency. I used an elegant buffering" + }, + { + "kind": "nkCommentStmt", + "comment": "# scheme which I have not seen anywhere else:" + }, + { + "kind": "nkCommentStmt", + "comment": "# We guarantee that a whole line is in the buffer. Thus only when scanning" + }, + { + "kind": "nkCommentStmt", + "comment": "# the \\n or \\r character we have to check whether we need to read in the next" + }, + { + "kind": "nkCommentStmt", + "comment": "# chunk. (\\n or \\r already need special handling for incrementing the line" + }, + { + "kind": "nkCommentStmt", + "comment": "# counter; choosing both \\n and \\r allows the lexer to properly read Unix," + }, + { + "kind": "nkCommentStmt", + "comment": "# DOS or Macintosh text files, even when it is not the native format." + }, + { + "kind": "nkCommentStmt", + "comment": "# nimph version:" + }, + { + "kind": "nkCommentStmt", + "comment": "# The nimph version has been simplified to not re-flow comments (or indeed do" + }, + { + "kind": "nkCommentStmt", + "comment": "# anything smart about them) and to include more source information about tokens" + }, + { + "kind": "nkCommentStmt", + "comment": "# such that they can be reproduced faithfully, similar to how nimpretty does it." + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# Each comment is treated as a single token starting at the comment marker (`#`)" + }, + { + "kind": "nkCommentStmt", + "comment": "# and ending at the end of line, with each line of comments being a new token." + }, + { + "kind": "nkCommentStmt", + "comment": "# Multiline tokens are similar except they include newlines as well up to the" + }, + { + "kind": "nkCommentStmt", + "comment": "# end-of-comment marker." + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "hashes" + }, + { + "kind": "nkIdent", + "ident": "phoptions" + }, + { + "kind": "nkIdent", + "ident": "phmsgs" + }, + { + "kind": "nkIdent", + "ident": "strutils" + }, + { + "kind": "nkIdent", + "ident": "platform" + }, + { + "kind": "nkIdent", + "ident": "idents" + }, + { + "kind": "nkIdent", + "ident": "nimlexbase" + }, + { + "kind": "nkIdent", + "ident": "llstream" + }, + { + "kind": "nkIdent", + "ident": "wordrecg" + }, + { + "kind": "nkIdent", + "ident": "phlineinfos" + }, + { + "kind": "nkIdent", + "ident": "pathutils" + }, + { + "kind": "nkIdent", + "ident": "parseutils" + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "nimPreviewSlimSystem" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkIdent", + "ident": "std" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "assertions" + }, + { + "kind": "nkIdent", + "ident": "formatfloat" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "numChars" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "char" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCharLit", + "intVal": 57 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 97 + }, + { + "kind": "nkCharLit", + "intVal": 122 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 65 + }, + { + "kind": "nkCharLit", + "intVal": 90 + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "SymChars" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "char" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 97 + }, + { + "kind": "nkCharLit", + "intVal": 122 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 65 + }, + { + "kind": "nkCharLit", + "intVal": 90 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCharLit", + "intVal": 57 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 128 + }, + { + "kind": "nkCharLit", + "intVal": 255 + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "SymStartChars" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "char" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 97 + }, + { + "kind": "nkCharLit", + "intVal": 122 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 65 + }, + { + "kind": "nkCharLit", + "intVal": 90 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 128 + }, + { + "kind": "nkCharLit", + "intVal": 255 + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "OpChars" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "char" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 43 + }, + { + "kind": "nkCharLit", + "intVal": 45 + }, + { + "kind": "nkCharLit", + "intVal": 42 + }, + { + "kind": "nkCharLit", + "intVal": 47 + }, + { + "kind": "nkCharLit", + "intVal": 92 + }, + { + "kind": "nkCharLit", + "intVal": 60 + }, + { + "kind": "nkCharLit", + "intVal": 62 + }, + { + "kind": "nkCharLit", + "intVal": 33 + }, + { + "kind": "nkCharLit", + "intVal": 63 + }, + { + "kind": "nkCharLit", + "intVal": 94 + }, + { + "kind": "nkCharLit", + "intVal": 46 + }, + { + "kind": "nkCharLit", + "intVal": 124 + }, + { + "kind": "nkCharLit", + "intVal": 61 + }, + { + "kind": "nkCharLit", + "intVal": 37 + }, + { + "kind": "nkCharLit", + "intVal": 38 + }, + { + "kind": "nkCharLit", + "intVal": 36 + }, + { + "kind": "nkCharLit", + "intVal": 64 + }, + { + "kind": "nkCharLit", + "intVal": 126 + }, + { + "kind": "nkCharLit", + "intVal": 58 + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "UnaryMinusWhitelist" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 32 + }, + { + "kind": "nkCharLit", + "intVal": 9 + }, + { + "kind": "nkCharLit", + "intVal": 10 + }, + { + "kind": "nkCharLit", + "intVal": 13 + }, + { + "kind": "nkCharLit", + "intVal": 44 + }, + { + "kind": "nkCharLit", + "intVal": 59 + }, + { + "kind": "nkCharLit", + "intVal": 40 + }, + { + "kind": "nkCharLit", + "intVal": 91 + }, + { + "kind": "nkCharLit", + "intVal": 123 + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# don\\\'t forget to update the \\\'highlite\\\' module if these charsets should change\", line: 63, col: 0, offsetA: 2006, offsetB: 2084)" + ], + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TokType" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInvalid" + }, + { + "kind": "nkStrLit", + "strVal": "tkInvalid" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkEof" + }, + { + "kind": "nkStrLit", + "strVal": "[EOF]" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# order is important here!\", line: 67, col: 20, offsetA: 2156, offsetB: 2182)" + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkStrLit", + "strVal": "tkSymbol" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# keywords:\", line: 68, col: 26, offsetA: 2209, offsetB: 2220)" + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkAddr" + }, + { + "kind": "nkStrLit", + "strVal": "addr" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkAnd" + }, + { + "kind": "nkStrLit", + "strVal": "and" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkAs" + }, + { + "kind": "nkStrLit", + "strVal": "as" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkAsm" + }, + { + "kind": "nkStrLit", + "strVal": "asm" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkBind" + }, + { + "kind": "nkStrLit", + "strVal": "bind" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkBlock" + }, + { + "kind": "nkStrLit", + "strVal": "block" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkBreak" + }, + { + "kind": "nkStrLit", + "strVal": "break" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCase" + }, + { + "kind": "nkStrLit", + "strVal": "case" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCast" + }, + { + "kind": "nkStrLit", + "strVal": "cast" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkConcept" + }, + { + "kind": "nkStrLit", + "strVal": "concept" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkConst" + }, + { + "kind": "nkStrLit", + "strVal": "const" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkContinue" + }, + { + "kind": "nkStrLit", + "strVal": "continue" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkConverter" + }, + { + "kind": "nkStrLit", + "strVal": "converter" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkDefer" + }, + { + "kind": "nkStrLit", + "strVal": "defer" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkDiscard" + }, + { + "kind": "nkStrLit", + "strVal": "discard" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkDistinct" + }, + { + "kind": "nkStrLit", + "strVal": "distinct" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkDiv" + }, + { + "kind": "nkStrLit", + "strVal": "div" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkDo" + }, + { + "kind": "nkStrLit", + "strVal": "do" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkElif" + }, + { + "kind": "nkStrLit", + "strVal": "elif" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkElse" + }, + { + "kind": "nkStrLit", + "strVal": "else" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkEnd" + }, + { + "kind": "nkStrLit", + "strVal": "end" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkEnum" + }, + { + "kind": "nkStrLit", + "strVal": "enum" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkExcept" + }, + { + "kind": "nkStrLit", + "strVal": "except" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkExport" + }, + { + "kind": "nkStrLit", + "strVal": "export" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFinally" + }, + { + "kind": "nkStrLit", + "strVal": "finally" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFor" + }, + { + "kind": "nkStrLit", + "strVal": "for" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFrom" + }, + { + "kind": "nkStrLit", + "strVal": "from" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFunc" + }, + { + "kind": "nkStrLit", + "strVal": "func" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkIf" + }, + { + "kind": "nkStrLit", + "strVal": "if" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkImport" + }, + { + "kind": "nkStrLit", + "strVal": "import" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkIn" + }, + { + "kind": "nkStrLit", + "strVal": "in" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInclude" + }, + { + "kind": "nkStrLit", + "strVal": "include" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInterface" + }, + { + "kind": "nkStrLit", + "strVal": "interface" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkIs" + }, + { + "kind": "nkStrLit", + "strVal": "is" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkIsnot" + }, + { + "kind": "nkStrLit", + "strVal": "isnot" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkIterator" + }, + { + "kind": "nkStrLit", + "strVal": "iterator" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkLet" + }, + { + "kind": "nkStrLit", + "strVal": "let" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkMacro" + }, + { + "kind": "nkStrLit", + "strVal": "macro" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkMethod" + }, + { + "kind": "nkStrLit", + "strVal": "method" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkMixin" + }, + { + "kind": "nkStrLit", + "strVal": "mixin" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkMod" + }, + { + "kind": "nkStrLit", + "strVal": "mod" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkNil" + }, + { + "kind": "nkStrLit", + "strVal": "nil" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkNot" + }, + { + "kind": "nkStrLit", + "strVal": "not" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkNotin" + }, + { + "kind": "nkStrLit", + "strVal": "notin" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkObject" + }, + { + "kind": "nkStrLit", + "strVal": "object" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkOf" + }, + { + "kind": "nkStrLit", + "strVal": "of" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkOr" + }, + { + "kind": "nkStrLit", + "strVal": "or" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkOut" + }, + { + "kind": "nkStrLit", + "strVal": "out" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkProc" + }, + { + "kind": "nkStrLit", + "strVal": "proc" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkPtr" + }, + { + "kind": "nkStrLit", + "strVal": "ptr" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkRaise" + }, + { + "kind": "nkStrLit", + "strVal": "raise" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkRef" + }, + { + "kind": "nkStrLit", + "strVal": "ref" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkReturn" + }, + { + "kind": "nkStrLit", + "strVal": "return" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkShl" + }, + { + "kind": "nkStrLit", + "strVal": "shl" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkShr" + }, + { + "kind": "nkStrLit", + "strVal": "shr" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkStatic" + }, + { + "kind": "nkStrLit", + "strVal": "static" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkTemplate" + }, + { + "kind": "nkStrLit", + "strVal": "template" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkTry" + }, + { + "kind": "nkStrLit", + "strVal": "try" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkTuple" + }, + { + "kind": "nkStrLit", + "strVal": "tuple" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkType" + }, + { + "kind": "nkStrLit", + "strVal": "type" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkUsing" + }, + { + "kind": "nkStrLit", + "strVal": "using" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkVar" + }, + { + "kind": "nkStrLit", + "strVal": "var" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkWhen" + }, + { + "kind": "nkStrLit", + "strVal": "when" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkWhile" + }, + { + "kind": "nkStrLit", + "strVal": "while" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkXor" + }, + { + "kind": "nkStrLit", + "strVal": "xor" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkYield" + }, + { + "kind": "nkStrLit", + "strVal": "yield" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# end of keywords\", line: 134, col: 22, offsetA: 3609, offsetB: 3626)" + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkIntLit" + }, + { + "kind": "nkStrLit", + "strVal": "tkIntLit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInt8Lit" + }, + { + "kind": "nkStrLit", + "strVal": "tkInt8Lit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInt16Lit" + }, + { + "kind": "nkStrLit", + "strVal": "tkInt16Lit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInt32Lit" + }, + { + "kind": "nkStrLit", + "strVal": "tkInt32Lit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInt64Lit" + }, + { + "kind": "nkStrLit", + "strVal": "tkInt64Lit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkUIntLit" + }, + { + "kind": "nkStrLit", + "strVal": "tkUIntLit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkUInt8Lit" + }, + { + "kind": "nkStrLit", + "strVal": "tkUInt8Lit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkUInt16Lit" + }, + { + "kind": "nkStrLit", + "strVal": "tkUInt16Lit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkUInt32Lit" + }, + { + "kind": "nkStrLit", + "strVal": "tkUInt32Lit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkUInt64Lit" + }, + { + "kind": "nkStrLit", + "strVal": "tkUInt64Lit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFloatLit" + }, + { + "kind": "nkStrLit", + "strVal": "tkFloatLit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFloat32Lit" + }, + { + "kind": "nkStrLit", + "strVal": "tkFloat32Lit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFloat64Lit" + }, + { + "kind": "nkStrLit", + "strVal": "tkFloat64Lit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFloat128Lit" + }, + { + "kind": "nkStrLit", + "strVal": "tkFloat128Lit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkStrLit" + }, + { + "kind": "nkStrLit", + "strVal": "tkStrLit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkRStrLit" + }, + { + "kind": "nkStrLit", + "strVal": "tkRStrLit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkTripleStrLit" + }, + { + "kind": "nkStrLit", + "strVal": "tkTripleStrLit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkGStrLit" + }, + { + "kind": "nkStrLit", + "strVal": "tkGStrLit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkGTripleStrLit" + }, + { + "kind": "nkStrLit", + "strVal": "tkGTripleStrLit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCharLit" + }, + { + "kind": "nkStrLit", + "strVal": "tkCharLit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCustomLit" + }, + { + "kind": "nkStrLit", + "strVal": "tkCustomLit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkStrLit", + "strVal": "(" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkParRi" + }, + { + "kind": "nkStrLit", + "strVal": ")" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkBracketLe" + }, + { + "kind": "nkStrLit", + "strVal": "[" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkBracketRi" + }, + { + "kind": "nkStrLit", + "strVal": "]" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCurlyLe" + }, + { + "kind": "nkStrLit", + "strVal": "{" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCurlyRi" + }, + { + "kind": "nkStrLit", + "strVal": "}" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkBracketDotLe" + }, + { + "kind": "nkStrLit", + "strVal": "[." + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkBracketDotRi" + }, + { + "kind": "nkStrLit", + "strVal": ".]" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCurlyDotLe" + }, + { + "kind": "nkStrLit", + "strVal": "{." + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCurlyDotRi" + }, + { + "kind": "nkStrLit", + "strVal": ".}" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkParDotLe" + }, + { + "kind": "nkStrLit", + "strVal": "(." + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkParDotRi" + }, + { + "kind": "nkStrLit", + "strVal": ".)" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkComma" + }, + { + "kind": "nkStrLit", + "strVal": "," + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkSemiColon" + }, + { + "kind": "nkStrLit", + "strVal": ";" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkColonColon" + }, + { + "kind": "nkStrLit", + "strVal": "::" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkEquals" + }, + { + "kind": "nkStrLit", + "strVal": "=" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkDot" + }, + { + "kind": "nkStrLit", + "strVal": "." + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkDotDot" + }, + { + "kind": "nkStrLit", + "strVal": ".." + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkBracketLeColon" + }, + { + "kind": "nkStrLit", + "strVal": "[:" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkOpr" + }, + { + "kind": "nkIdent", + "ident": "tkComment" + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkAccent" + }, + { + "kind": "nkStrLit", + "strVal": "`" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# these are fake tokens used by renderer.nim\", line: 178, col: 19, offsetA: 4751, offsetB: 4795)" + ] + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "tkInfixOpr" + }, + { + "kind": "nkIdent", + "ident": "tkPrefixOpr" + }, + { + "kind": "nkIdent", + "ident": "tkPostfixOpr" + }, + { + "kind": "nkIdent", + "ident": "tkHideableStart" + }, + { + "kind": "nkIdent", + "ident": "tkHideableEnd" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TokTypes" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "TokType" + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "tokKeywordLow" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "succ" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "tokKeywordHigh" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "pred" + }, + { + "kind": "nkIdent", + "ident": "tkIntLit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "NumericalBase" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "base10", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# base10 is listed as the first element,\", line: 195, col: 6, offsetA: 5046, offsetB: 5086)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# so that it is the correct default value\", line: 196, col: 6, offsetA: 5093, offsetB: 5134)" + ] + }, + { + "kind": "nkIdent", + "ident": "base2" + }, + { + "kind": "nkIdent", + "ident": "base8" + }, + { + "kind": "nkIdent", + "ident": "base16" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TokenSpacing" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "tsLeading" + }, + { + "kind": "nkIdent", + "ident": "tsTrailing" + }, + { + "kind": "nkIdent", + "ident": "tsEof" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a Nim token\", line: 206, col: 18, offsetA: 5248, offsetB: 5261)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TokType" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the type of the token\", line: 207, col: 22, offsetA: 5284, offsetB: 5307)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "base" + } + ] + }, + { + "kind": "nkIdent", + "ident": "NumericalBase" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the numerical base; only valid for int\", line: 209, col: 6, offsetA: 5339, offsetB: 5379)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# or float literals\", line: 210, col: 6, offsetA: 5386, offsetB: 5405)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "spacing" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "TokenSpacing" + } + ] + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# spaces around token\", line: 211, col: 32, offsetA: 5438, offsetB: 5459)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the indentation; != -1 if the token has been\", line: 213, col: 6, offsetA: 5483, offsetB: 5529)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# preceded with indentation\", line: 214, col: 6, offsetA: 5536, offsetB: 5563)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PIdent" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the parsed identifier\", line: 215, col: 19, offsetA: 5583, offsetB: 5606)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "BiggestInt" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the parsed integer literal\", line: 216, col: 25, offsetA: 5632, offsetB: 5660)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "fNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "BiggestFloat" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the parsed floating point literal\", line: 217, col: 27, offsetA: 5688, offsetB: 5723)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the parsed (string) literal; and\", line: 219, col: 6, offsetA: 5751, offsetB: 5785)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# documentation comments are here too\", line: 220, col: 6, offsetA: 5792, offsetB: 5829)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + }, + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "offsetA" + } + ] + }, + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "offsetB" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# used for pretty printing so that literals\", line: 223, col: 6, offsetA: 5885, offsetB: 5928)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# like 0b01 or r\\\"\\\\L\\\" are unaffected\", line: 224, col: 6, offsetA: 5935, offsetB: 5971)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "ErrorHandler" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkProcTy", + "sons": [ + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "TMsgKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkOfInherit", + "sons": [ + { + "kind": "nkIdent", + "ident": "TBaseLexer" + } + ] + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "indentAhead" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if > 0 an indentation has already been read\", line: 230, col: 6, offsetA: 6142, offsetB: 6187)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# this is needed because scanning comments\", line: 231, col: 6, offsetA: 6194, offsetB: 6236)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# needs so much look-ahead\", line: 232, col: 6, offsetA: 6243, offsetB: 6269)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "currLineIndent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "errorHandler" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ErrorHandler" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "cache" + } + ] + }, + { + "kind": "nkIdent", + "ident": "IdentCache" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "printTokens" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getLineInfo" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "Lexer" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "Token" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newLineInfo" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "offsetA" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "offsetA" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "offsetB" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "offsetB" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isKeyword" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TokType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "tokKeywordLow" + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "tokKeywordHigh" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "ones" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "untyped" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shl" + }, + { + "kind": "nkIntLit", + "intVal": 1 + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for utf-8 conversion\", line: 250, col: 0, offsetA: 6718, offsetB: 6740)" + ], + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isNimIdentifier" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "sLen" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "sLen" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "SymStartChars" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "sLen" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 95 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "sLen" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "SymChars" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "Token" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "tkIntLit" + }, + { + "kind": "nkIdent", + "ident": "tkInt64Lit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "tkFloatLit" + }, + { + "kind": "nkIdent", + "ident": "tkFloat64Lit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "fNumber" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInvalid" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "tkStrLit" + }, + { + "kind": "nkIdent", + "ident": "tkCharLit" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComment" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkEof" + }, + { + "kind": "nkIdent", + "ident": "tkAccent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "prettyTok" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "Token" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isKeyword" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "keyword " + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "printTok" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "Token" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# xxx factor with toLocation\", line: 291, col: 2, offsetA: 7544, offsetB: 7572)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "msgWriteln" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\u0009" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\u0009" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": " " + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": " " + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "offsetA" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "offsetB" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "openLexer" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "lex" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "inputstream" + }, + { + "kind": "nkIdent", + "ident": "PLLStream" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "cache" + }, + { + "kind": "nkIdent", + "ident": "IdentCache" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "config" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "printTokens" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "openBaseLexer" + }, + { + "kind": "nkIdent", + "ident": "lex" + }, + { + "kind": "nkIdent", + "ident": "inputstream" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "lex" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "lex" + }, + { + "kind": "nkIdent", + "ident": "indentAhead" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "lex" + }, + { + "kind": "nkIdent", + "ident": "currLineIndent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "lex" + }, + { + "kind": "nkIdent", + "ident": "lineNumber" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "inputstream" + }, + { + "kind": "nkIdent", + "ident": "lineOffset" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "lex" + }, + { + "kind": "nkIdent", + "ident": "cache" + } + ] + }, + { + "kind": "nkIdent", + "ident": "cache" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "lex" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "lex" + }, + { + "kind": "nkIdent", + "ident": "printTokens" + } + ] + }, + { + "kind": "nkIdent", + "ident": "printTokens" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "openLexer" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "lex" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "filename" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "inputstream" + }, + { + "kind": "nkIdent", + "ident": "PLLStream" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "cache" + }, + { + "kind": "nkIdent", + "ident": "IdentCache" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "config" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "printTokens" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "openLexer" + }, + { + "kind": "nkIdent", + "ident": "lex" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileInfoIdx" + }, + { + "kind": "nkIdent", + "ident": "config" + }, + { + "kind": "nkIdent", + "ident": "filename" + } + ] + }, + { + "kind": "nkIdent", + "ident": "inputstream" + }, + { + "kind": "nkIdent", + "ident": "cache" + }, + { + "kind": "nkIdent", + "ident": "config" + }, + { + "kind": "nkIdent", + "ident": "printTokens" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "closeLexer" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "lex" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "lex" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "lex" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "linesCompiled" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "lex" + }, + { + "kind": "nkIdent", + "ident": "lineNumber" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "closeBaseLexer" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "getLineInfo" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "Lexer" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newLineInfo" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "lineNumber" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getColNumber" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "dispMessage" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "Lexer" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "TMsgKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "errorHandler" + } + ] + }, + { + "kind": "nkIdent", + "ident": "isNil" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "phmsgs" + }, + { + "kind": "nkIdent", + "ident": "message" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "arg" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "errorHandler" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "arg" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "lexMessage" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "Lexer" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "TMsgKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "dispMessage" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getLineInfo" + }, + { + "kind": "nkIdent", + "ident": "L" + } + ] + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "arg" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "lexMessageTok" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "Lexer" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "TMsgKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "Token" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newLineInfo" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "dispMessage" + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "arg" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessagePos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "TMsgKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newLineInfo" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "lineNumber" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "lineStart" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "dispMessage" + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "arg" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "matchTwoChars" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "Lexer" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "first" + }, + { + "kind": "nkIdent", + "ident": "char" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "second" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "char" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "first" + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "second" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenBegin" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "dirty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "offsetA" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "offsetBase" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenEnd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "dirty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "offsetB" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "offsetBase" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenEndIgnore" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "offsetB" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "offsetBase" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenEndPrevious" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "offsetB" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "offsetBase" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "eatChar" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "replacementChar" + }, + { + "kind": "nkIdent", + "ident": "char" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "replacementChar" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "eatChar" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "getNumber" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "matchUnderscoreChars" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Natural" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "chars" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "char" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# use registers for pos, buf\", line: 380, col: 23, offsetA: 10075, offsetB: 10103)" + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "chars" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 95 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "chars" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessage" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "only single underscores may occur in a token and token may not " + }, + { + "kind": "nkStrLit", + "strVal": "end with an underscore: e.g. \'1__1\' and \'1_\' are invalid" + } + ] + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 95 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "matchChars" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "chars" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "char" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# use registers for pos, buf\", line: 406, col: 23, offsetA: 10722, offsetB: 10750)" + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "chars" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessageLitNum" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "startpos" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msgKind" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Used to get slightly human friendlier err messages.\", line: 416, col: 4, offsetA: 10958, offsetB: 11011)" + ], + "sons": [ + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "literalishChars" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 65 + }, + { + "kind": "nkCharLit", + "intVal": 90 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 97 + }, + { + "kind": "nkCharLit", + "intVal": 122 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCharLit", + "intVal": 57 + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 95 + }, + { + "kind": "nkCharLit", + "intVal": 46 + }, + { + "kind": "nkCharLit", + "intVal": 39 + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msgPos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "Token" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "startpos" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Use L.bufpos as pos because of matchChars\", line: 424, col: 24, offsetA: 11187, offsetB: 11230)" + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "matchChars" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "literalishChars" + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# We must verify +/- specifically so that we\\\'re not past the literal\", line: 427, col: 4, offsetA: 11274, offsetB: 11342)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 43 + }, + { + "kind": "nkCharLit", + "intVal": 45 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 101 + }, + { + "kind": "nkCharLit", + "intVal": 69 + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "matchChars" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "literalishChars" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "literalishChars" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "matchChars" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCharLit", + "intVal": 57 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "msgPos" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessage" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "msgKind" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIdent", + "ident": "BiggestInt" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "isBase10" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "numDigits" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \\\'c\\\', \\\'C\\\' is deprecated\", line: 447, col: 4, offsetA: 11798, offsetB: 11822)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "baseCodeChars" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 88 + }, + { + "kind": "nkCharLit", + "intVal": 120 + }, + { + "kind": "nkCharLit", + "intVal": 111 + }, + { + "kind": "nkCharLit", + "intVal": 98 + }, + { + "kind": "nkCharLit", + "intVal": 66 + }, + { + "kind": "nkCharLit", + "intVal": 99 + }, + { + "kind": "nkCharLit", + "intVal": 67 + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "literalishChars" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "baseCodeChars" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 65 + }, + { + "kind": "nkCharLit", + "intVal": 70 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 97 + }, + { + "kind": "nkCharLit", + "intVal": 102 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCharLit", + "intVal": 57 + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 95 + }, + { + "kind": "nkCharLit", + "intVal": 39 + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "floatTypes" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFloatLit" + }, + { + "kind": "nkIdent", + "ident": "tkFloat32Lit" + }, + { + "kind": "nkIdent", + "ident": "tkFloat64Lit" + }, + { + "kind": "nkIdent", + "ident": "tkFloat128Lit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkIntLit" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# int literal until we know better\", line: 452, col: 28, offsetA: 12067, offsetB: 12101)" + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "base" + } + ] + }, + { + "kind": "nkIdent", + "ident": "base10" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenBegin" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "isPositive" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 45 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eatChar" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "isPositive" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "startpos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "setNumber" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "field" + }, + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "field" + }, + { + "kind": "nkStmtListExpr", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "isPositive" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "value" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# First stage: find out base, make verifications, build token literal string\", line: 473, col: 2, offsetA: 12423, offsetB: 12499)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# {\\\'c\\\', \\\'C\\\'} is added for deprecation reasons to provide a clear error message\", line: 474, col: 2, offsetA: 12502, offsetB: 12580)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 48 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "baseCodeChars" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 99 + }, + { + "kind": "nkCharLit", + "intVal": 67 + }, + { + "kind": "nkCharLit", + "intVal": 79 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "isBase10" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eatChar" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCharLit", + "intVal": 48 + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 99 + }, + { + "kind": "nkCharLit", + "intVal": 67 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessageLitNum" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "$1 will soon be invalid for oct literals; Use \'0o\' " + }, + { + "kind": "nkStrLit", + "strVal": "for octals. \'c\', \'C\' prefix" + } + ] + }, + { + "kind": "nkIdent", + "ident": "startpos" + }, + { + "kind": "nkIdent", + "ident": "warnDeprecated" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eatChar" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCharLit", + "intVal": 99 + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "numDigits" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "matchUnderscoreChars" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCharLit", + "intVal": 55 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 79 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessageLitNum" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "$1 is an invalid int literal; For octal literals " + }, + { + "kind": "nkStrLit", + "strVal": "use the \'0o\' prefix." + } + ] + }, + { + "kind": "nkIdent", + "ident": "startpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 120 + }, + { + "kind": "nkCharLit", + "intVal": 88 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eatChar" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCharLit", + "intVal": 120 + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "numDigits" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "matchUnderscoreChars" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCharLit", + "intVal": 57 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 97 + }, + { + "kind": "nkCharLit", + "intVal": 102 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 65 + }, + { + "kind": "nkCharLit", + "intVal": 70 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 111 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eatChar" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCharLit", + "intVal": 111 + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "numDigits" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "matchUnderscoreChars" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCharLit", + "intVal": 55 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 98 + }, + { + "kind": "nkCharLit", + "intVal": 66 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eatChar" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCharLit", + "intVal": 98 + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "numDigits" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "matchUnderscoreChars" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCharLit", + "intVal": 49 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "internalError" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getLineInfo" + }, + { + "kind": "nkIdent", + "ident": "L" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "getNumber" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "numDigits" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessageLitNum" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkStrLit", + "strVal": "invalid number: \'$1\'" + }, + { + "kind": "nkIdent", + "ident": "startpos" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "matchUnderscoreChars" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCharLit", + "intVal": 57 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 46 + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCharLit", + "intVal": 57 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkFloatLit" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eatChar" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCharLit", + "intVal": 46 + } + ] + }, + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "matchUnderscoreChars" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCharLit", + "intVal": 57 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 101 + }, + { + "kind": "nkCharLit", + "intVal": 69 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkFloatLit" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eatChar" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 43 + }, + { + "kind": "nkCharLit", + "intVal": 45 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eatChar" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "matchUnderscoreChars" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCharLit", + "intVal": 57 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "endpos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Second stage, find out if there\\\'s a datatype suffix and handle it\", line: 531, col: 2, offsetA: 14221, offsetB: 14288)" + ], + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "postPos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "endpos" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "postPos" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 39 + }, + { + "kind": "nkCharLit", + "intVal": 102 + }, + { + "kind": "nkCharLit", + "intVal": 70 + }, + { + "kind": "nkCharLit", + "intVal": 100 + }, + { + "kind": "nkCharLit", + "intVal": 68 + }, + { + "kind": "nkCharLit", + "intVal": 105 + }, + { + "kind": "nkCharLit", + "intVal": 73 + }, + { + "kind": "nkCharLit", + "intVal": 117 + }, + { + "kind": "nkCharLit", + "intVal": 85 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "errPos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "postPos" + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "customLitPossible" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "postPos" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 39 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "postPos" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "customLitPossible" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "postPos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "SymChars" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "suffix" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStringOfCap" + }, + { + "kind": "nkIntLit", + "intVal": 10 + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "suffix" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "postPos" + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "postPos" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "postPos" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "SymChars" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 95 + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "suffixAsLower" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "suffix" + }, + { + "kind": "nkIdent", + "ident": "toLowerAscii" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "suffixAsLower" + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "f" + }, + { + "kind": "nkStrLit", + "strVal": "f32" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkFloat32Lit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "d" + }, + { + "kind": "nkStrLit", + "strVal": "f64" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkFloat64Lit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "f128" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkFloat128Lit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "i8" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkInt8Lit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "i16" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkInt16Lit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "i32" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkInt32Lit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "i64" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkInt64Lit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "u" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkUIntLit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "u8" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkUInt8Lit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "u16" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkUInt16Lit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "u32" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkUInt32Lit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "u64" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkUInt64Lit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "customLitPossible" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 8, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# remember the position of the `\\\'` so that the parser doesn\\\'t\", line: 577, col: 8, offsetA: 15489, offsetB: 15550)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 8, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# have to reparse the custom literal:\", line: 578, col: 8, offsetA: 15559, offsetB: 15596)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 39 + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "suffix" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkCustomLit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessageLitNum" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkStrLit", + "strVal": "invalid number suffix: \'$1\'" + }, + { + "kind": "nkIdent", + "ident": "errPos" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessageLitNum" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkStrLit", + "strVal": "invalid number suffix: \'$1\'" + }, + { + "kind": "nkIdent", + "ident": "errPos" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Is there still a literalish char awaiting? Then it\\\'s an error!\", line: 589, col: 2, offsetA: 15903, offsetB: 15967)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "postPos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "literalishChars" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "postPos" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 46 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "postPos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCharLit", + "intVal": 57 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessageLitNum" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkStrLit", + "strVal": "invalid number: \'$1\'" + }, + { + "kind": "nkIdent", + "ident": "startpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkCustomLit" + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Third stage, extract actual number\", line: 595, col: 4, offsetA: 16184, offsetB: 16220)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "startpos" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# restore position\", line: 596, col: 24, offsetA: 16245, offsetB: 16263)" + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "startpos" + } + ] + } + ] + }, + { + "kind": "nkTryStmt", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 48 + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "baseCodeChars" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# it is a base prefix\", line: 603, col: 15, offsetA: 16401, offsetB: 16422)" + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 98 + }, + { + "kind": "nkCharLit", + "intVal": 66 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "base" + } + ] + }, + { + "kind": "nkIdent", + "ident": "base2" + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIdent", + "ident": "endpos" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 95 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "shl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkCharLit", + "intVal": 48 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 111 + }, + { + "kind": "nkCharLit", + "intVal": 99 + }, + { + "kind": "nkCharLit", + "intVal": 67 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "base" + } + ] + }, + { + "kind": "nkIdent", + "ident": "base8" + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIdent", + "ident": "endpos" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 95 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "shl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkCharLit", + "intVal": 48 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 120 + }, + { + "kind": "nkCharLit", + "intVal": 88 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "base" + } + ] + }, + { + "kind": "nkIdent", + "ident": "base16" + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIdent", + "ident": "endpos" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 95 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCharLit", + "intVal": 57 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "shl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkCharLit", + "intVal": 48 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 97 + }, + { + "kind": "nkCharLit", + "intVal": 102 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "shl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkCharLit", + "intVal": 97 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 10 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 65 + }, + { + "kind": "nkCharLit", + "intVal": 70 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "shl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkCharLit", + "intVal": 65 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 10 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "internalError" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getLineInfo" + }, + { + "kind": "nkIdent", + "ident": "L" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "getNumber" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkIntLit" + }, + { + "kind": "nkIdent", + "ident": "tkInt64Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "setNumber" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "xi" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInt8Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "setNumber" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ashr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shl" + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 56 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 56 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInt16Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "setNumber" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ashr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shl" + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 48 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 48 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInt32Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "setNumber" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ashr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shl" + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 32 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 32 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkUIntLit" + }, + { + "kind": "nkIdent", + "ident": "tkUInt64Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "setNumber" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "xi" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkUInt8Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "setNumber" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 255 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkUInt16Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "setNumber" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 65535 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkUInt32Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "setNumber" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkInt64Lit", + "intVal": 4294967295 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFloat32Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "setNumber" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "fNumber" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkCast", + "sons": [ + { + "kind": "nkPtrTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "float32" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "addr" + }, + { + "kind": "nkIdent", + "ident": "xi" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFloat64Lit" + }, + { + "kind": "nkIdent", + "ident": "tkFloatLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "setNumber" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "fNumber" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkCast", + "sons": [ + { + "kind": "nkPtrTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "float64" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "addr" + }, + { + "kind": "nkIdent", + "ident": "xi" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "internalError" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getLineInfo" + }, + { + "kind": "nkIdent", + "ident": "L" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "getNumber" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "floatTypes" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "outOfRange" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkUInt8Lit" + }, + { + "kind": "nkIdent", + "ident": "tkUInt16Lit" + }, + { + "kind": "nkIdent", + "ident": "tkUInt32Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "xi" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInt8Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "BiggestInt" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "uint8" + }, + { + "kind": "nkIdent", + "ident": "high" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInt16Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "BiggestInt" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "uint16" + }, + { + "kind": "nkIdent", + "ident": "high" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInt32Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "BiggestInt" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "uint32" + }, + { + "kind": "nkIdent", + "ident": "high" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "outOfRange" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 12, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#echo \\\"out of range num: \\\", result.iNumber, \\\" vs \\\", xi\", line: 678, col: 12, offsetA: 18869, offsetB: 18923)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessageLitNum" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkStrLit", + "strVal": "number out of range: \'$1\'" + }, + { + "kind": "nkIdent", + "ident": "startpos" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "floatTypes" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "fNumber" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseFloat" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkUInt64Lit" + }, + { + "kind": "nkIdent", + "ident": "tkUIntLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "iNumber" + }, + { + "kind": "nkIdent", + "ident": "uint64" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "uint64" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkTryStmt", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseBiggestUInt" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + } + ] + } + ] + }, + { + "kind": "nkExceptBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ValueError" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkRaiseStmt", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newException" + }, + { + "kind": "nkIdent", + "ident": "OverflowDefect" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "number out of range: " + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkRaiseStmt", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newException" + }, + { + "kind": "nkIdent", + "ident": "ValueError" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "invalid integer: " + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkCast", + "sons": [ + { + "kind": "nkIdent", + "ident": "int64" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "iNumber" + }, + { + "kind": "nkIdent", + "ident": "int64" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "int64" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkTryStmt", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseBiggestInt" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + } + ] + } + ] + }, + { + "kind": "nkExceptBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ValueError" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkRaiseStmt", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newException" + }, + { + "kind": "nkIdent", + "ident": "OverflowDefect" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "number out of range: " + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkRaiseStmt", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newException" + }, + { + "kind": "nkIdent", + "ident": "ValueError" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "invalid integer: " + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "outOfRange" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInt8Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "int8" + }, + { + "kind": "nkIdent", + "ident": "high" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "int8" + }, + { + "kind": "nkIdent", + "ident": "low" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkUInt8Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "BiggestInt" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "uint8" + }, + { + "kind": "nkIdent", + "ident": "high" + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInt16Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "int16" + }, + { + "kind": "nkIdent", + "ident": "high" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "int16" + }, + { + "kind": "nkIdent", + "ident": "low" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkUInt16Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "BiggestInt" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "uint16" + }, + { + "kind": "nkIdent", + "ident": "high" + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInt32Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "int32" + }, + { + "kind": "nkIdent", + "ident": "high" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "int32" + }, + { + "kind": "nkIdent", + "ident": "low" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkUInt32Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "BiggestInt" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "uint32" + }, + { + "kind": "nkIdent", + "ident": "high" + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "outOfRange" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessageLitNum" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkStrLit", + "strVal": "number out of range: \'$1\'" + }, + { + "kind": "nkIdent", + "ident": "startpos" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Promote int literal to int64? Not always necessary, but more consistent\", line: 725, col: 6, offsetA: 20780, offsetB: 20853)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkIntLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "low" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkInt64Lit" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkExceptBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ValueError" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessageLitNum" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkStrLit", + "strVal": "invalid number: \'$1\'" + }, + { + "kind": "nkIdent", + "ident": "startpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkExceptBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "OverflowDefect" + }, + { + "kind": "nkIdent", + "ident": "RangeDefect" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessageLitNum" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkStrLit", + "strVal": "number out of range: \'$1\'" + }, + { + "kind": "nkIdent", + "ident": "startpos" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenEnd" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "postPos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "postPos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "handleHexChar" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "position" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "range" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "invalid" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessage" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "expected a hex digit, but found: " + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "; maybe prepend with 0" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCharLit", + "intVal": 57 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shl" + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkCharLit", + "intVal": 48 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 97 + }, + { + "kind": "nkCharLit", + "intVal": 102 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shl" + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkCharLit", + "intVal": 97 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 10 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 65 + }, + { + "kind": "nkCharLit", + "intVal": 70 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shl" + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkCharLit", + "intVal": 65 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 10 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 34 + }, + { + "kind": "nkCharLit", + "intVal": 39 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkIdent", + "ident": "position" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "invalid" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# do not progress the bufpos here.\", line: 762, col: 4, offsetA: 21850, offsetB: 21884)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "position" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "invalid" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Need to progress for `nim check`\", line: 767, col: 4, offsetA: 21953, offsetB: 21987)" + ], + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "handleDecChars" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCharLit", + "intVal": 57 + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 10 + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkCharLit", + "intVal": 48 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "addUnicodeCodePoint" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCast", + "sons": [ + { + "kind": "nkIdent", + "ident": "uint" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# inlined toUTF-8 to avoid unicode and strutils dependencies.\", line: 778, col: 2, offsetA: 22248, offsetB: 22309)" + ], + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 127 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "setLen" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 2047 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "setLen" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shr" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 192 + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ones" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 128 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 65535 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "setLen" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shr" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 12 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 224 + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shr" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ones" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 128 + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ones" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 128 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 2097151 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "setLen" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shr" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 18 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 240 + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shr" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 12 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ones" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 128 + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shr" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ones" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 128 + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ones" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 128 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 67108863 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "setLen" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 5 + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shr" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 24 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 248 + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shr" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 18 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ones" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 128 + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shr" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 12 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ones" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 128 + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shr" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ones" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 128 + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ones" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 128 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 2147483647 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "setLen" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shr" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 30 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 252 + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shr" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 24 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ones" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 128 + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shr" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 18 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ones" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 128 + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shr" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 12 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ones" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 128 + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shr" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ones" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 128 + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 5 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ones" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 128 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "getEscapedChar" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip \\\'\\\\\\\'\", line: 822, col: 16, offsetA: 23769, offsetB: 23779)" + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 110 + }, + { + "kind": "nkCharLit", + "intVal": 78 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 10 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 112 + }, + { + "kind": "nkCharLit", + "intVal": 80 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkCharLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessage" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkStrLit", + "strVal": "\\p not allowed in character literal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tnl" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 114 + }, + { + "kind": "nkCharLit", + "intVal": 82 + }, + { + "kind": "nkCharLit", + "intVal": 99 + }, + { + "kind": "nkCharLit", + "intVal": 67 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "CR" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 108 + }, + { + "kind": "nkCharLit", + "intVal": 76 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "LF" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 102 + }, + { + "kind": "nkCharLit", + "intVal": 70 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "FF" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 101 + }, + { + "kind": "nkCharLit", + "intVal": 69 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ESC" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 97 + }, + { + "kind": "nkCharLit", + "intVal": 65 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "BEL" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 98 + }, + { + "kind": "nkCharLit", + "intVal": 66 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "BACKSPACE" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 118 + }, + { + "kind": "nkCharLit", + "intVal": 86 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "VT" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 116 + }, + { + "kind": "nkCharLit", + "intVal": 84 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 9 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 39 + }, + { + "kind": "nkCharLit", + "intVal": 34 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 92 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 92 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 120 + }, + { + "kind": "nkCharLit", + "intVal": 88 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "handleHexChar" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "handleHexChar" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkIdent", + "ident": "xi" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 117 + }, + { + "kind": "nkCharLit", + "intVal": 85 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkCharLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessage" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkStrLit", + "strVal": "\\u not allowed in character literal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 123 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 125 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "handleHexChar" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessage" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkStrLit", + "strVal": "Unicode codepoint cannot be empty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 1114111 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "hex" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessage" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "Unicode codepoint must be lower than 0x10FFFF, but was: " + }, + { + "kind": "nkIdent", + "ident": "hex" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "handleHexChar" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "handleHexChar" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "handleHexChar" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "handleHexChar" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "addUnicodeCodePoint" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "xi" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCharLit", + "intVal": 57 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "matchTwoChars" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCharLit", + "intVal": 57 + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessage" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "warnOctalEscape" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "handleDecChars" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "xi" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkIdent", + "ident": "xi" + }, + { + "kind": "nkIntLit", + "intVal": 255 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkIdent", + "ident": "xi" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessage" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkStrLit", + "strVal": "invalid character constant" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessage" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkStrLit", + "strVal": "invalid character constant" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "handleCRLF" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "CR" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimlexbase" + }, + { + "kind": "nkIdent", + "ident": "handleCR" + } + ] + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "LF" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimlexbase" + }, + { + "kind": "nkIdent", + "ident": "handleLF" + } + ] + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "StringMode" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "normal" + }, + { + "kind": "nkIdent", + "ident": "raw" + }, + { + "kind": "nkIdent", + "ident": "generalized" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "getString" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "StringMode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "line" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "lineNumber" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# save linenumber for better error message\", line: 934, col: 26, offsetA: 26299, offsetB: 26341)" + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenBegin" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "raw" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip \\\"\", line: 938, col: 10, offsetA: 26396, offsetB: 26404)" + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 34 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 34 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkTripleStrLit" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# long string literal:\", line: 940, col: 33, offsetA: 26490, offsetB: 26512)" + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip \\\"\\\"\", line: 942, col: 16, offsetA: 26530, offsetB: 26539)" + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip leading newline:\", line: 943, col: 4, offsetA: 26544, offsetB: 26567)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 32 + }, + { + "kind": "nkCharLit", + "intVal": 9 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "newpos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "newpos" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 32 + }, + { + "kind": "nkCharLit", + "intVal": 9 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "newpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "newpos" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "CR" + }, + { + "kind": "nkIdent", + "ident": "LF" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIdent", + "ident": "newpos" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "handleCRLF" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 34 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 34 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 34 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 34 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenEndIgnore" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip the three \\\"\\\"\\\"\", line: 958, col: 29, offsetA: 26988, offsetB: 27008)" + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 34 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "CR" + }, + { + "kind": "nkIdent", + "ident": "LF" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenEndIgnore" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "handleCRLF" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\u000A" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimlexbase" + }, + { + "kind": "nkIdent", + "ident": "EndOfFile" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenEndIgnore" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "line2" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "lineNumber" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "lineNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessagePos" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "lineStart" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "closing \"\"\" expected, but end of file reached" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "lineNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "line2" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ordinary string literal\", line: 992, col: 4, offsetA: 27616, offsetB: 27641)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "normal" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkRStrLit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkStrLit" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkCharLit", + "intVal": 34 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "normal" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 34 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 34 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenEndIgnore" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip \\\'\\\"\\\'\", line: 1005, col: 19, offsetA: 27970, offsetB: 27980)" + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "CR" + }, + { + "kind": "nkIdent", + "ident": "LF" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimlexbase" + }, + { + "kind": "nkIdent", + "ident": "EndOfFile" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenEndIgnore" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessage" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkStrLit", + "strVal": "closing \" expected" + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkCharLit", + "intVal": 92 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "normal" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getEscapedChar" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "getCharacter" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenBegin" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "startPos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip \\\'\", line: 1030, col: 16, offsetA: 28474, offsetB: 28482)" + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 0 + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "pred" + }, + { + "kind": "nkCharLit", + "intVal": 32 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 39 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessage" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkStrLit", + "strVal": "invalid character literal" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 92 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getEscapedChar" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 39 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenEndIgnore" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip \\\'\", line: 1046, col: 18, offsetA: 28800, offsetB: 28808)" + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "startPos" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "startPos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 96 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\'" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "startPos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessage" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkStrLit", + "strVal": "missing closing \' for character literal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenEndIgnore" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "UnicodeOperatorStartChars" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 226 + }, + { + "kind": "nkCharLit", + "intVal": 194 + }, + { + "kind": "nkCharLit", + "intVal": 195 + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the allowed unicode characters (\\\"\u00E2\u0088\u0099 \u00E2\u0088\u0098 \u00C3\u0097 \u00E2\u0098\u0085 \u00E2\u008A\u0097 \u00E2\u008A\u0098 \u00E2\u008A\u0099 \u00E2\u008A\u009B \u00E2\u008A\u00A0 \u00E2\u008A\u00A1 \u00E2\u0088\u00A9 \u00E2\u0088\u00A7 \u00E2\u008A\u0093 \u00C2\u00B1 \u00E2\u008A\u0095 \u00E2\u008A\u0096 \u00E2\u008A\u009E \u00E2\u008A\u009F \u00E2\u0088\u00AA \u00E2\u0088\u00A8 \u00E2\u008A\u0094\\\")\", line: 1058, col: 4, offsetA: 29115, offsetB: 29233)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# all start with one of these.\", line: 1059, col: 4, offsetA: 29238, offsetB: 29268)" + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "UnicodeOprPred" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "Mul" + }, + { + "kind": "nkIdent", + "ident": "Add" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "unicodeOprLen" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkTupleConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "int8" + }, + { + "kind": "nkIdent", + "ident": "UnicodeOprPred" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkIdent", + "ident": "cstring" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "untyped" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkTupleConstr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "int8" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIdent", + "ident": "Mul" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "untyped" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkTupleConstr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "int8" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIdent", + "ident": "Add" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 226 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 136 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 152 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 3 + }, + { + "kind": "nkIdent", + "ident": "m" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \u00E2\u0088\u0098\", line: 1078, col: 21, offsetA: 29616, offsetB: 29621)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 153 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 3 + }, + { + "kind": "nkIdent", + "ident": "m" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \u00E2\u0088\u0099\", line: 1080, col: 21, offsetA: 29678, offsetB: 29683)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 167 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 3 + }, + { + "kind": "nkIdent", + "ident": "m" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \u00E2\u0088\u00A7\", line: 1082, col: 21, offsetA: 29740, offsetB: 29745)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 168 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 3 + }, + { + "kind": "nkIdent", + "ident": "a" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \u00E2\u0088\u00A8\", line: 1084, col: 21, offsetA: 29802, offsetB: 29807)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 169 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 3 + }, + { + "kind": "nkIdent", + "ident": "m" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \u00E2\u0088\u00A9\", line: 1086, col: 21, offsetA: 29864, offsetB: 29869)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 170 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 3 + }, + { + "kind": "nkIdent", + "ident": "a" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \u00E2\u0088\u00AA\", line: 1088, col: 21, offsetA: 29926, offsetB: 29931)" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 138 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 147 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 3 + }, + { + "kind": "nkIdent", + "ident": "m" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \u00E2\u008A\u0093\", line: 1091, col: 21, offsetA: 30019, offsetB: 30024)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 148 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 3 + }, + { + "kind": "nkIdent", + "ident": "a" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \u00E2\u008A\u0094\", line: 1093, col: 21, offsetA: 30081, offsetB: 30086)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 149 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 3 + }, + { + "kind": "nkIdent", + "ident": "a" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \u00E2\u008A\u0095\", line: 1095, col: 21, offsetA: 30143, offsetB: 30148)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 150 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 3 + }, + { + "kind": "nkIdent", + "ident": "a" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \u00E2\u008A\u0096\", line: 1097, col: 21, offsetA: 30205, offsetB: 30210)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 151 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 3 + }, + { + "kind": "nkIdent", + "ident": "m" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \u00E2\u008A\u0097\", line: 1099, col: 21, offsetA: 30267, offsetB: 30272)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 152 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 3 + }, + { + "kind": "nkIdent", + "ident": "m" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \u00E2\u008A\u0098\", line: 1101, col: 21, offsetA: 30329, offsetB: 30334)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 153 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 3 + }, + { + "kind": "nkIdent", + "ident": "m" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \u00E2\u008A\u0099\", line: 1103, col: 21, offsetA: 30391, offsetB: 30396)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 155 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 3 + }, + { + "kind": "nkIdent", + "ident": "m" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \u00E2\u008A\u009B\", line: 1105, col: 21, offsetA: 30453, offsetB: 30458)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 158 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 3 + }, + { + "kind": "nkIdent", + "ident": "a" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \u00E2\u008A\u009E\", line: 1107, col: 21, offsetA: 30515, offsetB: 30520)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 159 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 3 + }, + { + "kind": "nkIdent", + "ident": "a" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \u00E2\u008A\u009F\", line: 1109, col: 21, offsetA: 30577, offsetB: 30582)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 160 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 3 + }, + { + "kind": "nkIdent", + "ident": "m" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \u00E2\u008A\u00A0\", line: 1111, col: 21, offsetA: 30639, offsetB: 30644)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 161 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 3 + }, + { + "kind": "nkIdent", + "ident": "m" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \u00E2\u008A\u00A1\", line: 1113, col: 21, offsetA: 30701, offsetB: 30706)" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 152 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 133 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 3 + }, + { + "kind": "nkIdent", + "ident": "m" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \u00E2\u0098\u0085\", line: 1115, col: 19, offsetA: 30786, offsetB: 30791)" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 194 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 177 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 2 + }, + { + "kind": "nkIdent", + "ident": "a" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \u00C2\u00B1\", line: 1118, col: 19, offsetA: 30855, offsetB: 30859)" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 195 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "buf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 151 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 2 + }, + { + "kind": "nkIdent", + "ident": "m" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \u00C3\u0097\", line: 1121, col: 19, offsetA: 30923, offsetB: 30927)" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "getSymbol" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenBegin" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "suspicious" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 97 + }, + { + "kind": "nkCharLit", + "intVal": 122 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCharLit", + "intVal": 57 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!&" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 65 + }, + { + "kind": "nkCharLit", + "intVal": 90 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkCharLit", + "intVal": 97 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkCharLit", + "intVal": 65 + } + ] + } + ] + } + ] + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# toLower()\", line: 1140, col: 46, offsetA: 31267, offsetB: 31278)" + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!&" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "suspicious" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 95 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "SymChars" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessage" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkStrLit", + "strVal": "invalid token: trailing underscore" + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "suspicious" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 128 + }, + { + "kind": "nkCharLit", + "intVal": 255 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "UnicodeOperatorStartChars" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "unicodeOprLen" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!&" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenEnd" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!$" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "cache" + } + ] + }, + { + "kind": "nkIdent", + "ident": "getIdent" + } + ] + }, + { + "kind": "nkCast", + "sons": [ + { + "kind": "nkIdent", + "ident": "cstring" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "addr" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "tokKeywordLow" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "tokKeywordHigh" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "TokType" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "suspicious" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "optStyleHint" + }, + { + "kind": "nkIdent", + "ident": "optStyleError" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "globalOptions" + } + ] + } + ] + }, + { + "kind": "nkCurly" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lintReport" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getLineInfo" + }, + { + "kind": "nkIdent", + "ident": "L" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkIdent", + "ident": "normalize" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "endOperator" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "hash" + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!$" + }, + { + "kind": "nkIdent", + "ident": "hash" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "cache" + } + ] + }, + { + "kind": "nkIdent", + "ident": "getIdent" + } + ] + }, + { + "kind": "nkCast", + "sons": [ + { + "kind": "nkIdent", + "ident": "cstring" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "addr" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkIdent", + "ident": "oprLow" + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkIdent", + "ident": "oprHigh" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkOpr" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "TokType" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkIdent", + "ident": "oprLow" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "getOperator" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenBegin" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "OpChars" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!&" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "UnicodeOperatorStartChars" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "oprLen" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "unicodeOprLen" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "oprLen" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIdent", + "ident": "oprLen" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!&" + }, + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "endOperator" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenEnd" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# advance pos but don\\\'t store it in L.bufpos so the next token (which might\", line: 1217, col: 2, offsetA: 33097, offsetB: 33172)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# be an operator too) gets the preceding spaces:\", line: 1218, col: 2, offsetA: 33175, offsetB: 33223)" + ], + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "spacing" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "spacing" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tsTrailing" + }, + { + "kind": "nkIdent", + "ident": "tsEof" + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "trailing" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 32 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "trailing" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "CR" + }, + { + "kind": "nkIdent", + "ident": "LF" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimlexbase" + }, + { + "kind": "nkIdent", + "ident": "EndOfFile" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "spacing" + } + ] + }, + { + "kind": "nkIdent", + "ident": "incl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tsEof" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "trailing" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "spacing" + } + ] + }, + { + "kind": "nkIdent", + "ident": "incl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tsTrailing" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getPrecedence" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "Token" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Calculates the precedence of the given token.\", line: 1232, col: 2, offsetA: 33529, offsetB: 33577)" + ], + "sons": [ + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "MulPred" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 9 + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "PlusPred" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 8 + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkOpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "relevantChar" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# arrow like?\", line: 1239, col: 4, offsetA: 33692, offsetB: 33705)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 62 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 45 + }, + { + "kind": "nkCharLit", + "intVal": 126 + }, + { + "kind": "nkCharLit", + "intVal": 61 + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "considerAsgn" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + }, + { + "kind": "nkIdent", + "ident": "untyped" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 61 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "value" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "relevantChar" + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 36 + }, + { + "kind": "nkCharLit", + "intVal": 94 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "considerAsgn" + }, + { + "kind": "nkIntLit", + "intVal": 10 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 42 + }, + { + "kind": "nkCharLit", + "intVal": 37 + }, + { + "kind": "nkCharLit", + "intVal": 47 + }, + { + "kind": "nkCharLit", + "intVal": 92 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "considerAsgn" + }, + { + "kind": "nkIdent", + "ident": "MulPred" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 126 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 8 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 43 + }, + { + "kind": "nkCharLit", + "intVal": 45 + }, + { + "kind": "nkCharLit", + "intVal": 124 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "considerAsgn" + }, + { + "kind": "nkIdent", + "ident": "PlusPred" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 38 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "considerAsgn" + }, + { + "kind": "nkIntLit", + "intVal": 7 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 61 + }, + { + "kind": "nkCharLit", + "intVal": 60 + }, + { + "kind": "nkCharLit", + "intVal": 62 + }, + { + "kind": "nkCharLit", + "intVal": 33 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 5 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 46 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "considerAsgn" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 63 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "UnicodeOperatorStartChars" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 61 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkVarTuple", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkIdent", + "ident": "pred" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "unicodeOprLen" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "cstring" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "pred" + }, + { + "kind": "nkIdent", + "ident": "Mul" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "MulPred" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "PlusPred" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "considerAsgn" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkDiv" + }, + { + "kind": "nkIdent", + "ident": "tkMod" + }, + { + "kind": "nkIdent", + "ident": "tkShl" + }, + { + "kind": "nkIdent", + "ident": "tkShr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 9 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkDotDot" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkIn" + }, + { + "kind": "nkIdent", + "ident": "tkNotin" + }, + { + "kind": "nkIdent", + "ident": "tkIs" + }, + { + "kind": "nkIdent", + "ident": "tkIsnot" + }, + { + "kind": "nkIdent", + "ident": "tkOf" + }, + { + "kind": "nkIdent", + "ident": "tkAs" + }, + { + "kind": "nkIdent", + "ident": "tkFrom" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 5 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkAnd" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkOr" + }, + { + "kind": "nkIdent", + "ident": "tkXor" + }, + { + "kind": "nkIdent", + "ident": "tkPtr" + }, + { + "kind": "nkIdent", + "ident": "tkRef" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIntLit", + "intVal": -10 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "bufMatches" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "Lexer" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "chars" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "chars" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "scanMultiLineComment" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "isDoc" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "start" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenBegin" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "nesting" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimlexbase" + }, + { + "kind": "nkIdent", + "ident": "EndOfFile" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenEndIgnore" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessagePos" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkStrLit", + "strVal": "end of multiline comment expected" + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "isDoc" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufMatches" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkStrLit", + "strVal": "##[" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkIdent", + "ident": "nesting" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufMatches" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkStrLit", + "strVal": "]##" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "nesting" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "]##" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-=" + }, + { + "kind": "nkIdent", + "ident": "nesting" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufMatches" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkStrLit", + "strVal": "#[" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkIdent", + "ident": "nesting" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufMatches" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkStrLit", + "strVal": "]#" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "nesting" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "]#" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-=" + }, + { + "kind": "nkIdent", + "ident": "nesting" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "CR" + }, + { + "kind": "nkIdent", + "ident": "LF" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "handleCRLF" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenEnd" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "scanComment" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComment" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 91 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "scanMultiLineComment" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 35 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 91 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "scanMultiLineComment" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + }, + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenBegin" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "CR" + }, + { + "kind": "nkIdent", + "ident": "LF" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimlexbase" + }, + { + "kind": "nkIdent", + "ident": "EndOfFile" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenEndIgnore" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "skip" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenBegin" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "spacing" + } + ] + }, + { + "kind": "nkIdent", + "ident": "excl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tsLeading" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 32 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "spacing" + } + ] + }, + { + "kind": "nkIdent", + "ident": "incl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tsLeading" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 9 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessagePos" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkStrLit", + "strVal": "tabs are not allowed, use spaces instead" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "CR" + }, + { + "kind": "nkIdent", + "ident": "LF" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "handleCRLF" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 32 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "spacing" + } + ] + }, + { + "kind": "nkIdent", + "ident": "excl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tsLeading" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# and (L.buf[pos] != \\\'#\\\' or L.buf[pos+1] == \\\'#\\\'):\", line: 1404, col: 27, offsetA: 37083, offsetB: 37132)" + ], + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 32 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "currLineIndent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenEndPrevious" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "pos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "rawGetTok" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "atTokenEnd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "dirty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO nimsuggest leftover\", line: 1420, col: 2, offsetA: 37384, offsetB: 37410)" + ], + "ident": "reset" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skip" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "lineNumber" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getColNumber" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "SymStartChars" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 114 + }, + { + "kind": "nkCharLit", + "intVal": 82 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "UnicodeOperatorStartChars" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getSymbol" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "UnicodeOperatorStartChars" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "unicodeOprLen" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getOperator" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getSymbol" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 35 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "scanComment" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 42 + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \\\'*:\\\' is unfortunately a special case, because it is two tokens in\", line: 1443, col: 6, offsetA: 37863, offsetB: 37930)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \\\'var v*: int\\\'.\", line: 1444, col: 6, offsetA: 37937, offsetB: 37953)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 58 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "OpChars" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "h" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!&" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkCharLit", + "intVal": 42 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "endOperator" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "h" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getOperator" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 44 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 114 + }, + { + "kind": "nkCharLit", + "intVal": 82 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 34 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getString" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "raw" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getSymbol" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 40 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 46 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 46 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkParDotLe" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 41 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 91 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 46 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 46 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkBracketDotLe" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 58 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkBracketLeColon" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkBracketLe" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 93 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkBracketRi" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 46 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 93 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkBracketDotRi" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 125 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkCurlyDotRi" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 41 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkParDotRi" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getOperator" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 123 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 46 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 46 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkCurlyDotLe" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkCurlyLe" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 125 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkCurlyRi" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 59 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkSemiColon" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 96 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkAccent" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 95 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenBegin" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "SymChars" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 95 + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "cache" + } + ] + }, + { + "kind": "nkIdent", + "ident": "getIdent" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "_" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkInvalid" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessage" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "invalid token: " + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": " (\\" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 41 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokenEnd" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 34 + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# check for generalized raw string literal:\", line: 1538, col: 6, offsetA: 40105, offsetB: 40148)" + ], + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "SymChars" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "generalized" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "normal" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getString" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "mode" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "generalized" + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 8, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# tkRStrLit -> tkGStrLit\", line: 1547, col: 8, offsetA: 40349, offsetB: 40373)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 8, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# tkTripleStrLit -> tkGTripleStrLit\", line: 1548, col: 8, offsetA: 40382, offsetB: 40417)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 39 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkCharLit" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getCharacter" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkCharLit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCharLit", + "intVal": 57 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getNumber" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "SymChars" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 95 + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "UnicodeOperatorStartChars" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "unicodeOprLen" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessage" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkStrLit", + "strVal": "invalid token: no whitespace between number and identifier" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 45 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 48 + }, + { + "kind": "nkCharLit", + "intVal": 57 + } + ] + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "UnaryMinusWhitelist" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 8, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# x)-23 # binary minus\", line: 1573, col: 8, offsetA: 41076, offsetB: 41098)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 8, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ,-23 # unary minus\", line: 1574, col: 8, offsetA: 41107, offsetB: 41128)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 8, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \\\\n-78 # unary minus? Yes.\", line: 1575, col: 8, offsetA: 41137, offsetB: 41164)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 8, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# =-3 # parsed as `=-` anyway\", line: 1576, col: 8, offsetA: 41173, offsetB: 41204)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getNumber" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "SymChars" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 95 + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "UnicodeOperatorStartChars" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "unicodeOprLen" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessage" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkStrLit", + "strVal": "invalid token: no whitespace between number and identifier" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getOperator" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "OpChars" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getOperator" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimlexbase" + }, + { + "kind": "nkIdent", + "ident": "EndOfFile" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkEof" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkInvalid" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessage" + }, + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "invalid token: " + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": " (\\" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 41 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atTokenEnd" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "printTokens" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "printTok" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getIndentWidth" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "inputstream" + }, + { + "kind": "nkIdent", + "ident": "PLLStream" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "cache" + }, + { + "kind": "nkIdent", + "ident": "IdentCache" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "config" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "lex" + }, + { + "kind": "nkIdent", + "ident": "Lexer" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "default" + }, + { + "kind": "nkIdent", + "ident": "Lexer" + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "Token" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "default" + }, + { + "kind": "nkIdent", + "ident": "Token" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "openLexer" + }, + { + "kind": "nkIdent", + "ident": "lex" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "inputstream" + }, + { + "kind": "nkIdent", + "ident": "cache" + }, + { + "kind": "nkIdent", + "ident": "config" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "prevToken" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "tkEof" + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkEof" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rawGetTok" + }, + { + "kind": "nkIdent", + "ident": "lex" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "prevToken" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + }, + { + "kind": "nkIdent", + "ident": "tkType" + }, + { + "kind": "nkIdent", + "ident": "tkConst" + }, + { + "kind": "nkIdent", + "ident": "tkLet" + }, + { + "kind": "nkIdent", + "ident": "tkVar" + }, + { + "kind": "nkIdent", + "ident": "tkUsing" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "prevToken" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "closeLexer" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getPrecedence" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ident" + }, + { + "kind": "nkIdent", + "ident": "PIdent" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## assumes ident is binary operator already\", line: 1633, col: 2, offsetA: 42626, offsetB: 42669)" + ], + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokType" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ident" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "tokKeywordLow" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "tokKeywordHigh" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "TokType" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ident" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkOpr" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "Token" + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ident" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokType" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getPrecedence" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/phlineinfos.nim b/src/phlineinfos.nim new file mode 100644 index 0000000..d9b3257 --- /dev/null +++ b/src/phlineinfos.nim @@ -0,0 +1,413 @@ +# +# +# nimph +# (c) Copyright 2023 Jacek Sieka +# The Nim compiler +# (c) Copyright 2018 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# +## This module contains the ``TMsgKind`` enum as well as the +## ``TLineInfo`` object. + +import ropes, tables, pathutils, hashes + +const + explanationsBaseUrl* = "https://nim-lang.github.io/Nim" + # was: "https://nim-lang.org/docs" but we're now usually showing devel docs + # instead of latest release docs. + +proc createDocLink*(urlSuffix: string): string = + # os.`/` is not appropriate for urls. + result = explanationsBaseUrl + if urlSuffix.len > 0 and urlSuffix[0] == '/': + result.add urlSuffix + else: + result.add "/" & urlSuffix + +type + TMsgKind* = enum + # fatal errors + errUnknown + errFatal + errInternal # non-fatal errors + errIllFormedAstX + errCannotOpenFile + errXExpected + errRstMissingClosing + errRstGridTableNotImplemented + errRstMarkdownIllformedTable + errRstIllformedTable + errRstNewSectionExpected + errRstGeneralParseError + errRstInvalidDirectiveX + errRstInvalidField + errRstFootnoteMismatch + errRstSandboxedDirective + errProveInit # deadcode + errGenerated + errFailedMove + errUser # warnings + warnCannotOpenFile = "CannotOpenFile" + warnOctalEscape = "OctalEscape" + warnXIsNeverRead = "XIsNeverRead" + warnXmightNotBeenInit = "XmightNotBeenInit" + warnDeprecated = "Deprecated" + warnConfigDeprecated = "ConfigDeprecated" + warnDotLikeOps = "DotLikeOps" + warnSmallLshouldNotBeUsed = "SmallLshouldNotBeUsed" + warnUnknownMagic = "UnknownMagic" + warnRstRedefinitionOfLabel = "RedefinitionOfLabel" + warnRstUnknownSubstitutionX = "UnknownSubstitutionX" + warnRstAmbiguousLink = "AmbiguousLink" + warnRstBrokenLink = "BrokenLink" + warnRstLanguageXNotSupported = "LanguageXNotSupported" + warnRstFieldXNotSupported = "FieldXNotSupported" + warnRstUnusedImportdoc = "UnusedImportdoc" + warnRstStyle = "warnRstStyle" + warnCommentXIgnored = "CommentXIgnored" + warnTypelessParam = "TypelessParam" + warnUseBase = "UseBase" + warnWriteToForeignHeap = "WriteToForeignHeap" + warnUnsafeCode = "UnsafeCode" + warnUnusedImportX = "UnusedImport" + warnInheritFromException = "InheritFromException" + warnEachIdentIsTuple = "EachIdentIsTuple" + warnUnsafeSetLen = "UnsafeSetLen" + warnUnsafeDefault = "UnsafeDefault" + warnProveInit = "ProveInit" + warnProveField = "ProveField" + warnProveIndex = "ProveIndex" + warnUnreachableElse = "UnreachableElse" + warnUnreachableCode = "UnreachableCode" + warnStaticIndexCheck = "IndexCheck" + warnGcUnsafe = "GcUnsafe" + warnGcUnsafe2 = "GcUnsafe2" + warnUninit = "Uninit" + warnGcMem = "GcMem" + warnDestructor = "Destructor" + warnLockLevel = "LockLevel" # deadcode + warnResultShadowed = "ResultShadowed" + warnInconsistentSpacing = "Spacing" + warnCaseTransition = "CaseTransition" + warnCycleCreated = "CycleCreated" + warnObservableStores = "ObservableStores" + warnStrictNotNil = "StrictNotNil" + warnResultUsed = "ResultUsed" + warnCannotOpen = "CannotOpen" + warnFileChanged = "FileChanged" + warnSuspiciousEnumConv = "EnumConv" + warnAnyEnumConv = "AnyEnumConv" + warnHoleEnumConv = "HoleEnumConv" + warnCstringConv = "CStringConv" + warnPtrToCstringConv = "PtrToCstringConv" + warnEffect = "Effect" + warnCastSizes = "CastSizes" # deadcode + warnAboveMaxSizeSet = "AboveMaxSizeSet" + warnImplicitTemplateRedefinition = "ImplicitTemplateRedefinition" + warnUnnamedBreak = "UnnamedBreak" + warnStmtListLambda = "StmtListLambda" + warnBareExcept = "BareExcept" + warnImplicitDefaultValue = "ImplicitDefaultValue" + warnUser = "User" # hints + hintSuccess = "Success" + hintSuccessX = "SuccessX" + hintCC = "CC" + hintXDeclaredButNotUsed = "XDeclaredButNotUsed" + hintDuplicateModuleImport = "DuplicateModuleImport" + hintXCannotRaiseY = "XCannotRaiseY" + hintConvToBaseNotNeeded = "ConvToBaseNotNeeded" + hintConvFromXtoItselfNotNeeded = "ConvFromXtoItselfNotNeeded" + hintExprAlwaysX = "ExprAlwaysX" + hintQuitCalled = "QuitCalled" + hintProcessing = "Processing" + hintProcessingStmt = "ProcessingStmt" + hintCodeBegin = "CodeBegin" + hintCodeEnd = "CodeEnd" + hintConf = "Conf" + hintPath = "Path" + hintConditionAlwaysTrue = "CondTrue" + hintConditionAlwaysFalse = "CondFalse" + hintName = "Name" + hintPattern = "Pattern" + hintExecuting = "Exec" + hintLinking = "Link" + hintDependency = "Dependency" + hintSource = "Source" + hintPerformance = "Performance" + hintStackTrace = "StackTrace" + hintGCStats = "GCStats" + hintGlobalVar = "GlobalVar" + hintExpandMacro = "ExpandMacro" + hintAmbiguousEnum = "AmbiguousEnum" + hintUser = "User" + hintUserRaw = "UserRaw" + hintExtendedContext = "ExtendedContext" + hintMsgOrigin = "MsgOrigin" # since 1.3.5 + hintDeclaredLoc = "DeclaredLoc" # since 1.5.1 + +const + MsgKindToStr*: array[TMsgKind, string] = + [ + errUnknown: "unknown error", + errFatal: "fatal error: $1", + errInternal: "internal error: $1", + errIllFormedAstX: "illformed AST: $1", + errCannotOpenFile: "cannot open '$1'", + errXExpected: "'$1' expected", + errRstMissingClosing: "$1", + errRstGridTableNotImplemented: "grid table is not implemented", + errRstMarkdownIllformedTable: "illformed delimiter row of a markdown table", + errRstIllformedTable: "Illformed table: $1", + errRstNewSectionExpected: "new section expected $1", + errRstGeneralParseError: "general parse error", + errRstInvalidDirectiveX: "invalid directive: '$1'", + errRstInvalidField: "invalid field: $1", + errRstFootnoteMismatch: "number of footnotes and their references don't match: $1", + errRstSandboxedDirective: "disabled directive: '$1'", + errProveInit: "Cannot prove that '$1' is initialized.", # deadcode + errGenerated: "$1", + errFailedMove: "$1", + errUser: "$1", + warnCannotOpenFile: "cannot open '$1'", + warnOctalEscape: "octal escape sequences do not exist; leading zero is ignored", + warnXIsNeverRead: "'$1' is never read", + warnXmightNotBeenInit: "'$1' might not have been initialized", + warnDeprecated: "$1", + warnConfigDeprecated: "config file '$1' is deprecated", + warnDotLikeOps: "$1", + warnSmallLshouldNotBeUsed: + "'l' should not be used as an identifier; may look like '1' (one)", + warnUnknownMagic: "unknown magic '$1' might crash the compiler", + warnRstRedefinitionOfLabel: "redefinition of label '$1'", + warnRstUnknownSubstitutionX: "unknown substitution '$1'", + warnRstAmbiguousLink: "ambiguous doc link $1", + warnRstBrokenLink: "broken link '$1'", + warnRstLanguageXNotSupported: "language '$1' not supported", + warnRstFieldXNotSupported: "field '$1' not supported", + warnRstUnusedImportdoc: "importdoc for '$1' is not used", + warnRstStyle: "RST style: $1", + warnCommentXIgnored: "comment '$1' ignored", + warnTypelessParam: "", # deadcode + warnUseBase: "use {.base.} for base methods; baseless methods are deprecated", + warnWriteToForeignHeap: "write to foreign heap", + warnUnsafeCode: "unsafe code: '$1'", + warnUnusedImportX: "imported and not used: '$1'", + warnInheritFromException: + "inherit from a more precise exception type like ValueError, " & "IOError or OSError. If these don't suit, inherit from CatchableError or Defect.", + warnEachIdentIsTuple: "each identifier is a tuple", + warnUnsafeSetLen: + "setLen can potentially expand the sequence, " & "but the element type '$1' doesn't have a valid default value", + warnUnsafeDefault: "The '$1' type doesn't have a valid default value", + warnProveInit: + "Cannot prove that '$1' is initialized. This will become a compile time error in the future.", + warnProveField: "cannot prove that field '$1' is accessible", + warnProveIndex: "cannot prove index '$1' is valid", + warnUnreachableElse: "unreachable else, all cases are already covered", + warnUnreachableCode: + "unreachable code after 'return' statement or '{.noReturn.}' proc", + warnStaticIndexCheck: "$1", + warnGcUnsafe: "not GC-safe: '$1'", + warnGcUnsafe2: "$1", + warnUninit: "use explicit initialization of '$1' for clarity", + warnGcMem: "'$1' uses GC'ed memory", + warnDestructor: + "usage of a type with a destructor in a non destructible context. This will become a compile time error in the future.", + warnLockLevel: "$1", # deadcode + warnResultShadowed: "Special variable 'result' is shadowed.", + warnInconsistentSpacing: "Number of spaces around '$#' is not consistent", + warnCaseTransition: + "Potential object case transition, instantiate new object instead", + warnCycleCreated: "$1", + warnObservableStores: "observable stores to '$1'", + warnStrictNotNil: "$1", + warnResultUsed: "used 'result' variable", + warnCannotOpen: "cannot open: $1", + warnFileChanged: "file changed: $1", + warnSuspiciousEnumConv: "$1", + warnAnyEnumConv: "$1", + warnHoleEnumConv: "$1", + warnCstringConv: "$1", + warnPtrToCstringConv: + "unsafe conversion to 'cstring' from '$1'; this will become a compile time error in the future", + warnEffect: "$1", + warnCastSizes: "$1", # deadcode + warnAboveMaxSizeSet: "$1", + warnImplicitTemplateRedefinition: + "template '$1' is implicitly redefined; this is deprecated, add an explicit .redefine pragma", + warnUnnamedBreak: + "Using an unnamed break in a block is deprecated; Use a named block with a named break instead", + warnStmtListLambda: + "statement list expression assumed to be anonymous proc; this is deprecated, use `do (): ...` or `proc () = ...` instead", + warnBareExcept: "$1", + warnImplicitDefaultValue: "$1", + warnUser: "$1", + hintSuccess: "operation successful: $#", + # keep in sync with `testament.isSuccess` + hintSuccessX: "$build\n$loc lines; ${sec}s; $mem; proj: $project; out: $output", + hintCC: "CC: $1", + hintXDeclaredButNotUsed: "'$1' is declared but not used", + hintDuplicateModuleImport: "$1", + hintXCannotRaiseY: "$1", + hintConvToBaseNotNeeded: "conversion to base object is not needed", + hintConvFromXtoItselfNotNeeded: "conversion from $1 to itself is pointless", + hintExprAlwaysX: "expression evaluates always to '$1'", + hintQuitCalled: "quit() called", + hintProcessing: "$1", + hintProcessingStmt: "$1", + hintCodeBegin: "generated code listing:", + hintCodeEnd: "end of listing", + hintConf: "used config file '$1'", + hintPath: "added path: '$1'", + hintConditionAlwaysTrue: "condition is always true: '$1'", + hintConditionAlwaysFalse: "condition is always false: '$1'", + hintName: "$1", + hintPattern: "$1", + hintExecuting: "$1", + hintLinking: "$1", + hintDependency: "$1", + hintSource: "$1", + hintPerformance: "$1", + hintStackTrace: "$1", + hintGCStats: "$1", + hintGlobalVar: "global variable declared here", + hintExpandMacro: "expanded macro: $1", + hintAmbiguousEnum: "$1", + hintUser: "$1", + hintUserRaw: "$1", + hintExtendedContext: "$1", + hintMsgOrigin: "$1", + hintDeclaredLoc: "$1" + ] +const + fatalMsgs* = {errUnknown .. errInternal} + errMin* = errUnknown + errMax* = errUser + warnMin* = warnCannotOpenFile + warnMax* = pred(hintSuccess) + hintMin* = hintSuccess + hintMax* = high(TMsgKind) + rstWarnings* = {warnRstRedefinitionOfLabel .. warnRstStyle} + +type + TNoteKind* = range[warnMin .. hintMax] # "notes" are warnings or hints + TNoteKinds* = set[TNoteKind] + +proc computeNotesVerbosity(): array[0 .. 3, TNoteKinds] = + result[3] = + {low(TNoteKind) .. high(TNoteKind)} - { + warnObservableStores, warnResultUsed, warnAnyEnumConv, warnBareExcept + } + result[2] = + result[3] - { + hintStackTrace, hintExtendedContext, hintDeclaredLoc, hintProcessingStmt + } + result[1] = + result[2] - { + warnProveField, warnProveIndex, warnGcUnsafe, hintPath, hintDependency, + hintCodeBegin, hintCodeEnd, hintSource, hintGlobalVar, hintGCStats, + hintMsgOrigin, hintPerformance + } + result[0] = + result[1] - { + hintSuccessX, hintSuccess, hintConf, hintProcessing, hintPattern, hintExecuting, + hintLinking, hintCC + } + +const + NotesVerbosity* = computeNotesVerbosity() + errXMustBeCompileTime* = "'$1' can only be used in compile-time context" + errArgsNeedRunOption* = + "arguments can only be given if the '--run' option is selected" + +type + TFileInfo* = object + fullPath*: AbsoluteFile # This is a canonical full filesystem path + projPath*: RelativeFile # This is relative to the project's root + shortName*: string # short name of the module + quotedName*: Rope + # cached quoted short name for codegen + # purposes + quotedFullName*: Rope + # cached quoted full name for codegen + # purposes + lines*: seq[string] + # the source code of the module + # used for better error messages and + # embedding the original source in the + # generated code + dirtyFile*: AbsoluteFile + # the file that is actually read into memory + # and parsed; usually "" but is used + # for 'nimsuggest' + hash*: string # the checksum of the file + dirty*: bool # for 'nimpretty' like tooling + fullContent*: string + + FileIndex* = distinct int32 + TLineInfo* = object + # This is designed to be as small as possible, + # because it is used + # in syntax nodes. We save space here by using + # two int16 and an int32. + # On 64 bit and on 32 bit systems this is + # only 8 bytes. + line*: uint16 + col*: int16 + fileIndex*: FileIndex + offsetA*, offsetB*: int + + TErrorOutput* = enum + eStdOut + eStdErr + + TErrorOutputs* = set[TErrorOutput] + ERecoverableError* = object of ValueError + + ESuggestDone* = object of ValueError + +proc `==`*(a, b: FileIndex): bool {.borrow.} + +proc hash*(i: TLineInfo): Hash = + hash (i.line.int, i.col.int, i.fileIndex.int) + +proc raiseRecoverableError*(msg: string) {.noinline.} = + raise newException(ERecoverableError, msg) + +const + InvalidFileIdx* = FileIndex(-1) + unknownLineInfo* = TLineInfo(line: 0, col: -1, fileIndex: InvalidFileIdx) + +type + Severity* {.pure.} = enum ## VS Code only supports these three + Hint + Warning + Error + +const + trackPosInvalidFileIdx* = FileIndex(-2) + # special marker so that no suggestions + # are produced within comments and string literals + commandLineIdx* = FileIndex(-3) + +type + MsgConfig* = object ## does not need to be stored in the incremental cache + trackPos*: TLineInfo + trackPosAttached*: bool + ## whether the tracking position was attached to + ## some close token. + errorOutputs*: TErrorOutputs + msgContext*: seq[tuple[info: TLineInfo, detail: string]] + lastError*: TLineInfo + filenameToIndexTbl*: Table[string, FileIndex] + fileInfos*: seq[TFileInfo] + systemFileIdx*: FileIndex + +proc initMsgConfig*(): MsgConfig = + result.msgContext = @[] + result.lastError = unknownLineInfo + result.filenameToIndexTbl = initTable[string, FileIndex]() + result.fileInfos = @[] + result.errorOutputs = {eStdOut, eStdErr} + result.filenameToIndexTbl["???"] = FileIndex(-1) diff --git a/src/phlineinfos.nim.nimph.yaml b/src/phlineinfos.nim.nimph.yaml new file mode 100644 index 0000000..1f593a1 --- /dev/null +++ b/src/phlineinfos.nim.nimph.yaml @@ -0,0 +1,5911 @@ +{ + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# nimph" + }, + { + "kind": "nkCommentStmt", + "comment": "# (c) Copyright 2023 Jacek Sieka" + }, + { + "kind": "nkCommentStmt", + "comment": "# The Nim compiler" + }, + { + "kind": "nkCommentStmt", + "comment": "# (c) Copyright 2018 Andreas Rumpf" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# See the file \"copying.txt\", included in this" + }, + { + "kind": "nkCommentStmt", + "comment": "# distribution, for details about the copyright." + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "## This module contains the ``TMsgKind`` enum as well as the" + }, + { + "kind": "nkCommentStmt", + "comment": "## ``TLineInfo`` object." + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "ropes" + }, + { + "kind": "nkIdent", + "ident": "tables" + }, + { + "kind": "nkIdent", + "ident": "pathutils" + }, + { + "kind": "nkIdent", + "ident": "hashes" + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "explanationsBaseUrl" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "https://nim-lang.github.io/Nim" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# was: \\\"https://nim-lang.org/docs\\\" but we\\\'re now usually showing devel docs\", line: 18, col: 4, offsetA: 435, offsetB: 510)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# instead of latest release docs.\", line: 19, col: 4, offsetA: 515, offsetB: 548)" + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "createDocLink" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "urlSuffix" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# os.`/` is not appropriate for urls.\", line: 22, col: 2, offsetA: 601, offsetB: 638)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "explanationsBaseUrl" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "urlSuffix" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "urlSuffix" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 47 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "urlSuffix" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "/" + }, + { + "kind": "nkIdent", + "ident": "urlSuffix" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TMsgKind" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# fatal errors\", line: 31, col: 4, offsetA: 811, offsetB: 825)" + ], + "ident": "errUnknown" + }, + { + "kind": "nkIdent", + "ident": "errFatal" + }, + { + "kind": "nkIdent", + "ident": "errInternal", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# non-fatal errors\", line: 34, col: 16, offsetA: 870, offsetB: 888)" + ] + }, + { + "kind": "nkIdent", + "ident": "errIllFormedAstX" + }, + { + "kind": "nkIdent", + "ident": "errCannotOpenFile" + }, + { + "kind": "nkIdent", + "ident": "errXExpected" + }, + { + "kind": "nkIdent", + "ident": "errRstMissingClosing" + }, + { + "kind": "nkIdent", + "ident": "errRstGridTableNotImplemented" + }, + { + "kind": "nkIdent", + "ident": "errRstMarkdownIllformedTable" + }, + { + "kind": "nkIdent", + "ident": "errRstIllformedTable" + }, + { + "kind": "nkIdent", + "ident": "errRstNewSectionExpected" + }, + { + "kind": "nkIdent", + "ident": "errRstGeneralParseError" + }, + { + "kind": "nkIdent", + "ident": "errRstInvalidDirectiveX" + }, + { + "kind": "nkIdent", + "ident": "errRstInvalidField" + }, + { + "kind": "nkIdent", + "ident": "errRstFootnoteMismatch" + }, + { + "kind": "nkIdent", + "ident": "errRstSandboxedDirective" + }, + { + "kind": "nkIdent", + "ident": "errProveInit", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# deadcode\", line: 48, col: 17, offsetA: 1247, offsetB: 1257)" + ] + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkIdent", + "ident": "errFailedMove" + }, + { + "kind": "nkIdent", + "ident": "errUser", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# warnings\", line: 51, col: 12, offsetA: 1305, offsetB: 1315)" + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnCannotOpenFile" + }, + { + "kind": "nkStrLit", + "strVal": "CannotOpenFile" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnOctalEscape" + }, + { + "kind": "nkStrLit", + "strVal": "OctalEscape" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnXIsNeverRead" + }, + { + "kind": "nkStrLit", + "strVal": "XIsNeverRead" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnXmightNotBeenInit" + }, + { + "kind": "nkStrLit", + "strVal": "XmightNotBeenInit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnDeprecated" + }, + { + "kind": "nkStrLit", + "strVal": "Deprecated" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnConfigDeprecated" + }, + { + "kind": "nkStrLit", + "strVal": "ConfigDeprecated" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnDotLikeOps" + }, + { + "kind": "nkStrLit", + "strVal": "DotLikeOps" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnSmallLshouldNotBeUsed" + }, + { + "kind": "nkStrLit", + "strVal": "SmallLshouldNotBeUsed" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnUnknownMagic" + }, + { + "kind": "nkStrLit", + "strVal": "UnknownMagic" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnRstRedefinitionOfLabel" + }, + { + "kind": "nkStrLit", + "strVal": "RedefinitionOfLabel" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnRstUnknownSubstitutionX" + }, + { + "kind": "nkStrLit", + "strVal": "UnknownSubstitutionX" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnRstAmbiguousLink" + }, + { + "kind": "nkStrLit", + "strVal": "AmbiguousLink" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnRstBrokenLink" + }, + { + "kind": "nkStrLit", + "strVal": "BrokenLink" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnRstLanguageXNotSupported" + }, + { + "kind": "nkStrLit", + "strVal": "LanguageXNotSupported" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnRstFieldXNotSupported" + }, + { + "kind": "nkStrLit", + "strVal": "FieldXNotSupported" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnRstUnusedImportdoc" + }, + { + "kind": "nkStrLit", + "strVal": "UnusedImportdoc" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnRstStyle" + }, + { + "kind": "nkStrLit", + "strVal": "warnRstStyle" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnCommentXIgnored" + }, + { + "kind": "nkStrLit", + "strVal": "CommentXIgnored" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnTypelessParam" + }, + { + "kind": "nkStrLit", + "strVal": "TypelessParam" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnUseBase" + }, + { + "kind": "nkStrLit", + "strVal": "UseBase" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnWriteToForeignHeap" + }, + { + "kind": "nkStrLit", + "strVal": "WriteToForeignHeap" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnUnsafeCode" + }, + { + "kind": "nkStrLit", + "strVal": "UnsafeCode" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnUnusedImportX" + }, + { + "kind": "nkStrLit", + "strVal": "UnusedImport" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnInheritFromException" + }, + { + "kind": "nkStrLit", + "strVal": "InheritFromException" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnEachIdentIsTuple" + }, + { + "kind": "nkStrLit", + "strVal": "EachIdentIsTuple" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnUnsafeSetLen" + }, + { + "kind": "nkStrLit", + "strVal": "UnsafeSetLen" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnUnsafeDefault" + }, + { + "kind": "nkStrLit", + "strVal": "UnsafeDefault" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnProveInit" + }, + { + "kind": "nkStrLit", + "strVal": "ProveInit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnProveField" + }, + { + "kind": "nkStrLit", + "strVal": "ProveField" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnProveIndex" + }, + { + "kind": "nkStrLit", + "strVal": "ProveIndex" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnUnreachableElse" + }, + { + "kind": "nkStrLit", + "strVal": "UnreachableElse" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnUnreachableCode" + }, + { + "kind": "nkStrLit", + "strVal": "UnreachableCode" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnStaticIndexCheck" + }, + { + "kind": "nkStrLit", + "strVal": "IndexCheck" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnGcUnsafe" + }, + { + "kind": "nkStrLit", + "strVal": "GcUnsafe" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnGcUnsafe2" + }, + { + "kind": "nkStrLit", + "strVal": "GcUnsafe2" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnUninit" + }, + { + "kind": "nkStrLit", + "strVal": "Uninit" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnGcMem" + }, + { + "kind": "nkStrLit", + "strVal": "GcMem" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnDestructor" + }, + { + "kind": "nkStrLit", + "strVal": "Destructor" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnLockLevel" + }, + { + "kind": "nkStrLit", + "strVal": "LockLevel" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# deadcode\", line: 90, col: 32, offsetA: 2892, offsetB: 2902)" + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnResultShadowed" + }, + { + "kind": "nkStrLit", + "strVal": "ResultShadowed" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnInconsistentSpacing" + }, + { + "kind": "nkStrLit", + "strVal": "Spacing" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnCaseTransition" + }, + { + "kind": "nkStrLit", + "strVal": "CaseTransition" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnCycleCreated" + }, + { + "kind": "nkStrLit", + "strVal": "CycleCreated" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnObservableStores" + }, + { + "kind": "nkStrLit", + "strVal": "ObservableStores" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnStrictNotNil" + }, + { + "kind": "nkStrLit", + "strVal": "StrictNotNil" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnResultUsed" + }, + { + "kind": "nkStrLit", + "strVal": "ResultUsed" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnCannotOpen" + }, + { + "kind": "nkStrLit", + "strVal": "CannotOpen" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnFileChanged" + }, + { + "kind": "nkStrLit", + "strVal": "FileChanged" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnSuspiciousEnumConv" + }, + { + "kind": "nkStrLit", + "strVal": "EnumConv" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnAnyEnumConv" + }, + { + "kind": "nkStrLit", + "strVal": "AnyEnumConv" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnHoleEnumConv" + }, + { + "kind": "nkStrLit", + "strVal": "HoleEnumConv" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnCstringConv" + }, + { + "kind": "nkStrLit", + "strVal": "CStringConv" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnPtrToCstringConv" + }, + { + "kind": "nkStrLit", + "strVal": "PtrToCstringConv" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnEffect" + }, + { + "kind": "nkStrLit", + "strVal": "Effect" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnCastSizes" + }, + { + "kind": "nkStrLit", + "strVal": "CastSizes" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# deadcode\", line: 106, col: 32, offsetA: 3507, offsetB: 3517)" + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnAboveMaxSizeSet" + }, + { + "kind": "nkStrLit", + "strVal": "AboveMaxSizeSet" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnImplicitTemplateRedefinition" + }, + { + "kind": "nkStrLit", + "strVal": "ImplicitTemplateRedefinition" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnUnnamedBreak" + }, + { + "kind": "nkStrLit", + "strVal": "UnnamedBreak" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnStmtListLambda" + }, + { + "kind": "nkStrLit", + "strVal": "StmtListLambda" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnBareExcept" + }, + { + "kind": "nkStrLit", + "strVal": "BareExcept" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnImplicitDefaultValue" + }, + { + "kind": "nkStrLit", + "strVal": "ImplicitDefaultValue" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnUser" + }, + { + "kind": "nkStrLit", + "strVal": "User" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# hints\", line: 113, col: 22, offsetA: 3822, offsetB: 3829)" + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintSuccess" + }, + { + "kind": "nkStrLit", + "strVal": "Success" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintSuccessX" + }, + { + "kind": "nkStrLit", + "strVal": "SuccessX" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintCC" + }, + { + "kind": "nkStrLit", + "strVal": "CC" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintXDeclaredButNotUsed" + }, + { + "kind": "nkStrLit", + "strVal": "XDeclaredButNotUsed" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintDuplicateModuleImport" + }, + { + "kind": "nkStrLit", + "strVal": "DuplicateModuleImport" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintXCannotRaiseY" + }, + { + "kind": "nkStrLit", + "strVal": "XCannotRaiseY" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintConvToBaseNotNeeded" + }, + { + "kind": "nkStrLit", + "strVal": "ConvToBaseNotNeeded" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintConvFromXtoItselfNotNeeded" + }, + { + "kind": "nkStrLit", + "strVal": "ConvFromXtoItselfNotNeeded" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintExprAlwaysX" + }, + { + "kind": "nkStrLit", + "strVal": "ExprAlwaysX" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintQuitCalled" + }, + { + "kind": "nkStrLit", + "strVal": "QuitCalled" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintProcessing" + }, + { + "kind": "nkStrLit", + "strVal": "Processing" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintProcessingStmt" + }, + { + "kind": "nkStrLit", + "strVal": "ProcessingStmt" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintCodeBegin" + }, + { + "kind": "nkStrLit", + "strVal": "CodeBegin" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintCodeEnd" + }, + { + "kind": "nkStrLit", + "strVal": "CodeEnd" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintConf" + }, + { + "kind": "nkStrLit", + "strVal": "Conf" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintPath" + }, + { + "kind": "nkStrLit", + "strVal": "Path" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintConditionAlwaysTrue" + }, + { + "kind": "nkStrLit", + "strVal": "CondTrue" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintConditionAlwaysFalse" + }, + { + "kind": "nkStrLit", + "strVal": "CondFalse" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintName" + }, + { + "kind": "nkStrLit", + "strVal": "Name" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintPattern" + }, + { + "kind": "nkStrLit", + "strVal": "Pattern" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintExecuting" + }, + { + "kind": "nkStrLit", + "strVal": "Exec" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintLinking" + }, + { + "kind": "nkStrLit", + "strVal": "Link" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintDependency" + }, + { + "kind": "nkStrLit", + "strVal": "Dependency" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintSource" + }, + { + "kind": "nkStrLit", + "strVal": "Source" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintPerformance" + }, + { + "kind": "nkStrLit", + "strVal": "Performance" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintStackTrace" + }, + { + "kind": "nkStrLit", + "strVal": "StackTrace" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintGCStats" + }, + { + "kind": "nkStrLit", + "strVal": "GCStats" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintGlobalVar" + }, + { + "kind": "nkStrLit", + "strVal": "GlobalVar" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintExpandMacro" + }, + { + "kind": "nkStrLit", + "strVal": "ExpandMacro" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintAmbiguousEnum" + }, + { + "kind": "nkStrLit", + "strVal": "AmbiguousEnum" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintUser" + }, + { + "kind": "nkStrLit", + "strVal": "User" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintUserRaw" + }, + { + "kind": "nkStrLit", + "strVal": "UserRaw" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintExtendedContext" + }, + { + "kind": "nkStrLit", + "strVal": "ExtendedContext" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintMsgOrigin" + }, + { + "kind": "nkStrLit", + "strVal": "MsgOrigin" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# since 1.3.5\", line: 147, col: 32, offsetA: 5000, offsetB: 5013)" + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintDeclaredLoc" + }, + { + "kind": "nkStrLit", + "strVal": "DeclaredLoc" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# since 1.5.1\", line: 148, col: 36, offsetA: 5050, offsetB: 5063)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "MsgKindToStr" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "array" + }, + { + "kind": "nkIdent", + "ident": "TMsgKind" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "errUnknown" + }, + { + "kind": "nkStrLit", + "strVal": "unknown error" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "errFatal" + }, + { + "kind": "nkStrLit", + "strVal": "fatal error: $1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "errInternal" + }, + { + "kind": "nkStrLit", + "strVal": "internal error: $1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "errIllFormedAstX" + }, + { + "kind": "nkStrLit", + "strVal": "illformed AST: $1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "errCannotOpenFile" + }, + { + "kind": "nkStrLit", + "strVal": "cannot open \'$1\'" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "errXExpected" + }, + { + "kind": "nkStrLit", + "strVal": "\'$1\' expected" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "errRstMissingClosing" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "errRstGridTableNotImplemented" + }, + { + "kind": "nkStrLit", + "strVal": "grid table is not implemented" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "errRstMarkdownIllformedTable" + }, + { + "kind": "nkStrLit", + "strVal": "illformed delimiter row of a markdown table" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "errRstIllformedTable" + }, + { + "kind": "nkStrLit", + "strVal": "Illformed table: $1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "errRstNewSectionExpected" + }, + { + "kind": "nkStrLit", + "strVal": "new section expected $1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "errRstGeneralParseError" + }, + { + "kind": "nkStrLit", + "strVal": "general parse error" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "errRstInvalidDirectiveX" + }, + { + "kind": "nkStrLit", + "strVal": "invalid directive: \'$1\'" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "errRstInvalidField" + }, + { + "kind": "nkStrLit", + "strVal": "invalid field: $1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "errRstFootnoteMismatch" + }, + { + "kind": "nkStrLit", + "strVal": "number of footnotes and their references don\'t match: $1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "errRstSandboxedDirective" + }, + { + "kind": "nkStrLit", + "strVal": "disabled directive: \'$1\'" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "errProveInit" + }, + { + "kind": "nkStrLit", + "strVal": "Cannot prove that \'$1\' is initialized." + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "errFailedMove" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "errUser" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnCannotOpenFile" + }, + { + "kind": "nkStrLit", + "strVal": "cannot open \'$1\'" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnOctalEscape" + }, + { + "kind": "nkStrLit", + "strVal": "octal escape sequences do not exist; leading zero is ignored" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnXIsNeverRead" + }, + { + "kind": "nkStrLit", + "strVal": "\'$1\' is never read" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnXmightNotBeenInit" + }, + { + "kind": "nkStrLit", + "strVal": "\'$1\' might not have been initialized" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnDeprecated" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnConfigDeprecated" + }, + { + "kind": "nkStrLit", + "strVal": "config file \'$1\' is deprecated" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnDotLikeOps" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnSmallLshouldNotBeUsed" + }, + { + "kind": "nkStrLit", + "strVal": "\'l\' should not be used as an identifier; may look like \'1\' (one)" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnUnknownMagic" + }, + { + "kind": "nkStrLit", + "strVal": "unknown magic \'$1\' might crash the compiler" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnRstRedefinitionOfLabel" + }, + { + "kind": "nkStrLit", + "strVal": "redefinition of label \'$1\'" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnRstUnknownSubstitutionX" + }, + { + "kind": "nkStrLit", + "strVal": "unknown substitution \'$1\'" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnRstAmbiguousLink" + }, + { + "kind": "nkStrLit", + "strVal": "ambiguous doc link $1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnRstBrokenLink" + }, + { + "kind": "nkStrLit", + "strVal": "broken link \'$1\'" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnRstLanguageXNotSupported" + }, + { + "kind": "nkStrLit", + "strVal": "language \'$1\' not supported" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnRstFieldXNotSupported" + }, + { + "kind": "nkStrLit", + "strVal": "field \'$1\' not supported" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnRstUnusedImportdoc" + }, + { + "kind": "nkStrLit", + "strVal": "importdoc for \'$1\' is not used" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnRstStyle" + }, + { + "kind": "nkStrLit", + "strVal": "RST style: $1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnCommentXIgnored" + }, + { + "kind": "nkStrLit", + "strVal": "comment \'$1\' ignored" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnTypelessParam" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnUseBase" + }, + { + "kind": "nkStrLit", + "strVal": "use {.base.} for base methods; baseless methods are deprecated" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnWriteToForeignHeap" + }, + { + "kind": "nkStrLit", + "strVal": "write to foreign heap" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnUnsafeCode" + }, + { + "kind": "nkStrLit", + "strVal": "unsafe code: \'$1\'" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnUnusedImportX" + }, + { + "kind": "nkStrLit", + "strVal": "imported and not used: \'$1\'" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnInheritFromException" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "inherit from a more precise exception type like ValueError, " + }, + { + "kind": "nkStrLit", + "strVal": "IOError or OSError. If these don\'t suit, inherit from CatchableError or Defect." + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnEachIdentIsTuple" + }, + { + "kind": "nkStrLit", + "strVal": "each identifier is a tuple" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnUnsafeSetLen" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "setLen can potentially expand the sequence, " + }, + { + "kind": "nkStrLit", + "strVal": "but the element type \'$1\' doesn\'t have a valid default value" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnUnsafeDefault" + }, + { + "kind": "nkStrLit", + "strVal": "The \'$1\' type doesn\'t have a valid default value" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnProveInit" + }, + { + "kind": "nkStrLit", + "strVal": "Cannot prove that \'$1\' is initialized. This will become a compile time error in the future." + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnProveField" + }, + { + "kind": "nkStrLit", + "strVal": "cannot prove that field \'$1\' is accessible" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnProveIndex" + }, + { + "kind": "nkStrLit", + "strVal": "cannot prove index \'$1\' is valid" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnUnreachableElse" + }, + { + "kind": "nkStrLit", + "strVal": "unreachable else, all cases are already covered" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnUnreachableCode" + }, + { + "kind": "nkStrLit", + "strVal": "unreachable code after \'return\' statement or \'{.noReturn.}\' proc" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnStaticIndexCheck" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnGcUnsafe" + }, + { + "kind": "nkStrLit", + "strVal": "not GC-safe: \'$1\'" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnGcUnsafe2" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnUninit" + }, + { + "kind": "nkStrLit", + "strVal": "use explicit initialization of \'$1\' for clarity" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnGcMem" + }, + { + "kind": "nkStrLit", + "strVal": "\'$1\' uses GC\'ed memory" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnDestructor" + }, + { + "kind": "nkStrLit", + "strVal": "usage of a type with a destructor in a non destructible context. This will become a compile time error in the future." + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnLockLevel" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnResultShadowed" + }, + { + "kind": "nkStrLit", + "strVal": "Special variable \'result\' is shadowed." + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnInconsistentSpacing" + }, + { + "kind": "nkStrLit", + "strVal": "Number of spaces around \'$#\' is not consistent" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnCaseTransition" + }, + { + "kind": "nkStrLit", + "strVal": "Potential object case transition, instantiate new object instead" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnCycleCreated" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnObservableStores" + }, + { + "kind": "nkStrLit", + "strVal": "observable stores to \'$1\'" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnStrictNotNil" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnResultUsed" + }, + { + "kind": "nkStrLit", + "strVal": "used \'result\' variable" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnCannotOpen" + }, + { + "kind": "nkStrLit", + "strVal": "cannot open: $1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnFileChanged" + }, + { + "kind": "nkStrLit", + "strVal": "file changed: $1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnSuspiciousEnumConv" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnAnyEnumConv" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnHoleEnumConv" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnCstringConv" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnPtrToCstringConv" + }, + { + "kind": "nkStrLit", + "strVal": "unsafe conversion to \'cstring\' from \'$1\'; this will become a compile time error in the future" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnEffect" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnCastSizes" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnAboveMaxSizeSet" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnImplicitTemplateRedefinition" + }, + { + "kind": "nkStrLit", + "strVal": "template \'$1\' is implicitly redefined; this is deprecated, add an explicit .redefine pragma" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnUnnamedBreak" + }, + { + "kind": "nkStrLit", + "strVal": "Using an unnamed break in a block is deprecated; Use a named block with a named break instead" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnStmtListLambda" + }, + { + "kind": "nkStrLit", + "strVal": "statement list expression assumed to be anonymous proc; this is deprecated, use `do (): ...` or `proc () = ...` instead" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnBareExcept" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnImplicitDefaultValue" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnUser" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintSuccess" + }, + { + "kind": "nkStrLit", + "strVal": "operation successful: $#" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# keep in sync with `testament.isSuccess`\", line: 247, col: 6, offsetA: 10166, offsetB: 10207)" + ], + "ident": "hintSuccessX" + }, + { + "kind": "nkStrLit", + "strVal": "$build\u000A$loc lines; ${sec}s; $mem; proj: $project; out: $output" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintCC" + }, + { + "kind": "nkStrLit", + "strVal": "CC: $1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintXDeclaredButNotUsed" + }, + { + "kind": "nkStrLit", + "strVal": "\'$1\' is declared but not used" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintDuplicateModuleImport" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintXCannotRaiseY" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintConvToBaseNotNeeded" + }, + { + "kind": "nkStrLit", + "strVal": "conversion to base object is not needed" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintConvFromXtoItselfNotNeeded" + }, + { + "kind": "nkStrLit", + "strVal": "conversion from $1 to itself is pointless" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintExprAlwaysX" + }, + { + "kind": "nkStrLit", + "strVal": "expression evaluates always to \'$1\'" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintQuitCalled" + }, + { + "kind": "nkStrLit", + "strVal": "quit() called" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintProcessing" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintProcessingStmt" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintCodeBegin" + }, + { + "kind": "nkStrLit", + "strVal": "generated code listing:" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintCodeEnd" + }, + { + "kind": "nkStrLit", + "strVal": "end of listing" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintConf" + }, + { + "kind": "nkStrLit", + "strVal": "used config file \'$1\'" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintPath" + }, + { + "kind": "nkStrLit", + "strVal": "added path: \'$1\'" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintConditionAlwaysTrue" + }, + { + "kind": "nkStrLit", + "strVal": "condition is always true: \'$1\'" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintConditionAlwaysFalse" + }, + { + "kind": "nkStrLit", + "strVal": "condition is always false: \'$1\'" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintName" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintPattern" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintExecuting" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintLinking" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintDependency" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintSource" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintPerformance" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintStackTrace" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintGCStats" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintGlobalVar" + }, + { + "kind": "nkStrLit", + "strVal": "global variable declared here" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintExpandMacro" + }, + { + "kind": "nkStrLit", + "strVal": "expanded macro: $1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintAmbiguousEnum" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintUser" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintUserRaw" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintExtendedContext" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintMsgOrigin" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintDeclaredLoc" + }, + { + "kind": "nkStrLit", + "strVal": "$1" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "fatalMsgs" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "errUnknown" + }, + { + "kind": "nkIdent", + "ident": "errInternal" + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "errMin" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "errUnknown" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "errMax" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "errUser" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "warnMin" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "warnCannotOpenFile" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "warnMax" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "pred" + }, + { + "kind": "nkIdent", + "ident": "hintSuccess" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "hintMin" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "hintSuccess" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "hintMax" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkIdent", + "ident": "TMsgKind" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "rstWarnings" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "warnRstRedefinitionOfLabel" + }, + { + "kind": "nkIdent", + "ident": "warnRstStyle" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TNoteKind" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "range" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "warnMin" + }, + { + "kind": "nkIdent", + "ident": "hintMax" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \\\"notes\\\" are warnings or hints\", line: 294, col: 41, offsetA: 11886, offsetB: 11917)" + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TNoteKinds" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "TNoteKind" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "computeNotesVerbosity" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "array" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + }, + { + "kind": "nkIdent", + "ident": "TNoteKinds" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "low" + }, + { + "kind": "nkIdent", + "ident": "TNoteKind" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkIdent", + "ident": "TNoteKind" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnObservableStores" + }, + { + "kind": "nkIdent", + "ident": "warnResultUsed" + }, + { + "kind": "nkIdent", + "ident": "warnAnyEnumConv" + }, + { + "kind": "nkIdent", + "ident": "warnBareExcept" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintStackTrace" + }, + { + "kind": "nkIdent", + "ident": "hintExtendedContext" + }, + { + "kind": "nkIdent", + "ident": "hintDeclaredLoc" + }, + { + "kind": "nkIdent", + "ident": "hintProcessingStmt" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "warnProveField" + }, + { + "kind": "nkIdent", + "ident": "warnProveIndex" + }, + { + "kind": "nkIdent", + "ident": "warnGcUnsafe" + }, + { + "kind": "nkIdent", + "ident": "hintPath" + }, + { + "kind": "nkIdent", + "ident": "hintDependency" + }, + { + "kind": "nkIdent", + "ident": "hintCodeBegin" + }, + { + "kind": "nkIdent", + "ident": "hintCodeEnd" + }, + { + "kind": "nkIdent", + "ident": "hintSource" + }, + { + "kind": "nkIdent", + "ident": "hintGlobalVar" + }, + { + "kind": "nkIdent", + "ident": "hintGCStats" + }, + { + "kind": "nkIdent", + "ident": "hintMsgOrigin" + }, + { + "kind": "nkIdent", + "ident": "hintPerformance" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintSuccessX" + }, + { + "kind": "nkIdent", + "ident": "hintSuccess" + }, + { + "kind": "nkIdent", + "ident": "hintConf" + }, + { + "kind": "nkIdent", + "ident": "hintProcessing" + }, + { + "kind": "nkIdent", + "ident": "hintPattern" + }, + { + "kind": "nkIdent", + "ident": "hintExecuting" + }, + { + "kind": "nkIdent", + "ident": "hintLinking" + }, + { + "kind": "nkIdent", + "ident": "hintCC" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "NotesVerbosity" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "computeNotesVerbosity" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "errXMustBeCompileTime" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "\'$1\' can only be used in compile-time context" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "errArgsNeedRunOption" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "arguments can only be given if the \'--run\' option is selected" + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TFileInfo" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "fullPath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# This is a canonical full filesystem path\", line: 326, col: 28, offsetA: 12941, offsetB: 12983)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "projPath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "RelativeFile" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# This is relative to the project\\\'s root\", line: 327, col: 28, offsetA: 13012, offsetB: 13052)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "shortName" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# short name of the module\", line: 328, col: 23, offsetA: 13076, offsetB: 13102)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "quotedName" + } + ] + }, + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# cached quoted short name for codegen\", line: 330, col: 6, offsetA: 13131, offsetB: 13169)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# purposes\", line: 331, col: 6, offsetA: 13176, offsetB: 13186)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "quotedFullName" + } + ] + }, + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# cached quoted full name for codegen\", line: 333, col: 6, offsetA: 13219, offsetB: 13256)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# purposes\", line: 334, col: 6, offsetA: 13263, offsetB: 13273)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "lines" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the source code of the module\", line: 336, col: 6, offsetA: 13304, offsetB: 13335)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# used for better error messages and\", line: 337, col: 6, offsetA: 13342, offsetB: 13380)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# embedding the original source in the\", line: 338, col: 6, offsetA: 13387, offsetB: 13427)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# generated code\", line: 339, col: 6, offsetA: 13434, offsetB: 13452)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "dirtyFile" + } + ] + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the file that is actually read into memory\", line: 341, col: 6, offsetA: 13488, offsetB: 13532)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# and parsed; usually \\\"\\\" but is used\", line: 342, col: 6, offsetA: 13539, offsetB: 13575)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for \\\'nimsuggest\\\'\", line: 343, col: 6, offsetA: 13582, offsetB: 13600)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "hash" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the checksum of the file\", line: 344, col: 18, offsetA: 13619, offsetB: 13645)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "dirty" + } + ] + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for \\\'nimpretty\\\' like tooling\", line: 345, col: 17, offsetA: 13663, offsetB: 13693)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "fullContent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDistinctTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "int32" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# This is designed to be as small as possible,\", line: 350, col: 4, offsetA: 13776, offsetB: 13822)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# because it is used\", line: 351, col: 4, offsetA: 13827, offsetB: 13847)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# in syntax nodes. We save space here by using\", line: 352, col: 4, offsetA: 13852, offsetB: 13898)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# two int16 and an int32.\", line: 353, col: 4, offsetA: 13903, offsetB: 13928)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# On 64 bit and on 32 bit systems this is\", line: 354, col: 4, offsetA: 13933, offsetB: 13974)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# only 8 bytes.\", line: 355, col: 4, offsetA: 13979, offsetB: 13994)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + }, + { + "kind": "nkIdent", + "ident": "uint16" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int16" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "fileIndex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "offsetA" + } + ] + }, + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "offsetB" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TErrorOutput" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "eStdOut" + }, + { + "kind": "nkIdent", + "ident": "eStdErr" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TErrorOutputs" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "TErrorOutput" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "ERecoverableError" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkOfInherit", + "sons": [ + { + "kind": "nkIdent", + "ident": "ValueError" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "ESuggestDone" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkOfInherit", + "sons": [ + { + "kind": "nkIdent", + "ident": "ValueError" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "borrow" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "hash" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Hash" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "hash" + }, + { + "kind": "nkTupleConstr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "fileIndex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "raiseRecoverableError" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "noinline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkRaiseStmt", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newException" + }, + { + "kind": "nkIdent", + "ident": "ERecoverableError" + }, + { + "kind": "nkIdent", + "ident": "msg" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "InvalidFileIdx" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "unknownLineInfo" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "line" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "col" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIndex" + }, + { + "kind": "nkIdent", + "ident": "InvalidFileIdx" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPragmaExpr", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "Severity" + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "pure" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## VS Code only supports these three\", line: 383, col: 28, offsetA: 14634, offsetB: 14670)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "Hint" + }, + { + "kind": "nkIdent", + "ident": "Warning" + }, + { + "kind": "nkIdent", + "ident": "Error" + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "trackPosInvalidFileIdx" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkIntLit", + "intVal": -2 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# special marker so that no suggestions\", line: 390, col: 6, offsetA: 14757, offsetB: 14796)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# are produced within comments and string literals\", line: 391, col: 6, offsetA: 14803, offsetB: 14853)" + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "commandLineIdx" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkIntLit", + "intVal": -3 + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "MsgConfig" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## does not need to be stored in the incremental cache\", line: 395, col: 22, offsetA: 14916, offsetB: 14970)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "trackPos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "trackPosAttached" + } + ] + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## whether the tracking position was attached to\", line: 398, col: 6, offsetA: 15030, offsetB: 15078)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## some close token.\", line: 399, col: 6, offsetA: 15085, offsetB: 15105)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "errorOutputs" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TErrorOutputs" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "msgContext" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkTupleTy", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "detail" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "lastError" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "filenameToIndexTbl" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "Table" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "TFileInfo" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "systemFileIdx" + } + ] + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "initMsgConfig" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "MsgConfig" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "msgContext" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "lastError" + } + ] + }, + { + "kind": "nkIdent", + "ident": "unknownLineInfo" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "filenameToIndexTbl" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "initTable" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "errorOutputs" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "eStdOut" + }, + { + "kind": "nkIdent", + "ident": "eStdErr" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "filenameToIndexTbl" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "???" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/phmsgs.nim b/src/phmsgs.nim new file mode 100644 index 0000000..d5b249e --- /dev/null +++ b/src/phmsgs.nim @@ -0,0 +1,972 @@ +# +# +# nimph +# (c) Copyright 2023 Jacek Sieka +# The Nim compiler +# (c) Copyright 2018 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# + +import + std/[strutils, os, tables, terminal, macros, times], + std/private/miscdollars, + pathutils +import + ./phlineinfos, ./phoptions + +import ropes except `%` +when defined(nimPreviewSlimSystem): + import + std/[syncio, assertions] + +type + InstantiationInfo* = typeof(instantiationInfo()) + +template instLoc*(): InstantiationInfo = + instantiationInfo(-2, fullPaths = true) + +template toStdOrrKind(stdOrr): untyped = + if stdOrr == stdout: + stdOrrStdout + else: + stdOrrStderr + +proc flushDot*(conf: ConfigRef) = + ## safe to call multiple times + # xxx one edge case not yet handled is when `printf` is called at CT with `compiletimeFFI`. + let stdOrr = + if optStdout in conf.globalOptions: + stdout + else: + stderr + let stdOrrKind = toStdOrrKind(stdOrr) + if stdOrrKind in conf.lastMsgWasDot: + conf.lastMsgWasDot.excl stdOrrKind + + write(stdOrr, "\n") + +proc toCChar*(c: char; result: var string) {.inline.} = + case c + of '\0' .. '\x1F', '\x7F' .. '\xFF': + result.add '\\' + result.add toOctal(c) + of '\'', '\"', '\\', '?': + result.add '\\' + result.add c + else: + result.add c + +proc makeCString*(s: string): Rope = + result = newStringOfCap(int(s.len.toFloat * 1.1) + 1) + + result.add("\"") + for i in 0 ..< s.len: + # line wrapping of string litterals in cgen'd code was a bad idea, e.g. causes: bug #16265 + # It also makes reading c sources or grepping harder, for zero benefit. + # const MaxLineLength = 64 + # if (i + 1) mod MaxLineLength == 0: + # res.add("\"\L\"") + toCChar(s[i], result) + + result.add('\"') + +proc newFileInfo(fullPath: AbsoluteFile; projPath: RelativeFile): TFileInfo = + result.fullPath = fullPath + #shallow(result.fullPath) + result.projPath = projPath + #shallow(result.projPath) + result.shortName = fullPath.extractFilename + result.quotedName = result.shortName.makeCString + result.quotedFullName = fullPath.string.makeCString + result.lines = @[] + if not result.fullPath.isEmpty: + try: + result.fullContent = readFile(result.fullPath.string) + except IOError: + #rawMessage(errCannotOpenFile, result.fullPath) + # XXX fixme + result.fullContent = "" + +when defined(nimpretty) or defined(nimph): + proc fileSection*(conf: ConfigRef; fid: FileIndex; a, b: int): string = + substr(conf.m.fileInfos[fid.int].fullContent, a, b) + +proc canonicalCase(path: var string) {.inline.} = + ## the idea is to only use this for checking whether a path is already in + ## the table but otherwise keep the original case + when FileSystemCaseSensitive: + discard + else: + toLowerAscii(path) + +proc fileInfoKnown*(conf: ConfigRef; filename: AbsoluteFile): bool = + var canon: AbsoluteFile + try: + canon = canonicalizePath(conf, filename) + except OSError: + canon = filename + + canon.string.canonicalCase + + result = conf.m.filenameToIndexTbl.hasKey(canon.string) + +proc fileInfoIdx*( + conf: ConfigRef; filename: AbsoluteFile; isKnownFile: var bool +): FileIndex = + var + canon: AbsoluteFile + pseudoPath = false + try: + canon = canonicalizePath(conf, filename) + except OSError: + canon = filename + # The compiler uses "filenames" such as `command line` or `stdin` + # This flag indicates that we are working with such a path here + pseudoPath = true + + var canon2 = canon.string + + canon2.canonicalCase + if conf.m.filenameToIndexTbl.hasKey(canon2): + isKnownFile = true + result = conf.m.filenameToIndexTbl[canon2] + else: + isKnownFile = false + result = conf.m.fileInfos.len.FileIndex + + conf.m.fileInfos.add( + newFileInfo( + canon, + if pseudoPath: + RelativeFile filename + else: + relativeTo(canon, conf.projectPath) + ) + ) + + conf.m.filenameToIndexTbl[canon2] = result + +proc fileInfoIdx*(conf: ConfigRef; filename: AbsoluteFile): FileIndex = + var dummy: bool + + result = fileInfoIdx(conf, filename, dummy) + +proc fileInfoIdx*( + conf: ConfigRef; filename: RelativeFile; isKnownFile: var bool +): FileIndex = + fileInfoIdx(conf, AbsoluteFile expandFilename(filename.string), isKnownFile) + +proc fileInfoIdx*(conf: ConfigRef; filename: RelativeFile): FileIndex = + var dummy: bool + + fileInfoIdx(conf, AbsoluteFile expandFilename(filename.string), dummy) + +proc newLineInfo*(fileInfoIdx: FileIndex; line, col: int): TLineInfo = + result.fileIndex = fileInfoIdx + if line < int high(uint16): + result.line = uint16(line) + else: + result.line = high(uint16) + if col < int high(int16): + result.col = int16(col) + else: + result.col = -1 + +proc newLineInfo*(conf: ConfigRef; filename: AbsoluteFile; line, col: int): TLineInfo {. + inline +.} = + result = newLineInfo(fileInfoIdx(conf, filename), line, col) + +const + gCmdLineInfo* = newLineInfo(commandLineIdx, 1, 1) + +proc concat(strings: openArray[string]): string = + var totalLen = 0 + for s in strings: + totalLen += s.len + + result = newStringOfCap totalLen + for s in strings: + result.add s + +proc suggestWriteln*(conf: ConfigRef; s: string) = + if eStdOut in conf.m.errorOutputs: + if isNil(conf.writelnHook): + writeLine(stdout, s) + flushFile(stdout) + else: + conf.writelnHook(s) + +proc msgQuit*(x: int8) = + quit x + +proc msgQuit*(x: string) = + quit x + +proc suggestQuit*() = + raise newException(ESuggestDone, "suggest done") + +# this format is understood by many text editors: it is the same that +# Borland and Freepascal use +const + KindFormat = " [$1]" + KindColor = fgCyan + ErrorTitle = "Error: " + ErrorColor = fgRed + WarningTitle = "Warning: " + WarningColor = fgYellow + HintTitle = "Hint: " + HintColor = fgGreen + # NOTE: currently line info line numbers start with 1, + # but column numbers start with 0, however most editors expect + # first column to be 1, so we need to +1 here + ColOffset* = 1 + commandLineDesc* = "command line" + +proc getInfoContextLen*(conf: ConfigRef): int = + return conf.m.msgContext.len + +proc setInfoContextLen*(conf: ConfigRef; L: int) = + setLen(conf.m.msgContext, L) + +proc pushInfoContext*(conf: ConfigRef; info: TLineInfo; detail: string = "") = + conf.m.msgContext.add((info, detail)) + +proc popInfoContext*(conf: ConfigRef) = + setLen(conf.m.msgContext, conf.m.msgContext.len - 1) + +proc getInfoContext*(conf: ConfigRef; index: int): TLineInfo = + let i = + if index < 0: + conf.m.msgContext.len + index + else: + index + if i >=% conf.m.msgContext.len: + result = unknownLineInfo + else: + result = conf.m.msgContext[i].info + +template toFilename*(conf: ConfigRef; fileIdx: FileIndex): string = + if fileIdx.int32 < 0 or conf == nil: + if fileIdx == commandLineIdx: + commandLineDesc + else: "???" + else: + conf.m.fileInfos[fileIdx.int32].shortName + +proc toProjPath*(conf: ConfigRef; fileIdx: FileIndex): string = + if fileIdx.int32 < 0 or conf == nil: + if fileIdx == commandLineIdx: + commandLineDesc + else: "???" + else: + conf.m.fileInfos[fileIdx.int32].projPath.string + +proc toFullPath*(conf: ConfigRef; fileIdx: FileIndex): string = + if fileIdx.int32 < 0 or conf == nil: + result = + (if fileIdx == commandLineIdx: + commandLineDesc + else: "???" + ) + else: + result = conf.m.fileInfos[fileIdx.int32].fullPath.string + +proc setDirtyFile*(conf: ConfigRef; fileIdx: FileIndex; filename: AbsoluteFile) = + assert fileIdx.int32 >= 0 + + conf.m.fileInfos[fileIdx.int32].dirtyFile = filename + + setLen conf.m.fileInfos[fileIdx.int32].lines, 0 + +proc setHash*(conf: ConfigRef; fileIdx: FileIndex; hash: string) = + assert fileIdx.int32 >= 0 + when defined(gcArc) or defined(gcOrc) or defined(gcAtomicArc): + conf.m.fileInfos[fileIdx.int32].hash = hash + else: + shallowCopy(conf.m.fileInfos[fileIdx.int32].hash, hash) + +proc getHash*(conf: ConfigRef; fileIdx: FileIndex): string = + assert fileIdx.int32 >= 0 + when defined(gcArc) or defined(gcOrc) or defined(gcAtomicArc): + result = conf.m.fileInfos[fileIdx.int32].hash + else: + shallowCopy(result, conf.m.fileInfos[fileIdx.int32].hash) + +proc toFullPathConsiderDirty*(conf: ConfigRef; fileIdx: FileIndex): AbsoluteFile = + if fileIdx.int32 < 0: + result = + AbsoluteFile( + if fileIdx == commandLineIdx: + commandLineDesc + else: + "???" + ) + elif not conf.m.fileInfos[fileIdx.int32].dirtyFile.isEmpty: + result = conf.m.fileInfos[fileIdx.int32].dirtyFile + else: + result = conf.m.fileInfos[fileIdx.int32].fullPath + +template toFilename*(conf: ConfigRef; info: TLineInfo): string = + toFilename(conf, info.fileIndex) + +template toProjPath*(conf: ConfigRef; info: TLineInfo): string = + toProjPath(conf, info.fileIndex) + +template toFullPath*(conf: ConfigRef; info: TLineInfo): string = + toFullPath(conf, info.fileIndex) + +template toFullPathConsiderDirty*(conf: ConfigRef; info: TLineInfo): string = + string toFullPathConsiderDirty(conf, info.fileIndex) + +proc toFilenameOption*(conf: ConfigRef; fileIdx: FileIndex; opt: FilenameOption): string = + case opt + of foAbs: + result = toFullPath(conf, fileIdx) + of foRelProject: + result = toProjPath(conf, fileIdx) + of foCanonical: + let absPath = toFullPath(conf, fileIdx) + + result = canonicalImportAux(conf, absPath.AbsoluteFile) + of foName: + result = toProjPath(conf, fileIdx).lastPathPart + of foLegacyRelProj: + let + absPath = toFullPath(conf, fileIdx) + relPath = toProjPath(conf, fileIdx) + + result = + if (relPath.len > absPath.len) or (relPath.count("..") > 2): + absPath + else: + relPath + of foStacktrace: + if optExcessiveStackTrace in conf.globalOptions: + result = toFilenameOption(conf, fileIdx, foAbs) + else: + result = toFilenameOption(conf, fileIdx, foName) + +proc toMsgFilename*(conf: ConfigRef; fileIdx: FileIndex): string = + toFilenameOption(conf, fileIdx, conf.filenameOption) + +template toMsgFilename*(conf: ConfigRef; info: TLineInfo): string = + toMsgFilename(conf, info.fileIndex) + +proc toLinenumber*(info: TLineInfo): int {.inline.} = + result = int info.line + +proc toColumn*(info: TLineInfo): int {.inline.} = + result = info.col + +proc toFileLineCol(info: InstantiationInfo): string {.inline.} = + result.toLocation(info.filename, info.line, info.column + ColOffset) + +proc toFileLineCol*(conf: ConfigRef; info: TLineInfo): string {.inline.} = + result.toLocation(toMsgFilename(conf, info), info.line.int, info.col.int + ColOffset) + +proc `$`*(conf: ConfigRef; info: TLineInfo): string = + toFileLineCol(conf, info) + +proc `$`*(info: TLineInfo): string {.error.} = + discard + +proc `??`*(conf: ConfigRef; info: TLineInfo; filename: string): bool = + # only for debugging purposes + result = filename in toFilename(conf, info) + +type + MsgFlag* = enum ## flags altering msgWriteln behavior + msgStdout ## force writing to stdout, even stderr is default + msgSkipHook ## skip message hook even if it is present + msgNoUnitSep ## the message is a complete "paragraph". + + MsgFlags* = set[MsgFlag] + +proc msgWriteln*(conf: ConfigRef; s: string; flags: MsgFlags = {}) = + ## Writes given message string to stderr by default. + ## If ``--stdout`` option is given, writes to stdout instead. If message hook + ## is present, then it is used to output message rather than stderr/stdout. + ## This behavior can be altered by given optional flags. + ## This is used for 'nim dump' etc. where we don't have nimsuggest + ## support. + #if conf.cmd == cmdIdeTools and optCDebug notin gGlobalOptions: return + let sep = + if msgNoUnitSep notin flags: + conf.unitSep + else: + "" + if not isNil(conf.writelnHook) and msgSkipHook notin flags: + conf.writelnHook(s & sep) + elif optStdout in conf.globalOptions or msgStdout in flags: + if eStdOut in conf.m.errorOutputs: + flushDot(conf) + + write stdout, s + + writeLine(stdout, sep) + flushFile(stdout) + else: + if eStdErr in conf.m.errorOutputs: + flushDot(conf) + + write stderr, s + + writeLine(stderr, sep) + # On Windows stderr is fully-buffered when piped, regardless of C std. + when defined(windows): + flushFile(stderr) + +macro callIgnoringStyle(theProc: typed; first: typed; args: varargs[typed]): untyped = + let typForegroundColor = bindSym"ForegroundColor".getType + let typBackgroundColor = bindSym"BackgroundColor".getType + let typStyle = bindSym"Style".getType + let typTerminalCmd = bindSym"TerminalCmd".getType + + result = newCall(theProc) + if first.kind != nnkNilLit: + result.add(first) + for arg in children(args[0][1]): + if arg.kind == nnkNilLit: + continue + + let typ = arg.getType + if typ.kind != nnkEnumTy or typ != typForegroundColor and typ != typBackgroundColor and typ != typStyle and typ != typTerminalCmd: + result.add(arg) + +macro callStyledWriteLineStderr(args: varargs[typed]): untyped = + result = newCall(bindSym"styledWriteLine") + + result.add(bindSym"stderr") + for arg in children(args[0][1]): + result.add(arg) + when false: + # not needed because styledWriteLine already ends with resetAttributes + result = newStmtList(result, newCall(bindSym"resetAttributes", bindSym"stderr")) + +template callWritelnHook(args: varargs[string, `$`]) = + conf.writelnHook concat(args) + +proc msgWrite(conf: ConfigRef; s: string) = + if conf.m.errorOutputs != {}: + let stdOrr = + if optStdout in conf.globalOptions: + stdout + else: + stderr + + write(stdOrr, s) + flushFile(stdOrr) + + conf.lastMsgWasDot.incl stdOrr.toStdOrrKind() # subsequent writes need `flushDot` + +template styledMsgWriteln(args: varargs[typed]) = + if not isNil(conf.writelnHook): + callIgnoringStyle(callWritelnHook, nil, args) + elif optStdout in conf.globalOptions: + if eStdOut in conf.m.errorOutputs: + flushDot(conf) + callIgnoringStyle(writeLine, stdout, args) + flushFile(stdout) + elif eStdErr in conf.m.errorOutputs: + flushDot(conf) + if optUseColors in conf.globalOptions: + callStyledWriteLineStderr(args) + else: + callIgnoringStyle(writeLine, stderr, args) + # On Windows stderr is fully-buffered when piped, regardless of C std. + when defined(windows): + flushFile(stderr) + +proc msgKindToString*(kind: TMsgKind): string = + MsgKindToStr[kind] + +# later versions may provide translated error messages +proc getMessageStr(msg: TMsgKind; arg: string): string = + msgKindToString(msg) % [arg] + +type + TErrorHandling* = enum + doNothing + doAbort + doRaise + +proc log*(s: string) = + var f: File + if open(f, getHomeDir() / "nimsuggest.log", fmAppend): + f.writeLine(s) + close(f) + +proc quit(conf: ConfigRef; msg: TMsgKind) {.gcsafe.} = + if conf.isDefined("nimDebug"): + quitOrRaise(conf, $msg) + elif defined(debug) or msg == errInternal or conf.hasHint(hintStackTrace): + {.gcsafe.}: + if stackTraceAvailable() and isNil(conf.writelnHook): + writeStackTrace() + else: + styledMsgWriteln( + fgRed, + """ +No stack traceback available +To create a stacktrace, rerun compilation with './koch temp $1 ', see $2 for details""" % [ + conf.command, "intern.html#debugging-the-compiler".createDocLink + ], + conf.unitSep + ) + + quit 1 + +proc handleError( + conf: ConfigRef; msg: TMsgKind; eh: TErrorHandling; s: string; ignoreMsg: bool +) = + if msg in fatalMsgs: + if conf.cmd == cmdIdeTools: + log(s) + + quit(conf, msg) + if msg >= errMin and msg <= errMax or ( + msg in warnMin .. hintMax and msg in conf.warningAsErrors and not ignoreMsg + ): + inc(conf.errorCounter) + + conf.exitcode = 1'i8 + if conf.errorCounter >= conf.errorMax: + # only really quit when we're not in the new 'nim check --def' mode: + if conf.ideCmd == ideNone: + quit(conf, msg) + elif eh == doAbort and conf.cmd != cmdIdeTools: + quit(conf, msg) + elif eh == doRaise: + raiseRecoverableError(s) + +proc `==`*(a, b: TLineInfo): bool = + result = a.line == b.line and a.fileIndex == b.fileIndex + +proc exactEquals*(a, b: TLineInfo): bool = + result = a.fileIndex == b.fileIndex and a.line == b.line and a.col == b.col + +proc writeContext(conf: ConfigRef; lastinfo: TLineInfo) = + const + instantiationFrom = "template/generic instantiation from here" + const + instantiationOfFrom = "template/generic instantiation of `$1` from here" + + var info = lastinfo + for i in 0 ..< conf.m.msgContext.len: + let context = conf.m.msgContext[i] + if context.info != lastinfo and context.info != info: + if conf.structuredErrorHook != nil: + conf.structuredErrorHook(conf, context.info, instantiationFrom, Severity.Hint) + else: + let message = + if context.detail == "": + instantiationFrom + else: + instantiationOfFrom.format(context.detail) + + styledMsgWriteln( + styleBright, conf.toFileLineCol(context.info), " ", resetStyle, message + ) + + info = context.info + +proc ignoreMsgBecauseOfIdeTools(conf: ConfigRef; msg: TMsgKind): bool = + msg >= errGenerated and conf.cmd == cmdIdeTools and optIdeDebug notin conf.globalOptions + +proc addSourceLine(conf: ConfigRef; fileIdx: FileIndex; line: string) = + conf.m.fileInfos[fileIdx.int32].lines.add line + +proc numLines*(conf: ConfigRef; fileIdx: FileIndex): int = + ## xxx there's an off by 1 error that should be fixed; if a file ends with "foo" or "foo\n" + ## it will return same number of lines (ie, a trailing empty line is discounted) + result = conf.m.fileInfos[fileIdx.int32].lines.len + if result == 0: + try: + for line in lines(toFullPathConsiderDirty(conf, fileIdx).string): + addSourceLine conf, fileIdx, line + except IOError: + discard + + result = conf.m.fileInfos[fileIdx.int32].lines.len + +proc sourceLine*(conf: ConfigRef; i: TLineInfo): string = + ## 1-based index (matches editor line numbers); 1st line is for i.line = 1 + ## last valid line is `numLines` inclusive + if i.fileIndex.int32 < 0: + return "" + + let num = numLines(conf, i.fileIndex) + # can happen if the error points to EOF: + if i.line.int > num: + return "" + + result = conf.m.fileInfos[i.fileIndex.int32].lines[i.line.int - 1] + +proc getSurroundingSrc(conf: ConfigRef; info: TLineInfo): string = + if conf.hasHint(hintSource) and info != unknownLineInfo: + const + indent = " " + + result = "\n" & indent & $sourceLine(conf, info) + if info.col >= 0: + result.add "\n" & indent & spaces(info.col) & '^' + +proc formatMsg*(conf: ConfigRef; info: TLineInfo; msg: TMsgKind; arg: string): string = + let title = + case msg + of warnMin .. warnMax: + WarningTitle + of hintMin .. hintMax: + HintTitle + else: + ErrorTitle + + conf.toFileLineCol(info) & " " & title & getMessageStr(msg, arg) + +proc liMessage*( + conf: ConfigRef; + info: TLineInfo; + msg: TMsgKind; + arg: string; + eh: TErrorHandling; + info2: InstantiationInfo; + isRaw = false; + ignoreError = false +) {.gcsafe, noinline.} = + var + title: string + color: ForegroundColor + ignoreMsg = false + sev: Severity + + let errorOutputsOld = conf.m.errorOutputs + if msg in fatalMsgs: + # don't gag, refs bug #7080, bug #18278; this can happen with `{.fatal.}` + # or inside a `tryConstExpr`. + conf.m.errorOutputs = {eStdOut, eStdErr} + + let kind = + if msg in warnMin .. hintMax and msg != hintUserRaw: + $msg + else: + "" + # xxx not sure why hintUserRaw is special + case msg + of errMin .. errMax: + sev = Severity.Error + + writeContext(conf, info) + + title = ErrorTitle + color = ErrorColor + when false: + # we try to filter error messages so that not two error message + # in the same file and line are produced: + # xxx `lastError` is only used in this disabled code; but could be useful to revive + ignoreMsg = conf.m.lastError == info and info != unknownLineInfo and eh != doAbort + if info != unknownLineInfo: + conf.m.lastError = info + of warnMin .. warnMax: + sev = Severity.Warning + ignoreMsg = not conf.hasWarn(msg) + if not ignoreMsg and msg in conf.warningAsErrors: + title = ErrorTitle + color = ErrorColor + else: + title = WarningTitle + color = WarningColor + if not ignoreMsg: + writeContext(conf, info) + + inc(conf.warnCounter) + of hintMin .. hintMax: + sev = Severity.Hint + ignoreMsg = not conf.hasHint(msg) + if not ignoreMsg and msg in conf.warningAsErrors: + title = ErrorTitle + else: + title = HintTitle + + color = HintColor + + inc(conf.hintCounter) + + let s = + if isRaw: + arg + else: + getMessageStr(msg, arg) + if not ignoreMsg: + let loc = + if info != unknownLineInfo: + conf.toFileLineCol(info) & " " + else: + "" + + # we could also show `conf.cmdInput` here for `projectIsCmd` + var + kindmsg = + if kind.len > 0: + KindFormat % kind + else: + "" + if conf.structuredErrorHook != nil: + conf.structuredErrorHook(conf, info, s & kindmsg, sev) + if not ignoreMsgBecauseOfIdeTools(conf, msg): + if msg == hintProcessing and conf.hintProcessingDots: + msgWrite(conf, ".") + else: + styledMsgWriteln( + styleBright, + loc, + resetStyle, + color, + title, + resetStyle, + s, + KindColor, + kindmsg, + resetStyle, + conf.getSurroundingSrc(info), + conf.unitSep + ) + if hintMsgOrigin in conf.mainPackageNotes: + # xxx needs a bit of refactoring to honor `conf.filenameOption` + styledMsgWriteln( + styleBright, + toFileLineCol(info2), + resetStyle, + " compiler msg initiated here", + KindColor, + KindFormat % $hintMsgOrigin, + resetStyle, + conf.unitSep + ) + if not ignoreError: + handleError(conf, msg, eh, s, ignoreMsg) + if msg in fatalMsgs: + # most likely would have died here but just in case, we restore state + conf.m.errorOutputs = errorOutputsOld + +template rawMessage*(conf: ConfigRef; msg: TMsgKind; args: openArray[string]) = + let arg = msgKindToString(msg) % args + + liMessage(conf, unknownLineInfo, msg, arg, eh = doAbort, instLoc(), isRaw = true) + +template rawMessage*(conf: ConfigRef; msg: TMsgKind; arg: string) = + liMessage(conf, unknownLineInfo, msg, arg, eh = doAbort, instLoc()) + +template fatal*(conf: ConfigRef; info: TLineInfo; arg = ""; msg = errFatal) = + liMessage(conf, info, msg, arg, doAbort, instLoc()) + +template globalAssert*( + conf: ConfigRef; cond: untyped; info: TLineInfo = unknownLineInfo; arg = "" +) = + ## avoids boilerplate + if not cond: + var arg2 = "'$1' failed" % [astToStr(cond)] + if arg.len > 0: + arg2.add "; " & astToStr(arg) & ": " & arg + + liMessage(conf, info, errGenerated, arg2, doRaise, instLoc()) + +template globalError*(conf: ConfigRef; info: TLineInfo; msg: TMsgKind; arg = "") = + ## `local` means compilation keeps going until errorMax is reached (via `doNothing`), + ## `global` means it stops. + liMessage(conf, info, msg, arg, doRaise, instLoc()) + +template globalError*(conf: ConfigRef; info: TLineInfo; arg: string) = + liMessage(conf, info, errGenerated, arg, doRaise, instLoc()) + +template localError*(conf: ConfigRef; info: TLineInfo; msg: TMsgKind; arg = "") = + liMessage(conf, info, msg, arg, doNothing, instLoc()) + +template localError*(conf: ConfigRef; info: TLineInfo; arg: string) = + liMessage(conf, info, errGenerated, arg, doNothing, instLoc()) + +template message*(conf: ConfigRef; info: TLineInfo; msg: TMsgKind; arg = "") = + liMessage(conf, info, msg, arg, doNothing, instLoc()) + +proc warningDeprecated*(conf: ConfigRef; info: TLineInfo = gCmdLineInfo; msg = "") {. + inline +.} = + message(conf, info, warnDeprecated, msg) + +proc internalErrorImpl( + conf: ConfigRef; info: TLineInfo; errMsg: string; info2: InstantiationInfo +) = + if conf.cmd == cmdIdeTools and conf.structuredErrorHook.isNil: + return + + writeContext(conf, info) + liMessage(conf, info, errInternal, errMsg, doAbort, info2) + +template internalError*(conf: ConfigRef; info: TLineInfo; errMsg: string) = + internalErrorImpl(conf, info, errMsg, instLoc()) + +template internalError*(conf: ConfigRef; errMsg: string) = + internalErrorImpl(conf, unknownLineInfo, errMsg, instLoc()) + +template internalAssert*(conf: ConfigRef; e: bool) = + # xxx merge with `globalAssert` + if not e: + const + info2 = instLoc() + + let arg = info2.toFileLineCol + + internalErrorImpl(conf, unknownLineInfo, arg, info2) + +template lintReport*(conf: ConfigRef; info: TLineInfo; beau, got: string; extraMsg = "") = + let m = "'$1' should be: '$2'$3" % [got, beau, extraMsg] + let msg = + if optStyleError in conf.globalOptions: + errGenerated + else: + hintName + + liMessage(conf, info, msg, m, doNothing, instLoc()) + +proc quotedFilename*(conf: ConfigRef; i: TLineInfo): Rope = + if i.fileIndex.int32 < 0: + result = makeCString "???" + elif optExcessiveStackTrace in conf.globalOptions: + result = conf.m.fileInfos[i.fileIndex.int32].quotedFullName + else: + result = conf.m.fileInfos[i.fileIndex.int32].quotedName + +template listMsg(title, r) = + msgWriteln(conf, title, {msgNoUnitSep}) + for a in r: + msgWriteln( + conf, + " [$1] $2" % [ + if a in conf.notes: + "x" + else: + " " + , + $a + ], + {msgNoUnitSep} + ) + +proc listWarnings*(conf: ConfigRef) = + listMsg("Warnings:", warnMin .. warnMax) + +proc listHints*(conf: ConfigRef) = + listMsg("Hints:", hintMin .. hintMax) + +proc uniqueModuleName*(conf: ConfigRef; fid: FileIndex): string = + ## The unique module name is guaranteed to only contain {'A'..'Z', 'a'..'z', '0'..'9', '_'} + ## so that it is useful as a C identifier snippet. + let path = AbsoluteFile toFullPath(conf, fid) + let rel = + if path.string.startsWith(conf.libpath.string): + relativeTo(path, conf.libpath).string + else: + relativeTo(path, conf.projectPath).string + let trunc = + if rel.endsWith(".nim"): + rel.len - len(".nim") + else: + rel.len + + result = newStringOfCap(trunc) + for i in 0 ..< trunc: + let c = rel[i] + case c + of 'a' .. 'z': + result.add c + of {os.DirSep, os.AltSep}: + result.add 'Z' # because it looks a bit like '/' + of '.': + result.add 'O' # a circle + else: + # We mangle upper letters and digits too so that there cannot + # be clashes with our special meanings of 'Z' and 'O' + result.addInt ord(c) + +proc genSuccessX*(conf: ConfigRef) = + let mem = + when declared(system.getMaxMem): + formatSize(getMaxMem()) & " peakmem" + else: + formatSize(getTotalMem()) & " totmem" + let loc = $conf.linesCompiled + + var build = "" + var flags = "" + + const + debugModeHints = "none (DEBUG BUILD, `-d:release` generates faster code)" + if conf.cmd in cmdBackends: + if conf.backend != backendJs: + build.add "mm: $#; " % $conf.selectedGC + if optThreads in conf.globalOptions: + build.add "threads: on; " + + build.add "opt: " + if optOptimizeSpeed in conf.options: + build.add "speed" + elif optOptimizeSize in conf.options: + build.add "size" + else: + build.add debugModeHints + # pending https://github.com/timotheecour/Nim/issues/752, point to optimization.html + if isDefined(conf, "danger"): + flags.add " -d:danger" + elif isDefined(conf, "release"): + flags.add " -d:release" + else: + build.add "opt: " + if isDefined(conf, "danger"): + build.add "speed" + flags.add " -d:danger" + elif isDefined(conf, "release"): + build.add "speed" + flags.add " -d:release" + else: + build.add debugModeHints + if flags.len > 0: + build.add "; options:" & flags + + let sec = formatFloat(epochTime() - conf.lastCmdTime, ffDecimal, 3) + let project = + if conf.filenameOption == foAbs: + $conf.projectFull + else: + $conf.projectName # xxx honor conf.filenameOption more accurately + + var output: string + if optCompileOnly in conf.globalOptions and conf.cmd != cmdJsonscript: + output = $conf.jsonBuildFile + elif conf.outFile.isEmpty and conf.cmd notin {cmdJsonscript} + cmdDocLike + cmdBackends: + # for some cmd we expect a valid absOutFile + output = "unknownOutput" + else: + output = $conf.absOutFile + if conf.filenameOption != foAbs: + output = output.AbsoluteFile.extractFilename # xxx honor filenameOption more accurately + + rawMessage( + conf, + hintSuccessX, + [ + "build", + build, + "loc", + loc, + "sec", + sec, + "mem", + mem, + "project", + project, + "output", + output + ] + ) diff --git a/src/phmsgs.nim.nimph.yaml b/src/phmsgs.nim.nimph.yaml new file mode 100644 index 0000000..b99a221 --- /dev/null +++ b/src/phmsgs.nim.nimph.yaml @@ -0,0 +1,23616 @@ +{ + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# nimph" + }, + { + "kind": "nkCommentStmt", + "comment": "# (c) Copyright 2023 Jacek Sieka" + }, + { + "kind": "nkCommentStmt", + "comment": "# The Nim compiler" + }, + { + "kind": "nkCommentStmt", + "comment": "# (c) Copyright 2018 Andreas Rumpf" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# See the file \"copying.txt\", included in this" + }, + { + "kind": "nkCommentStmt", + "comment": "# distribution, for details about the copyright." + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkIdent", + "ident": "std" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "strutils" + }, + { + "kind": "nkIdent", + "ident": "os" + }, + { + "kind": "nkIdent", + "ident": "tables" + }, + { + "kind": "nkIdent", + "ident": "terminal" + }, + { + "kind": "nkIdent", + "ident": "macros" + }, + { + "kind": "nkIdent", + "ident": "times" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkIdent", + "ident": "std" + }, + { + "kind": "nkIdent", + "ident": "private" + } + ] + }, + { + "kind": "nkIdent", + "ident": "miscdollars" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pathutils" + } + ] + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "./" + }, + { + "kind": "nkIdent", + "ident": "phlineinfos" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "./" + }, + { + "kind": "nkIdent", + "ident": "phoptions" + } + ] + } + ] + }, + { + "kind": "nkImportExceptStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "ropes" + }, + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "nimPreviewSlimSystem" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkIdent", + "ident": "std" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "syncio" + }, + { + "kind": "nkIdent", + "ident": "assertions" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "InstantiationInfo" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "typeof" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "instantiationInfo" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "instLoc" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "InstantiationInfo" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "instantiationInfo" + }, + { + "kind": "nkIntLit", + "intVal": -2 + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fullPaths" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "toStdOrrKind" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "untyped" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "stdOrr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "stdOrr" + }, + { + "kind": "nkIdent", + "ident": "stdout" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "stdOrrStdout" + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "stdOrrStderr" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "flushDot" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## safe to call multiple times\", line: 37, col: 2, offsetA: 761, offsetB: 791)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# xxx one edge case not yet handled is when `printf` is called at CT with `compiletimeFFI`.\", line: 38, col: 2, offsetA: 794, offsetB: 885)" + ], + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "stdOrr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "optStdout" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "globalOptions" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "stdout" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "stderr" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "stdOrrKind" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toStdOrrKind" + }, + { + "kind": "nkIdent", + "ident": "stdOrr" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "stdOrrKind" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "lastMsgWasDot" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "lastMsgWasDot" + } + ] + }, + { + "kind": "nkIdent", + "ident": "excl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "stdOrrKind" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "write" + }, + { + "kind": "nkIdent", + "ident": "stdOrr" + }, + { + "kind": "nkStrLit", + "strVal": "\u000A" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toCChar" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "char" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 0 + }, + { + "kind": "nkCharLit", + "intVal": 31 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 127 + }, + { + "kind": "nkCharLit", + "intVal": 255 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 92 + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toOctal" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 39 + }, + { + "kind": "nkCharLit", + "intVal": 34 + }, + { + "kind": "nkCharLit", + "intVal": 92 + }, + { + "kind": "nkCharLit", + "intVal": 63 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 92 + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "makeCString" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStringOfCap" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIdent", + "ident": "toFloat" + } + ] + }, + { + "kind": "nkFloatLit", + "floatVal": 1.1 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\"" + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# line wrapping of string litterals in cgen\\\'d code was a bad idea, e.g. causes: bug #16265\", line: 66, col: 4, offsetA: 1503, offsetB: 1593)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# It also makes reading c sources or grepping harder, for zero benefit.\", line: 67, col: 4, offsetA: 1598, offsetB: 1669)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# const MaxLineLength = 64\", line: 68, col: 4, offsetA: 1674, offsetB: 1700)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if (i + 1) mod MaxLineLength == 0:\", line: 69, col: 4, offsetA: 1705, offsetB: 1741)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# res.add(\\\"\\\\\\\"\\\\L\\\\\\\"\\\")\", line: 70, col: 4, offsetA: 1746, offsetB: 1767)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toCChar" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 34 + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "newFileInfo" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "TFileInfo" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fullPath" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "projPath" + }, + { + "kind": "nkIdent", + "ident": "RelativeFile" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "fullPath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fullPath" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#shallow(result.fullPath)\", line: 77, col: 2, offsetA: 1924, offsetB: 1949)" + ], + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "projPath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "projPath" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#shallow(result.projPath)\", line: 79, col: 2, offsetA: 1981, offsetB: 2006)" + ], + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "shortName" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fullPath" + }, + { + "kind": "nkIdent", + "ident": "extractFilename" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "quotedName" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "shortName" + } + ] + }, + { + "kind": "nkIdent", + "ident": "makeCString" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "quotedFullName" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fullPath" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkIdent", + "ident": "makeCString" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "lines" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "fullPath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "isEmpty" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkTryStmt", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "fullContent" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "readFile" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "fullPath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkExceptBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "IOError" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#rawMessage(errCannotOpenFile, result.fullPath)\", line: 88, col: 6, offsetA: 2308, offsetB: 2355)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# XXX fixme\", line: 89, col: 6, offsetA: 2362, offsetB: 2373)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "fullContent" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "nimpretty" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "nimph" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "fileSection" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fid" + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "substr" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fid" + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "fullContent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "canonicalCase" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "path" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## the idea is to only use this for checking whether a path is already in\", line: 97, col: 2, offsetA: 2631, offsetB: 2704)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## the table but otherwise keep the original case\", line: 98, col: 2, offsetA: 2707, offsetB: 2756)" + ], + "sons": [ + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "FileSystemCaseSensitive" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toLowerAscii" + }, + { + "kind": "nkIdent", + "ident": "path" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "fileInfoKnown" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "filename" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "canon" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkTryStmt", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "canon" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "canonicalizePath" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "filename" + } + ] + } + ] + } + ] + }, + { + "kind": "nkExceptBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "OSError" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "canon" + }, + { + "kind": "nkIdent", + "ident": "filename" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "canon" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkIdent", + "ident": "canonicalCase" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "filenameToIndexTbl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "hasKey" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "canon" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "fileInfoIdx" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "filename" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "isKnownFile" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "canon" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pseudoPath" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkTryStmt", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "canon" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "canonicalizePath" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "filename" + } + ] + } + ] + } + ] + }, + { + "kind": "nkExceptBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "OSError" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "canon" + }, + { + "kind": "nkIdent", + "ident": "filename" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# The compiler uses \\\"filenames\\\" such as `command line` or `stdin`\", line: 125, col: 4, offsetA: 3358, offsetB: 3423)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# This flag indicates that we are working with such a path here\", line: 126, col: 4, offsetA: 3428, offsetB: 3491)" + ], + "ident": "pseudoPath" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "canon2" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "canon" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "canon2" + }, + { + "kind": "nkIdent", + "ident": "canonicalCase" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "filenameToIndexTbl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "hasKey" + } + ] + }, + { + "kind": "nkIdent", + "ident": "canon2" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "isKnownFile" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "filenameToIndexTbl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "canon2" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "isKnownFile" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newFileInfo" + }, + { + "kind": "nkIdent", + "ident": "canon" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "pseudoPath" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "RelativeFile" + }, + { + "kind": "nkIdent", + "ident": "filename" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "relativeTo" + }, + { + "kind": "nkIdent", + "ident": "canon" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "projectPath" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "filenameToIndexTbl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "canon2" + } + ] + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "fileInfoIdx" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "filename" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "dummy" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileInfoIdx" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "filename" + }, + { + "kind": "nkIdent", + "ident": "dummy" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "fileInfoIdx" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "filename" + }, + { + "kind": "nkIdent", + "ident": "RelativeFile" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "isKnownFile" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileInfoIdx" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "expandFilename" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "filename" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "isKnownFile" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "fileInfoIdx" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "filename" + }, + { + "kind": "nkIdent", + "ident": "RelativeFile" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "dummy" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileInfoIdx" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "expandFilename" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "filename" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "dummy" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newLineInfo" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileInfoIdx" + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "line" + }, + { + "kind": "nkIdent", + "ident": "col" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "fileIndex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfoIdx" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "line" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkIdent", + "ident": "uint16" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "uint16" + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkIdent", + "ident": "uint16" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "col" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkIdent", + "ident": "int16" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "int16" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newLineInfo" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "filename" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "line" + }, + { + "kind": "nkIdent", + "ident": "col" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newLineInfo" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileInfoIdx" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "filename" + } + ] + }, + { + "kind": "nkIdent", + "ident": "line" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "gCmdLineInfo" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newLineInfo" + }, + { + "kind": "nkIdent", + "ident": "commandLineIdx" + }, + { + "kind": "nkIntLit", + "intVal": 1 + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "concat" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "strings" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "openArray" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "totalLen" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "strings" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkIdent", + "ident": "totalLen" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStringOfCap" + }, + { + "kind": "nkIdent", + "ident": "totalLen" + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "strings" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "suggestWriteln" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "eStdOut" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "errorOutputs" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isNil" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "writelnHook" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "writeLine" + }, + { + "kind": "nkIdent", + "ident": "stdout" + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "flushFile" + }, + { + "kind": "nkIdent", + "ident": "stdout" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "writelnHook" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "msgQuit" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "int8" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "quit" + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "msgQuit" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "quit" + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "suggestQuit" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkRaiseStmt", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newException" + }, + { + "kind": "nkIdent", + "ident": "ESuggestDone" + }, + { + "kind": "nkStrLit", + "strVal": "suggest done" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# this format is understood by many text editors: it is the same that\", line: 211, col: 0, offsetA: 5539, offsetB: 5608)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Borland and Freepascal use\", line: 212, col: 0, offsetA: 5609, offsetB: 5637)" + ], + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "KindFormat" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": " [$1]" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "KindColor" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "fgCyan" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "ErrorTitle" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "Error: " + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "ErrorColor" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "fgRed" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "WarningTitle" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "Warning: " + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "WarningColor" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "fgYellow" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "HintTitle" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "Hint: " + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "HintColor" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "fgGreen" + } + ] + }, + { + "kind": "nkConstDef", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# NOTE: currently line info line numbers start with 1,\", line: 222, col: 2, offsetA: 5836, offsetB: 5890)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# but column numbers start with 0, however most editors expect\", line: 223, col: 2, offsetA: 5893, offsetB: 5955)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# first column to be 1, so we need to +1 here\", line: 224, col: 2, offsetA: 5958, offsetB: 6003)" + ], + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "ColOffset" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "commandLineDesc" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "command line" + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getInfoContextLen" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "msgContext" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "setInfoContextLen" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "L" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setLen" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "msgContext" + } + ] + }, + { + "kind": "nkIdent", + "ident": "L" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "pushInfoContext" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "detail" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "msgContext" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkTupleConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "detail" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "popInfoContext" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setLen" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "msgContext" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "msgContext" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getInfoContext" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "index" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "index" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "msgContext" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIdent", + "ident": "index" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "index" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=%" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "msgContext" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "unknownLineInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "msgContext" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toFilename" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "commandLineIdx" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "commandLineDesc" + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "???" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "shortName" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toProjPath" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "commandLineIdx" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "commandLineDesc" + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "???" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "projPath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toFullPath" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkStmtListExpr", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "commandLineIdx" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "commandLineDesc" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "???" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "fullPath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "setDirtyFile" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "filename" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "dirtyFile" + } + ] + }, + { + "kind": "nkIdent", + "ident": "filename" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "setLen" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "lines" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "setHash" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "hash" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "gcArc" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "gcOrc" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "gcAtomicArc" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "hash" + } + ] + }, + { + "kind": "nkIdent", + "ident": "hash" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "shallowCopy" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "hash" + } + ] + }, + { + "kind": "nkIdent", + "ident": "hash" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getHash" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "gcArc" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "gcOrc" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "gcAtomicArc" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "hash" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "shallowCopy" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "hash" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toFullPathConsiderDirty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "commandLineIdx" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "commandLineDesc" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "???" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "dirtyFile" + } + ] + }, + { + "kind": "nkIdent", + "ident": "isEmpty" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "dirtyFile" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "fullPath" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toFilename" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toFilename" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "fileIndex" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toProjPath" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toProjPath" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "fileIndex" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toFullPath" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toFullPath" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "fileIndex" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toFullPathConsiderDirty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toFullPathConsiderDirty" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "fileIndex" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toFilenameOption" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "opt" + }, + { + "kind": "nkIdent", + "ident": "FilenameOption" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "opt" + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "foAbs" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toFullPath" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "foRelProject" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toProjPath" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "foCanonical" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "absPath" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toFullPath" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "canonicalImportAux" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "absPath" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "foName" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toProjPath" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + }, + { + "kind": "nkIdent", + "ident": "lastPathPart" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "foLegacyRelProj" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "absPath" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toFullPath" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "relPath" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toProjPath" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "relPath" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "absPath" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "relPath" + }, + { + "kind": "nkIdent", + "ident": "count" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ".." + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "absPath" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "relPath" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "foStacktrace" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "optExcessiveStackTrace" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "globalOptions" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toFilenameOption" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "foAbs" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toFilenameOption" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "foName" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toMsgFilename" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toFilenameOption" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "filenameOption" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toMsgFilename" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toMsgFilename" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "fileIndex" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toLinenumber" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toColumn" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "toFileLineCol" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "InstantiationInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "toLocation" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "filename" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "column" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ColOffset" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toFileLineCol" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "toLocation" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toMsgFilename" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ColOffset" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toFileLineCol" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "error" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "??" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "filename" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# only for debugging purposes\", line: 377, col: 2, offsetA: 10795, offsetB: 10824)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "filename" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toFilename" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "MsgFlag" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## flags altering msgWriteln behavior\", line: 381, col: 18, offsetA: 10895, offsetB: 10932)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "msgStdout", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## force writing to stdout, even stderr is default\", line: 382, col: 14, offsetA: 10947, offsetB: 10997)" + ] + }, + { + "kind": "nkIdent", + "ident": "msgSkipHook", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## skip message hook even if it is present\", line: 383, col: 16, offsetA: 11014, offsetB: 11056)" + ] + }, + { + "kind": "nkIdent", + "ident": "msgNoUnitSep", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## the message is a complete \\\"paragraph\\\".\", line: 384, col: 17, offsetA: 11074, offsetB: 11115)" + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "MsgFlags" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "MsgFlag" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "msgWriteln" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "flags" + }, + { + "kind": "nkIdent", + "ident": "MsgFlags" + }, + { + "kind": "nkCurly" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Writes given message string to stderr by default.\", line: 389, col: 2, offsetA: 11216, offsetB: 11268)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## If ``--stdout`` option is given, writes to stdout instead. If message hook\", line: 390, col: 2, offsetA: 11271, offsetB: 11348)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## is present, then it is used to output message rather than stderr/stdout.\", line: 391, col: 2, offsetA: 11351, offsetB: 11426)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## This behavior can be altered by given optional flags.\", line: 392, col: 2, offsetA: 11429, offsetB: 11485)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## This is used for \\\'nim dump\\\' etc. where we don\\\'t have nimsuggest\", line: 393, col: 2, offsetA: 11488, offsetB: 11554)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## support.\", line: 394, col: 2, offsetA: 11557, offsetB: 11568)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#if conf.cmd == cmdIdeTools and optCDebug notin gGlobalOptions: return\", line: 395, col: 2, offsetA: 11571, offsetB: 11641)" + ], + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "sep" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "msgNoUnitSep" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "unitSep" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isNil" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "writelnHook" + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "msgSkipHook" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "writelnHook" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "sep" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "optStdout" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "globalOptions" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "msgStdout" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "eStdOut" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "errorOutputs" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "flushDot" + }, + { + "kind": "nkIdent", + "ident": "conf" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "write" + }, + { + "kind": "nkIdent", + "ident": "stdout" + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "writeLine" + }, + { + "kind": "nkIdent", + "ident": "stdout" + }, + { + "kind": "nkIdent", + "ident": "sep" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "flushFile" + }, + { + "kind": "nkIdent", + "ident": "stdout" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "eStdErr" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "errorOutputs" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "flushDot" + }, + { + "kind": "nkIdent", + "ident": "conf" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "write" + }, + { + "kind": "nkIdent", + "ident": "stderr" + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "writeLine" + }, + { + "kind": "nkIdent", + "ident": "stderr" + }, + { + "kind": "nkIdent", + "ident": "sep" + } + ] + }, + { + "kind": "nkWhenStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# On Windows stderr is fully-buffered when piped, regardless of C std.\", line: 418, col: 6, offsetA: 12143, offsetB: 12213)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "windows" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "flushFile" + }, + { + "kind": "nkIdent", + "ident": "stderr" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkMacroDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "callIgnoringStyle" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "untyped" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "theProc" + }, + { + "kind": "nkIdent", + "ident": "typed" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "first" + }, + { + "kind": "nkIdent", + "ident": "typed" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "args" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "varargs" + }, + { + "kind": "nkIdent", + "ident": "typed" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "typForegroundColor" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "bindSym" + }, + { + "kind": "nkRStrLit", + "strVal": "ForegroundColor" + } + ] + }, + { + "kind": "nkIdent", + "ident": "getType" + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "typBackgroundColor" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "bindSym" + }, + { + "kind": "nkRStrLit", + "strVal": "BackgroundColor" + } + ] + }, + { + "kind": "nkIdent", + "ident": "getType" + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "typStyle" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "bindSym" + }, + { + "kind": "nkRStrLit", + "strVal": "Style" + } + ] + }, + { + "kind": "nkIdent", + "ident": "getType" + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "typTerminalCmd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "bindSym" + }, + { + "kind": "nkRStrLit", + "strVal": "TerminalCmd" + } + ] + }, + { + "kind": "nkIdent", + "ident": "getType" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newCall" + }, + { + "kind": "nkIdent", + "ident": "theProc" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "first" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nnkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "first" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "children" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "args" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nnkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkContinueStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkIdent", + "ident": "getType" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nnkEnumTy" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "typForegroundColor" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "typBackgroundColor" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "typStyle" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "typTerminalCmd" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "arg" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkMacroDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "callStyledWriteLineStderr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "untyped" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "args" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "varargs" + }, + { + "kind": "nkIdent", + "ident": "typed" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newCall" + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "bindSym" + }, + { + "kind": "nkRStrLit", + "strVal": "styledWriteLine" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "bindSym" + }, + { + "kind": "nkRStrLit", + "strVal": "stderr" + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "children" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "args" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "arg" + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# not needed because styledWriteLine already ends with resetAttributes\", line: 446, col: 4, offsetA: 13129, offsetB: 13199)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStmtList" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newCall" + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "bindSym" + }, + { + "kind": "nkRStrLit", + "strVal": "resetAttributes" + } + ] + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "bindSym" + }, + { + "kind": "nkRStrLit", + "strVal": "stderr" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "callWritelnHook" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "args" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "varargs" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "writelnHook" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "concat" + }, + { + "kind": "nkIdent", + "ident": "args" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "msgWrite" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "errorOutputs" + } + ] + }, + { + "kind": "nkCurly" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "stdOrr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "optStdout" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "globalOptions" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "stdout" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "stderr" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "write" + }, + { + "kind": "nkIdent", + "ident": "stdOrr" + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "flushFile" + }, + { + "kind": "nkIdent", + "ident": "stdOrr" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "lastMsgWasDot" + } + ] + }, + { + "kind": "nkIdent", + "ident": "incl" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "stdOrr" + }, + { + "kind": "nkIdent", + "ident": "toStdOrrKind" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "styledMsgWriteln" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "args" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "varargs" + }, + { + "kind": "nkIdent", + "ident": "typed" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isNil" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "writelnHook" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "callIgnoringStyle" + }, + { + "kind": "nkIdent", + "ident": "callWritelnHook" + }, + { + "kind": "nkNilLit" + }, + { + "kind": "nkIdent", + "ident": "args" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "optStdout" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "globalOptions" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "eStdOut" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "errorOutputs" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "flushDot" + }, + { + "kind": "nkIdent", + "ident": "conf" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "callIgnoringStyle" + }, + { + "kind": "nkIdent", + "ident": "writeLine" + }, + { + "kind": "nkIdent", + "ident": "stdout" + }, + { + "kind": "nkIdent", + "ident": "args" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "flushFile" + }, + { + "kind": "nkIdent", + "ident": "stdout" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "eStdErr" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "errorOutputs" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "flushDot" + }, + { + "kind": "nkIdent", + "ident": "conf" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "optUseColors" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "globalOptions" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "callStyledWriteLineStderr" + }, + { + "kind": "nkIdent", + "ident": "args" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "callIgnoringStyle" + }, + { + "kind": "nkIdent", + "ident": "writeLine" + }, + { + "kind": "nkIdent", + "ident": "stderr" + }, + { + "kind": "nkIdent", + "ident": "args" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# On Windows stderr is fully-buffered when piped, regardless of C std.\", line: 479, col: 4, offsetA: 14192, offsetB: 14262)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "windows" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "flushFile" + }, + { + "kind": "nkIdent", + "ident": "stderr" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "msgKindToString" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TMsgKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "MsgKindToStr" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# later versions may provide translated error messages\", line: 486, col: 0, offsetA: 14385, offsetB: 14439)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "getMessageStr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "TMsgKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "msgKindToString" + }, + { + "kind": "nkIdent", + "ident": "msg" + } + ] + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TErrorHandling" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "doNothing" + }, + { + "kind": "nkIdent", + "ident": "doAbort" + }, + { + "kind": "nkIdent", + "ident": "doRaise" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "log" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkIdent", + "ident": "File" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "open" + }, + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getHomeDir" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "nimsuggest.log" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fmAppend" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkIdent", + "ident": "writeLine" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "close" + }, + { + "kind": "nkIdent", + "ident": "f" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "quit" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "TMsgKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcsafe" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "isDefined" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "nimDebug" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "quitOrRaise" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "msg" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "debug" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "errInternal" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "hasHint" + } + ] + }, + { + "kind": "nkIdent", + "ident": "hintStackTrace" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkPragmaBlock", + "sons": [ + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcsafe" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "stackTraceAvailable" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isNil" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "writelnHook" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "writeStackTrace" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "styledMsgWriteln" + }, + { + "kind": "nkIdent", + "ident": "fgRed" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkTripleStrLit", + "strVal": "No stack traceback available\u000ATo create a stacktrace, rerun compilation with \'./koch temp $1 \', see $2 for details" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "command" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "intern.html#debugging-the-compiler" + }, + { + "kind": "nkIdent", + "ident": "createDocLink" + } + ] + } + ] + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "unitSep" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "quit" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "handleError" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "TMsgKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "eh" + }, + { + "kind": "nkIdent", + "ident": "TErrorHandling" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ignoreMsg" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "fatalMsgs" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "cmd" + } + ] + }, + { + "kind": "nkIdent", + "ident": "cmdIdeTools" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "log" + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "quit" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "msg" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "errMin" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "errMax" + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "warnMin" + }, + { + "kind": "nkIdent", + "ident": "hintMax" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "warningAsErrors" + } + ] + } + ] + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkIdent", + "ident": "ignoreMsg" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "errorCounter" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "exitcode" + } + ] + }, + { + "kind": "nkInt8Lit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "errorCounter" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "errorMax" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# only really quit when we\\\'re not in the new \\\'nim check --def\\\' mode:\", line: 537, col: 6, offsetA: 15781, offsetB: 15849)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ideCmd" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ideNone" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "quit" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "msg" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "eh" + }, + { + "kind": "nkIdent", + "ident": "doAbort" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "cmd" + } + ] + }, + { + "kind": "nkIdent", + "ident": "cmdIdeTools" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "quit" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "msg" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "eh" + }, + { + "kind": "nkIdent", + "ident": "doRaise" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "raiseRecoverableError" + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "fileIndex" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "fileIndex" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "exactEquals" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "fileIndex" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "fileIndex" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "writeContext" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "lastinfo" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "instantiationFrom" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "template/generic instantiation from here" + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "instantiationOfFrom" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "template/generic instantiation of `$1` from here" + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "lastinfo" + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "msgContext" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "context" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "msgContext" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "context" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkIdent", + "ident": "lastinfo" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "context" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "structuredErrorHook" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "structuredErrorHook" + } + ] + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "context" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkIdent", + "ident": "instantiationFrom" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "Severity" + }, + { + "kind": "nkIdent", + "ident": "Hint" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "message" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "context" + }, + { + "kind": "nkIdent", + "ident": "detail" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "instantiationFrom" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "instantiationOfFrom" + }, + { + "kind": "nkIdent", + "ident": "format" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "context" + }, + { + "kind": "nkIdent", + "ident": "detail" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "styledMsgWriteln" + }, + { + "kind": "nkIdent", + "ident": "styleBright" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "toFileLineCol" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "context" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": " " + }, + { + "kind": "nkIdent", + "ident": "resetStyle" + }, + { + "kind": "nkIdent", + "ident": "message" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "context" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "ignoreMsgBecauseOfIdeTools" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "TMsgKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "cmd" + } + ] + }, + { + "kind": "nkIdent", + "ident": "cmdIdeTools" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "optIdeDebug" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "globalOptions" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "addSourceLine" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "line" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "lines" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "numLines" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## xxx there\\\'s an off by 1 error that should be fixed; if a file ends with \\\"foo\\\" or \\\"foo\\\\n\\\"\", line: 583, col: 2, offsetA: 17424, offsetB: 17515)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## it will return same number of lines (ie, a trailing empty line is discounted)\", line: 584, col: 2, offsetA: 17518, offsetB: 17598)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "lines" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkTryStmt", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "line" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lines" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toFullPathConsiderDirty" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "addSourceLine" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkExceptBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "IOError" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "lines" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sourceLine" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## 1-based index (matches editor line numbers); 1st line is for i.line = 1\", line: 596, col: 2, offsetA: 17944, offsetB: 18018)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## last valid line is `numLines` inclusive\", line: 597, col: 2, offsetA: 18021, offsetB: 18063)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "fileIndex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "num" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "numLines" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "fileIndex" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# can happen if the error points to EOF:\", line: 602, col: 2, offsetA: 18149, offsetB: 18189)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + }, + { + "kind": "nkIdent", + "ident": "num" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "fileIndex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "lines" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "getSurroundingSrc" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "hasHint" + } + ] + }, + { + "kind": "nkIdent", + "ident": "hintSource" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "unknownLineInfo" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": " " + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "\u000A" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "sourceLine" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "\u000A" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "spaces" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 94 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "formatMsg" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "TMsgKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "title" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "warnMin" + }, + { + "kind": "nkIdent", + "ident": "warnMax" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "WarningTitle" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "hintMin" + }, + { + "kind": "nkIdent", + "ident": "hintMax" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "HintTitle" + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "ErrorTitle" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "toFileLineCol" + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": " " + } + ] + }, + { + "kind": "nkIdent", + "ident": "title" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getMessageStr" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "arg" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "liMessage" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "TMsgKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "eh" + }, + { + "kind": "nkIdent", + "ident": "TErrorHandling" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info2" + }, + { + "kind": "nkIdent", + "ident": "InstantiationInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "isRaw" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ignoreError" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcsafe" + }, + { + "kind": "nkIdent", + "ident": "noinline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "title" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "color" + }, + { + "kind": "nkIdent", + "ident": "ForegroundColor" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ignoreMsg" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "sev" + }, + { + "kind": "nkIdent", + "ident": "Severity" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "errorOutputsOld" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "errorOutputs" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "fatalMsgs" + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# don\\\'t gag, refs bug #7080, bug #18278; this can happen with `{.fatal.}`\", line: 647, col: 4, offsetA: 19267, offsetB: 19340)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# or inside a `tryConstExpr`.\", line: 648, col: 4, offsetA: 19345, offsetB: 19374)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "errorOutputs" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "eStdOut" + }, + { + "kind": "nkIdent", + "ident": "eStdErr" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "warnMin" + }, + { + "kind": "nkIdent", + "ident": "hintMax" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "hintUserRaw" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "msg" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# xxx not sure why hintUserRaw is special\", line: 656, col: 4, offsetA: 19525, offsetB: 19566)" + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "errMin" + }, + { + "kind": "nkIdent", + "ident": "errMax" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "sev" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "Severity" + }, + { + "kind": "nkIdent", + "ident": "Error" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "writeContext" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "title" + }, + { + "kind": "nkIdent", + "ident": "ErrorTitle" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "color" + }, + { + "kind": "nkIdent", + "ident": "ErrorColor" + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# we try to filter error messages so that not two error message\", line: 666, col: 6, offsetA: 19725, offsetB: 19788)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# in the same file and line are produced:\", line: 667, col: 6, offsetA: 19795, offsetB: 19836)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# xxx `lastError` is only used in this disabled code; but could be useful to revive\", line: 668, col: 6, offsetA: 19843, offsetB: 19926)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "ignoreMsg" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "lastError" + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "unknownLineInfo" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "eh" + }, + { + "kind": "nkIdent", + "ident": "doAbort" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "unknownLineInfo" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "lastError" + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "warnMin" + }, + { + "kind": "nkIdent", + "ident": "warnMax" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "sev" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "Severity" + }, + { + "kind": "nkIdent", + "ident": "Warning" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "ignoreMsg" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "hasWarn" + } + ] + }, + { + "kind": "nkIdent", + "ident": "msg" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkIdent", + "ident": "ignoreMsg" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "warningAsErrors" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "title" + }, + { + "kind": "nkIdent", + "ident": "ErrorTitle" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "color" + }, + { + "kind": "nkIdent", + "ident": "ErrorColor" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "title" + }, + { + "kind": "nkIdent", + "ident": "WarningTitle" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "color" + }, + { + "kind": "nkIdent", + "ident": "WarningColor" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkIdent", + "ident": "ignoreMsg" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "writeContext" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "warnCounter" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "hintMin" + }, + { + "kind": "nkIdent", + "ident": "hintMax" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "sev" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "Severity" + }, + { + "kind": "nkIdent", + "ident": "Hint" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "ignoreMsg" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "hasHint" + } + ] + }, + { + "kind": "nkIdent", + "ident": "msg" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkIdent", + "ident": "ignoreMsg" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "warningAsErrors" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "title" + }, + { + "kind": "nkIdent", + "ident": "ErrorTitle" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "title" + }, + { + "kind": "nkIdent", + "ident": "HintTitle" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "color" + }, + { + "kind": "nkIdent", + "ident": "HintColor" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "hintCounter" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "isRaw" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getMessageStr" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "arg" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkIdent", + "ident": "ignoreMsg" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "loc" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "unknownLineInfo" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "toFileLineCol" + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": " " + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# we could also show `conf.cmdInput` here for `projectIsCmd`\", line: 709, col: 4, offsetA: 20876, offsetB: 20936)" + ], + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kindmsg" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkIdent", + "ident": "KindFormat" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "structuredErrorHook" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "structuredErrorHook" + } + ] + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "kindmsg" + } + ] + }, + { + "kind": "nkIdent", + "ident": "sev" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ignoreMsgBecauseOfIdeTools" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "msg" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "hintProcessing" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "hintProcessingDots" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "msgWrite" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkStrLit", + "strVal": "." + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "styledMsgWriteln" + }, + { + "kind": "nkIdent", + "ident": "styleBright" + }, + { + "kind": "nkIdent", + "ident": "loc" + }, + { + "kind": "nkIdent", + "ident": "resetStyle" + }, + { + "kind": "nkIdent", + "ident": "color" + }, + { + "kind": "nkIdent", + "ident": "title" + }, + { + "kind": "nkIdent", + "ident": "resetStyle" + }, + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "KindColor" + }, + { + "kind": "nkIdent", + "ident": "kindmsg" + }, + { + "kind": "nkIdent", + "ident": "resetStyle" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "getSurroundingSrc" + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "unitSep" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "hintMsgOrigin" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "mainPackageNotes" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 10, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# xxx needs a bit of refactoring to honor `conf.filenameOption`\", line: 737, col: 10, offsetA: 21643, offsetB: 21706)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "styledMsgWriteln" + }, + { + "kind": "nkIdent", + "ident": "styleBright" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toFileLineCol" + }, + { + "kind": "nkIdent", + "ident": "info2" + } + ] + }, + { + "kind": "nkIdent", + "ident": "resetStyle" + }, + { + "kind": "nkStrLit", + "strVal": " compiler msg initiated here" + }, + { + "kind": "nkIdent", + "ident": "KindColor" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkIdent", + "ident": "KindFormat" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "hintMsgOrigin" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "resetStyle" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "unitSep" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkIdent", + "ident": "ignoreError" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "handleError" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "eh" + }, + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "ignoreMsg" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "fatalMsgs" + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# most likely would have died here but just in case, we restore state\", line: 751, col: 4, offsetA: 22081, offsetB: 22150)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "errorOutputs" + } + ] + }, + { + "kind": "nkIdent", + "ident": "errorOutputsOld" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "rawMessage" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "TMsgKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "args" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "openArray" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "msgKindToString" + }, + { + "kind": "nkIdent", + "ident": "msg" + } + ] + }, + { + "kind": "nkIdent", + "ident": "args" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "liMessage" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "unknownLineInfo" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "eh" + }, + { + "kind": "nkIdent", + "ident": "doAbort" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "instLoc" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "isRaw" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "rawMessage" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "TMsgKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "liMessage" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "unknownLineInfo" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "eh" + }, + { + "kind": "nkIdent", + "ident": "doAbort" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "instLoc" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "fatal" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "errFatal" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "liMessage" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkIdent", + "ident": "doAbort" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "instLoc" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "globalAssert" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "cond" + }, + { + "kind": "nkIdent", + "ident": "untyped" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkIdent", + "ident": "unknownLineInfo" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## avoids boilerplate\", line: 768, col: 2, offsetA: 22782, offsetB: 22803)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkIdent", + "ident": "cond" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg2" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkStrLit", + "strVal": "\'$1\' failed" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "astToStr" + }, + { + "kind": "nkIdent", + "ident": "cond" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg2" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "; " + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "astToStr" + }, + { + "kind": "nkIdent", + "ident": "arg" + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ": " + } + ] + }, + { + "kind": "nkIdent", + "ident": "arg" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "liMessage" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkIdent", + "ident": "arg2" + }, + { + "kind": "nkIdent", + "ident": "doRaise" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "instLoc" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "globalError" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "TMsgKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## `local` means compilation keeps going until errorMax is reached (via `doNothing`),\", line: 777, col: 2, offsetA: 23089, offsetB: 23174)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## `global` means it stops.\", line: 778, col: 2, offsetA: 23177, offsetB: 23204)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "liMessage" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkIdent", + "ident": "doRaise" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "instLoc" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "globalError" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "liMessage" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkIdent", + "ident": "doRaise" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "instLoc" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "localError" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "TMsgKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "liMessage" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkIdent", + "ident": "doNothing" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "instLoc" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "localError" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "liMessage" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkIdent", + "ident": "doNothing" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "instLoc" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "message" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "TMsgKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "liMessage" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkIdent", + "ident": "doNothing" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "instLoc" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "warningDeprecated" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkIdent", + "ident": "gCmdLineInfo" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "message" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "warnDeprecated" + }, + { + "kind": "nkIdent", + "ident": "msg" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "internalErrorImpl" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "errMsg" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info2" + }, + { + "kind": "nkIdent", + "ident": "InstantiationInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "cmd" + } + ] + }, + { + "kind": "nkIdent", + "ident": "cmdIdeTools" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "structuredErrorHook" + } + ] + }, + { + "kind": "nkIdent", + "ident": "isNil" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "writeContext" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "liMessage" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "errInternal" + }, + { + "kind": "nkIdent", + "ident": "errMsg" + }, + { + "kind": "nkIdent", + "ident": "doAbort" + }, + { + "kind": "nkIdent", + "ident": "info2" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "internalError" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "errMsg" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "internalErrorImpl" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "errMsg" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "instLoc" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "internalError" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "errMsg" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "internalErrorImpl" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "unknownLineInfo" + }, + { + "kind": "nkIdent", + "ident": "errMsg" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "instLoc" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "internalAssert" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "e" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# xxx merge with `globalAssert`\", line: 814, col: 2, offsetA: 24530, offsetB: 24561)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkIdent", + "ident": "e" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "info2" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "instLoc" + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "info2" + }, + { + "kind": "nkIdent", + "ident": "toFileLineCol" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "internalErrorImpl" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "unknownLineInfo" + }, + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkIdent", + "ident": "info2" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "lintReport" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "beau" + }, + { + "kind": "nkIdent", + "ident": "got" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "extraMsg" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkStrLit", + "strVal": "\'$1\' should be: \'$2\'$3" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "got" + }, + { + "kind": "nkIdent", + "ident": "beau" + }, + { + "kind": "nkIdent", + "ident": "extraMsg" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "optStyleError" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "globalOptions" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "errGenerated" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintName" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "liMessage" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkIdent", + "ident": "doNothing" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "instLoc" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "quotedFilename" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Rope" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "fileIndex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "makeCString" + }, + { + "kind": "nkStrLit", + "strVal": "???" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "optExcessiveStackTrace" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "globalOptions" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "fileIndex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "quotedFullName" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "fileIndex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int32" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "quotedName" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "listMsg" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "title" + }, + { + "kind": "nkIdent", + "ident": "r" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "msgWriteln" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "title" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "msgNoUnitSep" + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "r" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "msgWriteln" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkStrLit", + "strVal": " [$1] $2" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "notes" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "x" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": " " + } + ] + } + ] + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "msgNoUnitSep" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "listWarnings" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "listMsg" + }, + { + "kind": "nkStrLit", + "strVal": "Warnings:" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "warnMin" + }, + { + "kind": "nkIdent", + "ident": "warnMax" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "listHints" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "listMsg" + }, + { + "kind": "nkStrLit", + "strVal": "Hints:" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "hintMin" + }, + { + "kind": "nkIdent", + "ident": "hintMax" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "uniqueModuleName" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fid" + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## The unique module name is guaranteed to only contain {\\\'A\\\'..\\\'Z\\\', \\\'a\\\'..\\\'z\\\', \\\'0\\\'..\\\'9\\\', \\\'_\\\'}\", line: 864, col: 2, offsetA: 25816, offsetB: 25907)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## so that it is useful as a C identifier snippet.\", line: 865, col: 2, offsetA: 25910, offsetB: 25960)" + ], + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "path" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toFullPath" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "fid" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "rel" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "path" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkIdent", + "ident": "startsWith" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "libpath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "relativeTo" + }, + { + "kind": "nkIdent", + "ident": "path" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "libpath" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "relativeTo" + }, + { + "kind": "nkIdent", + "ident": "path" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "projectPath" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "trunc" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "rel" + }, + { + "kind": "nkIdent", + "ident": "endsWith" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ".nim" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "rel" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": ".nim" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "rel" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStringOfCap" + }, + { + "kind": "nkIdent", + "ident": "trunc" + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIdent", + "ident": "trunc" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "rel" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 97 + }, + { + "kind": "nkCharLit", + "intVal": 122 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "os" + }, + { + "kind": "nkIdent", + "ident": "DirSep" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "os" + }, + { + "kind": "nkIdent", + "ident": "AltSep" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 90 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# because it looks a bit like \\\'/\\\'\", line: 885, col: 21, offsetA: 26448, offsetB: 26481)" + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 46 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 79 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a circle\", line: 887, col: 21, offsetA: 26515, offsetB: 26525)" + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# We mangle upper letters and digits too so that there cannot\", line: 889, col: 6, offsetA: 26542, offsetB: 26603)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# be clashes with our special meanings of \\\'Z\\\' and \\\'O\\\'\", line: 890, col: 6, offsetA: 26610, offsetB: 26663)" + ], + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addInt" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "genSuccessX" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "mem" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "declared" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "system" + }, + { + "kind": "nkIdent", + "ident": "getMaxMem" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "formatSize" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getMaxMem" + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": " peakmem" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "formatSize" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTotalMem" + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": " totmem" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "loc" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "linesCompiled" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "build" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "flags" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "debugModeHints" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "none (DEBUG BUILD, `-d:release` generates faster code)" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "cmd" + } + ] + }, + { + "kind": "nkIdent", + "ident": "cmdBackends" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "backend" + } + ] + }, + { + "kind": "nkIdent", + "ident": "backendJs" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "build" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkStrLit", + "strVal": "mm: $#; " + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "selectedGC" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "optThreads" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "globalOptions" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "build" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "threads: on; " + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "build" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "opt: " + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "optOptimizeSpeed" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "options" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "build" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "speed" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "optOptimizeSize" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "options" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "build" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "size" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "build" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "debugModeHints" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# pending https://github.com/timotheecour/Nim/issues/752, point to optimization.html\", line: 919, col: 6, offsetA: 27430, offsetB: 27514)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isDefined" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkStrLit", + "strVal": "danger" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "flags" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": " -d:danger" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isDefined" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkStrLit", + "strVal": "release" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "flags" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": " -d:release" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "build" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "opt: " + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isDefined" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkStrLit", + "strVal": "danger" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "build" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "speed" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "flags" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": " -d:danger" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isDefined" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkStrLit", + "strVal": "release" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "build" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "speed" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "flags" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": " -d:release" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "build" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "debugModeHints" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "flags" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "build" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "; options:" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "sec" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "formatFloat" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "epochTime" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "lastCmdTime" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "ffDecimal" + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "project" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "filenameOption" + } + ] + }, + { + "kind": "nkIdent", + "ident": "foAbs" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "projectFull" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "projectName" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# xxx honor conf.filenameOption more accurately\", line: 942, col: 24, offsetA: 28163, offsetB: 28210)" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "output" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "optCompileOnly" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "globalOptions" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "cmd" + } + ] + }, + { + "kind": "nkIdent", + "ident": "cmdJsonscript" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "output" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "jsonBuildFile" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "outFile" + } + ] + }, + { + "kind": "nkIdent", + "ident": "isEmpty" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "cmd" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "cmdJsonscript" + } + ] + }, + { + "kind": "nkIdent", + "ident": "cmdDocLike" + } + ] + }, + { + "kind": "nkIdent", + "ident": "cmdBackends" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for some cmd we expect a valid absOutFile\", line: 948, col: 4, offsetA: 28434, offsetB: 28477)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "output" + }, + { + "kind": "nkStrLit", + "strVal": "unknownOutput" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "output" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "absOutFile" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "filenameOption" + } + ] + }, + { + "kind": "nkIdent", + "ident": "foAbs" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "output" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "output" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + } + ] + }, + { + "kind": "nkIdent", + "ident": "extractFilename" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# xxx honor filenameOption more accurately\", line: 953, col: 49, offsetA: 28629, offsetB: 28671)" + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rawMessage" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "hintSuccessX" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "build" + }, + { + "kind": "nkIdent", + "ident": "build" + }, + { + "kind": "nkStrLit", + "strVal": "loc" + }, + { + "kind": "nkIdent", + "ident": "loc" + }, + { + "kind": "nkStrLit", + "strVal": "sec" + }, + { + "kind": "nkIdent", + "ident": "sec" + }, + { + "kind": "nkStrLit", + "strVal": "mem" + }, + { + "kind": "nkIdent", + "ident": "mem" + }, + { + "kind": "nkStrLit", + "strVal": "project" + }, + { + "kind": "nkIdent", + "ident": "project" + }, + { + "kind": "nkStrLit", + "strVal": "output" + }, + { + "kind": "nkIdent", + "ident": "output" + } + ] + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/phoptions.nim b/src/phoptions.nim new file mode 100644 index 0000000..9449945 --- /dev/null +++ b/src/phoptions.nim @@ -0,0 +1,1297 @@ +# +# +# nimph +# (c) Copyright 2023 Jacek Sieka +# The Nim compiler +# (c) Copyright 2018 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# + +import os, strutils, strtabs, sets, platform, prefixmatches, pathutils, nimpaths, tables +import phlineinfos + +from terminal import isatty +from times import utc, fromUnix, local, getTime, format, DateTime +from std/private/globs import nativeToUnixPath +when defined(nimPreviewSlimSystem): + import + std/[syncio, assertions] + +const + hasTinyCBackend* = defined(tinyc) + useEffectSystem* = true + useWriteTracking* = false + hasFFI* = defined(nimHasLibFFI) + copyrightYear* = "2023" + nimEnableCovariance* = defined(nimEnableCovariance) + +type + # please make sure we have under 32 options + # (improves code efficiency a lot!) + TOption* = enum # **keep binary compatible** + optNone + optObjCheck + optFieldCheck + optRangeCheck + optBoundsCheck + optOverflowCheck + optRefCheck + optNaNCheck + optInfCheck + optStaticBoundsCheck + optStyleCheck + optAssert + optLineDir + optWarns + optHints + optOptimizeSpeed + optOptimizeSize + optStackTrace # stack tracing support + optStackTraceMsgs # enable custom runtime msgs via `setFrameMsg` + optLineTrace # line tracing support (includes stack tracing) + optByRef + # use pass by ref for objects + # (for interfacing with C) + optProfiler # profiler turned on + optImplicitStatic + # optimization: implicit at compile time + # evaluation + optTrMacros # en/disable pattern matching + optMemTracker + optSinkInference # 'sink T' inference + optCursorInference + optImportHidden + optQuirky + + TOptions* = set[TOption] + TGlobalOption* = enum + gloptNone + optForceFullMake + optWasNimscript # redundant with `cmdNimscript`, could be removed + optListCmd + optCompileOnly + optNoLinking + optCDebug # turn on debugging information + optGenDynLib # generate a dynamic library + optGenStaticLib # generate a static library + optGenGuiApp # generate a GUI application + optGenScript # generate a script file to compile the *.c files + optGenCDeps # generate a list of *.c files to be read by CMake + optGenMapping # generate a mapping file + optRun # run the compiled project + optUseNimcache # save artifacts (including binary) in $nimcache + optStyleHint # check that the names adhere to NEP-1 + optStyleError # enforce that the names adhere to NEP-1 + optStyleUsages # only enforce consistent **usages** of the symbol + optSkipSystemConfigFile # skip the system's cfg/nims config file + optSkipProjConfigFile # skip the project's cfg/nims config file + optSkipUserConfigFile # skip the users's cfg/nims config file + optSkipParentConfigFiles # skip parent dir's cfg/nims config files + optNoMain # do not generate a "main" proc + optUseColors # use colors for hints, warnings, and errors + optThreads # support for multi-threading + optStdout # output to stdout + optThreadAnalysis # thread analysis pass + optTlsEmulation # thread var emulation turned on + optGenIndex # generate index file for documentation; + optGenIndexOnly # generate only index file for documentation + optNoImportdoc # disable loading external documentation files + optEmbedOrigSrc + # embed the original source in the generated code + # also: generate header file + optIdeDebug # idetools: debug mode + optIdeTerse # idetools: use terse descriptions + optExcessiveStackTrace # fully qualified module filenames + optShowAllMismatches # show all overloading resolution candidates + optWholeProject # for 'doc': output any dependency + optDocInternal # generate documentation for non-exported symbols + optMixedMode # true if some module triggered C++ codegen + optDeclaredLocs # show declaration locations in messages + optNoNimblePath + optHotCodeReloading + optDynlibOverrideAll + optSeqDestructors + # active if the implementation uses the new + # string/seq implementation based on destructors + optTinyRtti + # active if we use the new "tiny RTTI" + # implementation + optOwnedRefs # active if the Nim compiler knows about 'owned'. + optMultiMethods + optBenchmarkVM # Enables cpuTime() in the VM + optProduceAsm # produce assembler code + optPanics # turn panics (sysFatal) into a process termination + optSourcemap + optProfileVM # enable VM profiler + optEnableDeepCopy # ORC specific: enable 'deepcopy' for all types. + optShowNonExportedFields # for documentation: show fields that are not exported + optJsBigInt64 # use bigints for 64-bit integers in JS + + TGlobalOptions* = set[TGlobalOption] + +const + harmlessOptions* = {optForceFullMake, optNoLinking, optRun, optUseColors, optStdout} + genSubDir* = RelativeDir"nimcache" + NimExt* = "nim" + RodExt* = "rod" + HtmlExt* = "html" + JsonExt* = "json" + TagsExt* = "tags" + TexExt* = "tex" + IniExt* = "ini" + DefaultConfig* = RelativeFile"nim.cfg" + DefaultConfigNims* = RelativeFile"config.nims" + DocConfig* = RelativeFile"nimdoc.cfg" + DocTexConfig* = RelativeFile"nimdoc.tex.cfg" + htmldocsDir* = htmldocsDirname.RelativeDir + docRootDefault* = "@default" # using `@` instead of `$` to avoid shell quoting complications + oKeepVariableNames* = true + spellSuggestSecretSauce* = -1 + +type + TBackend* = enum + backendInvalid = "" # for parseEnum + backendC = "c" + backendCpp = "cpp" + backendJs = "js" + backendObjc = "objc" + # backendNimscript = "nimscript" # this could actually work + # backendLlvm = "llvm" # probably not well supported; was cmdCompileToLLVM + + Command* = enum ## Nim's commands + cmdNone # not yet processed command + cmdUnknown # command unmapped + cmdCompileToC + cmdCompileToCpp + cmdCompileToOC + cmdCompileToJS + cmdCrun # compile and run in nimache + cmdTcc # run the project via TCC backend + cmdCheck # semantic checking for whole project + cmdParse # parse a single file (for debugging) + cmdRod # .rod to some text representation (for debugging) + cmdIdeTools # ide tools (e.g. nimsuggest) + cmdNimscript # evaluate nimscript + cmdDoc0 + cmdDoc # convert .nim doc comments to HTML + cmdDoc2tex # convert .nim doc comments to LaTeX + cmdRst2html # convert a reStructuredText file to HTML + cmdRst2tex # convert a reStructuredText file to TeX + cmdMd2html # convert a Markdown file to HTML + cmdMd2tex # convert a Markdown file to TeX + cmdJsondoc0 + cmdJsondoc + cmdCtags + cmdBuildindex + cmdGendepend + cmdDump + cmdInteractive # start interactive session + cmdNop + cmdJsonscript + # compile a .json build file + # old unused: cmdInterpret, cmdDef: def feature (find definition for IDEs) + +const + cmdBackends* = + {cmdCompileToC, cmdCompileToCpp, cmdCompileToOC, cmdCompileToJS, cmdCrun} + cmdDocLike* = + {cmdDoc0, cmdDoc, cmdDoc2tex, cmdJsondoc0, cmdJsondoc, cmdCtags, cmdBuildindex} + +type + NimVer* = tuple[major: int, minor: int, patch: int] + TStringSeq* = seq[string] + TGCMode* = enum # the selected GC + gcUnselected = "unselected" + gcNone = "none" + gcBoehm = "boehm" + gcRegions = "regions" + gcArc = "arc" + gcOrc = "orc" + gcAtomicArc = "atomicArc" + gcMarkAndSweep = "markAndSweep" + gcHooks = "hooks" + gcRefc = "refc" + gcGo = "go" + # gcRefc and the GCs that follow it use a write barrier, + # as far as usesWriteBarrier() is concerned + + IdeCmd* = enum + ideNone + ideSug + ideCon + ideDef + ideUse + ideDus + ideChk + ideChkFile + ideMod + ideHighlight + ideOutline + ideKnown + ideMsg + ideProject + ideGlobalSymbols + ideRecompile + ideChanged + ideType + ideDeclaration + ideExpand + + Feature* = enum ## experimental features; DO NOT RENAME THESE! + dotOperators + callOperator + parallel + destructor + notnil + dynamicBindSym + forLoopMacros # not experimental anymore; remains here for backwards compatibility + caseStmtMacros # ditto + codeReordering + compiletimeFFI + ## This requires building nim with `-d:nimHasLibFFI` + ## which itself requires `nimble install libffi`, see #10150 + ## Note: this feature can't be localized with {.push.} + vmopsDanger + strictFuncs + views + strictNotNil + overloadableEnums # deadcode + strictEffects + unicodeOperators # deadcode + flexibleOptionalParams + strictDefs + strictCaseObjects + + LegacyFeature* = enum + allowSemcheckedAstModification + ## Allows to modify a NimNode where the type has already been + ## flagged with nfSem. If you actually do this, it will cause + ## bugs. + checkUnsignedConversions + ## Historically and especially in version 1.0.0 of the language + ## conversions to unsigned numbers were checked. In 1.0.4 they + ## are not anymore. + laxEffects ## Lax effects system prior to Nim 2.0. + verboseTypeMismatch + + SymbolFilesOption* = enum + disabledSf + writeOnlySf + readOnlySf + v2Sf + stressTest + + TSystemCC* = enum + ccNone + ccGcc + ccNintendoSwitch + ccLLVM_Gcc + ccCLang + ccBcc + ccVcc + ccTcc + ccEnv + ccIcl + ccIcc + ccClangCl + + ExceptionSystem* = enum + excNone # no exception system selected yet + excSetjmp # setjmp based exception handling + excCpp # use C++'s native exception handling + excGoto # exception handling based on goto (should become the new default for C) + excQuirky # quirky exception handling + + CfileFlag* {.pure.} = enum + Cached ## no need to recompile this time + External ## file was introduced via .compile pragma + + Cfile* = object + nimname*: string + cname*, obj*: AbsoluteFile + flags*: set[CfileFlag] + customArgs*: string + + CfileList* = seq[Cfile] + Suggest* = ref object + section*: IdeCmd + qualifiedPath*: seq[string] + name*: ptr string + # not used beyond sorting purposes; name is also + # part of 'qualifiedPath' + filePath*: string + line*: int # Starts at 1 + column*: int # Starts at 0 + doc*: string # Not escaped (yet) + forth*: string # type + quality*: range[0 .. 100] # matching quality + isGlobal*: bool # is a global variable + contextFits*: bool # type/non-type context matches + prefix*: PrefixMatch + symkind*: byte + scope*, localUsages*, globalUsages*: int # more usages is better + tokenLen*: int + version*: int + endLine*: uint16 + endCol*: int + + Suggestions* = seq[Suggest] + ProfileInfo* = object + time*: float + count*: int + + ProfileData* = ref object + data*: TableRef[TLineInfo, ProfileInfo] + + StdOrrKind* = enum + stdOrrStdout + stdOrrStderr + + FilenameOption* = enum + foAbs # absolute path, e.g.: /pathto/bar/foo.nim + foRelProject # relative to project path, e.g.: ../foo.nim + foCanonical # canonical module name + foLegacyRelProj # legacy, shortest of (foAbs, foRelProject) + foName # lastPathPart, e.g.: foo.nim + foStacktrace # if optExcessiveStackTrace: foAbs else: foName + + ConfigRef* {.acyclic.} = ref object + ## every global configuration + ## fields marked with '*' are subject to + ## the incremental compilation mechanisms + ## (+) means "part of the dependency" + backend*: TBackend # set via `nim x` or `nim --backend:x` + target*: Target # (+) + linesCompiled*: int # all lines that have been compiled + options*: TOptions # (+) + globalOptions*: TGlobalOptions # (+) + macrosToExpand*: StringTableRef + arcToExpand*: StringTableRef + m*: MsgConfig + filenameOption*: FilenameOption # how to render paths in compiler messages + unitSep*: string + evalTemplateCounter*: int + evalMacroCounter*: int + exitcode*: int8 + cmd*: Command # raw command parsed as enum + cmdInput*: string # input command + projectIsCmd*: bool # whether we're compiling from a command input + implicitCmd*: bool # whether some flag triggered an implicit `command` + selectedGC*: TGCMode # the selected GC (+) + exc*: ExceptionSystem + hintProcessingDots*: bool # true for dots, false for filenames + verbosity*: int # how verbose the compiler is + numberOfProcessors*: int # number of processors + lastCmdTime*: float # when caas is enabled, we measure each command + symbolFiles*: SymbolFilesOption + spellSuggestMax*: int # max number of spelling suggestions for typos + cppDefines*: HashSet[string] # (*) + headerFile*: string + nimbasePattern*: string # pattern to find nimbase.h + features*: set[Feature] + legacyFeatures*: set[LegacyFeature] + arguments*: string + ## the arguments to be passed to the program that + ## should be run + ideCmd*: IdeCmd + oldNewlines*: bool + cCompiler*: TSystemCC # the used compiler + modifiedyNotes*: TNoteKinds # notes that have been set/unset from either cmdline/configs + cmdlineNotes*: TNoteKinds # notes that have been set/unset from cmdline + foreignPackageNotes*: TNoteKinds + notes*: TNoteKinds # notes after resolving all logic(defaults, verbosity)/cmdline/configs + warningAsErrors*: TNoteKinds + mainPackageNotes*: TNoteKinds + mainPackageId*: int + errorCounter*: int + hintCounter*: int + warnCounter*: int + errorMax*: int + maxLoopIterationsVM*: int ## VM: max iterations of all loops + isVmTrace*: bool + configVars*: StringTableRef + symbols*: StringTableRef + ## We need to use a StringTableRef here as defined + ## symbols are always guaranteed to be style + ## insensitive. Otherwise hell would break lose. + packageCache*: StringTableRef + nimblePaths*: seq[AbsoluteDir] + searchPaths*: seq[AbsoluteDir] + lazyPaths*: seq[AbsoluteDir] + outFile*: RelativeFile + outDir*: AbsoluteDir + jsonBuildFile*: AbsoluteFile + prefixDir*, libpath*, nimcacheDir*: AbsoluteDir + nimStdlibVersion*: NimVer + dllOverrides, moduleOverrides*, cfileSpecificOptions*: StringTableRef + projectName*: string # holds a name like 'nim' + projectPath*: AbsoluteDir # holds a path like /home/alice/projects/nim/compiler/ + projectFull*: AbsoluteFile # projectPath/projectName + projectIsStdin*: bool # whether we're compiling from stdin + lastMsgWasDot*: set[StdOrrKind] # the last compiler message was a single '.' + projectMainIdx*: FileIndex # the canonical path id of the main module + projectMainIdx2*: FileIndex # consider merging with projectMainIdx + command*: string # the main command (e.g. cc, check, scan, etc) + commandArgs*: seq[string] # any arguments after the main command + commandLine*: string + extraCmds*: seq[string] # for writeJsonBuildInstructions + keepComments*: bool # whether the parser needs to keep comments + implicitImports*: seq[string] # modules that are to be implicitly imported + implicitIncludes*: seq[string] # modules that are to be implicitly included + docSeeSrcUrl*: string # if empty, no seeSrc will be generated. \ + # The string uses the formatting variables `path` and `line`. + docRoot*: string ## see nim --fullhelp for --docRoot + docCmd*: string ## see nim --fullhelp for --docCmd + configFiles*: seq[AbsoluteFile] # config files (cfg,nims) + cIncludes*: seq[AbsoluteDir] # directories to search for included files + cLibs*: seq[AbsoluteDir] # directories to search for lib files + cLinkedLibs*: seq[string] # libraries to link + externalToLink*: seq[string] + # files to link in addition to the file + # we compiled (*) + linkOptionsCmd*: string + compileOptionsCmd*: seq[string] + linkOptions*: string # (*) + compileOptions*: string # (*) + cCompilerPath*: string + toCompile*: CfileList # (*) + suggestionResultHook*: proc(result: Suggest) {.closure.} + suggestVersion*: int + suggestMaxResults*: int + lastLineInfo*: TLineInfo + writelnHook*: proc(output: string) {.closure, gcsafe.} + structuredErrorHook*: proc( + config: ConfigRef; info: TLineInfo; msg: string; severity: Severity + ) {.closure, gcsafe.} + cppCustomNamespace*: string + nimMainPrefix*: string + vmProfileData*: ProfileData + expandProgress*: bool + expandLevels*: int + expandNodeResult*: string + expandPosition*: TLineInfo + +proc parseNimVersion*(a: string): NimVer = + # could be moved somewhere reusable + if a.len > 0: + let b = a.split(".") + + assert b.len == 3, a + + template fn(i) = + result[i] = b[i].parseInt # could be optimized if needed + + fn(0) + fn(1) + fn(2) + +proc assignIfDefault*[T](result: var T; val: T; def = default(T)) = + ## if `result` was already assigned to a value (that wasn't `def`), this is a noop. + if result == def: + result = val + +template setErrorMaxHighMaybe*(conf: ConfigRef) = + ## do not stop after first error (but honor --errorMax if provided) + assignIfDefault(conf.errorMax, high(int)) + +proc setNoteDefaults*(conf: ConfigRef; note: TNoteKind; enabled = true) = + template fun(op) = + conf.notes.op note + conf.mainPackageNotes.op note + conf.foreignPackageNotes.op note + + if enabled: + fun(incl) + else: + fun(excl) + +proc setNote*(conf: ConfigRef; note: TNoteKind; enabled = true) = + # see also `prepareConfigNotes` which sets notes + if note notin conf.cmdlineNotes: + if enabled: + incl(conf.notes, note) + else: + excl(conf.notes, note) + +proc hasHint*(conf: ConfigRef; note: TNoteKind): bool = + # ternary states instead of binary states would simplify logic + if optHints notin conf.options: + false + elif note in {hintConf, hintProcessing}: + # could add here other special notes like hintSource + # these notes apply globally. + note in conf.mainPackageNotes + else: + note in conf.notes + +proc hasWarn*(conf: ConfigRef; note: TNoteKind): bool {.inline.} = + optWarns in conf.options and note in conf.notes + +proc hcrOn*(conf: ConfigRef): bool = + return optHotCodeReloading in conf.globalOptions + +when false: + template depConfigFields*(fn) {.dirty.} = # deadcode + fn(target) + fn(options) + fn(globalOptions) + fn(selectedGC) + +const + oldExperimentalFeatures* = {dotOperators, callOperator, parallel} +const + ChecksOptions* = + { + optObjCheck, optFieldCheck, optRangeCheck, optOverflowCheck, optBoundsCheck, + optAssert, optNaNCheck, optInfCheck, optStyleCheck + } + DefaultOptions* = + { + optObjCheck, optFieldCheck, optRangeCheck, optBoundsCheck, optOverflowCheck, + optAssert, optWarns, optRefCheck, optHints, optStackTrace, optLineTrace, # consider adding `optStackTraceMsgs` + optTrMacros, optStyleCheck, optCursorInference + } + DefaultGlobalOptions* = {optThreadAnalysis, optExcessiveStackTrace, optJsBigInt64} + +proc getSrcTimestamp(): DateTime = + try: + result = utc(fromUnix(parseInt(getEnv("SOURCE_DATE_EPOCH", "not a number")))) + except ValueError: + # Environment variable malformed. + # https://reproducible-builds.org/specs/source-date-epoch/: "If the + # value is malformed, the build process SHOULD exit with a non-zero + # error code", which this doesn't do. This uses local time, because + # that maintains compatibility with existing usage. + result = utc getTime() + +proc getDateStr*(): string = + result = format(getSrcTimestamp(), "yyyy-MM-dd") + +proc getClockStr*(): string = + result = format(getSrcTimestamp(), "HH:mm:ss") + +template newPackageCache*(): untyped = + newStringTable( + when FileSystemCaseSensitive: + modeCaseInsensitive + else: + modeCaseSensitive + ) + +proc newProfileData(): ProfileData = + ProfileData(data: newTable[TLineInfo, ProfileInfo]()) + +const + foreignPackageNotesDefault* = + { + hintProcessing, warnUnknownMagic, hintQuitCalled, hintExecuting, hintUser, + warnUser + } + +proc isDefined*(conf: ConfigRef; symbol: string): bool + +when defined(nimDebugUtils): + # this allows inserting debugging utilties in all modules that import `options` + # with a single switch, which is useful when debugging compiler. + import debugutils + + export debugutils + +proc initConfigRefCommon(conf: ConfigRef) = + conf.selectedGC = gcUnselected + conf.verbosity = 1 + conf.hintProcessingDots = true + conf.options = DefaultOptions + conf.globalOptions = DefaultGlobalOptions + conf.filenameOption = foAbs + conf.foreignPackageNotes = foreignPackageNotesDefault + conf.notes = NotesVerbosity[1] + conf.mainPackageNotes = NotesVerbosity[1] + +proc newConfigRef*(): ConfigRef = + result = + ConfigRef( + cCompiler: ccGcc, + macrosToExpand: newStringTable(modeStyleInsensitive), + arcToExpand: newStringTable(modeStyleInsensitive), + m: initMsgConfig(), + cppDefines: initHashSet[string](), + headerFile: "", + features: {}, + legacyFeatures: {}, + configVars: newStringTable(modeStyleInsensitive), + symbols: newStringTable(modeStyleInsensitive), + packageCache: newPackageCache(), + searchPaths: @[], + lazyPaths: @[], + outFile: RelativeFile"", + outDir: AbsoluteDir"", + prefixDir: AbsoluteDir"", + libpath: AbsoluteDir"", + nimcacheDir: AbsoluteDir"", + dllOverrides: newStringTable(modeCaseInsensitive), + moduleOverrides: newStringTable(modeStyleInsensitive), + cfileSpecificOptions: newStringTable(modeCaseSensitive), + projectName: "", # holds a name like 'nim' + projectPath: AbsoluteDir"", # holds a path like /home/alice/projects/nim/compiler/ + projectFull: AbsoluteFile"", # projectPath/projectName + projectIsStdin: false, # whether we're compiling from stdin + projectMainIdx: FileIndex(0'i32), # the canonical path id of the main module + command: "", # the main command (e.g. cc, check, scan, etc) + commandArgs: @[], # any arguments after the main command + commandLine: "", + keepComments: true, # whether the parser needs to keep comments + implicitImports: @[], # modules that are to be implicitly imported + implicitIncludes: @[], # modules that are to be implicitly included + docSeeSrcUrl: "", + cIncludes: @[], # directories to search for included files + cLibs: @[], # directories to search for lib files + cLinkedLibs: @[], # libraries to link + backend: backendInvalid, + externalToLink: @[], + linkOptionsCmd: "", + compileOptionsCmd: @[], + linkOptions: "", + compileOptions: "", + ccompilerpath: "", + toCompile: @[], + arguments: "", + suggestMaxResults: 10_000, + maxLoopIterationsVM: 10_000_000, + vmProfileData: newProfileData(), + spellSuggestMax: spellSuggestSecretSauce + ) + + initConfigRefCommon(result) + setTargetFromSystem(result.target) + # enable colors by default on terminals + if terminal.isatty(stderr): + incl(result.globalOptions, optUseColors) + when defined(nimDebugUtils): + onNewConfigRef(result) + +proc newPartialConfigRef*(): ConfigRef = + ## create a new ConfigRef that is only good enough for error reporting. + when defined(nimDebugUtils): + result = getConfigRef() + else: + result = ConfigRef() + + initConfigRefCommon(result) + +proc cppDefine*(c: ConfigRef; define: string) = + c.cppDefines.incl define + +proc getStdlibVersion*(conf: ConfigRef): NimVer = + if conf.nimStdlibVersion == (0, 0, 0): + let s = conf.symbols.getOrDefault("nimVersion", "") + + conf.nimStdlibVersion = s.parseNimVersion + + result = conf.nimStdlibVersion + +proc isDefined*(conf: ConfigRef; symbol: string): bool = + if conf.symbols.hasKey(symbol): + result = true + elif cmpIgnoreStyle(symbol, CPU[conf.target.targetCPU].name) == 0: + result = true + elif cmpIgnoreStyle(symbol, platform.OS[conf.target.targetOS].name) == 0: + result = true + else: + case symbol.normalize + of "x86": + result = conf.target.targetCPU == cpuI386 + of "itanium": + result = conf.target.targetCPU == cpuIa64 + of "x8664": + result = conf.target.targetCPU == cpuAmd64 + of "posix", "unix": + result = + conf.target.targetOS in { + osLinux, osMorphos, osSkyos, osIrix, osPalmos, osQnx, osAtari, osAix, + osHaiku, osVxWorks, osSolaris, osNetbsd, osFreebsd, osOpenbsd, osDragonfly, + osMacosx, osIos, osAndroid, osNintendoSwitch, osFreeRTOS, osCrossos, + osZephyr, osNuttX + } + of "linux": + result = conf.target.targetOS in {osLinux, osAndroid} + of "bsd": + result = + conf.target.targetOS in {osNetbsd, osFreebsd, osOpenbsd, osDragonfly, osCrossos} + of "freebsd": + result = conf.target.targetOS in {osFreebsd, osCrossos} + of "emulatedthreadvars": + result = platform.OS[conf.target.targetOS].props.contains(ospLacksThreadVars) + of "msdos": + result = conf.target.targetOS == osDos + of "mswindows", "win32": + result = conf.target.targetOS == osWindows + of "macintosh": + result = conf.target.targetOS in {osMacos, osMacosx, osIos} + of "osx", "macosx": + result = conf.target.targetOS in {osMacosx, osIos} + of "sunos": + result = conf.target.targetOS == osSolaris + of "nintendoswitch": + result = conf.target.targetOS == osNintendoSwitch + of "freertos", "lwip": + result = conf.target.targetOS == osFreeRTOS + of "zephyr": + result = conf.target.targetOS == osZephyr + of "nuttx": + result = conf.target.targetOS == osNuttX + of "littleendian": + result = CPU[conf.target.targetCPU].endian == littleEndian + of "bigendian": + result = CPU[conf.target.targetCPU].endian == bigEndian + of "cpu8": + result = CPU[conf.target.targetCPU].bit == 8 + of "cpu16": + result = CPU[conf.target.targetCPU].bit == 16 + of "cpu32": + result = CPU[conf.target.targetCPU].bit == 32 + of "cpu64": + result = CPU[conf.target.targetCPU].bit == 64 + of "nimrawsetjmp": + result = + conf.target.targetOS in { + osSolaris, osNetbsd, osFreebsd, osOpenbsd, osDragonfly, osMacosx + } + else: + discard + +template quitOrRaise*(conf: ConfigRef; msg = "") = + # xxx in future work, consider whether to also intercept `msgQuit` calls + if conf.isDefined("nimDebug"): + doAssert false, msg + else: + quit(msg) # quits with QuitFailure + +proc importantComments*(conf: ConfigRef): bool {.inline.} = + conf.cmd in cmdDocLike + {cmdIdeTools} + +proc usesWriteBarrier*(conf: ConfigRef): bool {.inline.} = + conf.selectedGC >= gcRefc + +template compilationCachePresent*(conf: ConfigRef): untyped = + false + +# conf.symbolFiles in {v2Sf, writeOnlySf} +template optPreserveOrigSource*(conf: ConfigRef): untyped = + optEmbedOrigSrc in conf.globalOptions + +proc mainCommandArg*(conf: ConfigRef): string = + ## This is intended for commands like check or parse + ## which will work on the main project file unless + ## explicitly given a specific file argument + if conf.commandArgs.len > 0: + result = conf.commandArgs[0] + else: + result = conf.projectName + +proc existsConfigVar*(conf: ConfigRef; key: string): bool = + result = hasKey(conf.configVars, key) + +proc getConfigVar*(conf: ConfigRef; key: string; default = ""): string = + result = conf.configVars.getOrDefault(key, default) + +proc setConfigVar*(conf: ConfigRef; key, val: string) = + conf.configVars[key] = val + +proc getOutFile*(conf: ConfigRef; filename: RelativeFile; ext: string): AbsoluteFile = + # explains regression https://github.com/nim-lang/Nim/issues/6583#issuecomment-625711125 + # Yet another reason why "" should not mean "."; `""/something` should raise + # instead of implying "" == "." as it's bug prone. + doAssert conf.outDir.string.len > 0 + + result = conf.outDir / changeFileExt(filename, ext) + +proc absOutFile*(conf: ConfigRef): AbsoluteFile = + doAssert not conf.outDir.isEmpty + doAssert not conf.outFile.isEmpty + + result = conf.outDir / conf.outFile + when defined(posix): + if dirExists(result.string): + result.string.add ".out" + +proc prepareToWriteOutput*(conf: ConfigRef): AbsoluteFile = + ## Create the output directory and returns a full path to the output file + result = conf.absOutFile + + createDir result.string.parentDir + +proc getPrefixDir*(conf: ConfigRef): AbsoluteDir = + ## Gets the prefix dir, usually the parent directory where the binary resides. + ## + ## This is overridden by some tools (namely nimsuggest) via the ``conf.prefixDir`` + ## field. + ## This should resolve to root of nim sources, whether running nim from a local + ## clone or using installed nim, so that these exist: `result/doc/advopt.txt` + ## and `result/lib/system.nim` + if not conf.prefixDir.isEmpty: + result = conf.prefixDir + else: + let binParent = AbsoluteDir splitPath(getAppDir()).head + when defined(posix): + if binParent == AbsoluteDir"/usr": + result = AbsoluteDir"/usr/lib/nim" + elif binParent == AbsoluteDir"/usr/local": + result = AbsoluteDir"/usr/local/lib/nim" + else: + result = binParent + else: + result = binParent + +proc setDefaultLibpath*(conf: ConfigRef) = + # set default value (can be overwritten): + if conf.libpath.isEmpty: + # choose default libpath: + var prefix = getPrefixDir(conf) + + conf.libpath = prefix / RelativeDir"lib" + + # Special rule to support other tools (nimble) which import the compiler + # modules and make use of them. + let + realNimPath = findExe("nim") + # Find out if $nim/../../lib/system.nim exists. + let + parentNimLibPath = realNimPath.parentDir.parentDir / "lib" + if not fileExists(conf.libpath.string / "system.nim") and fileExists( + parentNimLibPath / "system.nim" + ): + conf.libpath = AbsoluteDir parentNimLibPath + +proc canonicalizePath*(conf: ConfigRef; path: AbsoluteFile): AbsoluteFile = + result = AbsoluteFile path.string.expandFilename + +proc setFromProjectName*(conf: ConfigRef; projectName: string) = + try: + conf.projectFull = canonicalizePath(conf, AbsoluteFile projectName) + except OSError: + conf.projectFull = AbsoluteFile projectName + + let p = splitFile(conf.projectFull) + let dir = + if p.dir.isEmpty: + AbsoluteDir getCurrentDir() + else: + p.dir + + conf.projectPath = AbsoluteDir canonicalizePath(conf, AbsoluteFile dir) + conf.projectName = p.name + +proc removeTrailingDirSep*(path: string): string = + if (path.len > 0) and (path[^1] == DirSep): + result = substr(path, 0, path.len - 2) + else: + result = path + +proc disableNimblePath*(conf: ConfigRef) = + incl conf.globalOptions, optNoNimblePath + + conf.lazyPaths.setLen(0) + conf.nimblePaths.setLen(0) + +proc clearNimblePath*(conf: ConfigRef) = + conf.lazyPaths.setLen(0) + conf.nimblePaths.setLen(0) + +include + packagehandling + +proc getOsCacheDir(): string = + when defined(posix): + result = getEnv("XDG_CACHE_HOME", getHomeDir() / ".cache") / "nim" + else: + result = getHomeDir() / genSubDir.string + +proc getNimcacheDir*(conf: ConfigRef): AbsoluteDir = + proc nimcacheSuffix(conf: ConfigRef): string = + if conf.cmd == cmdCheck: + "_check" + elif isDefined(conf, "release") or isDefined(conf, "danger"): + "_r" + else: + "_d" + + # XXX projectName should always be without a file extension! + result = + if not conf.nimcacheDir.isEmpty: + conf.nimcacheDir + elif conf.backend == backendJs: + if conf.outDir.isEmpty: + conf.projectPath / genSubDir + else: + conf.outDir / genSubDir + else: + AbsoluteDir( + getOsCacheDir() / splitFile(conf.projectName).name & nimcacheSuffix(conf) + ) + +proc pathSubs*(conf: ConfigRef; p, config: string): string = + let home = removeTrailingDirSep(os.getHomeDir()) + + result = + unixToNativePath( + p % [ + "nim", + getPrefixDir(conf).string, + "lib", + conf.libpath.string, + "home", + home, + "config", + config, + "projectname", + conf.projectName, + "projectpath", + conf.projectPath.string, + "projectdir", + conf.projectPath.string, + "nimcache", + getNimcacheDir(conf).string + ] + ).expandTilde + +iterator nimbleSubs*(conf: ConfigRef; p: string): string = + let pl = p.toLowerAscii + if "$nimblepath" in pl or "$nimbledir" in pl: + for i in countdown(conf.nimblePaths.len - 1, 0): + let nimblePath = removeTrailingDirSep(conf.nimblePaths[i].string) + + yield p % ["nimblepath", nimblePath, "nimbledir", nimblePath] + else: + yield p + +proc toGeneratedFile*(conf: ConfigRef; path: AbsoluteFile; ext: string): AbsoluteFile = + ## converts "/home/a/mymodule.nim", "rod" to "/home/a/nimcache/mymodule.rod" + result = + getNimcacheDir(conf) / RelativeFile path.string.splitPath.tail.changeFileExt(ext) + +proc completeGeneratedFilePath*( + conf: ConfigRef; f: AbsoluteFile; createSubDir: bool = true +): AbsoluteFile = + ## Return an absolute path of a generated intermediary file. + ## Optionally creates the cache directory if `createSubDir` is `true`. + let subdir = getNimcacheDir(conf) + if createSubDir: + try: + createDir(subdir.string) + except OSError: + conf.quitOrRaise "cannot create directory: " & subdir.string + + result = subdir / RelativeFile f.string.splitPath.tail + +proc rawFindFile(conf: ConfigRef; f: RelativeFile; suppressStdlib: bool): AbsoluteFile = + for it in conf.searchPaths: + if suppressStdlib and it.string.startsWith(conf.libpath.string): + continue + + result = it / f + if fileExists(result): + return canonicalizePath(conf, result) + + result = AbsoluteFile"" + +proc rawFindFile2(conf: ConfigRef; f: RelativeFile): AbsoluteFile = + for i, it in conf.lazyPaths: + result = it / f + if fileExists(result): + # bring to front + for j in countdown(i, 1): + swap(conf.lazyPaths[j], conf.lazyPaths[j - 1]) + + return canonicalizePath(conf, result) + + result = AbsoluteFile"" + +template patchModule(conf: ConfigRef) {.dirty.} = + if not result.isEmpty and conf.moduleOverrides.len > 0: + let key = getPackageName(conf, result.string) & "_" & splitFile(result).name + if conf.moduleOverrides.hasKey(key): + let ov = conf.moduleOverrides[key] + if ov.len > 0: + result = AbsoluteFile(ov) + +const + stdlibDirs* = + [ + "pure", + "core", + "arch", + "pure/collections", + "pure/concurrency", + "pure/unidecode", + "impure", + "wrappers", + "wrappers/linenoise", + "windows", + "posix", + "js", + "deprecated/pure" + ] +const + pkgPrefix = "pkg/" + stdPrefix = "std/" + +proc getRelativePathFromConfigPath*( + conf: ConfigRef; f: AbsoluteFile; isTitle = false +): RelativeFile = + let f = $f + if isTitle: + for dir in stdlibDirs: + let path = conf.libpath.string / dir / f.lastPathPart + if path.cmpPaths(f) == 0: + return RelativeFile(stdPrefix & f.splitFile.name) + + template search(paths) = + for it in paths: + let it = $it + if f.isRelativeTo(it): + return relativePath(f, it).RelativeFile + + search(conf.searchPaths) + search(conf.lazyPaths) + +proc findFile*(conf: ConfigRef; f: string; suppressStdlib = false): AbsoluteFile = + if f.isAbsolute: + result = + if f.fileExists: + AbsoluteFile(f) + else: + AbsoluteFile"" + else: + result = rawFindFile(conf, RelativeFile f, suppressStdlib) + if result.isEmpty: + result = rawFindFile(conf, RelativeFile f.toLowerAscii, suppressStdlib) + if result.isEmpty: + result = rawFindFile2(conf, RelativeFile f) + if result.isEmpty: + result = rawFindFile2(conf, RelativeFile f.toLowerAscii) + + patchModule(conf) + +proc findModule*(conf: ConfigRef; modulename, currentModule: string): AbsoluteFile = + # returns path to module + var m = addFileExt(modulename, NimExt) + var hasRelativeDot = false + if m.startsWith(pkgPrefix): + result = findFile(conf, m.substr(pkgPrefix.len), suppressStdlib = true) + else: + if m.startsWith(stdPrefix): + let stripped = m.substr(stdPrefix.len) + for candidate in stdlibDirs: + let path = (conf.libpath.string / candidate / stripped) + if fileExists(path): + result = AbsoluteFile path + + break + else: # If prefixed with std/ why would we add the current module path! + let currentPath = currentModule.splitFile.dir + + result = AbsoluteFile currentPath / m + if m.startsWith('.') and not fileExists(result): + result = AbsoluteFile "" + hasRelativeDot = true + if not fileExists(result) and not hasRelativeDot: + result = findFile(conf, m) + + patchModule(conf) + +proc findProjectNimFile*(conf: ConfigRef; pkg: string): string = + const + extensions = [".nims", ".cfg", ".nimcfg", ".nimble"] + + var + candidates: seq[string] = @[] + dir = pkg + prev = dir + nimblepkg = "" + + let pkgname = pkg.lastPathPart() + while true: + for k, f in os.walkDir(dir, relative = true): + if k == pcFile and f != "config.nims": + let (_, name, ext) = splitFile(f) + if ext in extensions: + let x = changeFileExt(dir / name, ".nim") + if fileExists(x): + candidates.add x + if ext == ".nimble": + if nimblepkg.len == 0: + nimblepkg = name + # Since nimble packages can have their source in a subfolder, + # check the last folder we were in for a possible match. + if dir != prev: + let x = prev / x.extractFilename() + if fileExists(x): + candidates.add x + else: + # If we found more than one nimble file, chances are that we + # missed the real project file, or this is an invalid nimble + # package. Either way, bailing is the better choice. + return "" + + let pkgname = + if nimblepkg.len > 0: + nimblepkg + else: + pkgname + for c in candidates: + if pkgname in c.extractFilename(): + return c + if candidates.len > 0: + return candidates[0] + + prev = dir + dir = parentDir(dir) + if dir == "": + break + + return "" + +proc canonicalImportAux*(conf: ConfigRef; file: AbsoluteFile): string = + ##[ + Shows the canonical module import, e.g.: + system, std/tables, fusion/pointers, system/assertions, std/private/asciitables + ]## + var ret = getRelativePathFromConfigPath(conf, file, isTitle = true) + + let dir = getNimbleFile(conf, $file).parentDir.AbsoluteDir + if not dir.isEmpty: + let relPath = relativeTo(file, dir) + if not relPath.isEmpty and (ret.isEmpty or relPath.string.len < ret.string.len): + ret = relPath + if ret.isEmpty: + ret = relativeTo(file, conf.projectPath) + + result = ret.string + +proc canonicalImport*(conf: ConfigRef; file: AbsoluteFile): string = + let ret = canonicalImportAux(conf, file) + + result = ret.nativeToUnixPath.changeFileExt("") + +proc canonDynlibName(s: string): string = + let start = + if s.startsWith("lib"): + 3 + else: + 0 + let ende = strutils.find(s, {'(', ')', '.'}) + if ende >= 0: + result = s.substr(start, ende - 1) + else: + result = s.substr(start) + +proc inclDynlibOverride*(conf: ConfigRef; lib: string) = + conf.dllOverrides[lib.canonDynlibName] = "true" + +proc isDynlibOverride*(conf: ConfigRef; lib: string): bool = + result = + optDynlibOverrideAll in conf.globalOptions or conf.dllOverrides.hasKey( + lib.canonDynlibName + ) + +proc showNonExportedFields*(conf: ConfigRef) = + incl(conf.globalOptions, optShowNonExportedFields) + +proc expandDone*(conf: ConfigRef): bool = + result = conf.ideCmd == ideExpand and conf.expandLevels == 0 and conf.expandProgress + +proc parseIdeCmd*(s: string): IdeCmd = + case s + of "sug": + ideSug + of "con": + ideCon + of "def": + ideDef + of "use": + ideUse + of "dus": + ideDus + of "chk": + ideChk + of "chkFile": + ideChkFile + of "mod": + ideMod + of "highlight": + ideHighlight + of "outline": + ideOutline + of "known": + ideKnown + of "msg": + ideMsg + of "project": + ideProject + of "globalSymbols": + ideGlobalSymbols + of "recompile": + ideRecompile + of "changed": + ideChanged + of "type": + ideType + else: + ideNone + +proc `$`*(c: IdeCmd): string = + case c + of ideSug: + "sug" + of ideCon: + "con" + of ideDef: + "def" + of ideUse: + "use" + of ideDus: + "dus" + of ideChk: + "chk" + of ideChkFile: + "chkFile" + of ideMod: + "mod" + of ideNone: + "none" + of ideHighlight: + "highlight" + of ideOutline: + "outline" + of ideKnown: + "known" + of ideMsg: + "msg" + of ideProject: + "project" + of ideGlobalSymbols: + "globalSymbols" + of ideDeclaration: + "declaration" + of ideExpand: + "expand" + of ideRecompile: + "recompile" + of ideChanged: + "changed" + of ideType: + "type" + +proc floatInt64Align*(conf: ConfigRef): int16 = + ## Returns either 4 or 8 depending on reasons. + if conf != nil and conf.target.targetCPU == cpuI386: + #on Linux/BSD i386, double are aligned to 4bytes (except with -malign-double) + if conf.target.targetOS != osWindows: + # on i386 for all known POSIX systems, 64bits ints are aligned + # to 4bytes (except with -malign-double) + return 4 + + return 8 diff --git a/src/phoptions.nim.nimph.yaml b/src/phoptions.nim.nimph.yaml new file mode 100644 index 0000000..be9dd6a --- /dev/null +++ b/src/phoptions.nim.nimph.yaml @@ -0,0 +1,25131 @@ +{ + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# nimph" + }, + { + "kind": "nkCommentStmt", + "comment": "# (c) Copyright 2023 Jacek Sieka" + }, + { + "kind": "nkCommentStmt", + "comment": "# The Nim compiler" + }, + { + "kind": "nkCommentStmt", + "comment": "# (c) Copyright 2018 Andreas Rumpf" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# See the file \"copying.txt\", included in this" + }, + { + "kind": "nkCommentStmt", + "comment": "# distribution, for details about the copyright." + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "os" + }, + { + "kind": "nkIdent", + "ident": "strutils" + }, + { + "kind": "nkIdent", + "ident": "strtabs" + }, + { + "kind": "nkIdent", + "ident": "sets" + }, + { + "kind": "nkIdent", + "ident": "platform" + }, + { + "kind": "nkIdent", + "ident": "prefixmatches" + }, + { + "kind": "nkIdent", + "ident": "pathutils" + }, + { + "kind": "nkIdent", + "ident": "nimpaths" + }, + { + "kind": "nkIdent", + "ident": "tables" + } + ] + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "phlineinfos" + } + ] + }, + { + "kind": "nkFromStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "terminal" + }, + { + "kind": "nkIdent", + "ident": "isatty" + } + ] + }, + { + "kind": "nkFromStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "times" + }, + { + "kind": "nkIdent", + "ident": "utc" + }, + { + "kind": "nkIdent", + "ident": "fromUnix" + }, + { + "kind": "nkIdent", + "ident": "local" + }, + { + "kind": "nkIdent", + "ident": "getTime" + }, + { + "kind": "nkIdent", + "ident": "format" + }, + { + "kind": "nkIdent", + "ident": "DateTime" + } + ] + }, + { + "kind": "nkFromStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkIdent", + "ident": "std" + }, + { + "kind": "nkIdent", + "ident": "private" + } + ] + }, + { + "kind": "nkIdent", + "ident": "globs" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nativeToUnixPath" + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "nimPreviewSlimSystem" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkIdent", + "ident": "std" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "syncio" + }, + { + "kind": "nkIdent", + "ident": "assertions" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "hasTinyCBackend" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "tinyc" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "useEffectSystem" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "useWriteTracking" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "hasFFI" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "nimHasLibFFI" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "copyrightYear" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "2023" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nimEnableCovariance" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "nimEnableCovariance" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# please make sure we have under 32 options\", line: 31, col: 2, offsetA: 783, offsetB: 826)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# (improves code efficiency a lot!)\", line: 32, col: 2, offsetA: 829, offsetB: 864)" + ], + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TOption" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# **keep binary compatible**\", line: 33, col: 18, offsetA: 883, offsetB: 911)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "optNone" + }, + { + "kind": "nkIdent", + "ident": "optObjCheck" + }, + { + "kind": "nkIdent", + "ident": "optFieldCheck" + }, + { + "kind": "nkIdent", + "ident": "optRangeCheck" + }, + { + "kind": "nkIdent", + "ident": "optBoundsCheck" + }, + { + "kind": "nkIdent", + "ident": "optOverflowCheck" + }, + { + "kind": "nkIdent", + "ident": "optRefCheck" + }, + { + "kind": "nkIdent", + "ident": "optNaNCheck" + }, + { + "kind": "nkIdent", + "ident": "optInfCheck" + }, + { + "kind": "nkIdent", + "ident": "optStaticBoundsCheck" + }, + { + "kind": "nkIdent", + "ident": "optStyleCheck" + }, + { + "kind": "nkIdent", + "ident": "optAssert" + }, + { + "kind": "nkIdent", + "ident": "optLineDir" + }, + { + "kind": "nkIdent", + "ident": "optWarns" + }, + { + "kind": "nkIdent", + "ident": "optHints" + }, + { + "kind": "nkIdent", + "ident": "optOptimizeSpeed" + }, + { + "kind": "nkIdent", + "ident": "optOptimizeSize" + }, + { + "kind": "nkIdent", + "ident": "optStackTrace", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# stack tracing support\", line: 51, col: 18, offsetA: 1221, offsetB: 1244)" + ] + }, + { + "kind": "nkIdent", + "ident": "optStackTraceMsgs", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# enable custom runtime msgs via `setFrameMsg`\", line: 52, col: 22, offsetA: 1267, offsetB: 1313)" + ] + }, + { + "kind": "nkIdent", + "ident": "optLineTrace", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# line tracing support (includes stack tracing)\", line: 53, col: 17, offsetA: 1331, offsetB: 1378)" + ] + }, + { + "kind": "nkIdent", + "ident": "optByRef", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# use pass by ref for objects\", line: 55, col: 6, offsetA: 1398, offsetB: 1427)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# (for interfacing with C)\", line: 56, col: 6, offsetA: 1434, offsetB: 1460)" + ] + }, + { + "kind": "nkIdent", + "ident": "optProfiler", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# profiler turned on\", line: 57, col: 16, offsetA: 1477, offsetB: 1497)" + ] + }, + { + "kind": "nkIdent", + "ident": "optImplicitStatic", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# optimization: implicit at compile time\", line: 59, col: 6, offsetA: 1526, offsetB: 1566)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# evaluation\", line: 60, col: 6, offsetA: 1573, offsetB: 1585)" + ] + }, + { + "kind": "nkIdent", + "ident": "optTrMacros", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# en/disable pattern matching\", line: 61, col: 16, offsetA: 1602, offsetB: 1631)" + ] + }, + { + "kind": "nkIdent", + "ident": "optMemTracker" + }, + { + "kind": "nkIdent", + "ident": "optSinkInference", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \\\'sink T\\\' inference\", line: 63, col: 21, offsetA: 1671, offsetB: 1691)" + ] + }, + { + "kind": "nkIdent", + "ident": "optCursorInference" + }, + { + "kind": "nkIdent", + "ident": "optImportHidden" + }, + { + "kind": "nkIdent", + "ident": "optQuirky" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TOptions" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "TOption" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TGlobalOption" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "gloptNone" + }, + { + "kind": "nkIdent", + "ident": "optForceFullMake" + }, + { + "kind": "nkIdent", + "ident": "optWasNimscript", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# redundant with `cmdNimscript`, could be removed\", line: 72, col: 20, offsetA: 1856, offsetB: 1905)" + ] + }, + { + "kind": "nkIdent", + "ident": "optListCmd" + }, + { + "kind": "nkIdent", + "ident": "optCompileOnly" + }, + { + "kind": "nkIdent", + "ident": "optNoLinking" + }, + { + "kind": "nkIdent", + "ident": "optCDebug", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# turn on debugging information\", line: 76, col: 14, offsetA: 1971, offsetB: 2002)" + ] + }, + { + "kind": "nkIdent", + "ident": "optGenDynLib", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# generate a dynamic library\", line: 77, col: 17, offsetA: 2020, offsetB: 2048)" + ] + }, + { + "kind": "nkIdent", + "ident": "optGenStaticLib", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# generate a static library\", line: 78, col: 20, offsetA: 2069, offsetB: 2096)" + ] + }, + { + "kind": "nkIdent", + "ident": "optGenGuiApp", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# generate a GUI application\", line: 79, col: 17, offsetA: 2114, offsetB: 2142)" + ] + }, + { + "kind": "nkIdent", + "ident": "optGenScript", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# generate a script file to compile the *.c files\", line: 80, col: 17, offsetA: 2160, offsetB: 2209)" + ] + }, + { + "kind": "nkIdent", + "ident": "optGenCDeps", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# generate a list of *.c files to be read by CMake\", line: 81, col: 16, offsetA: 2226, offsetB: 2276)" + ] + }, + { + "kind": "nkIdent", + "ident": "optGenMapping", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# generate a mapping file\", line: 82, col: 18, offsetA: 2295, offsetB: 2320)" + ] + }, + { + "kind": "nkIdent", + "ident": "optRun", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# run the compiled project\", line: 83, col: 11, offsetA: 2332, offsetB: 2358)" + ] + }, + { + "kind": "nkIdent", + "ident": "optUseNimcache", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# save artifacts (including binary) in $nimcache\", line: 84, col: 19, offsetA: 2378, offsetB: 2426)" + ] + }, + { + "kind": "nkIdent", + "ident": "optStyleHint", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# check that the names adhere to NEP-1\", line: 85, col: 17, offsetA: 2444, offsetB: 2482)" + ] + }, + { + "kind": "nkIdent", + "ident": "optStyleError", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# enforce that the names adhere to NEP-1\", line: 86, col: 18, offsetA: 2501, offsetB: 2541)" + ] + }, + { + "kind": "nkIdent", + "ident": "optStyleUsages", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# only enforce consistent **usages** of the symbol\", line: 87, col: 19, offsetA: 2561, offsetB: 2611)" + ] + }, + { + "kind": "nkIdent", + "ident": "optSkipSystemConfigFile", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip the system\\\'s cfg/nims config file\", line: 88, col: 28, offsetA: 2640, offsetB: 2680)" + ] + }, + { + "kind": "nkIdent", + "ident": "optSkipProjConfigFile", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip the project\\\'s cfg/nims config file\", line: 89, col: 26, offsetA: 2707, offsetB: 2748)" + ] + }, + { + "kind": "nkIdent", + "ident": "optSkipUserConfigFile", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip the users\\\'s cfg/nims config file\", line: 90, col: 26, offsetA: 2775, offsetB: 2814)" + ] + }, + { + "kind": "nkIdent", + "ident": "optSkipParentConfigFiles", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip parent dir\\\'s cfg/nims config files\", line: 91, col: 29, offsetA: 2844, offsetB: 2885)" + ] + }, + { + "kind": "nkIdent", + "ident": "optNoMain", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# do not generate a \\\"main\\\" proc\", line: 92, col: 14, offsetA: 2900, offsetB: 2931)" + ] + }, + { + "kind": "nkIdent", + "ident": "optUseColors", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# use colors for hints, warnings, and errors\", line: 93, col: 17, offsetA: 2949, offsetB: 2993)" + ] + }, + { + "kind": "nkIdent", + "ident": "optThreads", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# support for multi-threading\", line: 94, col: 15, offsetA: 3009, offsetB: 3038)" + ] + }, + { + "kind": "nkIdent", + "ident": "optStdout", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# output to stdout\", line: 95, col: 14, offsetA: 3053, offsetB: 3071)" + ] + }, + { + "kind": "nkIdent", + "ident": "optThreadAnalysis", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# thread analysis pass\", line: 96, col: 22, offsetA: 3094, offsetB: 3116)" + ] + }, + { + "kind": "nkIdent", + "ident": "optTlsEmulation", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# thread var emulation turned on\", line: 97, col: 20, offsetA: 3137, offsetB: 3169)" + ] + }, + { + "kind": "nkIdent", + "ident": "optGenIndex", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# generate index file for documentation;\", line: 98, col: 16, offsetA: 3186, offsetB: 3226)" + ] + }, + { + "kind": "nkIdent", + "ident": "optGenIndexOnly", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# generate only index file for documentation\", line: 99, col: 20, offsetA: 3247, offsetB: 3291)" + ] + }, + { + "kind": "nkIdent", + "ident": "optNoImportdoc", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# disable loading external documentation files\", line: 100, col: 19, offsetA: 3311, offsetB: 3357)" + ] + }, + { + "kind": "nkIdent", + "ident": "optEmbedOrigSrc", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# embed the original source in the generated code\", line: 102, col: 6, offsetA: 3384, offsetB: 3433)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# also: generate header file\", line: 103, col: 6, offsetA: 3440, offsetB: 3468)" + ] + }, + { + "kind": "nkIdent", + "ident": "optIdeDebug", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# idetools: debug mode\", line: 104, col: 16, offsetA: 3485, offsetB: 3507)" + ] + }, + { + "kind": "nkIdent", + "ident": "optIdeTerse", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# idetools: use terse descriptions\", line: 105, col: 16, offsetA: 3524, offsetB: 3558)" + ] + }, + { + "kind": "nkIdent", + "ident": "optExcessiveStackTrace", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# fully qualified module filenames\", line: 106, col: 27, offsetA: 3586, offsetB: 3620)" + ] + }, + { + "kind": "nkIdent", + "ident": "optShowAllMismatches", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# show all overloading resolution candidates\", line: 107, col: 25, offsetA: 3646, offsetB: 3690)" + ] + }, + { + "kind": "nkIdent", + "ident": "optWholeProject", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for \\\'doc\\\': output any dependency\", line: 108, col: 20, offsetA: 3711, offsetB: 3745)" + ] + }, + { + "kind": "nkIdent", + "ident": "optDocInternal", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# generate documentation for non-exported symbols\", line: 109, col: 19, offsetA: 3765, offsetB: 3814)" + ] + }, + { + "kind": "nkIdent", + "ident": "optMixedMode", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# true if some module triggered C++ codegen\", line: 110, col: 17, offsetA: 3832, offsetB: 3875)" + ] + }, + { + "kind": "nkIdent", + "ident": "optDeclaredLocs", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# show declaration locations in messages\", line: 111, col: 20, offsetA: 3896, offsetB: 3936)" + ] + }, + { + "kind": "nkIdent", + "ident": "optNoNimblePath" + }, + { + "kind": "nkIdent", + "ident": "optHotCodeReloading" + }, + { + "kind": "nkIdent", + "ident": "optDynlibOverrideAll" + }, + { + "kind": "nkIdent", + "ident": "optSeqDestructors", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# active if the implementation uses the new\", line: 116, col: 6, offsetA: 4034, offsetB: 4077)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# string/seq implementation based on destructors\", line: 117, col: 6, offsetA: 4084, offsetB: 4132)" + ] + }, + { + "kind": "nkIdent", + "ident": "optTinyRtti", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# active if we use the new \\\"tiny RTTI\\\"\", line: 119, col: 6, offsetA: 4155, offsetB: 4193)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# implementation\", line: 120, col: 6, offsetA: 4200, offsetB: 4216)" + ] + }, + { + "kind": "nkIdent", + "ident": "optOwnedRefs", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# active if the Nim compiler knows about \\\'owned\\\'.\", line: 121, col: 17, offsetA: 4234, offsetB: 4283)" + ] + }, + { + "kind": "nkIdent", + "ident": "optMultiMethods" + }, + { + "kind": "nkIdent", + "ident": "optBenchmarkVM", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Enables cpuTime() in the VM\", line: 123, col: 19, offsetA: 4323, offsetB: 4352)" + ] + }, + { + "kind": "nkIdent", + "ident": "optProduceAsm", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# produce assembler code\", line: 124, col: 18, offsetA: 4371, offsetB: 4395)" + ] + }, + { + "kind": "nkIdent", + "ident": "optPanics", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# turn panics (sysFatal) into a process termination\", line: 125, col: 14, offsetA: 4410, offsetB: 4461)" + ] + }, + { + "kind": "nkIdent", + "ident": "optSourcemap" + }, + { + "kind": "nkIdent", + "ident": "optProfileVM", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# enable VM profiler\", line: 127, col: 17, offsetA: 4496, offsetB: 4516)" + ] + }, + { + "kind": "nkIdent", + "ident": "optEnableDeepCopy", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ORC specific: enable \\\'deepcopy\\\' for all types.\", line: 128, col: 22, offsetA: 4539, offsetB: 4587)" + ] + }, + { + "kind": "nkIdent", + "ident": "optShowNonExportedFields", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for documentation: show fields that are not exported\", line: 129, col: 29, offsetA: 4617, offsetB: 4671)" + ] + }, + { + "kind": "nkIdent", + "ident": "optJsBigInt64", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# use bigints for 64-bit integers in JS\", line: 130, col: 18, offsetA: 4690, offsetB: 4729)" + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TGlobalOptions" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "TGlobalOption" + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "harmlessOptions" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "optForceFullMake" + }, + { + "kind": "nkIdent", + "ident": "optNoLinking" + }, + { + "kind": "nkIdent", + "ident": "optRun" + }, + { + "kind": "nkIdent", + "ident": "optUseColors" + }, + { + "kind": "nkIdent", + "ident": "optStdout" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "genSubDir" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "RelativeDir" + }, + { + "kind": "nkRStrLit", + "strVal": "nimcache" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "NimExt" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "nim" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "RodExt" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "rod" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "HtmlExt" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "html" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "JsonExt" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "json" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TagsExt" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "tags" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TexExt" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "tex" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "IniExt" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "ini" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "DefaultConfig" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "RelativeFile" + }, + { + "kind": "nkRStrLit", + "strVal": "nim.cfg" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "DefaultConfigNims" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "RelativeFile" + }, + { + "kind": "nkRStrLit", + "strVal": "config.nims" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "DocConfig" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "RelativeFile" + }, + { + "kind": "nkRStrLit", + "strVal": "nimdoc.cfg" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "DocTexConfig" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "RelativeFile" + }, + { + "kind": "nkRStrLit", + "strVal": "nimdoc.tex.cfg" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "htmldocsDir" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "htmldocsDirname" + }, + { + "kind": "nkIdent", + "ident": "RelativeDir" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "docRootDefault" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "@default" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# using `@` instead of `$` to avoid shell quoting complications\", line: 149, col: 31, offsetA: 5286, offsetB: 5349)" + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "oKeepVariableNames" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "spellSuggestSecretSauce" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TBackend" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "backendInvalid" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for parseEnum\", line: 155, col: 24, offsetA: 5460, offsetB: 5475)" + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "backendC" + }, + { + "kind": "nkStrLit", + "strVal": "c" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "backendCpp" + }, + { + "kind": "nkStrLit", + "strVal": "cpp" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "backendJs" + }, + { + "kind": "nkStrLit", + "strVal": "js" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "backendObjc" + }, + { + "kind": "nkStrLit", + "strVal": "objc" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# backendNimscript = \\\"nimscript\\\" # this could actually work\", line: 160, col: 6, offsetA: 5570, offsetB: 5629)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# backendLlvm = \\\"llvm\\\" # probably not well supported; was cmdCompileToLLVM\", line: 161, col: 6, offsetA: 5636, offsetB: 5710)" + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "Command" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Nim\\\'s commands\", line: 163, col: 18, offsetA: 5730, offsetB: 5747)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "cmdNone", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# not yet processed command\", line: 164, col: 12, offsetA: 5760, offsetB: 5787)" + ] + }, + { + "kind": "nkIdent", + "ident": "cmdUnknown", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# command unmapped\", line: 165, col: 15, offsetA: 5803, offsetB: 5821)" + ] + }, + { + "kind": "nkIdent", + "ident": "cmdCompileToC" + }, + { + "kind": "nkIdent", + "ident": "cmdCompileToCpp" + }, + { + "kind": "nkIdent", + "ident": "cmdCompileToOC" + }, + { + "kind": "nkIdent", + "ident": "cmdCompileToJS" + }, + { + "kind": "nkIdent", + "ident": "cmdCrun", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# compile and run in nimache\", line: 170, col: 12, offsetA: 5910, offsetB: 5938)" + ] + }, + { + "kind": "nkIdent", + "ident": "cmdTcc", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# run the project via TCC backend\", line: 171, col: 11, offsetA: 5950, offsetB: 5983)" + ] + }, + { + "kind": "nkIdent", + "ident": "cmdCheck", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# semantic checking for whole project\", line: 172, col: 13, offsetA: 5997, offsetB: 6034)" + ] + }, + { + "kind": "nkIdent", + "ident": "cmdParse", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# parse a single file (for debugging)\", line: 173, col: 13, offsetA: 6048, offsetB: 6085)" + ] + }, + { + "kind": "nkIdent", + "ident": "cmdRod", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# .rod to some text representation (for debugging)\", line: 174, col: 11, offsetA: 6097, offsetB: 6147)" + ] + }, + { + "kind": "nkIdent", + "ident": "cmdIdeTools", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ide tools (e.g. nimsuggest)\", line: 175, col: 16, offsetA: 6164, offsetB: 6193)" + ] + }, + { + "kind": "nkIdent", + "ident": "cmdNimscript", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# evaluate nimscript\", line: 176, col: 17, offsetA: 6211, offsetB: 6231)" + ] + }, + { + "kind": "nkIdent", + "ident": "cmdDoc0" + }, + { + "kind": "nkIdent", + "ident": "cmdDoc", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# convert .nim doc comments to HTML\", line: 178, col: 11, offsetA: 6255, offsetB: 6290)" + ] + }, + { + "kind": "nkIdent", + "ident": "cmdDoc2tex", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# convert .nim doc comments to LaTeX\", line: 179, col: 15, offsetA: 6306, offsetB: 6342)" + ] + }, + { + "kind": "nkIdent", + "ident": "cmdRst2html", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# convert a reStructuredText file to HTML\", line: 180, col: 16, offsetA: 6359, offsetB: 6400)" + ] + }, + { + "kind": "nkIdent", + "ident": "cmdRst2tex", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# convert a reStructuredText file to TeX\", line: 181, col: 15, offsetA: 6416, offsetB: 6456)" + ] + }, + { + "kind": "nkIdent", + "ident": "cmdMd2html", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# convert a Markdown file to HTML\", line: 182, col: 15, offsetA: 6472, offsetB: 6505)" + ] + }, + { + "kind": "nkIdent", + "ident": "cmdMd2tex", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# convert a Markdown file to TeX\", line: 183, col: 14, offsetA: 6520, offsetB: 6552)" + ] + }, + { + "kind": "nkIdent", + "ident": "cmdJsondoc0" + }, + { + "kind": "nkIdent", + "ident": "cmdJsondoc" + }, + { + "kind": "nkIdent", + "ident": "cmdCtags" + }, + { + "kind": "nkIdent", + "ident": "cmdBuildindex" + }, + { + "kind": "nkIdent", + "ident": "cmdGendepend" + }, + { + "kind": "nkIdent", + "ident": "cmdDump" + }, + { + "kind": "nkIdent", + "ident": "cmdInteractive", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# start interactive session\", line: 190, col: 19, offsetA: 6663, offsetB: 6690)" + ] + }, + { + "kind": "nkIdent", + "ident": "cmdNop" + }, + { + "kind": "nkIdent", + "ident": "cmdJsonscript", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# compile a .json build file\", line: 193, col: 6, offsetA: 6726, offsetB: 6754)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# old unused: cmdInterpret, cmdDef: def feature (find definition for IDEs)\", line: 194, col: 6, offsetA: 6761, offsetB: 6835)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "cmdBackends" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "cmdCompileToC" + }, + { + "kind": "nkIdent", + "ident": "cmdCompileToCpp" + }, + { + "kind": "nkIdent", + "ident": "cmdCompileToOC" + }, + { + "kind": "nkIdent", + "ident": "cmdCompileToJS" + }, + { + "kind": "nkIdent", + "ident": "cmdCrun" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "cmdDocLike" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "cmdDoc0" + }, + { + "kind": "nkIdent", + "ident": "cmdDoc" + }, + { + "kind": "nkIdent", + "ident": "cmdDoc2tex" + }, + { + "kind": "nkIdent", + "ident": "cmdJsondoc0" + }, + { + "kind": "nkIdent", + "ident": "cmdJsondoc" + }, + { + "kind": "nkIdent", + "ident": "cmdCtags" + }, + { + "kind": "nkIdent", + "ident": "cmdBuildindex" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "NimVer" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkTupleTy", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "major" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "minor" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "patch" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TStringSeq" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TGCMode" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the selected GC\", line: 205, col: 18, offsetA: 7144, offsetB: 7161)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcUnselected" + }, + { + "kind": "nkStrLit", + "strVal": "unselected" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcNone" + }, + { + "kind": "nkStrLit", + "strVal": "none" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcBoehm" + }, + { + "kind": "nkStrLit", + "strVal": "boehm" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcRegions" + }, + { + "kind": "nkStrLit", + "strVal": "regions" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcArc" + }, + { + "kind": "nkStrLit", + "strVal": "arc" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcOrc" + }, + { + "kind": "nkStrLit", + "strVal": "orc" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcAtomicArc" + }, + { + "kind": "nkStrLit", + "strVal": "atomicArc" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcMarkAndSweep" + }, + { + "kind": "nkStrLit", + "strVal": "markAndSweep" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcHooks" + }, + { + "kind": "nkStrLit", + "strVal": "hooks" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcRefc" + }, + { + "kind": "nkStrLit", + "strVal": "refc" + } + ] + }, + { + "kind": "nkEnumFieldDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcGo" + }, + { + "kind": "nkStrLit", + "strVal": "go" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# gcRefc and the GCs that follow it use a write barrier,\", line: 217, col: 6, offsetA: 7428, offsetB: 7484)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# as far as usesWriteBarrier() is concerned\", line: 218, col: 6, offsetA: 7491, offsetB: 7534)" + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "IdeCmd" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "ideNone" + }, + { + "kind": "nkIdent", + "ident": "ideSug" + }, + { + "kind": "nkIdent", + "ident": "ideCon" + }, + { + "kind": "nkIdent", + "ident": "ideDef" + }, + { + "kind": "nkIdent", + "ident": "ideUse" + }, + { + "kind": "nkIdent", + "ident": "ideDus" + }, + { + "kind": "nkIdent", + "ident": "ideChk" + }, + { + "kind": "nkIdent", + "ident": "ideChkFile" + }, + { + "kind": "nkIdent", + "ident": "ideMod" + }, + { + "kind": "nkIdent", + "ident": "ideHighlight" + }, + { + "kind": "nkIdent", + "ident": "ideOutline" + }, + { + "kind": "nkIdent", + "ident": "ideKnown" + }, + { + "kind": "nkIdent", + "ident": "ideMsg" + }, + { + "kind": "nkIdent", + "ident": "ideProject" + }, + { + "kind": "nkIdent", + "ident": "ideGlobalSymbols" + }, + { + "kind": "nkIdent", + "ident": "ideRecompile" + }, + { + "kind": "nkIdent", + "ident": "ideChanged" + }, + { + "kind": "nkIdent", + "ident": "ideType" + }, + { + "kind": "nkIdent", + "ident": "ideDeclaration" + }, + { + "kind": "nkIdent", + "ident": "ideExpand" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "Feature" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## experimental features; DO NOT RENAME THESE!\", line: 242, col: 18, offsetA: 7845, offsetB: 7891)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "dotOperators" + }, + { + "kind": "nkIdent", + "ident": "callOperator" + }, + { + "kind": "nkIdent", + "ident": "parallel" + }, + { + "kind": "nkIdent", + "ident": "destructor" + }, + { + "kind": "nkIdent", + "ident": "notnil" + }, + { + "kind": "nkIdent", + "ident": "dynamicBindSym" + }, + { + "kind": "nkIdent", + "ident": "forLoopMacros", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# not experimental anymore; remains here for backwards compatibility\", line: 249, col: 18, offsetA: 8002, offsetB: 8070)" + ] + }, + { + "kind": "nkIdent", + "ident": "caseStmtMacros", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ditto\", line: 250, col: 19, offsetA: 8090, offsetB: 8097)" + ] + }, + { + "kind": "nkIdent", + "ident": "codeReordering" + }, + { + "kind": "nkIdent", + "ident": "compiletimeFFI", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## This requires building nim with `-d:nimHasLibFFI`\", line: 253, col: 6, offsetA: 8142, offsetB: 8194)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## which itself requires `nimble install libffi`, see #10150\", line: 254, col: 6, offsetA: 8201, offsetB: 8261)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Note: this feature can\\\'t be localized with {.push.}\", line: 255, col: 6, offsetA: 8268, offsetB: 8322)" + ] + }, + { + "kind": "nkIdent", + "ident": "vmopsDanger" + }, + { + "kind": "nkIdent", + "ident": "strictFuncs" + }, + { + "kind": "nkIdent", + "ident": "views" + }, + { + "kind": "nkIdent", + "ident": "strictNotNil" + }, + { + "kind": "nkIdent", + "ident": "overloadableEnums", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# deadcode\", line: 260, col: 22, offsetA: 8404, offsetB: 8414)" + ] + }, + { + "kind": "nkIdent", + "ident": "strictEffects" + }, + { + "kind": "nkIdent", + "ident": "unicodeOperators", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# deadcode\", line: 262, col: 21, offsetA: 8454, offsetB: 8464)" + ] + }, + { + "kind": "nkIdent", + "ident": "flexibleOptionalParams" + }, + { + "kind": "nkIdent", + "ident": "strictDefs" + }, + { + "kind": "nkIdent", + "ident": "strictCaseObjects" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "LegacyFeature" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "allowSemcheckedAstModification", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Allows to modify a NimNode where the type has already been\", line: 269, col: 6, offsetA: 8595, offsetB: 8656)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## flagged with nfSem. If you actually do this, it will cause\", line: 270, col: 6, offsetA: 8663, offsetB: 8724)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## bugs.\", line: 271, col: 6, offsetA: 8731, offsetB: 8739)" + ] + }, + { + "kind": "nkIdent", + "ident": "checkUnsignedConversions", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Historically and especially in version 1.0.0 of the language\", line: 273, col: 6, offsetA: 8775, offsetB: 8838)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## conversions to unsigned numbers were checked. In 1.0.4 they\", line: 274, col: 6, offsetA: 8845, offsetB: 8907)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## are not anymore.\", line: 275, col: 6, offsetA: 8914, offsetB: 8933)" + ] + }, + { + "kind": "nkIdent", + "ident": "laxEffects", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Lax effects system prior to Nim 2.0.\", line: 276, col: 15, offsetA: 8949, offsetB: 8988)" + ] + }, + { + "kind": "nkIdent", + "ident": "verboseTypeMismatch" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "SymbolFilesOption" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "disabledSf" + }, + { + "kind": "nkIdent", + "ident": "writeOnlySf" + }, + { + "kind": "nkIdent", + "ident": "readOnlySf" + }, + { + "kind": "nkIdent", + "ident": "v2Sf" + }, + { + "kind": "nkIdent", + "ident": "stressTest" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TSystemCC" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "ccNone" + }, + { + "kind": "nkIdent", + "ident": "ccGcc" + }, + { + "kind": "nkIdent", + "ident": "ccNintendoSwitch" + }, + { + "kind": "nkIdent", + "ident": "ccLLVM_Gcc" + }, + { + "kind": "nkIdent", + "ident": "ccCLang" + }, + { + "kind": "nkIdent", + "ident": "ccBcc" + }, + { + "kind": "nkIdent", + "ident": "ccVcc" + }, + { + "kind": "nkIdent", + "ident": "ccTcc" + }, + { + "kind": "nkIdent", + "ident": "ccEnv" + }, + { + "kind": "nkIdent", + "ident": "ccIcl" + }, + { + "kind": "nkIdent", + "ident": "ccIcc" + }, + { + "kind": "nkIdent", + "ident": "ccClangCl" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "ExceptionSystem" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "excNone", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# no exception system selected yet\", line: 301, col: 12, offsetA: 9315, offsetB: 9349)" + ] + }, + { + "kind": "nkIdent", + "ident": "excSetjmp", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# setjmp based exception handling\", line: 302, col: 14, offsetA: 9364, offsetB: 9397)" + ] + }, + { + "kind": "nkIdent", + "ident": "excCpp", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# use C++\\\'s native exception handling\", line: 303, col: 11, offsetA: 9409, offsetB: 9446)" + ] + }, + { + "kind": "nkIdent", + "ident": "excGoto", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# exception handling based on goto (should become the new default for C)\", line: 304, col: 12, offsetA: 9459, offsetB: 9531)" + ] + }, + { + "kind": "nkIdent", + "ident": "excQuirky", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# quirky exception handling\", line: 305, col: 14, offsetA: 9546, offsetB: 9573)" + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPragmaExpr", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "CfileFlag" + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "pure" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "Cached", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## no need to recompile this time\", line: 308, col: 11, offsetA: 9615, offsetB: 9648)" + ] + }, + { + "kind": "nkIdent", + "ident": "External", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## file was introduced via .compile pragma\", line: 309, col: 13, offsetA: 9662, offsetB: 9704)" + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "Cfile" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nimname" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "cname" + } + ] + }, + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "obj" + } + ] + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "CfileFlag" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "customArgs" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "CfileList" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "Cfile" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "Suggest" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRefTy", + "sons": [ + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "section" + } + ] + }, + { + "kind": "nkIdent", + "ident": "IdeCmd" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "qualifiedPath" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkPtrTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# not used beyond sorting purposes; name is also\", line: 322, col: 6, offsetA: 9959, offsetB: 10007)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# part of \\\'qualifiedPath\\\'\", line: 323, col: 6, offsetA: 10014, offsetB: 10039)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "filePath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Starts at 1\", line: 325, col: 15, offsetA: 10077, offsetB: 10090)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "column" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Starts at 0\", line: 326, col: 17, offsetA: 10108, offsetB: 10121)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "doc" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Not escaped (yet)\", line: 327, col: 17, offsetA: 10139, offsetB: 10158)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "forth" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# type\", line: 328, col: 19, offsetA: 10178, offsetB: 10184)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "quality" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "range" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIntLit", + "intVal": 100 + } + ] + } + ] + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# matching quality\", line: 329, col: 30, offsetA: 10215, offsetB: 10233)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isGlobal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# is a global variable\", line: 330, col: 20, offsetA: 10254, offsetB: 10276)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "contextFits" + } + ] + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# type/non-type context matches\", line: 331, col: 23, offsetA: 10300, offsetB: 10331)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "prefix" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PrefixMatch" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "symkind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "byte" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "scope" + } + ] + }, + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "localUsages" + } + ] + }, + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "globalUsages" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# more usages is better\", line: 334, col: 45, offsetA: 10421, offsetB: 10444)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "tokenLen" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "version" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "endLine" + } + ] + }, + { + "kind": "nkIdent", + "ident": "uint16" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "endCol" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "Suggestions" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "Suggest" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "ProfileInfo" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "time" + } + ] + }, + { + "kind": "nkIdent", + "ident": "float" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "count" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "ProfileData" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRefTy", + "sons": [ + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "data" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "TableRef" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkIdent", + "ident": "ProfileInfo" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "StdOrrKind" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "stdOrrStdout" + }, + { + "kind": "nkIdent", + "ident": "stdOrrStderr" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "FilenameOption" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "foAbs", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# absolute path, e.g.: /pathto/bar/foo.nim\", line: 353, col: 10, offsetA: 10773, offsetB: 10815)" + ] + }, + { + "kind": "nkIdent", + "ident": "foRelProject", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# relative to project path, e.g.: ../foo.nim\", line: 354, col: 17, offsetA: 10833, offsetB: 10877)" + ] + }, + { + "kind": "nkIdent", + "ident": "foCanonical", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# canonical module name\", line: 355, col: 16, offsetA: 10894, offsetB: 10917)" + ] + }, + { + "kind": "nkIdent", + "ident": "foLegacyRelProj", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# legacy, shortest of (foAbs, foRelProject)\", line: 356, col: 20, offsetA: 10938, offsetB: 10981)" + ] + }, + { + "kind": "nkIdent", + "ident": "foName", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# lastPathPart, e.g.: foo.nim\", line: 357, col: 11, offsetA: 10993, offsetB: 11022)" + ] + }, + { + "kind": "nkIdent", + "ident": "foStacktrace", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if optExcessiveStackTrace: foAbs else: foName\", line: 358, col: 17, offsetA: 11040, offsetB: 11087)" + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPragmaExpr", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "acyclic" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRefTy", + "sons": [ + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## every global configuration\", line: 361, col: 4, offsetA: 11131, offsetB: 11160)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## fields marked with \\\'*\\\' are subject to\", line: 362, col: 4, offsetA: 11165, offsetB: 11205)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## the incremental compilation mechanisms\", line: 363, col: 4, offsetA: 11210, offsetB: 11251)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## (+) means \\\"part of the dependency\\\"\", line: 364, col: 4, offsetA: 11256, offsetB: 11293)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "backend" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TBackend" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# set via `nim x` or `nim --backend:x`\", line: 365, col: 23, offsetA: 11317, offsetB: 11355)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "Target" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# (+)\", line: 366, col: 20, offsetA: 11376, offsetB: 11381)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "linesCompiled" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# all lines that have been compiled\", line: 367, col: 24, offsetA: 11406, offsetB: 11441)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "options" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TOptions" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# (+)\", line: 368, col: 23, offsetA: 11465, offsetB: 11470)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "globalOptions" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TGlobalOptions" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# (+)\", line: 369, col: 35, offsetA: 11506, offsetB: 11511)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "macrosToExpand" + } + ] + }, + { + "kind": "nkIdent", + "ident": "StringTableRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "arcToExpand" + } + ] + }, + { + "kind": "nkIdent", + "ident": "StringTableRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "MsgConfig" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "filenameOption" + } + ] + }, + { + "kind": "nkIdent", + "ident": "FilenameOption" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# how to render paths in compiler messages\", line: 373, col: 36, offsetA: 11635, offsetB: 11677)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "unitSep" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "evalTemplateCounter" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "evalMacroCounter" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "exitcode" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int8" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "cmd" + } + ] + }, + { + "kind": "nkIdent", + "ident": "Command" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# raw command parsed as enum\", line: 378, col: 18, offsetA: 11794, offsetB: 11822)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "cmdInput" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# input command\", line: 379, col: 22, offsetA: 11845, offsetB: 11860)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "projectIsCmd" + } + ] + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# whether we\\\'re compiling from a command input\", line: 380, col: 24, offsetA: 11885, offsetB: 11931)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "implicitCmd" + } + ] + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# whether some flag triggered an implicit `command`\", line: 381, col: 23, offsetA: 11955, offsetB: 12006)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "selectedGC" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TGCMode" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the selected GC (+)\", line: 382, col: 25, offsetA: 12032, offsetB: 12053)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "exc" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ExceptionSystem" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "hintProcessingDots" + } + ] + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# true for dots, false for filenames\", line: 384, col: 30, offsetA: 12110, offsetB: 12146)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "verbosity" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# how verbose the compiler is\", line: 385, col: 20, offsetA: 12167, offsetB: 12196)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "numberOfProcessors" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# number of processors\", line: 386, col: 29, offsetA: 12226, offsetB: 12248)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "lastCmdTime" + } + ] + }, + { + "kind": "nkIdent", + "ident": "float" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# when caas is enabled, we measure each command\", line: 387, col: 24, offsetA: 12273, offsetB: 12320)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "symbolFiles" + } + ] + }, + { + "kind": "nkIdent", + "ident": "SymbolFilesOption" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "spellSuggestMax" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# max number of spelling suggestions for typos\", line: 389, col: 26, offsetA: 12383, offsetB: 12429)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "cppDefines" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "HashSet" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# (*)\", line: 390, col: 33, offsetA: 12463, offsetB: 12468)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "headerFile" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nimbasePattern" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# pattern to find nimbase.h\", line: 392, col: 28, offsetA: 12521, offsetB: 12548)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "features" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "Feature" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "legacyFeatures" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "LegacyFeature" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "arguments" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## the arguments to be passed to the program that\", line: 396, col: 6, offsetA: 12646, offsetB: 12695)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## should be run\", line: 397, col: 6, offsetA: 12702, offsetB: 12718)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "ideCmd" + } + ] + }, + { + "kind": "nkIdent", + "ident": "IdeCmd" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "oldNewlines" + } + ] + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "cCompiler" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TSystemCC" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the used compiler\", line: 400, col: 26, offsetA: 12788, offsetB: 12807)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "modifiedyNotes" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TNoteKinds" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# notes that have been set/unset from either cmdline/configs\", line: 401, col: 32, offsetA: 12840, offsetB: 12900)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "cmdlineNotes" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TNoteKinds" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# notes that have been set/unset from cmdline\", line: 402, col: 30, offsetA: 12931, offsetB: 12976)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "foreignPackageNotes" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TNoteKinds" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "notes" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TNoteKinds" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# notes after resolving all logic(defaults, verbosity)/cmdline/configs\", line: 404, col: 23, offsetA: 13037, offsetB: 13107)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "warningAsErrors" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TNoteKinds" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "mainPackageNotes" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TNoteKinds" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "mainPackageId" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "errorCounter" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "hintCounter" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "warnCounter" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "errorMax" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "maxLoopIterationsVM" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## VM: max iterations of all loops\", line: 412, col: 30, offsetA: 13315, offsetB: 13349)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isVmTrace" + } + ] + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "configVars" + } + ] + }, + { + "kind": "nkIdent", + "ident": "StringTableRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "symbols" + } + ] + }, + { + "kind": "nkIdent", + "ident": "StringTableRef" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## We need to use a StringTableRef here as defined\", line: 416, col: 6, offsetA: 13438, offsetB: 13488)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## symbols are always guaranteed to be style\", line: 417, col: 6, offsetA: 13495, offsetB: 13539)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## insensitive. Otherwise hell would break lose.\", line: 418, col: 6, offsetA: 13546, offsetB: 13594)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "packageCache" + } + ] + }, + { + "kind": "nkIdent", + "ident": "StringTableRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nimblePaths" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "searchPaths" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "lazyPaths" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "outFile" + } + ] + }, + { + "kind": "nkIdent", + "ident": "RelativeFile" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "outDir" + } + ] + }, + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "jsonBuildFile" + } + ] + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "prefixDir" + } + ] + }, + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "libpath" + } + ] + }, + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nimcacheDir" + } + ] + }, + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nimStdlibVersion" + } + ] + }, + { + "kind": "nkIdent", + "ident": "NimVer" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "dllOverrides" + }, + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "moduleOverrides" + } + ] + }, + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "cfileSpecificOptions" + } + ] + }, + { + "kind": "nkIdent", + "ident": "StringTableRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "projectName" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# holds a name like \\\'nim\\\'\", line: 429, col: 25, offsetA: 13998, offsetB: 14023)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "projectPath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# holds a path like /home/alice/projects/nim/compiler/\", line: 430, col: 30, offsetA: 14054, offsetB: 14108)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "projectFull" + } + ] + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# projectPath/projectName\", line: 431, col: 31, offsetA: 14140, offsetB: 14165)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "projectIsStdin" + } + ] + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# whether we\\\'re compiling from stdin\", line: 432, col: 26, offsetA: 14192, offsetB: 14228)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "lastMsgWasDot" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "StdOrrKind" + } + ] + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the last compiler message was a single \\\'.\\\'\", line: 433, col: 36, offsetA: 14265, offsetB: 14309)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "projectMainIdx" + } + ] + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the canonical path id of the main module\", line: 434, col: 31, offsetA: 14341, offsetB: 14383)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "projectMainIdx2" + } + ] + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# consider merging with projectMainIdx\", line: 435, col: 32, offsetA: 14416, offsetB: 14454)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "command" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the main command (e.g. cc, check, scan, etc)\", line: 436, col: 21, offsetA: 14476, offsetB: 14522)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "commandArgs" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# any arguments after the main command\", line: 437, col: 30, offsetA: 14553, offsetB: 14591)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "commandLine" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "extraCmds" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for writeJsonBuildInstructions\", line: 439, col: 28, offsetA: 14645, offsetB: 14677)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "keepComments" + } + ] + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# whether the parser needs to keep comments\", line: 440, col: 24, offsetA: 14702, offsetB: 14745)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "implicitImports" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# modules that are to be implicitly imported\", line: 441, col: 34, offsetA: 14780, offsetB: 14824)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "implicitIncludes" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# modules that are to be implicitly included\", line: 442, col: 35, offsetA: 14860, offsetB: 14904)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "docSeeSrcUrl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if empty, no seeSrc will be generated. \\\\\", line: 443, col: 26, offsetA: 14931, offsetB: 14973)" + ] + }, + { + "kind": "nkIdentDefs", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# The string uses the formatting variables `path` and `line`.\", line: 444, col: 4, offsetA: 14978, offsetB: 15039)" + ], + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "docRoot" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## see nim --fullhelp for --docRoot\", line: 445, col: 21, offsetA: 15061, offsetB: 15096)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "docCmd" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## see nim --fullhelp for --docCmd\", line: 446, col: 20, offsetA: 15117, offsetB: 15151)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "configFiles" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + } + ] + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# config files (cfg,nims)\", line: 447, col: 36, offsetA: 15188, offsetB: 15213)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "cIncludes" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + } + ] + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# directories to search for included files\", line: 448, col: 33, offsetA: 15247, offsetB: 15289)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "cLibs" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + } + ] + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# directories to search for lib files\", line: 449, col: 29, offsetA: 15319, offsetB: 15356)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "cLinkedLibs" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# libraries to link\", line: 450, col: 30, offsetA: 15387, offsetB: 15406)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "externalToLink" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# files to link in addition to the file\", line: 452, col: 6, offsetA: 15446, offsetB: 15485)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# we compiled (*)\", line: 453, col: 6, offsetA: 15492, offsetB: 15509)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "linkOptionsCmd" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "compileOptionsCmd" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "linkOptions" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# (*)\", line: 456, col: 25, offsetA: 15599, offsetB: 15604)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "compileOptions" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# (*)\", line: 457, col: 28, offsetA: 15633, offsetB: 15638)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "cCompilerPath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toCompile" + } + ] + }, + { + "kind": "nkIdent", + "ident": "CfileList" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# (*)\", line: 459, col: 26, offsetA: 15692, offsetB: 15697)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "suggestionResultHook" + } + ] + }, + { + "kind": "nkProcTy", + "sons": [ + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "Suggest" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "closure" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "suggestVersion" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "suggestMaxResults" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "lastLineInfo" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "writelnHook" + } + ] + }, + { + "kind": "nkProcTy", + "sons": [ + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "output" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "closure" + }, + { + "kind": "nkIdent", + "ident": "gcsafe" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "structuredErrorHook" + } + ] + }, + { + "kind": "nkProcTy", + "sons": [ + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "config" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "severity" + }, + { + "kind": "nkIdent", + "ident": "Severity" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "closure" + }, + { + "kind": "nkIdent", + "ident": "gcsafe" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "cppCustomNamespace" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nimMainPrefix" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "vmProfileData" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ProfileData" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "expandProgress" + } + ] + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "expandLevels" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "expandNodeResult" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "expandPosition" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "parseNimVersion" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "NimVer" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# could be moved somewhere reusable\", line: 477, col: 2, offsetA: 16281, offsetB: 16316)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "split" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "." + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "parseInt" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# could be optimized if needed\", line: 484, col: 32, offsetA: 16438, offsetB: 16468)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "assignIfDefault" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "T" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "T" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "val" + }, + { + "kind": "nkIdent", + "ident": "T" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "def" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "default" + }, + { + "kind": "nkIdent", + "ident": "T" + } + ] + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## if `result` was already assigned to a value (that wasn\\\'t `def`), this is a noop.\", line: 491, col: 2, offsetA: 16571, offsetB: 16654)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "def" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "setErrorMaxHighMaybe" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## do not stop after first error (but honor --errorMax if provided)\", line: 496, col: 2, offsetA: 16745, offsetB: 16812)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assignIfDefault" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "errorMax" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "setNoteDefaults" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "note" + }, + { + "kind": "nkIdent", + "ident": "TNoteKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "enabled" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "fun" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "op" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "notes" + } + ] + }, + { + "kind": "nkIdent", + "ident": "op" + } + ] + }, + { + "kind": "nkIdent", + "ident": "note" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "mainPackageNotes" + } + ] + }, + { + "kind": "nkIdent", + "ident": "op" + } + ] + }, + { + "kind": "nkIdent", + "ident": "note" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "foreignPackageNotes" + } + ] + }, + { + "kind": "nkIdent", + "ident": "op" + } + ] + }, + { + "kind": "nkIdent", + "ident": "note" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "enabled" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fun" + }, + { + "kind": "nkIdent", + "ident": "incl" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fun" + }, + { + "kind": "nkIdent", + "ident": "excl" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "setNote" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "note" + }, + { + "kind": "nkIdent", + "ident": "TNoteKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "enabled" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# see also `prepareConfigNotes` which sets notes\", line: 511, col: 2, offsetA: 17167, offsetB: 17215)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "note" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "cmdlineNotes" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "enabled" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "incl" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "notes" + } + ] + }, + { + "kind": "nkIdent", + "ident": "note" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "excl" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "notes" + } + ] + }, + { + "kind": "nkIdent", + "ident": "note" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "hasHint" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "note" + }, + { + "kind": "nkIdent", + "ident": "TNoteKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# ternary states instead of binary states would simplify logic\", line: 519, col: 2, offsetA: 17394, offsetB: 17456)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "optHints" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "options" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "note" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintConf" + }, + { + "kind": "nkIdent", + "ident": "hintProcessing" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# could add here other special notes like hintSource\", line: 523, col: 4, offsetA: 17548, offsetB: 17600)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# these notes apply globally.\", line: 524, col: 4, offsetA: 17605, offsetB: 17634)" + ], + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "note" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "mainPackageNotes" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "note" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "notes" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "hasWarn" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "note" + }, + { + "kind": "nkIdent", + "ident": "TNoteKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "optWarns" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "options" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "note" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "notes" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "hcrOn" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "optHotCodeReloading" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "globalOptions" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkTemplateDef", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# deadcode\", line: 536, col: 44, offsetA: 17964, offsetB: 17974)" + ], + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "depConfigFields" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "dirty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIdent", + "ident": "options" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIdent", + "ident": "globalOptions" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fn" + }, + { + "kind": "nkIdent", + "ident": "selectedGC" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "oldExperimentalFeatures" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "dotOperators" + }, + { + "kind": "nkIdent", + "ident": "callOperator" + }, + { + "kind": "nkIdent", + "ident": "parallel" + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "ChecksOptions" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "optObjCheck" + }, + { + "kind": "nkIdent", + "ident": "optFieldCheck" + }, + { + "kind": "nkIdent", + "ident": "optRangeCheck" + }, + { + "kind": "nkIdent", + "ident": "optOverflowCheck" + }, + { + "kind": "nkIdent", + "ident": "optBoundsCheck" + }, + { + "kind": "nkIdent", + "ident": "optAssert" + }, + { + "kind": "nkIdent", + "ident": "optNaNCheck" + }, + { + "kind": "nkIdent", + "ident": "optInfCheck" + }, + { + "kind": "nkIdent", + "ident": "optStyleCheck" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "DefaultOptions" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "optObjCheck" + }, + { + "kind": "nkIdent", + "ident": "optFieldCheck" + }, + { + "kind": "nkIdent", + "ident": "optRangeCheck" + }, + { + "kind": "nkIdent", + "ident": "optBoundsCheck" + }, + { + "kind": "nkIdent", + "ident": "optOverflowCheck" + }, + { + "kind": "nkIdent", + "ident": "optAssert" + }, + { + "kind": "nkIdent", + "ident": "optWarns" + }, + { + "kind": "nkIdent", + "ident": "optRefCheck" + }, + { + "kind": "nkIdent", + "ident": "optHints" + }, + { + "kind": "nkIdent", + "ident": "optStackTrace" + }, + { + "kind": "nkIdent", + "ident": "optLineTrace" + }, + { + "kind": "nkIdent", + "ident": "optTrMacros" + }, + { + "kind": "nkIdent", + "ident": "optStyleCheck" + }, + { + "kind": "nkIdent", + "ident": "optCursorInference" + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "DefaultGlobalOptions" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "optThreadAnalysis" + }, + { + "kind": "nkIdent", + "ident": "optExcessiveStackTrace" + }, + { + "kind": "nkIdent", + "ident": "optJsBigInt64" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "getSrcTimestamp" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "DateTime" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkTryStmt", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "utc" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fromUnix" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseInt" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getEnv" + }, + { + "kind": "nkStrLit", + "strVal": "SOURCE_DATE_EPOCH" + }, + { + "kind": "nkStrLit", + "strVal": "not a number" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkExceptBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ValueError" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Environment variable malformed.\", line: 562, col: 4, offsetA: 18819, offsetB: 18852)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# https://reproducible-builds.org/specs/source-date-epoch/: \\\"If the\", line: 563, col: 4, offsetA: 18857, offsetB: 18924)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# value is malformed, the build process SHOULD exit with a non-zero\", line: 564, col: 4, offsetA: 18929, offsetB: 18996)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# error code\\\", which this doesn\\\'t do. This uses local time, because\", line: 565, col: 4, offsetA: 19001, offsetB: 19068)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# that maintains compatibility with existing usage.\", line: 566, col: 4, offsetA: 19073, offsetB: 19124)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "utc" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTime" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getDateStr" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "format" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getSrcTimestamp" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "yyyy-MM-dd" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getClockStr" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "format" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getSrcTimestamp" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "HH:mm:ss" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newPackageCache" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "untyped" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStringTable" + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "FileSystemCaseSensitive" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "modeCaseInsensitive" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "modeCaseSensitive" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "newProfileData" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "ProfileData" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkObjConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ProfileData" + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "data" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "newTable" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkIdent", + "ident": "ProfileInfo" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "foreignPackageNotesDefault" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "hintProcessing" + }, + { + "kind": "nkIdent", + "ident": "warnUnknownMagic" + }, + { + "kind": "nkIdent", + "ident": "hintQuitCalled" + }, + { + "kind": "nkIdent", + "ident": "hintExecuting" + }, + { + "kind": "nkIdent", + "ident": "hintUser" + }, + { + "kind": "nkIdent", + "ident": "warnUser" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isDefined" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "symbol" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "nimDebugUtils" + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# this allows inserting debugging utilties in all modules that import `options`\", line: 596, col: 2, offsetA: 19798, offsetB: 19877)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# with a single switch, which is useful when debugging compiler.\", line: 597, col: 2, offsetA: 19880, offsetB: 19944)" + ], + "sons": [ + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "debugutils" + } + ] + }, + { + "kind": "nkExportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "debugutils" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "initConfigRefCommon" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "selectedGC" + } + ] + }, + { + "kind": "nkIdent", + "ident": "gcUnselected" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "verbosity" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "hintProcessingDots" + } + ] + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "options" + } + ] + }, + { + "kind": "nkIdent", + "ident": "DefaultOptions" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "globalOptions" + } + ] + }, + { + "kind": "nkIdent", + "ident": "DefaultGlobalOptions" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "filenameOption" + } + ] + }, + { + "kind": "nkIdent", + "ident": "foAbs" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "foreignPackageNotes" + } + ] + }, + { + "kind": "nkIdent", + "ident": "foreignPackageNotesDefault" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "notes" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "NotesVerbosity" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "mainPackageNotes" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "NotesVerbosity" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newConfigRef" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "ConfigRef" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkObjConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "cCompiler" + }, + { + "kind": "nkIdent", + "ident": "ccGcc" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "macrosToExpand" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStringTable" + }, + { + "kind": "nkIdent", + "ident": "modeStyleInsensitive" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "arcToExpand" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStringTable" + }, + { + "kind": "nkIdent", + "ident": "modeStyleInsensitive" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initMsgConfig" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "cppDefines" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "initHashSet" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "headerFile" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "features" + }, + { + "kind": "nkCurly" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "legacyFeatures" + }, + { + "kind": "nkCurly" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "configVars" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStringTable" + }, + { + "kind": "nkIdent", + "ident": "modeStyleInsensitive" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "symbols" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStringTable" + }, + { + "kind": "nkIdent", + "ident": "modeStyleInsensitive" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "packageCache" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newPackageCache" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "searchPaths" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "lazyPaths" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "outFile" + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "RelativeFile" + }, + { + "kind": "nkRStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "outDir" + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + }, + { + "kind": "nkRStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "prefixDir" + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + }, + { + "kind": "nkRStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "libpath" + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + }, + { + "kind": "nkRStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimcacheDir" + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + }, + { + "kind": "nkRStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dllOverrides" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStringTable" + }, + { + "kind": "nkIdent", + "ident": "modeCaseInsensitive" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "moduleOverrides" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStringTable" + }, + { + "kind": "nkIdent", + "ident": "modeStyleInsensitive" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "cfileSpecificOptions" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStringTable" + }, + { + "kind": "nkIdent", + "ident": "modeCaseSensitive" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "projectName" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "projectPath" + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + }, + { + "kind": "nkRStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "projectFull" + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkRStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "projectIsStdin" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "projectMainIdx" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkInt32Lit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "command" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "commandArgs" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "commandLine" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "keepComments" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "implicitImports" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "implicitIncludes" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "docSeeSrcUrl" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "cIncludes" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "cLibs" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "cLinkedLibs" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "backend" + }, + { + "kind": "nkIdent", + "ident": "backendInvalid" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "externalToLink" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "linkOptionsCmd" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "compileOptionsCmd" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "linkOptions" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "compileOptions" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ccompilerpath" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "toCompile" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "arguments" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "suggestMaxResults" + }, + { + "kind": "nkIntLit", + "intVal": 10000 + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "maxLoopIterationsVM" + }, + { + "kind": "nkIntLit", + "intVal": 10000000 + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "vmProfileData" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newProfileData" + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "spellSuggestMax" + }, + { + "kind": "nkIdent", + "ident": "spellSuggestSecretSauce" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initConfigRefCommon" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setTargetFromSystem" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# enable colors by default on terminals\", line: 669, col: 2, offsetA: 22596, offsetB: 22635)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "terminal" + }, + { + "kind": "nkIdent", + "ident": "isatty" + } + ] + }, + { + "kind": "nkIdent", + "ident": "stderr" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "incl" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "globalOptions" + } + ] + }, + { + "kind": "nkIdent", + "ident": "optUseColors" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "nimDebugUtils" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "onNewConfigRef" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newPartialConfigRef" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "ConfigRef" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## create a new ConfigRef that is only good enough for error reporting.\", line: 676, col: 2, offsetA: 22813, offsetB: 22884)" + ], + "sons": [ + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "nimDebugUtils" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getConfigRef" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ConfigRef" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initConfigRefCommon" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "cppDefine" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "define" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "cppDefines" + } + ] + }, + { + "kind": "nkIdent", + "ident": "incl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "define" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getStdlibVersion" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "NimVer" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "nimStdlibVersion" + } + ] + }, + { + "kind": "nkTupleConstr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "symbols" + } + ] + }, + { + "kind": "nkIdent", + "ident": "getOrDefault" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "nimVersion" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "nimStdlibVersion" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "parseNimVersion" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "nimStdlibVersion" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isDefined" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "symbol" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "symbols" + } + ] + }, + { + "kind": "nkIdent", + "ident": "hasKey" + } + ] + }, + { + "kind": "nkIdent", + "ident": "symbol" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "cmpIgnoreStyle" + }, + { + "kind": "nkIdent", + "ident": "symbol" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "CPU" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetCPU" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "cmpIgnoreStyle" + }, + { + "kind": "nkIdent", + "ident": "symbol" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "platform" + }, + { + "kind": "nkIdent", + "ident": "OS" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetOS" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "symbol" + }, + { + "kind": "nkIdent", + "ident": "normalize" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "x86" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetCPU" + } + ] + }, + { + "kind": "nkIdent", + "ident": "cpuI386" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "itanium" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetCPU" + } + ] + }, + { + "kind": "nkIdent", + "ident": "cpuIa64" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "x8664" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetCPU" + } + ] + }, + { + "kind": "nkIdent", + "ident": "cpuAmd64" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "posix" + }, + { + "kind": "nkStrLit", + "strVal": "unix" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetOS" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "osLinux" + }, + { + "kind": "nkIdent", + "ident": "osMorphos" + }, + { + "kind": "nkIdent", + "ident": "osSkyos" + }, + { + "kind": "nkIdent", + "ident": "osIrix" + }, + { + "kind": "nkIdent", + "ident": "osPalmos" + }, + { + "kind": "nkIdent", + "ident": "osQnx" + }, + { + "kind": "nkIdent", + "ident": "osAtari" + }, + { + "kind": "nkIdent", + "ident": "osAix" + }, + { + "kind": "nkIdent", + "ident": "osHaiku" + }, + { + "kind": "nkIdent", + "ident": "osVxWorks" + }, + { + "kind": "nkIdent", + "ident": "osSolaris" + }, + { + "kind": "nkIdent", + "ident": "osNetbsd" + }, + { + "kind": "nkIdent", + "ident": "osFreebsd" + }, + { + "kind": "nkIdent", + "ident": "osOpenbsd" + }, + { + "kind": "nkIdent", + "ident": "osDragonfly" + }, + { + "kind": "nkIdent", + "ident": "osMacosx" + }, + { + "kind": "nkIdent", + "ident": "osIos" + }, + { + "kind": "nkIdent", + "ident": "osAndroid" + }, + { + "kind": "nkIdent", + "ident": "osNintendoSwitch" + }, + { + "kind": "nkIdent", + "ident": "osFreeRTOS" + }, + { + "kind": "nkIdent", + "ident": "osCrossos" + }, + { + "kind": "nkIdent", + "ident": "osZephyr" + }, + { + "kind": "nkIdent", + "ident": "osNuttX" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "linux" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetOS" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "osLinux" + }, + { + "kind": "nkIdent", + "ident": "osAndroid" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "bsd" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetOS" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "osNetbsd" + }, + { + "kind": "nkIdent", + "ident": "osFreebsd" + }, + { + "kind": "nkIdent", + "ident": "osOpenbsd" + }, + { + "kind": "nkIdent", + "ident": "osDragonfly" + }, + { + "kind": "nkIdent", + "ident": "osCrossos" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "freebsd" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetOS" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "osFreebsd" + }, + { + "kind": "nkIdent", + "ident": "osCrossos" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "emulatedthreadvars" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "platform" + }, + { + "kind": "nkIdent", + "ident": "OS" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetOS" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "props" + } + ] + }, + { + "kind": "nkIdent", + "ident": "contains" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ospLacksThreadVars" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "msdos" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetOS" + } + ] + }, + { + "kind": "nkIdent", + "ident": "osDos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "mswindows" + }, + { + "kind": "nkStrLit", + "strVal": "win32" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetOS" + } + ] + }, + { + "kind": "nkIdent", + "ident": "osWindows" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "macintosh" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetOS" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "osMacos" + }, + { + "kind": "nkIdent", + "ident": "osMacosx" + }, + { + "kind": "nkIdent", + "ident": "osIos" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "osx" + }, + { + "kind": "nkStrLit", + "strVal": "macosx" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetOS" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "osMacosx" + }, + { + "kind": "nkIdent", + "ident": "osIos" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "sunos" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetOS" + } + ] + }, + { + "kind": "nkIdent", + "ident": "osSolaris" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "nintendoswitch" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetOS" + } + ] + }, + { + "kind": "nkIdent", + "ident": "osNintendoSwitch" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "freertos" + }, + { + "kind": "nkStrLit", + "strVal": "lwip" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetOS" + } + ] + }, + { + "kind": "nkIdent", + "ident": "osFreeRTOS" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "zephyr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetOS" + } + ] + }, + { + "kind": "nkIdent", + "ident": "osZephyr" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "nuttx" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetOS" + } + ] + }, + { + "kind": "nkIdent", + "ident": "osNuttX" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "littleendian" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "CPU" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetCPU" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "endian" + } + ] + }, + { + "kind": "nkIdent", + "ident": "littleEndian" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "bigendian" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "CPU" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetCPU" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "endian" + } + ] + }, + { + "kind": "nkIdent", + "ident": "bigEndian" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "cpu8" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "CPU" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetCPU" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "bit" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 8 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "cpu16" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "CPU" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetCPU" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "bit" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 16 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "cpu32" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "CPU" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetCPU" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "bit" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 32 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "cpu64" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "CPU" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetCPU" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "bit" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 64 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "nimrawsetjmp" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetOS" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "osSolaris" + }, + { + "kind": "nkIdent", + "ident": "osNetbsd" + }, + { + "kind": "nkIdent", + "ident": "osFreebsd" + }, + { + "kind": "nkIdent", + "ident": "osOpenbsd" + }, + { + "kind": "nkIdent", + "ident": "osDragonfly" + }, + { + "kind": "nkIdent", + "ident": "osMacosx" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "quitOrRaise" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# xxx in future work, consider whether to also intercept `msgQuit` calls\", line: 766, col: 2, offsetA: 25922, offsetB: 25994)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "isDefined" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "nimDebug" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "doAssert" + }, + { + "kind": "nkIdent", + "ident": "false" + }, + { + "kind": "nkIdent", + "ident": "msg" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "quit" + }, + { + "kind": "nkIdent", + "ident": "msg" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# quits with QuitFailure\", line: 770, col: 14, offsetA: 26074, offsetB: 26098)" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "importantComments" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "cmd" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "cmdDocLike" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "cmdIdeTools" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "usesWriteBarrier" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "selectedGC" + } + ] + }, + { + "kind": "nkIdent", + "ident": "gcRefc" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "compilationCachePresent" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "untyped" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# conf.symbolFiles in {v2Sf, writeOnlySf}\", line: 781, col: 0, offsetA: 26361, offsetB: 26403)" + ], + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "optPreserveOrigSource" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "untyped" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "optEmbedOrigSrc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "globalOptions" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "mainCommandArg" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## This is intended for commands like check or parse\", line: 786, col: 2, offsetA: 26555, offsetB: 26607)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## which will work on the main project file unless\", line: 787, col: 2, offsetA: 26610, offsetB: 26660)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## explicitly given a specific file argument\", line: 788, col: 2, offsetA: 26663, offsetB: 26707)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "commandArgs" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "commandArgs" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "projectName" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "existsConfigVar" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "hasKey" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "configVars" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getConfigVar" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "default" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "configVars" + } + ] + }, + { + "kind": "nkIdent", + "ident": "getOrDefault" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "default" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "setConfigVar" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkIdent", + "ident": "val" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "configVars" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkIdent", + "ident": "val" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getOutFile" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "filename" + }, + { + "kind": "nkIdent", + "ident": "RelativeFile" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ext" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# explains regression https://github.com/nim-lang/Nim/issues/6583#issuecomment-625711125\", line: 804, col: 2, offsetA: 27215, offsetB: 27303)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Yet another reason why \\\"\\\" should not mean \\\".\\\"; `\\\"\\\"/something` should raise\", line: 805, col: 2, offsetA: 27306, offsetB: 27383)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# instead of implying \\\"\\\" == \\\".\\\" as it\\\'s bug prone.\", line: 806, col: 2, offsetA: 27386, offsetB: 27436)" + ], + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "doAssert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "outDir" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "outDir" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "changeFileExt" + }, + { + "kind": "nkIdent", + "ident": "filename" + }, + { + "kind": "nkIdent", + "ident": "ext" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "absOutFile" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "doAssert" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "outDir" + } + ] + }, + { + "kind": "nkIdent", + "ident": "isEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "doAssert" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "outFile" + } + ] + }, + { + "kind": "nkIdent", + "ident": "isEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "outDir" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "outFile" + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "posix" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "dirExists" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ".out" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "prepareToWriteOutput" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Create the output directory and returns a full path to the output file\", line: 821, col: 2, offsetA: 27841, offsetB: 27914)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "absOutFile" + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "createDir" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkIdent", + "ident": "parentDir" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getPrefixDir" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Gets the prefix dir, usually the parent directory where the binary resides.\", line: 827, col: 2, offsetA: 28033, offsetB: 28111)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"##\", line: 828, col: 2, offsetA: 28114, offsetB: 28116)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## This is overridden by some tools (namely nimsuggest) via the ``conf.prefixDir``\", line: 829, col: 2, offsetA: 28119, offsetB: 28201)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## field.\", line: 830, col: 2, offsetA: 28204, offsetB: 28213)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## This should resolve to root of nim sources, whether running nim from a local\", line: 831, col: 2, offsetA: 28216, offsetB: 28295)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## clone or using installed nim, so that these exist: `result/doc/advopt.txt`\", line: 832, col: 2, offsetA: 28298, offsetB: 28376)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## and `result/lib/system.nim`\", line: 833, col: 2, offsetA: 28379, offsetB: 28409)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "prefixDir" + } + ] + }, + { + "kind": "nkIdent", + "ident": "isEmpty" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "prefixDir" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "binParent" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitPath" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getAppDir" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "head" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "posix" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "binParent" + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + }, + { + "kind": "nkRStrLit", + "strVal": "/usr" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + }, + { + "kind": "nkRStrLit", + "strVal": "/usr/lib/nim" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "binParent" + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + }, + { + "kind": "nkRStrLit", + "strVal": "/usr/local" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + }, + { + "kind": "nkRStrLit", + "strVal": "/usr/local/lib/nim" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "binParent" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "binParent" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "setDefaultLibpath" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# set default value (can be overwritten):\", line: 849, col: 2, offsetA: 28866, offsetB: 28907)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "libpath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "isEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# choose default libpath:\", line: 851, col: 4, offsetA: 28939, offsetB: 28964)" + ], + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "prefix" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getPrefixDir" + }, + { + "kind": "nkIdent", + "ident": "conf" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "libpath" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkIdent", + "ident": "prefix" + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "RelativeDir" + }, + { + "kind": "nkRStrLit", + "strVal": "lib" + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Special rule to support other tools (nimble) which import the compiler\", line: 856, col: 4, offsetA: 29052, offsetB: 29124)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# modules and make use of them.\", line: 857, col: 4, offsetA: 29129, offsetB: 29160)" + ], + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "realNimPath" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "findExe" + }, + { + "kind": "nkStrLit", + "strVal": "nim" + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Find out if $nim/../../lib/system.nim exists.\", line: 860, col: 4, offsetA: 29208, offsetB: 29255)" + ], + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "parentNimLibPath" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "realNimPath" + }, + { + "kind": "nkIdent", + "ident": "parentDir" + } + ] + }, + { + "kind": "nkIdent", + "ident": "parentDir" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "lib" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileExists" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "libpath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "system.nim" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileExists" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkIdent", + "ident": "parentNimLibPath" + }, + { + "kind": "nkStrLit", + "strVal": "system.nim" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "libpath" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + }, + { + "kind": "nkIdent", + "ident": "parentNimLibPath" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "canonicalizePath" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "path" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "path" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkIdent", + "ident": "expandFilename" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "setFromProjectName" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "projectName" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkTryStmt", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "projectFull" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "canonicalizePath" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkIdent", + "ident": "projectName" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkExceptBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "OSError" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "projectFull" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkIdent", + "ident": "projectName" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitFile" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "projectFull" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "dir" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "dir" + } + ] + }, + { + "kind": "nkIdent", + "ident": "isEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getCurrentDir" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "dir" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "projectPath" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "canonicalizePath" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkIdent", + "ident": "dir" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "projectName" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "removeTrailingDirSep" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "path" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "path" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "path" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "DirSep" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "substr" + }, + { + "kind": "nkIdent", + "ident": "path" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "path" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "path" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "disableNimblePath" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "incl" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "globalOptions" + } + ] + }, + { + "kind": "nkIdent", + "ident": "optNoNimblePath" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "lazyPaths" + } + ] + }, + { + "kind": "nkIdent", + "ident": "setLen" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "nimblePaths" + } + ] + }, + { + "kind": "nkIdent", + "ident": "setLen" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "clearNimblePath" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "lazyPaths" + } + ] + }, + { + "kind": "nkIdent", + "ident": "setLen" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "nimblePaths" + } + ] + }, + { + "kind": "nkIdent", + "ident": "setLen" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkIncludeStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "packagehandling" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "getOsCacheDir" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "posix" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getEnv" + }, + { + "kind": "nkStrLit", + "strVal": "XDG_CACHE_HOME" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getHomeDir" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ".cache" + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "nim" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getHomeDir" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "genSubDir" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getNimcacheDir" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimcacheSuffix" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "cmd" + } + ] + }, + { + "kind": "nkIdent", + "ident": "cmdCheck" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "_check" + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isDefined" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkStrLit", + "strVal": "release" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isDefined" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkStrLit", + "strVal": "danger" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "_r" + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "_d" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# XXX projectName should always be without a file extension!\", line: 921, col: 2, offsetA: 30936, offsetB: 30996)" + ], + "ident": "result" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "nimcacheDir" + } + ] + }, + { + "kind": "nkIdent", + "ident": "isEmpty" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "nimcacheDir" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "backend" + } + ] + }, + { + "kind": "nkIdent", + "ident": "backendJs" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "outDir" + } + ] + }, + { + "kind": "nkIdent", + "ident": "isEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "projectPath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "genSubDir" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "outDir" + } + ] + }, + { + "kind": "nkIdent", + "ident": "genSubDir" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getOsCacheDir" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitFile" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "projectName" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimcacheSuffix" + }, + { + "kind": "nkIdent", + "ident": "conf" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "pathSubs" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "config" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "home" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "removeTrailingDirSep" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "os" + }, + { + "kind": "nkIdent", + "ident": "getHomeDir" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "unixToNativePath" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "nim" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getPrefixDir" + }, + { + "kind": "nkIdent", + "ident": "conf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "lib" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "libpath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "home" + }, + { + "kind": "nkIdent", + "ident": "home" + }, + { + "kind": "nkStrLit", + "strVal": "config" + }, + { + "kind": "nkIdent", + "ident": "config" + }, + { + "kind": "nkStrLit", + "strVal": "projectname" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "projectName" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "projectpath" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "projectPath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "projectdir" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "projectPath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "nimcache" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getNimcacheDir" + }, + { + "kind": "nkIdent", + "ident": "conf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "expandTilde" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIteratorDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "nimbleSubs" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pl" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "toLowerAscii" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkStrLit", + "strVal": "$nimblepath" + }, + { + "kind": "nkIdent", + "ident": "pl" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkStrLit", + "strVal": "$nimbledir" + }, + { + "kind": "nkIdent", + "ident": "pl" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "countdown" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "nimblePaths" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimblePath" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "removeTrailingDirSep" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "nimblePaths" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkYieldStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "nimblepath" + }, + { + "kind": "nkIdent", + "ident": "nimblePath" + }, + { + "kind": "nkStrLit", + "strVal": "nimbledir" + }, + { + "kind": "nkIdent", + "ident": "nimblePath" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkYieldStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "toGeneratedFile" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "path" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ext" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## converts \\\"/home/a/mymodule.nim\\\", \\\"rod\\\" to \\\"/home/a/nimcache/mymodule.rod\\\"\", line: 971, col: 2, offsetA: 32366, offsetB: 32442)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getNimcacheDir" + }, + { + "kind": "nkIdent", + "ident": "conf" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "RelativeFile" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "path" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkIdent", + "ident": "splitPath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tail" + } + ] + }, + { + "kind": "nkIdent", + "ident": "changeFileExt" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ext" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "completeGeneratedFilePath" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "createSubDir" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Return an absolute path of a generated intermediary file.\", line: 978, col: 2, offsetA: 32658, offsetB: 32718)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Optionally creates the cache directory if `createSubDir` is `true`.\", line: 979, col: 2, offsetA: 32721, offsetB: 32791)" + ], + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "subdir" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getNimcacheDir" + }, + { + "kind": "nkIdent", + "ident": "conf" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "createSubDir" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkTryStmt", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "createDir" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "subdir" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + } + ] + }, + { + "kind": "nkExceptBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "OSError" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "quitOrRaise" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "cannot create directory: " + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "subdir" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkIdent", + "ident": "subdir" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "RelativeFile" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkIdent", + "ident": "splitPath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tail" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "rawFindFile" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkIdent", + "ident": "RelativeFile" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "suppressStdlib" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "it" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "searchPaths" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "suppressStdlib" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "it" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkIdent", + "ident": "startsWith" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "libpath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkContinueStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkIdent", + "ident": "it" + }, + { + "kind": "nkIdent", + "ident": "f" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileExists" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "canonicalizePath" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkRStrLit", + "strVal": "" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "rawFindFile2" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkIdent", + "ident": "RelativeFile" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "it" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "lazyPaths" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkIdent", + "ident": "it" + }, + { + "kind": "nkIdent", + "ident": "f" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileExists" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# bring to front\", line: 1004, col: 6, offsetA: 33508, offsetB: 33524)" + ], + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "j" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "countdown" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "swap" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "lazyPaths" + } + ] + }, + { + "kind": "nkIdent", + "ident": "j" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "lazyPaths" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "j" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "canonicalizePath" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkRStrLit", + "strVal": "" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "patchModule" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "dirty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "isEmpty" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "moduleOverrides" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "key" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getPackageName" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "_" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitFile" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "moduleOverrides" + } + ] + }, + { + "kind": "nkIdent", + "ident": "hasKey" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ov" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "moduleOverrides" + } + ] + }, + { + "kind": "nkIdent", + "ident": "key" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ov" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkIdent", + "ident": "ov" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "stdlibDirs" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "pure" + }, + { + "kind": "nkStrLit", + "strVal": "core" + }, + { + "kind": "nkStrLit", + "strVal": "arch" + }, + { + "kind": "nkStrLit", + "strVal": "pure/collections" + }, + { + "kind": "nkStrLit", + "strVal": "pure/concurrency" + }, + { + "kind": "nkStrLit", + "strVal": "pure/unidecode" + }, + { + "kind": "nkStrLit", + "strVal": "impure" + }, + { + "kind": "nkStrLit", + "strVal": "wrappers" + }, + { + "kind": "nkStrLit", + "strVal": "wrappers/linenoise" + }, + { + "kind": "nkStrLit", + "strVal": "windows" + }, + { + "kind": "nkStrLit", + "strVal": "posix" + }, + { + "kind": "nkStrLit", + "strVal": "js" + }, + { + "kind": "nkStrLit", + "strVal": "deprecated/pure" + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "pkgPrefix" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "pkg/" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "stdPrefix" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "std/" + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getRelativePathFromConfigPath" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "RelativeFile" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "isTitle" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "f" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "isTitle" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "dir" + }, + { + "kind": "nkIdent", + "ident": "stdlibDirs" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "path" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "libpath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkIdent", + "ident": "dir" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkIdent", + "ident": "lastPathPart" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "path" + }, + { + "kind": "nkIdent", + "ident": "cmpPaths" + } + ] + }, + { + "kind": "nkIdent", + "ident": "f" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "RelativeFile" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkIdent", + "ident": "stdPrefix" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkIdent", + "ident": "splitFile" + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "search" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "paths" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "it" + }, + { + "kind": "nkIdent", + "ident": "paths" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "it" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "it" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkIdent", + "ident": "isRelativeTo" + } + ] + }, + { + "kind": "nkIdent", + "ident": "it" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "relativePath" + }, + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkIdent", + "ident": "it" + } + ] + }, + { + "kind": "nkIdent", + "ident": "RelativeFile" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "search" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "searchPaths" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "search" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "lazyPaths" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "findFile" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "suppressStdlib" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkIdent", + "ident": "isAbsolute" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkIdent", + "ident": "fileExists" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkIdent", + "ident": "f" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCallStrLit", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkRStrLit", + "strVal": "" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rawFindFile" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "RelativeFile" + }, + { + "kind": "nkIdent", + "ident": "f" + } + ] + }, + { + "kind": "nkIdent", + "ident": "suppressStdlib" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "isEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rawFindFile" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "RelativeFile" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkIdent", + "ident": "toLowerAscii" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "suppressStdlib" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "isEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rawFindFile2" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "RelativeFile" + }, + { + "kind": "nkIdent", + "ident": "f" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "isEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rawFindFile2" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "RelativeFile" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkIdent", + "ident": "toLowerAscii" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "patchModule" + }, + { + "kind": "nkIdent", + "ident": "conf" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "findModule" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "modulename" + }, + { + "kind": "nkIdent", + "ident": "currentModule" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# returns path to module\", line: 1079, col: 2, offsetA: 35504, offsetB: 35528)" + ], + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "addFileExt" + }, + { + "kind": "nkIdent", + "ident": "modulename" + }, + { + "kind": "nkIdent", + "ident": "NimExt" + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "hasRelativeDot" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkIdent", + "ident": "startsWith" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pkgPrefix" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "findFile" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkIdent", + "ident": "substr" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "pkgPrefix" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "suppressStdlib" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkIdent", + "ident": "startsWith" + } + ] + }, + { + "kind": "nkIdent", + "ident": "stdPrefix" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "stripped" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkIdent", + "ident": "substr" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "stdPrefix" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "candidate" + }, + { + "kind": "nkIdent", + "ident": "stdlibDirs" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "path" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "libpath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkIdent", + "ident": "candidate" + } + ] + }, + { + "kind": "nkIdent", + "ident": "stripped" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileExists" + }, + { + "kind": "nkIdent", + "ident": "path" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkIdent", + "ident": "path" + } + ] + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# If prefixed with std/ why would we add the current module path!\", line: 1093, col: 10, offsetA: 35982, offsetB: 36047)" + ], + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "currentPath" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "currentModule" + }, + { + "kind": "nkIdent", + "ident": "splitFile" + } + ] + }, + { + "kind": "nkIdent", + "ident": "dir" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkIdent", + "ident": "currentPath" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "m" + }, + { + "kind": "nkIdent", + "ident": "startsWith" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 46 + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileExists" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "hasRelativeDot" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileExists" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkIdent", + "ident": "hasRelativeDot" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "findFile" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "patchModule" + }, + { + "kind": "nkIdent", + "ident": "conf" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "findProjectNimFile" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pkg" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "extensions" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkStrLit", + "strVal": ".nims" + }, + { + "kind": "nkStrLit", + "strVal": ".cfg" + }, + { + "kind": "nkStrLit", + "strVal": ".nimcfg" + }, + { + "kind": "nkStrLit", + "strVal": ".nimble" + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "candidates" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket" + } + ] + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "dir" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "pkg" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "prev" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "dir" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimblepkg" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pkgname" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "pkg" + }, + { + "kind": "nkIdent", + "ident": "lastPathPart" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "k" + }, + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "os" + }, + { + "kind": "nkIdent", + "ident": "walkDir" + } + ] + }, + { + "kind": "nkIdent", + "ident": "dir" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "relative" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "k" + }, + { + "kind": "nkIdent", + "ident": "pcFile" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkStrLit", + "strVal": "config.nims" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkVarTuple", + "sons": [ + { + "kind": "nkIdent", + "ident": "_" + }, + { + "kind": "nkIdent", + "ident": "name" + }, + { + "kind": "nkIdent", + "ident": "ext" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitFile" + }, + { + "kind": "nkIdent", + "ident": "f" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "ext" + }, + { + "kind": "nkIdent", + "ident": "extensions" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "changeFileExt" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkIdent", + "ident": "dir" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": ".nim" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileExists" + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "candidates" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "ext" + }, + { + "kind": "nkStrLit", + "strVal": ".nimble" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimblepkg" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimblepkg" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 14, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Since nimble packages can have their source in a subfolder,\", line: 1127, col: 14, offsetA: 37028, offsetB: 37089)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 14, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# check the last folder we were in for a possible match.\", line: 1128, col: 14, offsetA: 37104, offsetB: 37160)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "dir" + }, + { + "kind": "nkIdent", + "ident": "prev" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkIdent", + "ident": "prev" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "extractFilename" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileExists" + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "candidates" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 14, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# If we found more than one nimble file, chances are that we\", line: 1134, col: 14, offsetA: 37343, offsetB: 37403)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 14, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# missed the real project file, or this is an invalid nimble\", line: 1135, col: 14, offsetA: 37418, offsetB: 37478)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 14, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# package. Either way, bailing is the better choice.\", line: 1136, col: 14, offsetA: 37493, offsetB: 37545)" + ], + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pkgname" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimblepkg" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimblepkg" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "pkgname" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "candidates" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "pkgname" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "extractFilename" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "candidates" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "candidates" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "prev" + }, + { + "kind": "nkIdent", + "ident": "dir" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "dir" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parentDir" + }, + { + "kind": "nkIdent", + "ident": "dir" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "dir" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "canonicalImportAux" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "file" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"##[\\n Shows the canonical module import, e.g.:\\n system, std/tables, fusion/pointers, system/assertions, std/private/asciitables\\n ]##\", line: 1158, col: 2, offsetA: 37959, offsetB: 38092)" + ], + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ret" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getRelativePathFromConfigPath" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "file" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "isTitle" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "dir" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getNimbleFile" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "file" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "parentDir" + } + ] + }, + { + "kind": "nkIdent", + "ident": "AbsoluteDir" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "dir" + }, + { + "kind": "nkIdent", + "ident": "isEmpty" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "relPath" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "relativeTo" + }, + { + "kind": "nkIdent", + "ident": "file" + }, + { + "kind": "nkIdent", + "ident": "dir" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "relPath" + }, + { + "kind": "nkIdent", + "ident": "isEmpty" + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ret" + }, + { + "kind": "nkIdent", + "ident": "isEmpty" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "relPath" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ret" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "ret" + }, + { + "kind": "nkIdent", + "ident": "relPath" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ret" + }, + { + "kind": "nkIdent", + "ident": "isEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "ret" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "relativeTo" + }, + { + "kind": "nkIdent", + "ident": "file" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "projectPath" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ret" + }, + { + "kind": "nkIdent", + "ident": "string" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "canonicalImport" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "file" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ret" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "canonicalImportAux" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "file" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ret" + }, + { + "kind": "nkIdent", + "ident": "nativeToUnixPath" + } + ] + }, + { + "kind": "nkIdent", + "ident": "changeFileExt" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "canonDynlibName" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "startsWith" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "lib" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ende" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "strutils" + }, + { + "kind": "nkIdent", + "ident": "find" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 40 + }, + { + "kind": "nkCharLit", + "intVal": 41 + }, + { + "kind": "nkCharLit", + "intVal": 46 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkIdent", + "ident": "ende" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "substr" + } + ] + }, + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "ende" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "substr" + } + ] + }, + { + "kind": "nkIdent", + "ident": "start" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "inclDynlibOverride" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "lib" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "dllOverrides" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "lib" + }, + { + "kind": "nkIdent", + "ident": "canonDynlibName" + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "true" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isDynlibOverride" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "lib" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "optDynlibOverrideAll" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "globalOptions" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "dllOverrides" + } + ] + }, + { + "kind": "nkIdent", + "ident": "hasKey" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "lib" + }, + { + "kind": "nkIdent", + "ident": "canonDynlibName" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "showNonExportedFields" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "incl" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "globalOptions" + } + ] + }, + { + "kind": "nkIdent", + "ident": "optShowNonExportedFields" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "expandDone" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ideCmd" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ideExpand" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "expandLevels" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "expandProgress" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "parseIdeCmd" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "IdeCmd" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "sug" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideSug" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "con" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideCon" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "def" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideDef" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "use" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideUse" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "dus" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideDus" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "chk" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideChk" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "chkFile" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideChkFile" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "mod" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideMod" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "highlight" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideHighlight" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "outline" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideOutline" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "known" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideKnown" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "msg" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideMsg" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "project" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideProject" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "globalSymbols" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideGlobalSymbols" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "recompile" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideRecompile" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "changed" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideChanged" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "type" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideType" + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideNone" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "IdeCmd" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideSug" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "sug" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideCon" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "con" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideDef" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "def" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideUse" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "use" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideDus" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "dus" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideChk" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "chk" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideChkFile" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "chkFile" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideMod" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "mod" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideNone" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "none" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideHighlight" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "highlight" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideOutline" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "outline" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideKnown" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "known" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideMsg" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "msg" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideProject" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "project" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideGlobalSymbols" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "globalSymbols" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideDeclaration" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "declaration" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideExpand" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "expand" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideRecompile" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "recompile" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideChanged" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "changed" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "ideType" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "type" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "floatInt64Align" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int16" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Returns either 4 or 8 depending on reasons.\", line: 1289, col: 2, offsetA: 40617, offsetB: 40663)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetCPU" + } + ] + }, + { + "kind": "nkIdent", + "ident": "cpuI386" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#on Linux/BSD i386, double are aligned to 4bytes (except with -malign-double)\", line: 1291, col: 4, offsetA: 40723, offsetB: 40800)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "target" + } + ] + }, + { + "kind": "nkIdent", + "ident": "targetOS" + } + ] + }, + { + "kind": "nkIdent", + "ident": "osWindows" + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# on i386 for all known POSIX systems, 64bits ints are aligned\", line: 1293, col: 6, offsetA: 40849, offsetB: 40911)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# to 4bytes (except with -malign-double)\", line: 1294, col: 6, offsetA: 40918, offsetB: 40958)" + ], + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 8 + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/phparser.nim b/src/phparser.nim new file mode 100644 index 0000000..ef8bdbb --- /dev/null +++ b/src/phparser.nim @@ -0,0 +1,3375 @@ +# +# +# nimph +# (c) Copyright 2023 Jacek Sieka +# The Nim compiler +# (c) Copyright 2018 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# +# This module implements the parser of the standard Nim syntax. +# The parser strictly reflects the grammar ("doc/grammar.txt"); however +# it uses several helper routines to keep the parser small. A special +# efficient algorithm is used for the precedence levels. The parser here can +# be seen as a refinement of the grammar, as it specifies how the AST is built +# from the grammar and how comments belong to the AST. +# nimph version: +# * analyse comment structure in parser instead of lexer +# * attach comments to nodes as prefix/mid/postfix to anchor them to the most +# plausible node that they belong to +# - prefix for comments that precede a construct +# - mid for comments that appear in the middle of complex syntax nodes, ie +# between `:` and statements of an `if` +# - postfix is the dustbin that anything that the parser doesn't know where to +# place ends up - these are rendered after the AST node which is the most +# common cause for comment reordering, ie that we didn't find a suitable +# place to put them +# +# Comment handling is made difficult because the upstream parser "sometimes" +# puts comments in the AST and the rules for this have evolved over time meaning +# that great creativity exists in where comments may appear. It doesn't help +# that the lexer is trying to do comment layout / reflow / analysis in the +# middle of lexing.. + +import llstream, idents, strutils, pathutils +import + "."/[phast, phlexer, phlineinfos, phmsgs, phoptions] +when defined(nimPreviewSlimSystem): + import + std/assertions + +type + Parser* = object + # A Parser object represents a file that + # is being parsed + currInd: int # current indentation level + firstTok: bool # Has the first token been read? + hasProgress: bool # some while loop requires progress ensurance + lex*: Lexer # The lexer that is used for parsing + tok*: Token # The current token + lineStartPrevious*: int + lineNumberPrevious*: int + bufposPrevious*: int + inPragma*: int # Pragma level + inSemiStmtList*: int + emptyNode: PNode + skipped*: seq[Token] + + SymbolMode = enum + smNormal + smAllowNil + smAfterDot + + PrimaryMode = enum + pmNormal + pmTypeDesc + pmTypeDef + pmTrySimple + + CommentLoc = enum + clPrefix + clMid + clPostfix + +proc isOperator*(tok: Token): bool + +proc getTok*(p: var Parser) + +proc parMessage*(p: Parser; msg: TMsgKind; arg: string = "") + +proc skipComment*(p: var Parser; node: PNode; commentLoc = clPostfix) + +proc newNodeP*(kind: TNodeKind; p: var Parser): PNode + +proc newIntNodeP*(kind: TNodeKind; intVal: BiggestInt; p: var Parser): PNode + +proc newFloatNodeP*(kind: TNodeKind; floatVal: BiggestFloat; p: var Parser): PNode + +proc newStrNodeP*(kind: TNodeKind; strVal: string; p: var Parser): PNode + +proc newIdentNodeP*(ident: PIdent; p: var Parser): PNode + +proc expectIdentOrKeyw*(p: Parser) + +proc expectIdent*(p: Parser) + +proc parLineInfo*(p: Parser): TLineInfo + +proc eat*(p: var Parser; tokType: TokType) + +proc skipInd*(p: var Parser) + +proc optPar*(p: var Parser) + +proc optInd*(p: var Parser; n: PNode; commentLoc = clPostfix) + +proc indAndComment*( + p: var Parser; n: PNode; commentLoc = clPostfix; maybeMissEquals = false +) + +proc setBaseFlags*(n: PNode; base: NumericalBase) + +proc parseSymbol*(p: var Parser; mode = smNormal): PNode + +proc parseTry(p: var Parser; isExpr: bool): PNode + +proc parseCase(p: var Parser): PNode + +proc parseStmtPragma(p: var Parser): PNode + +proc parsePragma(p: var Parser): PNode + +proc postExprBlocks(p: var Parser; x: PNode): PNode + +proc parseExprStmt(p: var Parser): PNode + +proc parseBlock(p: var Parser): PNode + +proc primary(p: var Parser; mode: PrimaryMode): PNode + +proc simpleExprAux(p: var Parser; limit: int; mode: PrimaryMode): PNode # implementation + +template prettySection(body) = + body + +proc getTok(p: var Parser) = + ## Get the next token from the parser's lexer, and store it in the parser's + ## `tok` member. + p.lineNumberPrevious = p.lex.lineNumber + p.lineStartPrevious = p.lex.lineStart + p.bufposPrevious = p.lex.bufpos + + rawGetTok(p.lex, p.tok) + + p.hasProgress = true + +proc openParser*( + p: var Parser; + fileIdx: FileIndex; + inputStream: PLLStream; + cache: IdentCache; + config: ConfigRef; + printTokens: bool +) = + ## Open a parser, using the given arguments to set up its internal state. + ## + reset(p.tok) + openLexer(p.lex, fileIdx, inputStream, cache, config, printTokens) + getTok(p) # read the first token + + p.firstTok = true + p.emptyNode = newNode(nkEmpty) + +proc openParser*( + p: var Parser; + filename: AbsoluteFile; + inputStream: PLLStream; + cache: IdentCache; + config: ConfigRef; + printTokens: bool +) = + openParser(p, fileInfoIdx(config, filename), inputStream, cache, config, printTokens) + +proc closeParser(p: var Parser) = + ## Close a parser, freeing up its resources. + closeLexer(p.lex) + +proc parMessage(p: Parser; msg: TMsgKind; arg = "") = + ## Produce and emit the parser message `arg` to output. + lexMessageTok(p.lex, msg, p.tok, arg) + +proc parMessage(p: Parser; msg: string; tok: Token) = + ## Produce and emit a parser message to output about the token `tok` + parMessage(p, errGenerated, msg % prettyTok(tok)) + +proc parMessage(p: Parser; arg: string) = + ## Produce and emit the parser message `arg` to output. + lexMessageTok(p.lex, errGenerated, p.tok, arg) + +template withInd(p, body: untyped) = + let oldInd = p.currInd + + p.currInd = p.tok.indent + + body + + p.currInd = oldInd + +template newlineWasSplitting(p: var Parser) = + discard + +# TODO nimpretty leftover +template realInd(p): bool = + p.tok.indent > p.currInd + +template sameInd(p): bool = + p.tok.indent == p.currInd + +template sameOrNoInd(p): bool = + p.tok.indent == p.currInd or p.tok.indent < 0 + +proc validInd(p: var Parser): bool {.inline.} = + result = p.tok.indent < 0 or p.tok.indent > p.currInd + +proc addComment(node: PNode; tok: Token; commentLoc: CommentLoc) = + case commentLoc + of clPrefix: + node.prefix.add tok + of clMid: + node.mid.add tok + of clPostfix: + node.postfix.add tok + +proc rawSkipComment( + p: var Parser; node: PNode; commentLoc = clPostfix; ind = 0; maxInd = int.high +) = + while p.tok.tokType == tkComment and ( + p.tok.indent == -1 or (p.tok.indent >= ind and p.tok.indent < maxInd) + ): + # debugEcho "rsk ", p.tok.indent, " ", ind, " ", maxInd, " ", $p.tok + if node != nil: + addComment(node, p.tok, commentLoc) + else: + parMessage(p, errInternal, "skipComment") + + getTok(p) + +proc skipComment(p: var Parser; node: PNode; commentLoc = clPostfix) = + rawSkipComment(p, node, commentLoc) + +proc indComment(p: var Parser; node: PNode; commentLoc = clPostfix) = + # Add all comments at the current indent level or greater to node - this + # is useful to catch comments in statement lists etc + rawSkipComment(p, node, commentLoc, p.currInd) + +proc commentLookahead(p: var Parser; maxInd = int.high): seq[Token] = + while p.tok.tokType == tkComment and p.tok.indent < maxInd: + result.add p.tok + + getTok(p) + +const + errInvalidIndentation = "invalid indentation $1" + errIdentifierExpected = "identifier expected, but got '$1'" + errExprExpected = "expression expected, but found '$1'" + +proc skipInd(p: var Parser) = + if p.tok.indent >= 0: + if not realInd(p): + parMessage(p, errInvalidIndentation % "skipInd") + +proc optPar(p: var Parser) = + if p.tok.indent >= 0: + if p.tok.indent < p.currInd: + parMessage(p, errInvalidIndentation % "optPar") + +proc optInd(p: var Parser; n: PNode; commentLoc = clPostfix) = + skipComment(p, n, commentLoc) + skipInd(p) + +proc getTokNoInd(p: var Parser) = + getTok(p) + if p.tok.indent >= 0: + parMessage(p, errInvalidIndentation % "getTokNoInd") + +proc expectIdentOrKeyw(p: Parser) = + if p.tok.tokType != tkSymbol and not isKeyword(p.tok.tokType): + lexMessage(p.lex, errGenerated, errIdentifierExpected % prettyTok(p.tok)) + +proc expectIdent(p: Parser) = + if p.tok.tokType != tkSymbol: + lexMessage(p.lex, errGenerated, errIdentifierExpected % prettyTok(p.tok)) + +proc eat(p: var Parser; tokType: TokType) = + ## Move the parser to the next token if the current token is of type + ## `tokType`, otherwise error. + if p.tok.tokType == tokType: + getTok(p) + else: + # raiseAssert "" + lexMessage( + p.lex, + errGenerated, + "expected: '" & $tokType & "', but got: '" & prettyTok(p.tok) & "'" + ) + +proc parLineInfo(p: Parser): TLineInfo = + ## Retrieve the line information associated with the parser's current state. + result = getLineInfo(p.lex, p.tok) + +proc splitComments( + comments: openArray[Token]; a: PNode; ind: int; commentLoc: CommentLoc +): seq[Token] = + for c in comments: + if c.indent == -1 or c.indent > ind: + a.addComment(c, commentLoc) + else: + result.add(c) + +proc splitLookahead(p: var Parser; n: PNode; commentLoc: CommentLoc) = + let comments = p.skipped & commentLookahead(p) + + p.skipped = splitComments(comments, n, p.tok.indent, commentLoc) + +proc indAndComment( + p: var Parser; n: PNode; commentLoc = clPostfix; maybeMissEquals = false +) = + indComment(p, n, commentLoc) + if p.tok.indent > p.currInd: + if maybeMissEquals: + let col = p.bufposPrevious - p.lineStartPrevious + + var info = newLineInfo(p.lex.fileIdx, p.lineNumberPrevious, col) + + parMessage( + p, "invalid indentation, maybe you forgot a '=' at $1 ?" % [p.lex.config $ info] + ) + else: + #raiseAssert $p.tok, " ", p.parLineInfo() + parMessage(p, errInvalidIndentation % "indAndComment") + +proc newNodeP(kind: TNodeKind; p: var Parser): PNode = + result = newNodeI(kind, parLineInfo(p)) + result.prefix = move(p.skipped) + +proc newIntNodeP(kind: TNodeKind; intVal: BiggestInt; p: var Parser): PNode = + result = newNodeP(kind, p) + result.intVal = intVal + +proc newFloatNodeP(kind: TNodeKind; floatVal: BiggestFloat; p: var Parser): PNode = + result = newNodeP(kind, p) + result.floatVal = floatVal + +proc newStrNodeP(kind: TNodeKind; strVal: string; p: var Parser): PNode = + result = newNodeP(kind, p) + result.strVal = strVal + +proc newIdentNodeP(ident: PIdent; p: var Parser): PNode = + result = newNodeP(nkIdent, p) + result.ident = ident + +proc parseExpr(p: var Parser): PNode + +proc parseStmt(p: var Parser): PNode + +proc parseTypeDesc(p: var Parser; fullExpr = false): PNode + +proc parseTypeDefValue(p: var Parser): PNode + +proc parseParamList(p: var Parser; retColon = true): PNode + +proc isSigilLike(tok: Token): bool {.inline.} = + result = tok.tokType == tkOpr and tok.ident.s[0] == '@' + +proc isRightAssociative(tok: Token): bool {.inline.} = + ## Determines whether the token is right assocative. + result = tok.tokType == tkOpr and tok.ident.s[0] == '^' + +# or (tok.ident.s.len > 1 and tok.ident.s[^1] == '>') +proc isUnary(tok: Token): bool = + ## Check if the given token is a unary operator + tok.tokType in {tkOpr, tkDotDot} and tok.spacing == {tsLeading} + +proc checkBinary(p: Parser) {.inline.} = + ## Check if the current parser token is a binary operator. + # we don't check '..' here as that's too annoying + if p.tok.tokType == tkOpr: + if p.tok.spacing == {tsTrailing}: + parMessage(p, warnInconsistentSpacing, prettyTok(p.tok)) + +#| module = complexOrSimpleStmt ^* (';' / IND{=}) +#| +#| comma = ',' COMMENT? +#| semicolon = ';' COMMENT? +#| colon = ':' COMMENT? +#| colcom = ':' COMMENT? +#| +#| operator = OP0 | OP1 | OP2 | OP3 | OP4 | OP5 | OP6 | OP7 | OP8 | OP9 +#| | 'or' | 'xor' | 'and' +#| | 'is' | 'isnot' | 'in' | 'notin' | 'of' | 'as' | 'from' +#| | 'div' | 'mod' | 'shl' | 'shr' | 'not' | '..' +#| +#| prefixOperator = operator +#| +#| optInd = COMMENT? IND? +#| optPar = (IND{>} | IND{=})? +#| +#| simpleExpr = arrowExpr (OP0 optInd arrowExpr)* pragma? +#| arrowExpr = assignExpr (OP1 optInd assignExpr)* +#| assignExpr = orExpr (OP2 optInd orExpr)* +#| orExpr = andExpr (OP3 optInd andExpr)* +#| andExpr = cmpExpr (OP4 optInd cmpExpr)* +#| cmpExpr = sliceExpr (OP5 optInd sliceExpr)* +#| sliceExpr = ampExpr (OP6 optInd ampExpr)* +#| ampExpr = plusExpr (OP7 optInd plusExpr)* +#| plusExpr = mulExpr (OP8 optInd mulExpr)* +#| mulExpr = dollarExpr (OP9 optInd dollarExpr)* +#| dollarExpr = primary (OP10 optInd primary)* +proc isOperator(tok: Token): bool = + #| operatorB = OP0 | OP1 | OP2 | OP3 | OP4 | OP5 | OP6 | OP7 | OP8 | OP9 | + #| 'div' | 'mod' | 'shl' | 'shr' | 'in' | 'notin' | + #| 'is' | 'isnot' | 'not' | 'of' | 'as' | 'from' | '..' | 'and' | 'or' | 'xor' + tok.tokType in { + tkOpr, tkDiv, tkMod, tkShl, tkShr, tkIn, tkNotin, tkIs, tkIsnot, tkNot, tkOf, + tkAs, tkFrom, tkDotDot, tkAnd, tkOr, tkXor + } + +proc parseComStmt(p: var Parser; n: PNode; commentLoc = clPostfix): PNode = + splitLookahead(p, n, commentLoc) + parseStmt(p) + +proc parseColComStmt(p: var Parser; n: PNode; commentLoc = clPostfix): PNode = + # `:` followed by a list of statements, with comments interspresed + # Comments with greater indent than the statements are added to `n` at + # `commentLoc` - these typically are part of what was just parsed. + # + # Comments at the statement level are added as prefixes to the statement + # since they are more likely to be part of whatever the statements are doing. + # This strategy requires lookahead for the comment tokents. + eat(p, tkColon) + parseComStmt(p, n, commentLoc) + +const + tkBuiltInMagics = {tkType, tkStatic, tkAddr} + +template setEndInfo() = + # TODO nimsuggest leftover + discard + +proc parseSymbol(p: var Parser; mode = smNormal): PNode = + #| symbol = '`' (KEYW|IDENT|literal|(operator|'('|')'|'['|']'|'{'|'}'|'=')+)+ '`' + #| | IDENT | 'addr' | 'type' | 'static' + #| symbolOrKeyword = symbol | KEYW + case p.tok.tokType + of tkSymbol: + result = newIdentNodeP(p.tok.ident, p) + + getTok(p) + of tokKeywordLow .. tokKeywordHigh: + if p.tok.tokType in tkBuiltInMagics or mode == smAfterDot: + # for backwards compatibility these 2 are always valid: + result = newIdentNodeP(p.tok.ident, p) + + getTok(p) + elif p.tok.tokType == tkNil and mode == smAllowNil: + result = newNodeP(nkNilLit, p) + + getTok(p) + else: + parMessage(p, errIdentifierExpected, p.tok) + + result = p.emptyNode + of tkAccent: + result = newNodeP(nkAccQuoted, p) + + getTok(p) + # progress guaranteed + while true: + case p.tok.tokType + of tkAccent: + if result.len == 0: + parMessage(p, errIdentifierExpected, p.tok) + + break + of tkOpr, tkDot, tkDotDot, tkEquals, tkParLe .. tkParDotRi: + var lineinfo = parLineInfo(p) + var accm = "" + while p.tok.tokType in {tkOpr, tkDot, tkDotDot, tkEquals, tkParLe .. tkParDotRi}: + accm.add($p.tok) + getTok(p) + + let node = newNodeI(nkIdent, lineinfo) + + node.ident = p.lex.cache.getIdent(accm) + + result.add(node) + of tokKeywordLow .. tokKeywordHigh, tkSymbol, tkIntLit .. tkCustomLit: + result.add(newIdentNodeP(p.lex.cache.getIdent($p.tok), p)) + getTok(p) + else: + parMessage(p, errIdentifierExpected, p.tok) + + break + + eat(p, tkAccent) + else: + parMessage(p, errIdentifierExpected, p.tok) + + # BUGFIX: We must consume a token here to prevent endless loops! + # But: this really sucks for idetools and keywords, so we don't do it + # if it is a keyword: + #if not isKeyword(p.tok.tokType): getTok(p) + result = p.emptyNode + + setEndInfo() + +proc equals(p: var Parser; a: PNode): PNode = + if p.tok.tokType == tkEquals: + result = newNodeP(nkExprEqExpr, p) + + getTok(p) + + p.skipped = commentLookahead(p) + + result.add(a) + result.add(parseExpr(p)) + splitLookahead(p, result, clPostfix) + else: + result = a + +proc colonOrEquals(p: var Parser; a: PNode): PNode = + if p.tok.tokType == tkColon: + result = newNodeP(nkExprColonExpr, p) + + getTok(p) + splitLookahead(p, result, clPostfix) # TODO mid? + + p.skipped = commentLookahead(p) + + #optInd(p, result) + result.add(a) + result.add(parseExpr(p)) + splitLookahead(p, result, clPostfix) + else: + result = equals(p, a) + +proc exprColonEqExpr(p: var Parser): PNode = + #| exprColonEqExpr = expr ((':'|'=') expr + #| / doBlock extraPostExprBlock*)? + var a = parseExpr(p) + if p.tok.tokType == tkDo: + result = postExprBlocks(p, a) + else: + result = colonOrEquals(p, a) + +proc exprEqExpr(p: var Parser): PNode = + #| exprEqExpr = expr ('=' expr + #| / doBlock extraPostExprBlock*)? + var a = parseExpr(p) + if p.tok.tokType == tkDo: + result = postExprBlocks(p, a) + else: + result = equals(p, a) + +proc exprList(p: var Parser; endTok: TokType; result: PNode) = + #| exprList = expr ^+ comma + getTok(p) + + p.skipped.add commentLookahead(p) + + skipInd(p) + + # progress guaranteed + var + a = parseExpr(p) + + result.add(a) + while (p.tok.tokType != endTok) and (p.tok.tokType != tkEof): + if p.tok.tokType != tkComma: + break + + getTok(p) + splitLookahead(p, a, clPostfix) + skipInd(p) + + var a = parseExpr(p) + + result.add(a) + +proc optionalExprList(p: var Parser; endTok: TokType; result: PNode) = + #| optionalExprList = expr ^* comma + getTok(p) + + p.skipped.add commentLookahead(p) + + skipInd(p) + # progress guaranteed + while (p.tok.tokType != endTok) and (p.tok.tokType != tkEof): + var a = parseExpr(p) + + result.add(a) + if p.tok.tokType != tkComma: + break + + getTok(p) + splitLookahead(p, a, clPostfix) + skipInd(p) + +proc exprColonEqExprListAux(p: var Parser; endTok: TokType; result: PNode) = + assert(endTok in {tkCurlyRi, tkCurlyDotRi, tkBracketRi, tkParRi}) + getTok(p) + splitLookahead(p, result, clMid) + optPar(p) + # progress guaranteed + while p.tok.tokType != endTok and p.tok.tokType != tkEof: + var a = exprColonEqExpr(p) + + result.add(a) + splitLookahead(p, a, clPostfix) + if p.tok.tokType != tkComma: + break + elif result.kind == nkPar: + result.transitionSonsKind(nkTupleConstr) + + getTok(p) + splitLookahead(p, a, clPostfix) + + optPar(p) + eat(p, endTok) + +proc exprColonEqExprList(p: var Parser; kind: TNodeKind; endTok: TokType): PNode = + #| exprColonEqExprList = exprColonEqExpr (comma exprColonEqExpr)* (comma)? + result = newNodeP(kind, p) + + exprColonEqExprListAux(p, endTok, result) + +proc dotExpr(p: var Parser; a: PNode): PNode = + var info = p.parLineInfo + + getTok(p) + + result = newNodeP(nkDotExpr, p) + result.info = info + + splitLookahead(p, result, clMid) + skipInd(p) + result.add(a) + result.add(parseSymbol(p, smAfterDot)) + # TODO non-line-ending comments? + # splitLookahead(p, result[^1], clPostfix) + if p.tok.tokType == tkBracketLeColon and tsLeading notin p.tok.spacing: + var x = newNodeP(nkBracketExpr, p) + + # rewrite 'x.y[:z]()' to 'y[z](x)' + x.add result[1] + + exprList(p, tkBracketRi, x) + eat(p, tkBracketRi) + + var y = newNodeP(nkCall, p) + + y.add x + y.add result[0] + if p.tok.tokType == tkParLe and tsLeading notin p.tok.spacing: + exprColonEqExprListAux(p, tkParRi, y) + + result = y + +proc dotLikeExpr(p: var Parser; a: PNode): PNode = + var info = p.parLineInfo + + result = newNodeI(nkInfix, info) + + splitLookahead(p, result, clMid) + skipInd(p) + + var opNode = newIdentNodeP(p.tok.ident, p) + + getTok(p) + result.add(opNode) + result.add(a) + result.add(parseSymbol(p, smAfterDot)) + splitLookahead(p, result[^1], clPostfix) + +proc qualifiedIdent(p: var Parser): PNode = + #| qualifiedIdent = symbol ('.' optInd symbolOrKeyword)? + result = parseSymbol(p) + + splitLookahead(p, result, clPostfix) + if p.tok.tokType == tkDot: + result = dotExpr(p, result) + +proc setOrTableConstr(p: var Parser): PNode = + #| setOrTableConstr = '{' ((exprColonEqExpr comma)* | ':' ) '}' + result = newNodeP(nkCurly, p) + + getTok(p) # skip '{' + optInd(p, result) + if p.tok.tokType == tkColon: + getTok(p) # skip ':' + result.transitionSonsKind(nkTableConstr) + else: + # progress guaranteed + while p.tok.tokType notin {tkCurlyRi, tkEof}: + var a = exprColonEqExpr(p) + if a.kind == nkExprColonExpr: + result.transitionSonsKind(nkTableConstr) + + result.add(a) + if p.tok.tokType != tkComma: + break + + getTok(p) + skipComment(p, a) + + optPar(p) + eat(p, tkCurlyRi) # skip '}' + +proc parseCast(p: var Parser): PNode = + #| castExpr = 'cast' ('[' optInd typeDesc optPar ']' '(' optInd expr optPar ')') / + # ('(' optInd exprColonEqExpr optPar ')') + result = newNodeP(nkCast, p) + + getTok(p) + if p.tok.tokType == tkBracketLe: + getTok(p) + optInd(p, result) + result.add(parseTypeDesc(p)) + optPar(p) + eat(p, tkBracketRi) + eat(p, tkParLe) + optInd(p, result) + result.add(parseExpr(p)) + else: + result.add p.emptyNode + + eat(p, tkParLe) + optInd(p, result) + result.add(exprColonEqExpr(p)) + + optPar(p) + eat(p, tkParRi) + setEndInfo() + +proc setBaseFlags(n: PNode; base: NumericalBase) = + case base + of base10: + discard + of base2: + incl(n.flags, nfBase2) + of base8: + incl(n.flags, nfBase8) + of base16: + incl(n.flags, nfBase16) + +proc parseGStrLit(p: var Parser; a: PNode): PNode = + case p.tok.tokType + of tkGStrLit: + result = newNodeP(nkCallStrLit, p) + + result.add(a) + result.add(newStrNodeP(nkRStrLit, p.tok.literal, p)) + getTok(p) + of tkGTripleStrLit: + result = newNodeP(nkCallStrLit, p) + + result.add(a) + result.add(newStrNodeP(nkTripleStrLit, p.tok.literal, p)) + getTok(p) + else: + result = a + + setEndInfo() + +proc complexOrSimpleStmt(p: var Parser): PNode + +proc simpleExpr(p: var Parser; mode = pmNormal): PNode + +proc parseIfOrWhenExpr(p: var Parser; kind: TNodeKind): PNode + +proc semiStmtList(p: var Parser; result: PNode) = + inc p.inSemiStmtList + + withInd(p): + let a = + case p.tok.tokType + of tkIf: + parseIfOrWhenExpr(p, nkIfStmt) + of tkWhen: + parseIfOrWhenExpr(p, nkWhenStmt) + else: + complexOrSimpleStmt(p) + + result.add a + while p.tok.tokType != tkEof: + if p.tok.tokType == tkSemiColon: + getTok(p) + if p.tok.tokType == tkParRi: + break + elif not (sameInd(p) or realInd(p)): + parMessage(p, errInvalidIndentation % "semiStmtList") + + let a = complexOrSimpleStmt(p) + if a.kind == nkEmpty: + debugEcho "2" + + parMessage(p, errExprExpected, p.tok) + getTok(p) + else: + result.add a + + dec p.inSemiStmtList + + result.transitionSonsKind(nkStmtListExpr) + +proc parsePar(p: var Parser): PNode = + #| parKeyw = 'discard' | 'include' | 'if' | 'while' | 'case' | 'try' + #| | 'finally' | 'except' | 'for' | 'block' | 'const' | 'let' + #| | 'when' | 'var' | 'mixin' + #| par = '(' optInd + #| ( &parKeyw (ifExpr / complexOrSimpleStmt) ^+ ';' + #| | ';' (ifExpr / complexOrSimpleStmt) ^+ ';' + #| | pragmaStmt + #| | simpleExpr ( (doBlock extraPostExprBlock*) + #| | ('=' expr (';' (ifExpr / complexOrSimpleStmt) ^+ ';' )? ) + #| | (':' expr (',' exprColonEqExpr ^+ ',' )? ) ) ) + #| optPar ')' + # + # unfortunately it's ambiguous: (expr: expr) vs (exprStmt); however a + # leading ';' could be used to enforce a 'stmt' context ... + result = newNodeP(nkPar, p) + + getTok(p) + + p.skipped = commentLookahead(p) + + skipInd(p) + if p.tok.tokType in { + tkDiscard, tkInclude, tkIf, tkWhile, tkCase, tkTry, tkDefer, tkFinally, tkExcept, + tkBlock, tkConst, tkLet, tkWhen, tkVar, tkFor, tkMixin + }: + # XXX 'bind' used to be an expression, so we exclude it here; + # tests/reject/tbind2 fails otherwise. + semiStmtList(p, result) + elif p.tok.tokType == tkSemiColon: + # '(;' enforces 'stmt' context: + getTok(p) + optInd(p, result) + semiStmtList(p, result) + elif p.tok.tokType == tkCurlyDotLe: + result.add(parseStmtPragma(p)) + elif p.tok.tokType == tkParRi: + # Empty tuple '()' + result.transitionSonsKind(nkTupleConstr) + else: + var a = simpleExpr(p) + if p.tok.tokType == tkDo: + result = postExprBlocks(p, a) + elif p.tok.tokType == tkEquals: + # special case: allow assignments + let asgn = newNodeP(nkAsgn, p) + + getTok(p) + optInd(p, result) + + let b = parseExpr(p) + + asgn.add a + asgn.add b + + result.add(asgn) + if p.tok.tokType == tkSemiColon: + semiStmtList(p, result) + elif p.tok.tokType == tkSemiColon: + # stmt context: + result.add(a) + semiStmtList(p, result) + else: + a = colonOrEquals(p, a) + if a.kind == nkExprColonExpr: + result.transitionSonsKind(nkTupleConstr) + + result.add(a) + if p.tok.tokType == tkComma: + getTok(p) + skipComment(p, a) + # (1,) produces a tuple expression: + result.transitionSonsKind(nkTupleConstr) + # progress guaranteed + while p.tok.tokType != tkParRi and p.tok.tokType != tkEof: + var a = exprColonEqExpr(p) + + result.add(a) + if p.tok.tokType != tkComma: + break + + getTok(p) + skipComment(p, a) + + optPar(p) + eat(p, tkParRi) + setEndInfo() + +proc identOrLiteral(p: var Parser; mode: PrimaryMode): PNode = + #| literal = | INT_LIT | INT8_LIT | INT16_LIT | INT32_LIT | INT64_LIT + #| | UINT_LIT | UINT8_LIT | UINT16_LIT | UINT32_LIT | UINT64_LIT + #| | FLOAT_LIT | FLOAT32_LIT | FLOAT64_LIT + #| | STR_LIT | RSTR_LIT | TRIPLESTR_LIT + #| | CHAR_LIT | CUSTOM_NUMERIC_LIT + #| | NIL + #| generalizedLit = GENERALIZED_STR_LIT | GENERALIZED_TRIPLESTR_LIT + #| identOrLiteral = generalizedLit | symbol | literal + #| | par | arrayConstr | setOrTableConstr | tupleConstr + #| | castExpr + #| tupleConstr = '(' optInd (exprColonEqExpr comma?)* optPar ')' + #| arrayConstr = '[' optInd (exprColonEqExpr comma?)* optPar ']' + case p.tok.tokType + of tkSymbol, tkBuiltInMagics, tkOut: + result = newIdentNodeP(p.tok.ident, p) + + getTok(p) + + result = parseGStrLit(p, result) + of tkAccent: + result = parseSymbol(p) # literals + of tkIntLit: + result = newIntNodeP(nkIntLit, p.tok.iNumber, p) + + setBaseFlags(result, p.tok.base) + getTok(p) + of tkInt8Lit: + result = newIntNodeP(nkInt8Lit, p.tok.iNumber, p) + + setBaseFlags(result, p.tok.base) + getTok(p) + of tkInt16Lit: + result = newIntNodeP(nkInt16Lit, p.tok.iNumber, p) + + setBaseFlags(result, p.tok.base) + getTok(p) + of tkInt32Lit: + result = newIntNodeP(nkInt32Lit, p.tok.iNumber, p) + + setBaseFlags(result, p.tok.base) + getTok(p) + of tkInt64Lit: + result = newIntNodeP(nkInt64Lit, p.tok.iNumber, p) + + setBaseFlags(result, p.tok.base) + getTok(p) + of tkUIntLit: + result = newIntNodeP(nkUIntLit, p.tok.iNumber, p) + + setBaseFlags(result, p.tok.base) + getTok(p) + of tkUInt8Lit: + result = newIntNodeP(nkUInt8Lit, p.tok.iNumber, p) + + setBaseFlags(result, p.tok.base) + getTok(p) + of tkUInt16Lit: + result = newIntNodeP(nkUInt16Lit, p.tok.iNumber, p) + + setBaseFlags(result, p.tok.base) + getTok(p) + of tkUInt32Lit: + result = newIntNodeP(nkUInt32Lit, p.tok.iNumber, p) + + setBaseFlags(result, p.tok.base) + getTok(p) + of tkUInt64Lit: + result = newIntNodeP(nkUInt64Lit, p.tok.iNumber, p) + + setBaseFlags(result, p.tok.base) + getTok(p) + of tkFloatLit: + result = newFloatNodeP(nkFloatLit, p.tok.fNumber, p) + + setBaseFlags(result, p.tok.base) + getTok(p) + of tkFloat32Lit: + result = newFloatNodeP(nkFloat32Lit, p.tok.fNumber, p) + + setBaseFlags(result, p.tok.base) + getTok(p) + of tkFloat64Lit: + result = newFloatNodeP(nkFloat64Lit, p.tok.fNumber, p) + + setBaseFlags(result, p.tok.base) + getTok(p) + of tkFloat128Lit: + result = newFloatNodeP(nkFloat128Lit, p.tok.fNumber, p) + + setBaseFlags(result, p.tok.base) + getTok(p) + of tkStrLit: + result = newStrNodeP(nkStrLit, p.tok.literal, p) + + getTok(p) + of tkRStrLit: + result = newStrNodeP(nkRStrLit, p.tok.literal, p) + + getTok(p) + of tkTripleStrLit: + result = newStrNodeP(nkTripleStrLit, p.tok.literal, p) + + getTok(p) + of tkCharLit: + result = newIntNodeP(nkCharLit, ord(p.tok.literal[0]), p) + + getTok(p) + of tkCustomLit: + let splitPos = p.tok.iNumber.int + let str = newStrNodeP(nkRStrLit, p.tok.literal.substr(0, splitPos - 1), p) + let callee = newIdentNodeP(getIdent(p.lex.cache, p.tok.literal.substr(splitPos)), p) + + callee.info.offsetA += splitPos + + result = newNodeP(nkDotExpr, p) + + result.add str + result.add callee + + getTok(p) + of tkNil: + result = newNodeP(nkNilLit, p) + + getTok(p) + of tkParLe: + # () constructor + if mode in {pmTypeDesc, pmTypeDef}: + result = exprColonEqExprList(p, nkPar, tkParRi) + else: + result = parsePar(p) + of tkCurlyLe: + # {} constructor + result = setOrTableConstr(p) + of tkBracketLe: + # [] constructor + result = exprColonEqExprList(p, nkBracket, tkBracketRi) + of tkCast: + result = parseCast(p) + else: + debugEcho "1" + + parMessage(p, errExprExpected, p.tok) + getTok(p) # we must consume a token here to prevent endless loops! + + result = p.emptyNode + +proc namedParams(p: var Parser; callee: PNode; kind: TNodeKind; endTok: TokType): PNode = + let a = callee + + result = newNodeP(kind, p) + + result.add(a) + # progress guaranteed + exprColonEqExprListAux(p, endTok, result) + +proc commandParam(p: var Parser; isFirstParam: var bool; mode: PrimaryMode): PNode = + if mode == pmTypeDesc: + result = simpleExpr(p, mode) + elif not isFirstParam: + result = exprEqExpr(p) + else: + result = parseExpr(p) + if p.tok.tokType == tkDo: + result = postExprBlocks(p, result) + + isFirstParam = false + +proc commandExpr(p: var Parser; r: PNode; mode: PrimaryMode): PNode = + if mode == pmTrySimple: + result = r + else: + result = newNodeP(nkCommand, p) + + result.add(r) + + var isFirstParam = true + + # progress NOT guaranteed + p.hasProgress = false + + result.add commandParam(p, isFirstParam, mode) + +proc isDotLike(tok: Token): bool = + result = + tok.tokType == tkOpr and tok.ident.s.len > 1 and tok.ident.s[0] == '.' and tok.ident.s[ + 1] != '.' + +proc primarySuffix(p: var Parser; r: PNode; baseIndent: int; mode: PrimaryMode): PNode = + #| primarySuffix = '(' (exprColonEqExpr comma?)* ')' + #| | '.' optInd symbolOrKeyword ('[:' exprList ']' ( '(' exprColonEqExpr ')' )?)? generalizedLit? + #| | DOTLIKEOP optInd symbolOrKeyword generalizedLit? + #| | '[' optInd exprColonEqExprList optPar ']' + #| | '{' optInd exprColonEqExprList optPar '}' + # XXX strong spaces need to be reflected above + result = r + # progress guaranteed + while p.tok.indent < 0 or (p.tok.tokType == tkDot and p.tok.indent >= baseIndent): + case p.tok.tokType + of tkParLe: + # progress guaranteed + if tsLeading in p.tok.spacing: + result = commandExpr(p, result, mode) + + break + + result = namedParams(p, result, nkCall, tkParRi) + + splitLookahead(p, result, clPostfix) + if result.len > 1 and result[1].kind == nkExprColonExpr: + result.transitionSonsKind(nkObjConstr) + of tkDot: + # progress guaranteed + result = dotExpr(p, result) + result = parseGStrLit(p, result) + + splitLookahead(p, result, clPostfix) + of tkBracketLe: + # progress guaranteed + if tsLeading in p.tok.spacing: + result = commandExpr(p, result, mode) + + break + + result = namedParams(p, result, nkBracketExpr, tkBracketRi) + of tkCurlyLe: + # progress guaranteed + if tsLeading in p.tok.spacing: + result = commandExpr(p, result, mode) + + break + + result = namedParams(p, result, nkCurlyExpr, tkCurlyRi) + of tkSymbol, + tkAccent, + tkIntLit .. tkCustomLit, + tkNil, + tkCast, + tkOpr, + tkDotDot, + tkVar, + tkOut, + tkStatic, + tkType, + tkEnum, + tkTuple, + tkObject, + tkProc: + # XXX: In type sections we allow the free application of the + # command syntax, with the exception of expressions such as + # `foo ref` or `foo ptr`. Unfortunately, these two are also + # used as infix operators for the memory regions feature and + # the current parsing rules don't play well here. + let isDotLike2 = p.tok.isDotLike + if isDotLike2 and p.lex.config.isDefined("nimPreviewDotLikeOps"): + # synchronize with `tkDot` branch + result = dotLikeExpr(p, result) + result = parseGStrLit(p, result) + else: + if isDotLike2: + parMessage( + p, + warnDotLikeOps, + "dot-like operators will be parsed differently with `-d:nimPreviewDotLikeOps`" + ) + if p.inPragma == 0 and (isUnary(p.tok) or p.tok.tokType notin {tkOpr, tkDotDot}): + # actually parsing {.push hints:off.} as {.push(hints:off).} is a sweet + # solution, but pragmas.nim can't handle that + result = commandExpr(p, result, mode) + + break + else: + break + +proc parseOperators( + p: var Parser; headNode: PNode; limit: int; mode: PrimaryMode +): PNode = + result = headNode + + # expand while operators have priorities higher than 'limit' + var + opPrec = getPrecedence(p.tok) + + let modeB = + if mode == pmTypeDef: + pmTypeDesc + else: + mode + # the operator itself must not start on a new line: + # progress guaranteed + while opPrec >= limit and p.tok.indent < 0 and not isUnary(p.tok): + checkBinary(p) + + let leftAssoc = ord(not isRightAssociative(p.tok)) + + var a = newNodeP(nkInfix, p) + var opNode = newIdentNodeP(p.tok.ident, p) # skip operator: + + getTok(p) + splitLookahead(p, opNode, clPostfix) + optPar(p) + + # read sub-expression with higher priority: + var + b = simpleExprAux(p, opPrec + leftAssoc, modeB) + + a.add(opNode) + a.add(result) + a.add(b) + + result = a + opPrec = getPrecedence(p.tok) + + setEndInfo() + +proc simpleExprAux(p: var Parser; limit: int; mode: PrimaryMode): PNode = + var mode = mode + + result = primary(p, mode) + if mode == pmTrySimple: + mode = pmNormal + if p.tok.tokType == tkCurlyDotLe and (p.tok.indent < 0 or realInd(p)) and mode == pmNormal: + var pragmaExp = newNodeP(nkPragmaExpr, p) + + pragmaExp.add result + pragmaExp.add p.parsePragma + + result = pragmaExp + + result = parseOperators(p, result, limit, mode) + +proc simpleExpr(p: var Parser; mode = pmNormal): PNode = + result = simpleExprAux(p, -1, mode) + +proc parsePragma(p: var Parser): PNode = + #| pragma = '{.' optInd (exprColonEqExpr comma?)* optPar ('.}' | '}') + result = newNodeP(nkPragma, p) + + inc p.inPragma + + getTok(p) + splitLookahead(p, result, clMid) + while p.tok.tokType notin {tkCurlyDotRi, tkCurlyRi, tkEof}: + p.hasProgress = false + + var a = exprColonEqExpr(p) + + splitLookahead(p, a, clPostfix) + if not p.hasProgress: + break + + result.add(a) + if p.tok.tokType == tkComma: + getTok(p) + splitLookahead(p, a, clPostfix) + + optPar(p) + if p.tok.tokType in {tkCurlyDotRi, tkCurlyRi}: + getTok(p) + else: + parMessage(p, "expected '.}'") + + dec p.inPragma + + setEndInfo() + +proc identVis(p: var Parser; allowDot = false): PNode = + #| identVis = symbol OPR? # postfix position + #| identVisDot = symbol '.' optInd symbolOrKeyword OPR? + var a = parseSymbol(p) + + splitLookahead(p, a, clPostfix) + if p.tok.tokType == tkOpr: + result = newNodeP(nkPostfix, p) + + result.add(newIdentNodeP(p.tok.ident, p)) + result.add(a) + getTok(p) + elif p.tok.tokType == tkDot and allowDot: + result = dotExpr(p, a) + else: + result = a + +proc identWithPragma(p: var Parser; allowDot = false): PNode = + #| identWithPragma = identVis pragma? + #| identWithPragmaDot = identVisDot pragma? + var a = identVis(p, allowDot) + if p.tok.tokType == tkCurlyDotLe: + result = newNodeP(nkPragmaExpr, p) + + result.add(a) + result.add(parsePragma(p)) + splitLookahead(p, result, clPostfix) + else: + result = a + +type + DeclaredIdentFlag = enum + withPragma # identifier may have pragma + withBothOptional # both ':' and '=' parts are optional + withDot # allow 'var ident.ident = value' + + DeclaredIdentFlags = set[DeclaredIdentFlag] + +proc parseIdentColonEquals(p: var Parser; flags: DeclaredIdentFlags): PNode = + #| declColonEquals = identWithPragma (comma identWithPragma)* comma? + #| (':' optInd typeDescExpr)? ('=' optInd expr)? + #| identColonEquals = IDENT (comma IDENT)* comma? + #| (':' optInd typeDescExpr)? ('=' optInd expr)?) + var a: PNode + + result = newNodeP(nkIdentDefs, p) + # progress guaranteed + while true: + case p.tok.tokType + of tkSymbol, tkAccent: + if withPragma in flags: + a = identWithPragma(p, allowDot = withDot in flags) + else: + a = parseSymbol(p) + if a.kind == nkEmpty: + return + else: + break + + result.add(a) + splitLookahead(p, a, clPostfix) + if p.tok.tokType != tkComma: + break + + getTok(p) + splitLookahead(p, a, clPostfix) + skipInd(p) + if p.tok.tokType == tkColon: + getTok(p) + splitLookahead(p, result, clMid) + skipInd(p) + result.add(parseTypeDesc(p, fullExpr = true)) + else: + result.add(newNodeP(nkEmpty, p)) + if p.tok.tokType != tkEquals and withBothOptional notin flags: + parMessage(p, "':' or '=' expected, but got '$1'", p.tok) + if p.tok.tokType == tkEquals: + getTok(p) + splitLookahead(p, result, clMid) + skipInd(p) + result.add(parseExpr(p)) + else: + result.add(newNodeP(nkEmpty, p)) + + splitLookahead(p, result, clPostfix) + setEndInfo() + +proc parseTuple(p: var Parser; indentAllowed = false): PNode = + #| tupleTypeBracket = '[' optInd (identColonEquals (comma/semicolon)?)* optPar ']' + #| tupleType = 'tuple' tupleTypeBracket + #| tupleDecl = 'tuple' (tupleTypeBracket / + #| COMMENT? (IND{>} identColonEquals (IND{=} identColonEquals)*)?) + result = newNodeP(nkTupleTy, p) + + getTok(p) + if p.tok.tokType == tkBracketLe: + getTok(p) + + p.skipped = commentLookahead(p) + + skipInd(p) + # progress guaranteed + while p.tok.tokType in {tkSymbol, tkAccent}: + var a = parseIdentColonEquals(p, {}) + + result.add(a) + if p.tok.tokType notin {tkComma, tkSemiColon}: + break + + getTok(p) + splitLookahead(p, a, clPostfix) + + optPar(p) + eat(p, tkBracketRi) + splitLookahead(p, result, clPostfix) + elif indentAllowed: + splitLookahead(p, result, clMid) + if realInd(p): + withInd(p): + splitLookahead(p, result, clMid) + # progress guaranteed + while true: + case p.tok.tokType + of tkSymbol, tkAccent: + var a = parseIdentColonEquals(p, {}) + + result.add(a) + of tkEof: + break + else: + parMessage(p, errIdentifierExpected, p.tok) + + break + if not sameInd(p): + break + + splitLookahead(p, result, clPostfix) + elif p.tok.tokType == tkParLe: + parMessage( + p, errGenerated, "the syntax for tuple types is 'tuple[...]', not 'tuple(...)'" + ) + else: + result = newNodeP(nkTupleClassTy, p) + + splitLookahead(p, result, clPostfix) + + setEndInfo() + +proc parseParamList(p: var Parser; retColon = true): PNode = + #| paramList = '(' declColonEquals ^* (comma/semicolon) ')' + #| paramListArrow = paramList? ('->' optInd typeDesc)? + #| paramListColon = paramList? (':' optInd typeDesc)? + var a: PNode + + result = newNodeP(nkFormalParams, p) + + result.add(p.emptyNode) # return type + + let hasParLe = p.tok.tokType == tkParLe and p.tok.indent < 0 + if hasParLe: + getTok(p) + splitLookahead(p, result, clMid) + skipInd(p) + # progress guaranteed + while true: + case p.tok.tokType + of tkSymbol, tkAccent: + a = parseIdentColonEquals(p, {withBothOptional, withPragma}) + of tkParRi: + break + of tkVar: + parMessage( + p, errGenerated, "the syntax is 'parameter: var T', not 'var parameter: T'" + ) + + break + else: + parMessage(p, "expected closing ')'") + + break + + result.add(a) + skipComment(p, a) + if p.tok.tokType notin {tkComma, tkSemiColon}: + break + + getTok(p) + skipComment(p, a) + + optPar(p) + eat(p, tkParRi) + + let hasRet = + if retColon: + p.tok.tokType == tkColon + else: + p.tok.tokType == tkOpr and p.tok.ident.s == "->" + if hasRet and p.tok.indent < 0: + getTok(p) + optInd(p, result) + + result[0] = parseTypeDesc(p) + elif not retColon and not hasParLe: + # Mark as "not there" in order to mark for deprecation in the semantic pass: + result = p.emptyNode + + setEndInfo() + +proc optPragmas(p: var Parser): PNode = + if p.tok.tokType == tkCurlyDotLe and (p.tok.indent < 0 or realInd(p)): + result = parsePragma(p) + else: + result = p.emptyNode + +proc parseDoBlock(p: var Parser; info: TLineInfo): PNode = + #| doBlock = 'do' paramListArrow pragma? colcom stmt + var params = parseParamList(p, retColon = false) + + let pragmas = optPragmas(p) + + result = + newProcNode( + nkDo, + info, + body = nil, + params = params, + name = p.emptyNode, + pattern = p.emptyNode, + genericParams = p.emptyNode, + pragmas = pragmas, + exceptions = p.emptyNode + ) + + let body = parseColComStmt(p, result, clMid) + if params.kind != nkEmpty or pragmas.kind != nkEmpty: + if params.kind == nkEmpty: + params = newNodeP(nkFormalParams, p) + + params.add(p.emptyNode) # return type + + result[paramsPos] = params + + result[bodyPos] = body + else: + body.prefix.add(result.prefix) + body.mid.add(result.mid) + body.postfix.add(result.postfix) + + result = body + + setEndInfo() + +proc parseProcExpr(p: var Parser; isExpr: bool; kind: TNodeKind): PNode = + #| routineExpr = ('proc' | 'func' | 'iterator') paramListColon pragma? ('=' COMMENT? stmt)? + #| routineType = ('proc' | 'iterator') paramListColon pragma? + # either a proc type or a anonymous proc + let info = parLineInfo(p) + let hasSignature = p.tok.tokType in {tkParLe, tkColon} and p.tok.indent < 0 + let params = parseParamList(p) + let pragmas = optPragmas(p) + if p.tok.tokType == tkEquals and isExpr: + getTok(p) + + result = + newProcNode( + kind, + info, + body = p.emptyNode, + params = params, + name = p.emptyNode, + pattern = p.emptyNode, + genericParams = p.emptyNode, + pragmas = pragmas, + exceptions = p.emptyNode + ) + result[bodyPos] = parseComStmt(p, result, clMid) + else: + result = + newNodeI( + if kind == nkIteratorDef: + nkIteratorTy + else: + nkProcTy + , + info + ) + if hasSignature or pragmas.kind != nkEmpty: + if hasSignature: + result.add(params) + else: # pragmas but no param list, implies typeclass with pragmas + result.add(p.emptyNode) + if kind == nkFuncDef: + parMessage( + p, + "func keyword is not allowed in type descriptions, use proc with {.noSideEffect.} pragma instead" + ) + + result.add(pragmas) + + setEndInfo() + +proc isExprStart(p: Parser): bool = + case p.tok.tokType + of tkSymbol, + tkAccent, + tkOpr, + tkNot, + tkNil, + tkCast, + tkIf, + tkFor, + tkProc, + tkFunc, + tkIterator, + tkBind, + tkBuiltInMagics, + tkParLe, + tkBracketLe, + tkCurlyLe, + tkIntLit .. tkCustomLit, + tkVar, + tkRef, + tkPtr, + tkEnum, + tkTuple, + tkObject, + tkWhen, + tkCase, + tkOut, + tkTry, + tkBlock: + result = true + else: + result = false + +proc parseSymbolList(p: var Parser; result: PNode) = + # progress guaranteed + while true: + var s = parseSymbol(p, smAllowNil) + if s.kind == nkEmpty: + break + + result.add(s) + if p.tok.tokType != tkComma: + break + + getTok(p) + splitLookahead(p, s, clPostfix) + skipInd(p) + + setEndInfo() + +proc parseTypeDescKAux(p: var Parser; kind: TNodeKind; mode: PrimaryMode): PNode = + result = newNodeP(kind, p) + + getTok(p) + if p.tok.indent != -1 and p.tok.indent <= p.currInd: + return + + optInd(p, result) + + let isTypedef = mode == pmTypeDef and p.tok.tokType in {tkObject, tkTuple} + if not isOperator(p.tok) and isExprStart(p): + if isTypedef: + result.add(parseTypeDefValue(p)) + else: + result.add(primary(p, mode)) + if kind == nkDistinctTy and p.tok.tokType == tkSymbol: + # XXX document this feature! + var nodeKind: TNodeKind + if p.tok.ident.s == "with": + nodeKind = nkWith + elif p.tok.ident.s == "without": + nodeKind = nkWithout + else: + return result + + getTok(p) + + let list = newNodeP(nodeKind, p) + + result.add list + + parseSymbolList(p, list) + if mode == pmTypeDef and not isTypedef: + result = parseOperators(p, result, -1, mode) + + setEndInfo() + +proc parseVarTuple(p: var Parser): PNode + +proc parseFor(p: var Parser): PNode = + #| forStmt = 'for' ((varTuple / identWithPragma) ^+ comma) 'in' expr colcom stmt + #| forExpr = forStmt + getTokNoInd(p) + + result = newNodeP(nkForStmt, p) + if p.tok.tokType == tkParLe: + result.add(parseVarTuple(p)) + else: + var a = identWithPragma(p) + + result.add(a) + while p.tok.tokType == tkComma: + getTok(p) + optInd(p, a) + if p.tok.tokType == tkParLe: + result.add(parseVarTuple(p)) + + break + + a = identWithPragma(p) + + result.add(a) + + eat(p, tkIn) + result.add(parseExpr(p)) + result.add(parseColComStmt(p, result, clMid)) + setEndInfo() + +template nimprettyDontTouch(body) = + body # TODO nimpretty leftover + +proc parseExpr(p: var Parser): PNode = + #| expr = (blockExpr + #| | ifExpr + #| | whenExpr + #| | caseStmt + #| | forExpr + #| | tryExpr) + #| / simpleExpr + case p.tok.tokType + of tkBlock: + nimprettyDontTouch: + result = parseBlock(p) + of tkIf: + nimprettyDontTouch: + result = parseIfOrWhenExpr(p, nkIfExpr) + of tkFor: + nimprettyDontTouch: + result = parseFor(p) + of tkWhen: + nimprettyDontTouch: + result = parseIfOrWhenExpr(p, nkWhenExpr) + of tkCase: + # Currently we think nimpretty is good enough with case expressions, + # so it is allowed to touch them: + #nimprettyDontTouch: + result = parseCase(p) + of tkTry: + nimprettyDontTouch: + result = parseTry(p, isExpr = true) + else: + result = simpleExpr(p) + + setEndInfo() + +proc parseEnum(p: var Parser): PNode + +proc parseObject(p: var Parser): PNode + +proc parseTypeClass(p: var Parser): PNode + +proc primary(p: var Parser; mode: PrimaryMode): PNode = + #| simplePrimary = SIGILLIKEOP? identOrLiteral primarySuffix* + #| commandStart = &('`'|IDENT|literal|'cast'|'addr'|'type'|'var'|'out'| + #| 'static'|'enum'|'tuple'|'object'|'proc') + #| primary = simplePrimary (commandStart expr (doBlock extraPostExprBlock*)?)? + #| / operatorB primary + #| / routineExpr + #| / rawTypeDesc + #| / prefixOperator primary + # XXX strong spaces need to be reflected in commandStart + # command part is handled in the primarySuffix proc + # prefix operators: + if isOperator(p.tok): + # Note 'sigil like' operators are currently not reflected in the grammar + # and should be removed for Nim 2.0, I don't think anybody uses them. + let isSigil = isSigilLike(p.tok) + + result = newNodeP(nkPrefix, p) + + var a = newIdentNodeP(p.tok.ident, p) + + result.add(a) + getTok(p) + splitLookahead(p, a, clPostfix) + + const + identOrLiteralKinds = + tkBuiltInMagics + { + tkSymbol, + tkAccent, + tkNil, + tkIntLit .. tkCustomLit, + tkCast, + tkOut, + tkParLe, + tkBracketLe, + tkCurlyLe + } + if isSigil and p.tok.tokType in identOrLiteralKinds: + let baseInd = p.lex.currLineIndent + + result.add(identOrLiteral(p, mode)) + + result = primarySuffix(p, result, baseInd, mode) + else: + result.add(primary(p, pmNormal)) + + return + case p.tok.tokType + of tkProc: + getTok(p) + + result = parseProcExpr(p, mode != pmTypeDesc, nkLambda) + of tkFunc: + getTok(p) + + result = parseProcExpr(p, mode != pmTypeDesc, nkFuncDef) + of tkIterator: + getTok(p) + + result = parseProcExpr(p, mode != pmTypeDesc, nkIteratorDef) + of tkBind: + # legacy syntax, no-op in current nim + result = newNodeP(nkBind, p) + + getTok(p) + optInd(p, result) + result.add(primary(p, pmNormal)) + of tkTuple, tkEnum, tkObject, tkConcept, tkVar, tkOut, tkRef, tkPtr, tkDistinct: + result = parseTypeDesc(p) + else: + let baseInd = p.lex.currLineIndent + + result = identOrLiteral(p, mode) + result = primarySuffix(p, result, baseInd, mode) + +proc binaryNot(p: var Parser; a: PNode): PNode = + if p.tok.tokType == tkNot: + let notOpr = newIdentNodeP(p.tok.ident, p) + + getTok(p) + optInd(p, notOpr) + + let b = primary(p, pmTypeDesc) + + result = newNodeP(nkInfix, p) + + result.add notOpr + result.add a + result.add b + else: + result = a + +proc parseTypeDesc(p: var Parser; fullExpr = false): PNode = + #| rawTypeDesc = (tupleType | routineType | 'enum' | 'object' | + #| ('var' | 'out' | 'ref' | 'ptr' | 'distinct') typeDesc?) + #| ('not' primary)? + #| typeDescExpr = (routineType / simpleExpr) ('not' primary)? + #| typeDesc = rawTypeDesc / typeDescExpr + newlineWasSplitting(p) + if fullExpr: + result = simpleExpr(p, pmTypeDesc) + else: + case p.tok.tokType + of tkTuple: + result = parseTuple(p, false) + of tkProc: + getTok(p) + + result = parseProcExpr(p, false, nkLambda) + of tkIterator: + getTok(p) + + result = parseProcExpr(p, false, nkIteratorDef) + of tkEnum: + result = newNodeP(nkEnumTy, p) + + getTok(p) + of tkObject: + result = newNodeP(nkObjectTy, p) + + getTok(p) + of tkConcept: + parMessage(p, "the 'concept' keyword is only valid in 'type' sections") + of tkVar: + result = parseTypeDescKAux(p, nkVarTy, pmTypeDesc) + of tkOut: + result = parseTypeDescKAux(p, nkOutTy, pmTypeDesc) + of tkRef: + result = parseTypeDescKAux(p, nkRefTy, pmTypeDesc) + of tkPtr: + result = parseTypeDescKAux(p, nkPtrTy, pmTypeDesc) + of tkDistinct: + result = parseTypeDescKAux(p, nkDistinctTy, pmTypeDesc) + else: + result = simpleExpr(p, pmTypeDesc) + + result = binaryNot(p, result) + + setEndInfo() + +proc parseTypeDefValue(p: var Parser): PNode = + #| typeDefValue = ((tupleDecl | enumDecl | objectDecl | conceptDecl | + #| ('ref' | 'ptr' | 'distinct') (tupleDecl | objectDecl)) + #| / (simpleExpr (exprEqExpr ^+ comma postExprBlocks?)?)) + #| ('not' primary)? + case p.tok.tokType + of tkTuple: + result = parseTuple(p, true) + of tkRef: + result = parseTypeDescKAux(p, nkRefTy, pmTypeDef) + of tkPtr: + result = parseTypeDescKAux(p, nkPtrTy, pmTypeDef) + of tkDistinct: + result = parseTypeDescKAux(p, nkDistinctTy, pmTypeDef) + of tkEnum: + prettySection: + result = parseEnum(p) + of tkObject: + prettySection: + result = parseObject(p) + of tkConcept: + result = parseTypeClass(p) + else: + result = simpleExpr(p, pmTypeDef) + if p.tok.tokType != tkNot: + if result.kind == nkCommand: + var isFirstParam = false + while p.tok.tokType == tkComma: + getTok(p) + optInd(p, result) + result.add(commandParam(p, isFirstParam, pmTypeDef)) + + result = postExprBlocks(p, result) + + result = binaryNot(p, result) + + setEndInfo() + +proc makeCall(n: PNode): PNode = + ## Creates a call if the given node isn't already a call. + if n.kind in nkCallKinds: + result = n + else: + result = newNodeI(nkCall, n.info) + + result.add n + +proc postExprBlocks(p: var Parser; x: PNode): PNode = + #| extraPostExprBlock = ( IND{=} doBlock + #| | IND{=} 'of' exprList ':' stmt + #| | IND{=} 'elif' expr ':' stmt + #| | IND{=} 'except' optionalExprList ':' stmt + #| | IND{=} 'finally' ':' stmt + #| | IND{=} 'else' ':' stmt ) + #| postExprBlocks = (doBlock / ':' (extraPostExprBlock / stmt)) extraPostExprBlock* + result = x + if p.tok.indent >= 0: + return + + var + openingParams = p.emptyNode + openingPragmas = p.emptyNode + if p.tok.tokType == tkDo: + getTok(p) + + openingParams = parseParamList(p, retColon = false) + openingPragmas = optPragmas(p) + if p.tok.tokType == tkColon: + result = makeCall(result) + + getTok(p) + splitLookahead(p, result, clMid) + if not (p.tok.tokType in {tkOf, tkElif, tkElse, tkExcept, tkFinally} and sameInd(p)): + var stmtList = newNodeP(nkStmtList, p) + + stmtList.add parseStmt(p) + # to keep backwards compatibility (see tests/vm/tstringnil) + if stmtList[0].kind == nkStmtList: + stmtList = stmtList[0] + + stmtList.flags.incl nfBlockArg + if openingParams.kind != nkEmpty or openingPragmas.kind != nkEmpty: + if openingParams.kind == nkEmpty: + openingParams = newNodeP(nkFormalParams, p) + + openingParams.add(p.emptyNode) # return type + + result.add newProcNode( + nkDo, + stmtList.info, + body = stmtList, + params = openingParams, + name = p.emptyNode, + pattern = p.emptyNode, + genericParams = p.emptyNode, + pragmas = openingPragmas, + exceptions = p.emptyNode + ) + + result[^1].mid = move(result.mid) + else: + result.add stmtList + while sameInd(p): + var nextBlock: PNode + + let nextToken = p.tok.tokType + if nextToken == tkDo: + let info = parLineInfo(p) + + getTok(p) + + nextBlock = parseDoBlock(p, info) + else: + case nextToken + of tkOf: + nextBlock = newNodeP(nkOfBranch, p) + + exprList(p, tkColon, nextBlock) + of tkElif: + nextBlock = newNodeP(nkElifBranch, p) + + getTok(p) + optInd(p, nextBlock) + + nextBlock.add parseExpr(p) + of tkExcept: + nextBlock = newNodeP(nkExceptBranch, p) + + optionalExprList(p, tkColon, nextBlock) + of tkFinally: + nextBlock = newNodeP(nkFinally, p) + + getTok(p) + of tkElse: + nextBlock = newNodeP(nkElse, p) + + getTok(p) + else: + break + + eat(p, tkColon) + + nextBlock.add parseStmt(p) + + nextBlock.flags.incl nfBlockArg + result.add nextBlock + if nextBlock.kind in {nkElse, nkFinally}: + break + else: + if openingParams.kind != nkEmpty: + parMessage(p, "expected ':'") + +proc parseExprStmt(p: var Parser): PNode = + #| exprStmt = simpleExpr postExprBlocks? + #| / simplePrimary (exprEqExpr ^+ comma) postExprBlocks? + #| / simpleExpr '=' optInd (expr postExprBlocks?) + var a = simpleExpr(p, pmTrySimple) + if p.tok.tokType == tkEquals: + result = newNodeP(nkAsgn, p) + + getTok(p) + optInd(p, result) + + var b = parseExpr(p) + + b = postExprBlocks(p, b) + + result.add(a) + result.add(b) + else: + var isFirstParam = false + # if an expression is starting here, a simplePrimary was parsed and + # this is the start of a command + if p.tok.indent < 0 and isExprStart(p): + result = newTreeI(nkCommand, a.info, a) + + let baseIndent = p.currInd + while true: + result.add(commandParam(p, isFirstParam, pmNormal)) + if p.tok.tokType != tkComma or (p.tok.indent >= 0 and p.tok.indent < baseIndent): + break + + getTok(p) + optInd(p, result) + else: + result = a + + result = postExprBlocks(p, result) + + setEndInfo() + +proc parseModuleName(p: var Parser; kind: TNodeKind): PNode = + result = parseExpr(p) + + setEndInfo() + +proc parseImport(p: var Parser; kind: TNodeKind): PNode = + #| importStmt = 'import' optInd expr + #| ((comma expr)* + #| / 'except' optInd (expr ^+ comma)) + #| exportStmt = 'export' optInd expr + #| ((comma expr)* + #| / 'except' optInd (expr ^+ comma)) + result = newNodeP(kind, p) + + getTok(p) # skip `import` or `export` + + p.skipped = commentLookahead(p) # TODO `mid` for import? + + skipInd(p) + + var a = parseModuleName(p, kind) + + result.add(a) + splitLookahead(p, a, clPostfix) + if p.tok.tokType in {tkComma, tkExcept}: + if p.tok.tokType == tkExcept: + result.transitionSonsKind(succ(kind)) + + getTok(p) + splitLookahead(p, a, clPostfix) + while true: + # was: while p.tok.tokType notin {tkEof, tkSad, tkDed}: + p.hasProgress = false + a = parseModuleName(p, kind) + if a.kind == nkEmpty or not p.hasProgress: + break + + splitLookahead(p, a, clPostfix) + result.add(a) + if p.tok.tokType != tkComma: + break + + getTok(p) + splitLookahead(p, a, clPostfix) + skipInd(p) + + #expectNl(p) + setEndInfo() + +proc parseIncludeStmt(p: var Parser): PNode = + #| includeStmt = 'include' optInd expr ^+ comma + result = newNodeP(nkIncludeStmt, p) + + getTok(p) # skip `import` or `include` + + p.skipped = commentLookahead(p) # TODO `mid` for include? + while true: + # was: while p.tok.tokType notin {tkEof, tkSad, tkDed}: + p.hasProgress = false + + var a = parseExpr(p) + if a.kind == nkEmpty or not p.hasProgress: + break + + splitLookahead(p, a, clPostfix) + result.add(a) + if p.tok.tokType != tkComma: + break + + getTok(p) + splitLookahead(p, a, clPostfix) + skipInd(p) + + #expectNl(p) + setEndInfo() + +proc parseFromStmt(p: var Parser): PNode = + #| fromStmt = 'from' expr 'import' optInd expr (comma expr)* + result = newNodeP(nkFromStmt, p) + + getTok(p) # skip `from` + + p.skipped = commentLookahead(p) + + skipInd(p) + + var a = parseModuleName(p, nkImportStmt) + + splitLookahead(p, a, clPrefix) # TODO 'mid' for from? + result.add(a) #optInd(p, a); + eat(p, tkImport) + + p.skipped = commentLookahead(p) + + skipInd(p) + while true: + # p.tok.tokType notin {tkEof, tkSad, tkDed}: + p.hasProgress = false + a = parseExpr(p) + if a.kind == nkEmpty or not p.hasProgress: + break + + splitLookahead(p, a, clPostfix) + result.add(a) + if p.tok.tokType != tkComma: + break + + getTok(p) + splitLookahead(p, a, clPostfix) + skipInd(p) + + #expectNl(p) + setEndInfo() + +proc parseReturnOrRaise(p: var Parser; kind: TNodeKind): PNode = + #| returnStmt = 'return' optInd expr? + #| raiseStmt = 'raise' optInd expr? + #| yieldStmt = 'yield' optInd expr? + #| discardStmt = 'discard' optInd expr? + #| breakStmt = 'break' optInd expr? + #| continueStmt = 'continue' optInd expr? + result = newNodeP(kind, p) + + getTok(p) + + # We don't split lookahead here because it might be that we end up with no + # expression - in this case, we don't want the comments attached to + # the discard midpoint - question is, what to do with them? + p.skipped = commentLookahead(p) + if p.tok.indent >= 0 and p.tok.indent <= p.currInd or not isExprStart(p): + # NL terminates: + result.add(p.emptyNode) + else: + var e = parseExpr(p) + + splitLookahead(p, e, clPostfix) + + e = postExprBlocks(p, e) + if e.kind != nkEmpty: + splitLookahead(p, result, clPostfix) + + result.add(e) + + setEndInfo() + +proc parseIfOrWhen(p: var Parser; kind: TNodeKind): PNode = + #| condStmt = expr colcom stmt COMMENT? + #| (IND{=} 'elif' expr colcom stmt)* + #| (IND{=} 'else' colcom stmt)? + #| ifStmt = 'if' condStmt + #| whenStmt = 'when' condStmt + result = newNodeP(kind, p) + while true: + getTok(p) # skip `if`, `when`, `elif` + + var branch = newNodeP(nkElifBranch, p) + + splitLookahead(p, branch, clMid) + skipInd(p) + branch.add(parseExpr(p)) + branch.add(parseColComStmt(p, branch, clMid)) + result.add(branch) + splitLookahead(p, branch, clPostfix) + if p.tok.tokType != tkElif or not sameOrNoInd(p): + break + if p.tok.tokType == tkElse and sameOrNoInd(p): + var branch = newNodeP(nkElse, p) + + eat(p, tkElse) + branch.add(parseColComStmt(p, branch, clMid)) + result.add(branch) + + setEndInfo() + +proc parseIfOrWhenExpr(p: var Parser; kind: TNodeKind): PNode = + #| condExpr = expr colcom stmt optInd + #| ('elif' expr colcom stmt optInd)* + #| 'else' colcom stmt + #| ifExpr = 'if' condExpr + #| whenExpr = 'when' condExpr + result = newNodeP(kind, p) + while true: + getTok(p) # skip `if`, `when`, `elif` + + var branch = newNodeP(nkElifExpr, p) + + splitLookahead(p, branch, clMid) + skipInd(p) + branch.add(parseExpr(p)) + branch.add(parseColComStmt(p, branch, clMid)) + result.add(branch) + splitLookahead(p, branch, clPostfix) + if p.tok.tokType != tkElif: + break + if p.tok.tokType == tkElse: + var branch = newNodeP(nkElseExpr, p) + + eat(p, tkElse) + branch.add(parseColComStmt(p, branch, clMid)) + result.add(branch) + + setEndInfo() + +proc parseWhile(p: var Parser): PNode = + #| whileStmt = 'while' expr colcom stmt + result = newNodeP(nkWhileStmt, p) + + getTok(p) + splitLookahead(p, result, clMid) + skipInd(p) + result.add(parseExpr(p)) + result.add(parseColComStmt(p, result, clMid)) + setEndInfo() + +proc parseCase(p: var Parser): PNode = + #| ofBranch = 'of' exprList colcom stmt + #| ofBranches = ofBranch (IND{=} ofBranch)* + #| (IND{=} 'elif' expr colcom stmt)* + #| (IND{=} 'else' colcom stmt)? + #| caseStmt = 'case' expr ':'? COMMENT? + #| (IND{>} ofBranches DED + #| | IND{=} ofBranches) + var + b: PNode + inElif = false + wasIndented = false + + result = newNodeP(nkCaseStmt, p) + + getTok(p) + result.add(parseExpr(p)) + if p.tok.tokType == tkColon: + getTok(p) + + splitLookahead(p, result, clMid) + + let oldInd = p.currInd + if realInd(p): + p.currInd = p.tok.indent + wasIndented = true + while sameInd(p): + case p.tok.tokType + of tkOf: + if inElif: + break + + b = newNodeP(nkOfBranch, p) + + exprList(p, tkColon, b) + of tkElif: + inElif = true + b = newNodeP(nkElifBranch, p) + + getTok(p) + + p.skipped = commentLookahead(p) + + skipInd(p) + b.add(parseExpr(p)) + + p.skipped = commentLookahead(p) + of tkElse: + b = newNodeP(nkElse, p) + + getTok(p) + + p.skipped = commentLookahead(p) + else: + break + + b.add(parseColComStmt(p, b, clMid)) + + p.skipped = commentLookahead(p) + + result.add(b) + if b.kind == nkElse: + break + if wasIndented: + p.currInd = oldInd + + setEndInfo() + +proc parseTry(p: var Parser; isExpr: bool): PNode = + #| tryStmt = 'try' colcom stmt &(IND{=}? 'except'|'finally') + #| (IND{=}? 'except' optionalExprList colcom stmt)* + #| (IND{=}? 'finally' colcom stmt)? + #| tryExpr = 'try' colcom stmt &(optInd 'except'|'finally') + #| (optInd 'except' optionalExprList colcom stmt)* + #| (optInd 'finally' colcom stmt)? + result = newNodeP(nkTryStmt, p) + + let parentIndent = p.currInd # isExpr + + getTok(p) + result.add(parseColComStmt(p, result, clMid)) + + var b: PNode = nil + while sameOrNoInd(p) or (isExpr and parentIndent <= p.tok.indent): + case p.tok.tokType + of tkExcept: + b = newNodeP(nkExceptBranch, p) + + optionalExprList(p, tkColon, b) + of tkFinally: + b = newNodeP(nkFinally, p) + + getTok(p) + else: + break + + b.add(parseColComStmt(p, b, clMid)) + result.add(b) + if b == nil: + parMessage(p, "expected 'except'") + + setEndInfo() + +proc parseExceptBlock(p: var Parser; kind: TNodeKind): PNode = + result = newNodeP(kind, p) + + getTok(p) + result.add(parseColComStmt(p, result, clMid)) + setEndInfo() + +proc parseBlock(p: var Parser): PNode = + #| blockStmt = 'block' symbol? colcom stmt + #| blockExpr = 'block' symbol? colcom stmt + result = newNodeP(nkBlockStmt, p) + + getTokNoInd(p) + if p.tok.tokType == tkColon: + result.add(p.emptyNode) + else: + result.add(parseSymbol(p)) + + result.add(parseColComStmt(p, result, clMid)) + setEndInfo() + +proc parseStaticOrDefer(p: var Parser; k: TNodeKind): PNode = + #| staticStmt = 'static' colcom stmt + #| deferStmt = 'defer' colcom stmt + result = newNodeP(k, p) + + getTok(p) + result.add(parseColComStmt(p, result, clMid)) + setEndInfo() + +proc parseAsm(p: var Parser): PNode = + #| asmStmt = 'asm' pragma? (STR_LIT | RSTR_LIT | TRIPLESTR_LIT) + result = newNodeP(nkAsmStmt, p) + + getTokNoInd(p) + if p.tok.tokType == tkCurlyDotLe: + result.add(parsePragma(p)) + else: + result.add(p.emptyNode) + case p.tok.tokType + of tkStrLit: + result.add(newStrNodeP(nkStrLit, p.tok.literal, p)) + of tkRStrLit: + result.add(newStrNodeP(nkRStrLit, p.tok.literal, p)) + of tkTripleStrLit: + result.add(newStrNodeP(nkTripleStrLit, p.tok.literal, p)) + else: + parMessage(p, "the 'asm' statement takes a string literal") + result.add(p.emptyNode) + + return + + getTok(p) + setEndInfo() + +proc parseGenericParam(p: var Parser): PNode = + #| genericParam = symbol (comma symbol)* (colon expr)? ('=' optInd expr)? + var a: PNode + + result = newNodeP(nkIdentDefs, p) + # progress guaranteed + while true: + case p.tok.tokType + of tkIn, tkOut: + let x = + p.lex.cache.getIdent( + if p.tok.tokType == tkIn: + "in" + else: + "out" + ) + + a = newNodeP(nkPrefix, p) + + a.add newIdentNodeP(x, p) + + getTok(p) + expectIdent(p) + a.add(parseSymbol(p)) + of tkSymbol, tkAccent: + a = parseSymbol(p) + if a.kind == nkEmpty: + return + else: + break + + result.add(a) + if p.tok.tokType != tkComma: + break + + getTok(p) + splitLookahead(p, a, clPostfix) + skipInd(p) + if p.tok.tokType == tkColon: + getTok(p) + splitLookahead(p, result, clPostfix) # TODO mid? + skipInd(p) + result.add(parseExpr(p)) + else: + result.add(p.emptyNode) + if p.tok.tokType == tkEquals: + getTok(p) + splitLookahead(p, result, clPostfix) # TODO mid? + skipInd(p) + result.add(parseExpr(p)) + else: + result.add(p.emptyNode) + + setEndInfo() + +proc parseGenericParamList(p: var Parser): PNode = + #| genericParamList = '[' optInd + #| genericParam ^* (comma/semicolon) optPar ']' + result = newNodeP(nkGenericParams, p) + + getTok(p) + + p.skipped = commentLookahead(p) + + skipInd(p) + # progress guaranteed + while p.tok.tokType in {tkSymbol, tkAccent, tkIn, tkOut}: + var a = parseGenericParam(p) + + result.add(a) + if p.tok.tokType notin {tkComma, tkSemiColon}: + break + + getTok(p) + splitLookahead(p, a, clPostfix) + + optPar(p) + eat(p, tkBracketRi) + setEndInfo() + +proc parsePattern(p: var Parser): PNode = + #| pattern = '{' stmt '}' + eat(p, tkCurlyLe) + + result = parseStmt(p) + + eat(p, tkCurlyRi) + setEndInfo() + +proc parseRoutine(p: var Parser; kind: TNodeKind): PNode = + #| indAndComment = (IND{>} COMMENT)? | COMMENT? + #| routine = optInd identVis pattern? genericParamList? + #| paramListColon pragma? ('=' COMMENT? stmt)? indAndComment + result = newNodeP(kind, p) + + getTok(p) + splitLookahead(p, result, clMid) + if kind in {nkProcDef, nkLambda, nkIteratorDef, nkFuncDef} and p.tok.tokType notin { + tkSymbol, tokKeywordLow .. tokKeywordHigh, tkAccent + }: + # no name; lambda or proc type + # in every context that we can parse a routine, we can also parse these + result = + parseProcExpr( + p, + true, + if kind == nkProcDef: + nkLambda + else: + kind + ) + + return + + result.add(identVis(p)) + if p.tok.tokType == tkCurlyLe and p.validInd: + result.add(p.parsePattern) + else: + result.add(p.emptyNode) + if p.tok.tokType == tkBracketLe and p.validInd: + result.add(p.parseGenericParamList) + else: + result.add(p.emptyNode) + + result.add(p.parseParamList) + if p.tok.tokType == tkCurlyDotLe and p.validInd: + result.add(p.parsePragma) + else: + result.add(p.emptyNode) + + # empty exception tracking: + result.add(p.emptyNode) + + let maybeMissEquals = p.tok.tokType != tkEquals + if (not maybeMissEquals) and p.validInd: + getTok(p) + splitLookahead(p, result, clMid) + # debugEcho 333, p.tok.tokType + result.add(parseStmt(p)) + else: + result.add(p.emptyNode) + + # TODO commentlookahead + indAndComment(p, result, maybeMissEquals = maybeMissEquals) + + let body = result[^1] + if body.kind == nkStmtList and body.len > 0 and body[0].comment.len > 0 and body[0].kind != nkCommentStmt: + if result.comment.len == 0: + # proc fn*(a: int): int = a ## foo + # => moves comment `foo` to `fn` + result.comment = body[0].comment + body[0].comment = "" + #else: + # assert false, p.lex.config$body.info # avoids hard to track bugs, fail early. + # Yeah, that worked so well. There IS a bug in this logic, now what? + + setEndInfo() + +proc parseCommentStmt(p: var Parser): PNode = + #| commentStmt = COMMENT + result = newNodeP(nkCommentStmt, p) + result.comment = p.tok.literal + + getTok(p) + +proc parseSection( + p: var Parser; kind: TNodeKind; defparser: proc(p: var Parser): PNode {.nimcall.} +): PNode = + #| section(RULE) = COMMENT? RULE / (IND{>} (RULE / COMMENT)^+IND{=} DED) + result = newNodeP(kind, p) + if kind != nkTypeSection: + getTok(p) + + splitLookahead(p, result, clMid) + if realInd(p): + withInd(p): + while sameInd(p) or p.tok.tokType == tkComment and p.tok.indent > p.currInd: + case p.tok.tokType + of tkSymbol, tkAccent, tkParLe: + var a = defparser(p) + + splitLookahead(p, a, clPostfix) + result.add(a) + of tkComment: + var a = parseCommentStmt(p) + + result.add(a) + else: + parMessage(p, errIdentifierExpected, p.tok) + + break + if result.len == 0: + parMessage(p, errIdentifierExpected, p.tok) + elif p.tok.tokType in {tkSymbol, tkAccent, tkParLe} and p.tok.indent < 0: + # tkParLe is allowed for ``var (x, y) = ...`` tuple parsing + result.add(defparser(p)) + else: + parMessage(p, errIdentifierExpected, p.tok) + + setEndInfo() + +proc parseEnum(p: var Parser): PNode = + #| enumDecl = 'enum' optInd (symbol pragma? optInd ('=' optInd expr COMMENT?)? comma?)+ + result = newNodeP(nkEnumTy, p) + + getTok(p) + result.add(p.emptyNode) + splitLookahead(p, result, clMid) + # progress guaranteed + while true: + var a = parseSymbol(p) + if a.kind == nkEmpty: + return + + var comments = commentLookahead(p) + var symPragma = a + var pragma: PNode + if (p.tok.indent < 0 or p.tok.indent >= p.currInd) and p.tok.tokType == tkCurlyDotLe: + pragma = optPragmas(p) + symPragma = newNodeP(nkPragmaExpr, p) + + symPragma.add(a) + symPragma.add(pragma) + + let symInd = p.currInd + + comments.add commentLookahead(p) + if p.tok.indent >= 0 and p.tok.indent <= p.currInd: + p.skipped = splitComments(comments, symPragma, symInd, clPostfix) + + result.add(symPragma) + + break + if p.tok.tokType == tkEquals and p.tok.indent < 0: + getTok(p) + + comments.add commentLookahead(p) + + skipInd(p) + + var b = symPragma + + symPragma = newNodeP(nkEnumFieldDef, p) + + symPragma.add(b) + symPragma.add(parseExpr(p)) + + comments.add commentLookahead(p) + if p.tok.tokType == tkComma and p.tok.indent < 0: + getTok(p) + + comments.add commentLookahead(p) + + p.skipped = splitComments(comments, symPragma, symInd, clPostfix) + + result.add(symPragma) + if p.tok.indent >= 0 and p.tok.indent <= p.currInd or p.tok.tokType == tkEof: + break + if result.len <= 1: + parMessage(p, errIdentifierExpected, p.tok) + + setEndInfo() + +proc parseObjectPart(p: var Parser): PNode + +proc parseObjectWhen(p: var Parser): PNode = + #| objectWhen = 'when' expr colcom objectPart COMMENT? + #| ('elif' expr colcom objectPart COMMENT?)* + #| ('else' colcom objectPart COMMENT?)? + result = newNodeP(nkRecWhen, p) + # progress guaranteed + while sameInd(p): + getTok(p) # skip `when`, `elif` + + var branch = newNodeP(nkElifBranch, p) + + splitLookahead(p, branch, clMid) + skipInd(p) + branch.add(parseExpr(p)) + eat(p, tkColon) + splitLookahead(p, branch, clMid) + branch.add(parseObjectPart(p)) + result.add(branch) + if p.tok.tokType != tkElif: + break + if p.tok.tokType == tkElse and sameInd(p): + var branch = newNodeP(nkElse, p) + + eat(p, tkElse) + + p.skipped = commentLookahead(p) + + eat(p, tkColon) + splitLookahead(p, branch, clMid) + skipInd(p) + branch.add(parseObjectPart(p)) + result.add(branch) + + setEndInfo() + +proc parseObjectCase(p: var Parser): PNode = + #| objectBranch = 'of' exprList colcom objectPart + #| objectBranches = objectBranch (IND{=} objectBranch)* + #| (IND{=} 'elif' expr colcom objectPart)* + #| (IND{=} 'else' colcom objectPart)? + #| objectCase = 'case' declColonEquals ':'? COMMENT? + #| (IND{>} objectBranches DED + #| | IND{=} objectBranches) + result = newNodeP(nkRecCase, p) + + splitLookahead(p, result, clMid) + getTokNoInd(p) + + var a = parseIdentColonEquals(p, {withPragma}) + + result.add(a) + if p.tok.tokType == tkColon: + getTok(p) + splitLookahead(p, result, clMid) + + var wasIndented = false + + let oldInd = p.currInd + if realInd(p): + p.currInd = p.tok.indent + wasIndented = true + # progress guaranteed + while sameInd(p): + var b: PNode + case p.tok.tokType + of tkOf: + b = newNodeP(nkOfBranch, p) + + exprList(p, tkColon, b) + of tkElse: + b = newNodeP(nkElse, p) + + getTok(p) + else: + break + + eat(p, tkColon) + splitLookahead(p, b, clMid) + + var fields = parseObjectPart(p) + if fields.kind == nkEmpty: + parMessage(p, errIdentifierExpected, p.tok) + + fields = newNodeP(nkNilLit, p) # don't break further semantic checking + + b.add(fields) + result.add(b) + if b.kind == nkElse: + break + if wasIndented: + p.currInd = oldInd + + setEndInfo() + +proc parseObjectPart(p: var Parser): PNode = + #| objectPart = IND{>} objectPart^+IND{=} DED + #| / objectWhen / objectCase / 'nil' / 'discard' / declColonEquals + if realInd(p): + result = newNodeP(nkRecList, p) + + withInd(p): + while sameInd(p): + case p.tok.tokType + of tkCase, tkWhen, tkSymbol, tkAccent, tkNil, tkDiscard: + result.add(parseObjectPart(p)) + else: + parMessage(p, errIdentifierExpected, p.tok) + + break + elif sameOrNoInd(p): + case p.tok.tokType + of tkWhen: + result = parseObjectWhen(p) + of tkCase: + result = parseObjectCase(p) + of tkSymbol, tkAccent: + result = parseIdentColonEquals(p, {withPragma}) + of tkNil, tkDiscard: + result = newNodeP(nkNilLit, p) + + getTok(p) + splitLookahead(p, result, clPostfix) + else: + result = p.emptyNode + else: + result = p.emptyNode + + setEndInfo() + +proc parseObject(p: var Parser): PNode = + #| objectDecl = 'object' ('of' typeDesc)? COMMENT? objectPart + result = newNodeP(nkObjectTy, p) + + getTok(p) + result.add(p.emptyNode) # compatibility with old pragma node + if p.tok.tokType == tkOf and p.tok.indent < 0: + var a = newNodeP(nkOfInherit, p) + + getTok(p) + a.add(parseTypeDesc(p)) + result.add(a) + else: + result.add(p.emptyNode) + + splitLookahead(p, result, clMid) + # an initial IND{>} HAS to follow: + if not realInd(p): + result.add(p.emptyNode) + else: + # Any comments just after `object` are assumed to be part of the object, + # not the fields that follow + p.skipped = splitComments(p.skipped, result, p.tok.indent - 1, clMid) + + result.add(parseObjectPart(p)) + + setEndInfo() + +proc parseTypeClassParam(p: var Parser): PNode = + let modifier = + case p.tok.tokType + of tkOut, tkVar: + nkVarTy + of tkPtr: + nkPtrTy + of tkRef: + nkRefTy + of tkStatic: + nkStaticTy + of tkType: + nkTypeOfExpr + else: + nkEmpty + if modifier != nkEmpty: + result = newNodeP(modifier, p) + + getTok(p) + result.add(p.parseSymbol) + else: + result = p.parseSymbol + + setEndInfo() + +proc parseTypeClass(p: var Parser): PNode = + #| conceptParam = ('var' | 'out')? symbol + #| conceptDecl = 'concept' conceptParam ^* ',' (pragma)? ('of' typeDesc ^* ',')? + #| &IND{>} stmt + result = newNodeP(nkTypeClassTy, p) + + getTok(p) + if p.tok.tokType == tkComment: + skipComment(p, result) + if p.tok.indent < 0: + var args = newNodeP(nkArgList, p) + + result.add(args) + args.add(p.parseTypeClassParam) + while p.tok.tokType == tkComma: + getTok(p) + args.add(p.parseTypeClassParam) + else: + result.add(p.emptyNode) # see ast.isNewStyleConcept + if p.tok.tokType == tkCurlyDotLe and p.validInd: + result.add(parsePragma(p)) + else: + result.add(p.emptyNode) + if p.tok.tokType == tkOf and p.tok.indent < 0: + var a = newNodeP(nkOfInherit, p) + + getTok(p) + # progress guaranteed + while true: + a.add(parseTypeDesc(p)) + if p.tok.tokType != tkComma: + break + + getTok(p) + + result.add(a) + else: + result.add(p.emptyNode) + if p.tok.tokType == tkComment: + skipComment(p, result) + # an initial IND{>} HAS to follow: + if not realInd(p): + if result.isNewStyleConcept: + parMessage( + p, + "routine expected, but found '$1' (empty new-styled concepts are not allowed)", + p.tok + ) + + result.add(p.emptyNode) + else: + result.add(parseStmt(p)) + + setEndInfo() + +proc parseTypeDef(p: var Parser): PNode = + #| + #| typeDef = identVisDot genericParamList? pragma '=' optInd typeDefValue + #| indAndComment? + result = newNodeP(nkTypeDef, p) + + var identifier = identVis(p, allowDot = true) + var identPragma = identifier + var pragma: PNode + var genericParam: PNode + var next = identifier + var comments = commentLookahead(p) + if p.tok.tokType == tkBracketLe and p.validInd: + p.skipped = splitComments(comments, identifier, p.tok.indent, clPostfix) + genericParam = parseGenericParamList(p) + comments = commentLookahead(p) + next = genericParam + else: + genericParam = p.emptyNode + # pragma = optPragmas(p) + if p.tok.tokType == tkCurlyDotLe and (p.tok.indent < 0 or realInd(p)): + p.skipped = splitComments(comments, next, p.tok.indent, clPostfix) + pragma = parsePragma(p) + comments = commentLookahead(p) + next = pragma + else: + pragma = p.emptyNode + if pragma.kind != nkEmpty: + identPragma = newNodeP(nkPragmaExpr, p) + + identPragma.add(identifier) + identPragma.add(pragma) + + result.add(identPragma) + result.add(genericParam) + if p.tok.tokType == tkEquals: + result.info = parLineInfo(p) + + getTok(p) + + comments.add commentLookahead(p) + + skipInd(p) + + p.skipped = comments + + result.add(parseTypeDefValue(p)) + + comments = commentLookahead(p) + p.skipped = splitComments(comments, result[^1], p.currInd, clPostfix) + else: + result.add(p.emptyNode) + + setEndInfo() + +proc parseVarTuple(p: var Parser): PNode = + #| varTupleLhs = '(' optInd (identWithPragma / varTupleLhs) ^+ comma optPar ')' + #| varTuple = varTupleLhs '=' optInd expr + result = newNodeP(nkVarTuple, p) + + getTok(p) # skip '(' + + p.skipped = commentLookahead(p) + # progress guaranteed + while p.tok.tokType in {tkSymbol, tkAccent, tkParLe}: + var a: PNode + if p.tok.tokType == tkParLe: + a = parseVarTuple(p) + + a.add(p.emptyNode) + else: + a = identWithPragma(p, allowDot = true) + + result.add(a) + if p.tok.tokType != tkComma: + break + + getTok(p) + splitLookahead(p, a, clPostfix) + + result.add(p.emptyNode) # no type desc + optPar(p) + eat(p, tkParRi) + setEndInfo() + +proc parseVariable(p: var Parser): PNode = + #| colonBody = colcom stmt postExprBlocks? + #| variable = (varTuple / identColonEquals) colonBody? indAndComment + if p.tok.tokType == tkParLe: + result = parseVarTuple(p) + + eat(p, tkEquals) + splitLookahead(p, result, clMid) + skipInd(p) + result.add(parseExpr(p)) + splitLookahead(p, result[^1], clPostfix) + else: + result = parseIdentColonEquals(p, {withPragma, withDot}) + + result[^1] = postExprBlocks(p, result[^1]) + + splitLookahead(p, result[^1], clPostfix) + setEndInfo() + +proc parseConstant(p: var Parser): PNode = + #| constant = (varTuple / identWithPragma) (colon typeDesc)? '=' optInd expr indAndComment + if p.tok.tokType == tkParLe: + result = parseVarTuple(p) + else: + result = newNodeP(nkConstDef, p) + + result.add(identWithPragma(p)) + if p.tok.tokType == tkColon: + getTok(p) + splitLookahead(p, result, clMid) + skipInd(p) + result.add(parseTypeDesc(p)) + else: + result.add(p.emptyNode) + + eat(p, tkEquals) + splitLookahead(p, result, clMid) + skipInd(p) + #add(result, parseStmtListExpr(p)) + result.add(parseExpr(p)) + + result[^1] = postExprBlocks(p, result[^1]) + + setEndInfo() + +proc parseBind(p: var Parser; k: TNodeKind): PNode = + #| bindStmt = 'bind' optInd qualifiedIdent ^+ comma + #| mixinStmt = 'mixin' optInd qualifiedIdent ^+ comma + result = newNodeP(k, p) + + getTok(p) + optInd(p, result) + # progress guaranteed + while true: + var a = qualifiedIdent(p) + + result.add(a) + if p.tok.tokType != tkComma: + break + + getTok(p) + splitLookahead(p, a, clPostfix) + skipInd(p) + + #expectNl(p) + setEndInfo() + +proc parseStmtPragma(p: var Parser): PNode = + #| pragmaStmt = pragma (':' COMMENT? stmt)? + result = parsePragma(p) + if p.tok.tokType == tkColon and p.tok.indent < 0: + let a = result + + result = newNodeI(nkPragmaBlock, a.info) + + result.add a + + getTok(p) + splitLookahead(p, result, clPostfix) # TODO mid + + result.add parseStmt(p) + + splitLookahead(p, result, clPostfix) + + setEndInfo() + +proc simpleStmt(p: var Parser): PNode = + #| simpleStmt = ((returnStmt | raiseStmt | yieldStmt | discardStmt | breakStmt + #| | continueStmt | pragmaStmt | importStmt | exportStmt | fromStmt + #| | includeStmt | commentStmt) / exprStmt) COMMENT? + #| + case p.tok.tokType + of tkReturn: + result = parseReturnOrRaise(p, nkReturnStmt) + of tkRaise: + result = parseReturnOrRaise(p, nkRaiseStmt) + of tkYield: + result = parseReturnOrRaise(p, nkYieldStmt) + of tkDiscard: + result = parseReturnOrRaise(p, nkDiscardStmt) + of tkBreak: + result = parseReturnOrRaise(p, nkBreakStmt) + of tkContinue: + result = parseReturnOrRaise(p, nkContinueStmt) + of tkCurlyDotLe: + result = parseStmtPragma(p) + of tkImport: + result = parseImport(p, nkImportStmt) + of tkExport: + result = parseImport(p, nkExportStmt) + of tkFrom: + result = parseFromStmt(p) + of tkInclude: + result = parseIncludeStmt(p) + of tkComment: + result = parseCommentStmt(p) + else: + if isExprStart(p): + result = parseExprStmt(p) + else: + result = p.emptyNode + +proc complexOrSimpleStmt(p: var Parser): PNode = + #| complexOrSimpleStmt = (ifStmt | whenStmt | whileStmt + #| | tryStmt | forStmt + #| | blockStmt | staticStmt | deferStmt | asmStmt + #| | 'proc' routine + #| | 'method' routine + #| | 'func' routine + #| | 'iterator' routine + #| | 'macro' routine + #| | 'template' routine + #| | 'converter' routine + #| | 'type' section(typeDef) + #| | 'const' section(constant) + #| | ('let' | 'var' | 'using') section(variable) + #| | bindStmt | mixinStmt) + #| / simpleStmt + case p.tok.tokType + of tkIf: + result = parseIfOrWhen(p, nkIfStmt) + of tkWhile: + result = parseWhile(p) + of tkCase: + result = parseCase(p) + of tkTry: + result = parseTry(p, isExpr = false) + of tkFinally: + result = parseExceptBlock(p, nkFinally) + of tkExcept: + result = parseExceptBlock(p, nkExceptBranch) + of tkFor: + result = parseFor(p) + of tkBlock: + result = parseBlock(p) + of tkStatic: + result = parseStaticOrDefer(p, nkStaticStmt) + of tkDefer: + result = parseStaticOrDefer(p, nkDefer) + of tkAsm: + result = parseAsm(p) + of tkProc: + result = parseRoutine(p, nkProcDef) + of tkFunc: + result = parseRoutine(p, nkFuncDef) + of tkMethod: + result = parseRoutine(p, nkMethodDef) + of tkIterator: + result = parseRoutine(p, nkIteratorDef) + of tkMacro: + result = parseRoutine(p, nkMacroDef) + of tkTemplate: + result = parseRoutine(p, nkTemplateDef) + of tkConverter: + result = parseRoutine(p, nkConverterDef) + of tkType: + getTok(p) + if p.tok.tokType == tkParLe: + getTok(p) + + result = newNodeP(nkTypeOfExpr, p) + + result.add(primary(p, pmTypeDesc)) + eat(p, tkParRi) + + result = parseOperators(p, result, -1, pmNormal) + else: + result = parseSection(p, nkTypeSection, parseTypeDef) + of tkConst: + prettySection: + result = parseSection(p, nkConstSection, parseConstant) + of tkLet: + prettySection: + result = parseSection(p, nkLetSection, parseVariable) + of tkVar: + prettySection: + result = parseSection(p, nkVarSection, parseVariable) + of tkWhen: + result = parseIfOrWhen(p, nkWhenStmt) + of tkBind: + result = parseBind(p, nkBindStmt) + of tkMixin: + result = parseBind(p, nkMixinStmt) + of tkUsing: + result = parseSection(p, nkUsingStmt, parseVariable) + else: + result = simpleStmt(p) + +proc parseStmt(p: var Parser): PNode = + #| stmt = (IND{>} complexOrSimpleStmt^+(IND{=} / ';') DED) + #| / simpleStmt ^+ ';' + if p.tok.indent > p.currInd: + # nimpretty support here + result = newNodeP(nkStmtList, p) + + withInd(p): + splitLookahead(p, result, clPrefix) + while true: + if p.tok.indent == p.currInd or p.tok.indent > p.currInd and p.tok.tokType == tkComment: + discard + elif p.tok.tokType == tkSemiColon: + getTok(p) + if p.tok.indent < 0 or p.tok.indent == p.currInd: + discard + else: + break + else: + # TODO this hack causes reindentation of the comment to the "current" + # level when the comment is indented more than the last statement + if p.tok.indent > p.currInd and p.tok.tokType notin {tkDot, tkComment}: + debugEcho p.currInd + + printTok(p.lex.config, p.tok) + parMessage(p, errInvalidIndentation % "parseStmt") + + break + if p.tok.tokType in {tkCurlyRi, tkParRi, tkCurlyDotRi, tkBracketRi}: + # XXX this ensures tnamedparamanonproc still compiles; + # deprecate this syntax later + break + + p.hasProgress = false + if p.tok.tokType in {tkElse, tkElif}: + break + # Allow this too, see tests/parser/tifexprs + + let a = complexOrSimpleStmt(p) + if a.kind == nkEmpty and not p.hasProgress: + debugEcho 3 + + parMessage(p, errExprExpected, p.tok) + + break + else: + result.add a + + let comments = commentLookahead(p) + + p.skipped.add splitComments(comments, a, p.currInd, clPostfix) + if not p.hasProgress and p.tok.tokType == tkEof: + break + else: + # the case statement is only needed for better error messages: + case p.tok.tokType + of tkIf, tkWhile, tkCase, tkTry, tkFor, tkBlock, tkAsm, tkProc, tkFunc, tkIterator, + tkMacro, tkType, tkConst, tkWhen, tkVar: + parMessage(p, "nestable statement requires indentation") + + result = p.emptyNode + else: + if p.inSemiStmtList > 0: + result = simpleStmt(p) + if result.kind == nkEmpty: + debugEcho 4 + + parMessage(p, errExprExpected, p.tok) + else: + result = newNodeP(nkStmtList, p) + while true: + # if p.tok.indent >= 0: + # parMessage(p, errInvalidIndentation % "parseStmt 2") + p.hasProgress = false + + let a = simpleStmt(p) + let err = not p.hasProgress + if a.kind == nkEmpty: + debugEcho 5 + + parMessage(p, errExprExpected, p.tok) + + result.add(a) + if p.tok.tokType != tkSemiColon: + break + + getTok(p) + if err and p.tok.tokType == tkEof: + break + + setEndInfo() + +proc parseAll(p: var Parser): PNode = + ## Parses the rest of the input stream held by the parser into a PNode. + result = newNodeP(nkStmtList, p) + while p.tok.tokType != tkEof: + p.hasProgress = false + + var a = complexOrSimpleStmt(p) + if a.kind != nkEmpty and p.hasProgress: + result.add(a) + else: + debugEcho 6 + + parMessage(p, errExprExpected, p.tok) + # bugfix: consume a token here to prevent an endless loop: + getTok(p) + if p.tok.indent != 0 and p.tok.tokType != tkComment: + debugEcho p.tok.tokType, " ", p.tok.indent + + parMessage(p, errInvalidIndentation % "parseAll") + for c in p.skipped: + let n = newNodeI(nkCommentStmt, getLineInfo(p.lex, c)) + + n.comment = c.literal + + result.add n + + setEndInfo() + +proc checkFirstLineIndentation*(p: var Parser) = + if p.tok.indent != 0 and tsLeading in p.tok.spacing: + parMessage(p, errInvalidIndentation % "checkFirstLineIndentation") + +proc parseString*( + s: string; + cache: IdentCache; + config: ConfigRef; + filename: string = ""; + line: int = 0; + errorHandler: ErrorHandler = nil; + printTokens = false +): PNode = + ## Parses a string into an AST, returning the top node. + ## `filename` and `line`, although optional, provide info so that the + ## compiler can generate correct error messages referring to the original + ## source. + var stream = llStreamOpen(s) + + stream.lineOffset = line + + var p: Parser + + p.lex.errorHandler = errorHandler + + openParser(p, AbsoluteFile filename, stream, cache, config, printTokens) + + let fid = config.fileInfoIdx(AbsoluteFile filename) + + config.m.fileInfos[fid.int].fullContent = s + result = p.parseAll + + closeParser(p) + setEndInfo() diff --git a/src/phparser.nim.nimph.yaml b/src/phparser.nim.nimph.yaml new file mode 100644 index 0000000..1b4eae5 --- /dev/null +++ b/src/phparser.nim.nimph.yaml @@ -0,0 +1,65695 @@ +{ + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# nimph" + }, + { + "kind": "nkCommentStmt", + "comment": "# (c) Copyright 2023 Jacek Sieka" + }, + { + "kind": "nkCommentStmt", + "comment": "# The Nim compiler" + }, + { + "kind": "nkCommentStmt", + "comment": "# (c) Copyright 2018 Andreas Rumpf" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# See the file \"copying.txt\", included in this" + }, + { + "kind": "nkCommentStmt", + "comment": "# distribution, for details about the copyright." + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# This module implements the parser of the standard Nim syntax." + }, + { + "kind": "nkCommentStmt", + "comment": "# The parser strictly reflects the grammar (\"doc/grammar.txt\"); however" + }, + { + "kind": "nkCommentStmt", + "comment": "# it uses several helper routines to keep the parser small. A special" + }, + { + "kind": "nkCommentStmt", + "comment": "# efficient algorithm is used for the precedence levels. The parser here can" + }, + { + "kind": "nkCommentStmt", + "comment": "# be seen as a refinement of the grammar, as it specifies how the AST is built" + }, + { + "kind": "nkCommentStmt", + "comment": "# from the grammar and how comments belong to the AST." + }, + { + "kind": "nkCommentStmt", + "comment": "# nimph version:" + }, + { + "kind": "nkCommentStmt", + "comment": "# * analyse comment structure in parser instead of lexer" + }, + { + "kind": "nkCommentStmt", + "comment": "# * attach comments to nodes as prefix/mid/postfix to anchor them to the most" + }, + { + "kind": "nkCommentStmt", + "comment": "# plausible node that they belong to" + }, + { + "kind": "nkCommentStmt", + "comment": "# - prefix for comments that precede a construct" + }, + { + "kind": "nkCommentStmt", + "comment": "# - mid for comments that appear in the middle of complex syntax nodes, ie" + }, + { + "kind": "nkCommentStmt", + "comment": "# between `:` and statements of an `if`" + }, + { + "kind": "nkCommentStmt", + "comment": "# - postfix is the dustbin that anything that the parser doesn\'t know where to" + }, + { + "kind": "nkCommentStmt", + "comment": "# place ends up - these are rendered after the AST node which is the most" + }, + { + "kind": "nkCommentStmt", + "comment": "# common cause for comment reordering, ie that we didn\'t find a suitable" + }, + { + "kind": "nkCommentStmt", + "comment": "# place to put them" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# Comment handling is made difficult because the upstream parser \"sometimes\"" + }, + { + "kind": "nkCommentStmt", + "comment": "# puts comments in the AST and the rules for this have evolved over time meaning" + }, + { + "kind": "nkCommentStmt", + "comment": "# that great creativity exists in where comments may appear. It doesn\'t help" + }, + { + "kind": "nkCommentStmt", + "comment": "# that the lexer is trying to do comment layout / reflow / analysis in the" + }, + { + "kind": "nkCommentStmt", + "comment": "# middle of lexing.." + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "llstream" + }, + { + "kind": "nkIdent", + "ident": "idents" + }, + { + "kind": "nkIdent", + "ident": "strutils" + }, + { + "kind": "nkIdent", + "ident": "pathutils" + } + ] + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkStrLit", + "strVal": "." + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "phast" + }, + { + "kind": "nkIdent", + "ident": "phlexer" + }, + { + "kind": "nkIdent", + "ident": "phlineinfos" + }, + { + "kind": "nkIdent", + "ident": "phmsgs" + }, + { + "kind": "nkIdent", + "ident": "phoptions" + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "nimPreviewSlimSystem" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkIdent", + "ident": "std" + }, + { + "kind": "nkIdent", + "ident": "assertions" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# A Parser object represents a file that\", line: 44, col: 4, offsetA: 1813, offsetB: 1853)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# is being parsed\", line: 45, col: 4, offsetA: 1858, offsetB: 1875)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "currInd" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# current indentation level\", line: 46, col: 17, offsetA: 1893, offsetB: 1920)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "firstTok" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Has the first token been read?\", line: 47, col: 19, offsetA: 1940, offsetB: 1972)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "hasProgress" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# some while loop requires progress ensurance\", line: 48, col: 22, offsetA: 1995, offsetB: 2040)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "Lexer" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# The lexer that is used for parsing\", line: 49, col: 16, offsetA: 2057, offsetB: 2093)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "Token" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# The current token\", line: 50, col: 16, offsetA: 2110, offsetB: 2129)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "lineStartPrevious" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "lineNumberPrevious" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "bufposPrevious" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "inPragma" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Pragma level\", line: 54, col: 19, offsetA: 2231, offsetB: 2245)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "inSemiStmtList" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "emptyNode" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "SymbolMode" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "smNormal" + }, + { + "kind": "nkIdent", + "ident": "smAllowNil" + }, + { + "kind": "nkIdent", + "ident": "smAfterDot" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "PrimaryMode" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "pmNormal" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDesc" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDef" + }, + { + "kind": "nkIdent", + "ident": "pmTrySimple" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "CommentLoc" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "clPrefix" + }, + { + "kind": "nkIdent", + "ident": "clMid" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isOperator" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "Token" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "getTok" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "parMessage" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "Parser" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "TMsgKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "skipComment" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "node" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLoc" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newNodeP" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newIntNodeP" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "intVal" + }, + { + "kind": "nkIdent", + "ident": "BiggestInt" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newFloatNodeP" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "floatVal" + }, + { + "kind": "nkIdent", + "ident": "BiggestFloat" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newStrNodeP" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "strVal" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "newIdentNodeP" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ident" + }, + { + "kind": "nkIdent", + "ident": "PIdent" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "expectIdentOrKeyw" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "Parser" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "expectIdent" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "Parser" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "parLineInfo" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "Parser" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "eat" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokType" + }, + { + "kind": "nkIdent", + "ident": "TokType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "skipInd" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "optPar" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "optInd" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLoc" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "indAndComment" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLoc" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "maybeMissEquals" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "setBaseFlags" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "base" + }, + { + "kind": "nkIdent", + "ident": "NumericalBase" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "parseSymbol" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "smNormal" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTry" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "isExpr" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseCase" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseStmtPragma" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parsePragma" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "postExprBlocks" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExprStmt" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseBlock" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "primary" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "PrimaryMode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "simpleExprAux" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "limit" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "PrimaryMode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# implementation\", line: 131, col: 72, offsetA: 3984, offsetB: 4000)" + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "prettySection" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "body" + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Get the next token from the parser\\\'s lexer, and store it in the parser\\\'s\", line: 137, col: 2, offsetA: 4072, offsetB: 4147)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## `tok` member.\", line: 138, col: 2, offsetA: 4150, offsetB: 4166)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lineNumberPrevious" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "lineNumber" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lineStartPrevious" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "lineStart" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "bufposPrevious" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "bufpos" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rawGetTok" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "hasProgress" + } + ] + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "openParser" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "inputStream" + }, + { + "kind": "nkIdent", + "ident": "PLLStream" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "cache" + }, + { + "kind": "nkIdent", + "ident": "IdentCache" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "config" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "printTokens" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Open a parser, using the given arguments to set up its internal state.\", line: 155, col: 2, offsetA: 4498, offsetB: 4571)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"##\", line: 156, col: 2, offsetA: 4574, offsetB: 4576)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "reset" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "openLexer" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + }, + { + "kind": "nkIdent", + "ident": "inputStream" + }, + { + "kind": "nkIdent", + "ident": "cache" + }, + { + "kind": "nkIdent", + "ident": "config" + }, + { + "kind": "nkIdent", + "ident": "printTokens" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# read the first token\", line: 159, col: 12, offsetA: 4673, offsetB: 4695)" + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "firstTok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNode" + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "openParser" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "filename" + }, + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "inputStream" + }, + { + "kind": "nkIdent", + "ident": "PLLStream" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "cache" + }, + { + "kind": "nkIdent", + "ident": "IdentCache" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "config" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "printTokens" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "openParser" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileInfoIdx" + }, + { + "kind": "nkIdent", + "ident": "config" + }, + { + "kind": "nkIdent", + "ident": "filename" + } + ] + }, + { + "kind": "nkIdent", + "ident": "inputStream" + }, + { + "kind": "nkIdent", + "ident": "cache" + }, + { + "kind": "nkIdent", + "ident": "config" + }, + { + "kind": "nkIdent", + "ident": "printTokens" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "closeParser" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Close a parser, freeing up its resources.\", line: 175, col: 2, offsetA: 5041, offsetB: 5085)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "closeLexer" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "Parser" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "TMsgKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Produce and emit the parser message `arg` to output.\", line: 179, col: 2, offsetA: 5163, offsetB: 5218)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessageTok" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "arg" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "Parser" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "Token" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Produce and emit a parser message to output about the token `tok`\", line: 183, col: 2, offsetA: 5316, offsetB: 5384)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkIdent", + "ident": "msg" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "prettyTok" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "Parser" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "arg" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Produce and emit the parser message `arg` to output.\", line: 187, col: 2, offsetA: 5482, offsetB: 5537)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessageTok" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "arg" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "withInd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkIdent", + "ident": "untyped" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "oldInd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + }, + { + "kind": "nkIdent", + "ident": "oldInd" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "newlineWasSplitting" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO nimpretty leftover\", line: 202, col: 0, offsetA: 5766, offsetB: 5791)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "realInd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "sameInd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "sameOrNoInd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "validInd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "addComment" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "node" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "Token" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLoc" + }, + { + "kind": "nkIdent", + "ident": "CommentLoc" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLoc" + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "clPrefix" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "node" + }, + { + "kind": "nkIdent", + "ident": "prefix" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "clMid" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "node" + }, + { + "kind": "nkIdent", + "ident": "mid" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "clPostfix" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "node" + }, + { + "kind": "nkIdent", + "ident": "postfix" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "rawSkipComment" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "node" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLoc" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ind" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "maxInd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdent", + "ident": "high" + } + ] + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComment" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ind" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "maxInd" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# debugEcho \\\"rsk \\\", p.tok.indent, \\\" \\\", ind, \\\" \\\", maxInd, \\\" \\\", $p.tok\", line: 230, col: 4, offsetA: 6526, offsetB: 6594)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "node" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "addComment" + }, + { + "kind": "nkIdent", + "ident": "node" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "commentLoc" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "errInternal" + }, + { + "kind": "nkStrLit", + "strVal": "skipComment" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipComment" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "node" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLoc" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rawSkipComment" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "node" + }, + { + "kind": "nkIdent", + "ident": "commentLoc" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "indComment" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "node" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLoc" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Add all comments at the current indent level or greater to node - this\", line: 242, col: 2, offsetA: 6913, offsetB: 6985)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# is useful to catch comments in statement lists etc\", line: 243, col: 2, offsetA: 6988, offsetB: 7040)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "rawSkipComment" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "node" + }, + { + "kind": "nkIdent", + "ident": "commentLoc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "maxInd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdent", + "ident": "high" + } + ] + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComment" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "maxInd" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "errInvalidIndentation" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "invalid indentation $1" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "errIdentifierExpected" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "identifier expected, but got \'$1\'" + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "errExprExpected" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "expression expected, but found \'$1\'" + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "realInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkIdent", + "ident": "errInvalidIndentation" + }, + { + "kind": "nkStrLit", + "strVal": "skipInd" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "optPar" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkIdent", + "ident": "errInvalidIndentation" + }, + { + "kind": "nkStrLit", + "strVal": "optPar" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "optInd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLoc" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipComment" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "commentLoc" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTokNoInd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkIdent", + "ident": "errInvalidIndentation" + }, + { + "kind": "nkStrLit", + "strVal": "getTokNoInd" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "expectIdentOrKeyw" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "Parser" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isKeyword" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessage" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkIdent", + "ident": "errIdentifierExpected" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "prettyTok" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "expectIdent" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "Parser" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessage" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkIdent", + "ident": "errIdentifierExpected" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "prettyTok" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tokType" + }, + { + "kind": "nkIdent", + "ident": "TokType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Move the parser to the next token if the current token is of type\", line: 285, col: 2, offsetA: 8316, offsetB: 8384)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## `tokType`, otherwise error.\", line: 286, col: 2, offsetA: 8387, offsetB: 8417)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# raiseAssert \\\"\\\"\", line: 290, col: 4, offsetA: 8475, offsetB: 8491)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lexMessage" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "expected: \'" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\', but got: \'" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "prettyTok" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\'" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parLineInfo" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "Parser" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Retrieve the line information associated with the parser\\\'s current state.\", line: 298, col: 2, offsetA: 8665, offsetB: 8741)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getLineInfo" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitComments" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "comments" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "openArray" + }, + { + "kind": "nkIdent", + "ident": "Token" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ind" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLoc" + }, + { + "kind": "nkIdent", + "ident": "CommentLoc" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "comments" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ind" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "addComment" + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "commentLoc" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLoc" + }, + { + "kind": "nkIdent", + "ident": "CommentLoc" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "comments" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitComments" + }, + { + "kind": "nkIdent", + "ident": "comments" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "commentLoc" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "indAndComment" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLoc" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "maybeMissEquals" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "indComment" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "commentLoc" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "maybeMissEquals" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "col" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "bufposPrevious" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lineStartPrevious" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newLineInfo" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileIdx" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lineNumberPrevious" + } + ] + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkStrLit", + "strVal": "invalid indentation, maybe you forgot a \'=\' at $1 ?" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#raiseAssert $p.tok, \\\" \\\", p.parLineInfo()\", line: 329, col: 6, offsetA: 9653, offsetB: 9694)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkIdent", + "ident": "errInvalidIndentation" + }, + { + "kind": "nkStrLit", + "strVal": "indAndComment" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeI" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parLineInfo" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "prefix" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "move" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIntNodeP" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "intVal" + }, + { + "kind": "nkIdent", + "ident": "BiggestInt" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "newFloatNodeP" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "floatVal" + }, + { + "kind": "nkIdent", + "ident": "BiggestFloat" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStrNodeP" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "strVal" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIdentNodeP" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ident" + }, + { + "kind": "nkIdent", + "ident": "PIdent" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkIdent" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseStmt" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDesc" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fullExpr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDefValue" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseParamList" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "retColon" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "isSigilLike" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "Token" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkOpr" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 64 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "isRightAssociative" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "Token" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Determines whether the token is right assocative.\", line: 366, col: 2, offsetA: 10814, offsetB: 10866)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkOpr" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 94 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# or (tok.ident.s.len > 1 and tok.ident.s[^1] == \\\'>\\\')\", line: 369, col: 0, offsetA: 10926, offsetB: 10979)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "isUnary" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "Token" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Check if the given token is a unary operator\", line: 371, col: 2, offsetA: 11015, offsetB: 11062)" + ], + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkOpr" + }, + { + "kind": "nkIdent", + "ident": "tkDotDot" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "spacing" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tsLeading" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "checkBinary" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "Parser" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Check if the current parser token is a binary operator.\", line: 375, col: 2, offsetA: 11173, offsetB: 11231)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# we don\\\'t check \\\'..\\\' here as that\\\'s too annoying\", line: 376, col: 2, offsetA: 11234, offsetB: 11283)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkOpr" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "spacing" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tsTrailing" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "warnInconsistentSpacing" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "prettyTok" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| module = complexOrSimpleStmt ^* (\\\';\\\' / IND{=})\", line: 381, col: 0, offsetA: 11415, offsetB: 11464)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#|\", line: 382, col: 0, offsetA: 11465, offsetB: 11467)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| comma = \\\',\\\' COMMENT?\", line: 383, col: 0, offsetA: 11468, offsetB: 11491)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| semicolon = \\\';\\\' COMMENT?\", line: 384, col: 0, offsetA: 11492, offsetB: 11519)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| colon = \\\':\\\' COMMENT?\", line: 385, col: 0, offsetA: 11520, offsetB: 11543)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| colcom = \\\':\\\' COMMENT?\", line: 386, col: 0, offsetA: 11544, offsetB: 11568)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#|\", line: 387, col: 0, offsetA: 11569, offsetB: 11571)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| operator = OP0 | OP1 | OP2 | OP3 | OP4 | OP5 | OP6 | OP7 | OP8 | OP9\", line: 388, col: 0, offsetA: 11572, offsetB: 11644)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | \\\'or\\\' | \\\'xor\\\' | \\\'and\\\'\", line: 389, col: 0, offsetA: 11645, offsetB: 11679)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | \\\'is\\\' | \\\'isnot\\\' | \\\'in\\\' | \\\'notin\\\' | \\\'of\\\' | \\\'as\\\' | \\\'from\\\'\", line: 390, col: 0, offsetA: 11680, offsetB: 11748)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | \\\'div\\\' | \\\'mod\\\' | \\\'shl\\\' | \\\'shr\\\' | \\\'not\\\' | \\\'..\\\'\", line: 391, col: 0, offsetA: 11749, offsetB: 11807)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#|\", line: 392, col: 0, offsetA: 11808, offsetB: 11810)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| prefixOperator = operator\", line: 393, col: 0, offsetA: 11811, offsetB: 11839)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#|\", line: 394, col: 0, offsetA: 11840, offsetB: 11842)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| optInd = COMMENT? IND?\", line: 395, col: 0, offsetA: 11843, offsetB: 11868)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| optPar = (IND{>} | IND{=})?\", line: 396, col: 0, offsetA: 11869, offsetB: 11899)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#|\", line: 397, col: 0, offsetA: 11900, offsetB: 11902)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| simpleExpr = arrowExpr (OP0 optInd arrowExpr)* pragma?\", line: 398, col: 0, offsetA: 11903, offsetB: 11960)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| arrowExpr = assignExpr (OP1 optInd assignExpr)*\", line: 399, col: 0, offsetA: 11961, offsetB: 12011)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| assignExpr = orExpr (OP2 optInd orExpr)*\", line: 400, col: 0, offsetA: 12012, offsetB: 12055)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| orExpr = andExpr (OP3 optInd andExpr)*\", line: 401, col: 0, offsetA: 12056, offsetB: 12097)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| andExpr = cmpExpr (OP4 optInd cmpExpr)*\", line: 402, col: 0, offsetA: 12098, offsetB: 12140)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| cmpExpr = sliceExpr (OP5 optInd sliceExpr)*\", line: 403, col: 0, offsetA: 12141, offsetB: 12187)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| sliceExpr = ampExpr (OP6 optInd ampExpr)*\", line: 404, col: 0, offsetA: 12188, offsetB: 12232)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| ampExpr = plusExpr (OP7 optInd plusExpr)*\", line: 405, col: 0, offsetA: 12233, offsetB: 12277)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| plusExpr = mulExpr (OP8 optInd mulExpr)*\", line: 406, col: 0, offsetA: 12278, offsetB: 12321)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| mulExpr = dollarExpr (OP9 optInd dollarExpr)*\", line: 407, col: 0, offsetA: 12322, offsetB: 12370)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| dollarExpr = primary (OP10 optInd primary)*\", line: 408, col: 0, offsetA: 12371, offsetB: 12417)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "isOperator" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "Token" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| operatorB = OP0 | OP1 | OP2 | OP3 | OP4 | OP5 | OP6 | OP7 | OP8 | OP9 |\", line: 410, col: 2, offsetA: 12456, offsetB: 12530)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| \\\'div\\\' | \\\'mod\\\' | \\\'shl\\\' | \\\'shr\\\' | \\\'in\\\' | \\\'notin\\\' |\", line: 411, col: 2, offsetA: 12533, offsetB: 12596)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| \\\'is\\\' | \\\'isnot\\\' | \\\'not\\\' | \\\'of\\\' | \\\'as\\\' | \\\'from\\\' | \\\'..\\\' | \\\'and\\\' | \\\'or\\\' | \\\'xor\\\'\", line: 412, col: 2, offsetA: 12599, offsetB: 12689)" + ], + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkOpr" + }, + { + "kind": "nkIdent", + "ident": "tkDiv" + }, + { + "kind": "nkIdent", + "ident": "tkMod" + }, + { + "kind": "nkIdent", + "ident": "tkShl" + }, + { + "kind": "nkIdent", + "ident": "tkShr" + }, + { + "kind": "nkIdent", + "ident": "tkIn" + }, + { + "kind": "nkIdent", + "ident": "tkNotin" + }, + { + "kind": "nkIdent", + "ident": "tkIs" + }, + { + "kind": "nkIdent", + "ident": "tkIsnot" + }, + { + "kind": "nkIdent", + "ident": "tkNot" + }, + { + "kind": "nkIdent", + "ident": "tkOf" + }, + { + "kind": "nkIdent", + "ident": "tkAs" + }, + { + "kind": "nkIdent", + "ident": "tkFrom" + }, + { + "kind": "nkIdent", + "ident": "tkDotDot" + }, + { + "kind": "nkIdent", + "ident": "tkAnd" + }, + { + "kind": "nkIdent", + "ident": "tkOr" + }, + { + "kind": "nkIdent", + "ident": "tkXor" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseComStmt" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLoc" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "commentLoc" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseColComStmt" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLoc" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# `:` followed by a list of statements, with comments interspresed\", line: 423, col: 2, offsetA: 13057, offsetB: 13123)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Comments with greater indent than the statements are added to `n` at\", line: 424, col: 2, offsetA: 13126, offsetB: 13196)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# `commentLoc` - these typically are part of what was just parsed.\", line: 425, col: 2, offsetA: 13199, offsetB: 13265)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#\", line: 426, col: 2, offsetA: 13268, offsetB: 13269)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Comments at the statement level are added as prefixes to the statement\", line: 427, col: 2, offsetA: 13272, offsetB: 13344)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# since they are more likely to be part of whatever the statements are doing.\", line: 428, col: 2, offsetA: 13347, offsetB: 13424)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# This strategy requires lookahead for the comment tokents.\", line: 429, col: 2, offsetA: 13427, offsetB: 13486)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseComStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "commentLoc" + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkBuiltInMagics" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkType" + }, + { + "kind": "nkIdent", + "ident": "tkStatic" + }, + { + "kind": "nkIdent", + "ident": "tkAddr" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO nimsuggest leftover\", line: 437, col: 2, offsetA: 13619, offsetB: 13645)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseSymbol" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "smNormal" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| symbol = \\\'`\\\' (KEYW|IDENT|literal|(operator|\\\'(\\\'|\\\')\\\'|\\\'[\\\'|\\\']\\\'|\\\'{\\\'|\\\'}\\\'|\\\'=\\\')+)+ \\\'`\\\'\", line: 441, col: 2, offsetA: 13717, offsetB: 13798)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | IDENT | \\\'addr\\\' | \\\'type\\\' | \\\'static\\\'\", line: 442, col: 2, offsetA: 13801, offsetB: 13847)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| symbolOrKeyword = symbol | KEYW\", line: 443, col: 2, offsetA: 13850, offsetB: 13884)" + ], + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIdentNodeP" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "tokKeywordLow" + }, + { + "kind": "nkIdent", + "ident": "tokKeywordHigh" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkBuiltInMagics" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "smAfterDot" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for backwards compatibility these 2 are always valid:\", line: 451, col: 6, offsetA: 14086, offsetB: 14141)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIdentNodeP" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkNil" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "smAllowNil" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkNilLit" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "errIdentifierExpected" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkAccent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkAccQuoted" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkWhileStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 467, col: 4, offsetA: 14474, offsetB: 14495)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkAccent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "errIdentifierExpected" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkOpr" + }, + { + "kind": "nkIdent", + "ident": "tkDot" + }, + { + "kind": "nkIdent", + "ident": "tkDotDot" + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkIdent", + "ident": "tkParDotRi" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "lineinfo" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parLineInfo" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "accm" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkOpr" + }, + { + "kind": "nkIdent", + "ident": "tkDot" + }, + { + "kind": "nkIdent", + "ident": "tkDotDot" + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkIdent", + "ident": "tkParDotRi" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "accm" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "node" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeI" + }, + { + "kind": "nkIdent", + "ident": "nkIdent" + }, + { + "kind": "nkIdent", + "ident": "lineinfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "node" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "cache" + } + ] + }, + { + "kind": "nkIdent", + "ident": "getIdent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "accm" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "node" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "tokKeywordLow" + }, + { + "kind": "nkIdent", + "ident": "tokKeywordHigh" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "tkIntLit" + }, + { + "kind": "nkIdent", + "ident": "tkCustomLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIdentNodeP" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "cache" + } + ] + }, + { + "kind": "nkIdent", + "ident": "getIdent" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "errIdentifierExpected" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkAccent" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "errIdentifierExpected" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# BUGFIX: We must consume a token here to prevent endless loops!\", line: 499, col: 4, offsetA: 15363, offsetB: 15427)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# But: this really sucks for idetools and keywords, so we don\\\'t do it\", line: 500, col: 4, offsetA: 15432, offsetB: 15501)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if it is a keyword:\", line: 501, col: 4, offsetA: 15506, offsetB: 15527)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#if not isKeyword(p.tok.tokType): getTok(p)\", line: 502, col: 4, offsetA: 15532, offsetB: 15575)" + ], + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "equals" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkExprEqExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "colonOrEquals" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkColon" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkExprColonExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO mid?\", line: 526, col: 41, offsetA: 16082, offsetB: 16093)" + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#optInd(p, result)\", line: 530, col: 4, offsetA: 16136, offsetB: 16154)" + ], + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "equals" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "exprColonEqExpr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| exprColonEqExpr = expr ((\\\':\\\'|\\\'=\\\') expr\", line: 538, col: 2, offsetA: 16325, offsetB: 16366)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| / doBlock extraPostExprBlock*)?\", line: 539, col: 2, offsetA: 16369, offsetB: 16426)" + ], + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkDo" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "postExprBlocks" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "colonOrEquals" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "exprEqExpr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| exprEqExpr = expr (\\\'=\\\' expr\", line: 547, col: 2, offsetA: 16596, offsetB: 16626)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| / doBlock extraPostExprBlock*)?\", line: 548, col: 2, offsetA: 16629, offsetB: 16681)" + ], + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkDo" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "postExprBlocks" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "equals" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "exprList" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "endTok" + }, + { + "kind": "nkIdent", + "ident": "TokType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| exprList = expr ^+ comma\", line: 556, col: 2, offsetA: 16867, offsetB: 16894)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkVarSection", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 563, col: 2, offsetA: 16961, offsetB: 16982)" + ], + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "endTok" + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkEof" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "optionalExprList" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "endTok" + }, + { + "kind": "nkIdent", + "ident": "TokType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| optionalExprList = expr ^* comma\", line: 581, col: 2, offsetA: 17321, offsetB: 17356)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkWhileStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 587, col: 2, offsetA: 17422, offsetB: 17443)" + ], + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "endTok" + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkEof" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "exprColonEqExprListAux" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "endTok" + }, + { + "kind": "nkIdent", + "ident": "TokType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "endTok" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCurlyRi" + }, + { + "kind": "nkIdent", + "ident": "tkCurlyDotRi" + }, + { + "kind": "nkIdent", + "ident": "tkBracketRi" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optPar" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkWhileStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 604, col: 2, offsetA: 17870, offsetB: 17891)" + ], + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "endTok" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkEof" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "exprColonEqExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkPar" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "transitionSonsKind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkTupleConstr" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optPar" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "endTok" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "exprColonEqExprList" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "endTok" + }, + { + "kind": "nkIdent", + "ident": "TokType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| exprColonEqExprList = exprColonEqExpr (comma exprColonEqExpr)* (comma)?\", line: 622, col: 2, offsetA: 18328, offsetB: 18402)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "exprColonEqExprListAux" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "endTok" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "dotExpr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "parLineInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkDotExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseSymbol" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "smAfterDot" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO non-line-ending comments?\", line: 639, col: 2, offsetA: 18729, offsetB: 18761)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# splitLookahead(p, result[^1], clPostfix)\", line: 640, col: 2, offsetA: 18764, offsetB: 18806)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkBracketLeColon" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "tsLeading" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "spacing" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkBracketExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# rewrite \\\'x.y[:z]()\\\' to \\\'y[z](x)\\\'\", line: 644, col: 4, offsetA: 18925, offsetB: 18959)" + ], + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "exprList" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkBracketRi" + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkBracketRi" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "y" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkCall" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "y" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "y" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "tsLeading" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "spacing" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "exprColonEqExprListAux" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + }, + { + "kind": "nkIdent", + "ident": "y" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "y" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "dotLikeExpr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "parLineInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeI" + }, + { + "kind": "nkIdent", + "ident": "nkInfix" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "opNode" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIdentNodeP" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "opNode" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseSymbol" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "smAfterDot" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "qualifiedIdent" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| qualifiedIdent = symbol (\\\'.\\\' optInd symbolOrKeyword)?\", line: 676, col: 2, offsetA: 19621, offsetB: 19677)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseSymbol" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkDot" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "dotExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "setOrTableConstr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| setOrTableConstr = \\\'{\\\' ((exprColonEqExpr comma)* | \\\':\\\' ) \\\'}\\\'\", line: 684, col: 2, offsetA: 19854, offsetB: 19917)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkCurly" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip \\\'{\\\'\", line: 687, col: 12, offsetA: 19963, offsetB: 19973)" + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optInd" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkColon" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip \\\':\\\'\", line: 690, col: 14, offsetA: 20039, offsetB: 20049)" + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "transitionSonsKind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkTableConstr" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 693, col: 4, offsetA: 20107, offsetB: 20128)" + ], + "sons": [ + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCurlyRi" + }, + { + "kind": "nkIdent", + "ident": "tkEof" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "exprColonEqExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkExprColonExpr" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "transitionSonsKind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkTableConstr" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipComment" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optPar" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkCurlyRi" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip \\\'}\\\'\", line: 707, col: 20, offsetA: 20441, offsetB: 20451)" + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseCast" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| castExpr = \\\'cast\\\' (\\\'[\\\' optInd typeDesc optPar \\\']\\\' \\\'(\\\' optInd expr optPar \\\')\\\') /\", line: 710, col: 2, offsetA: 20494, offsetB: 20576)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# (\\\'(\\\' optInd exprColonEqExpr optPar \\\')\\\')\", line: 711, col: 2, offsetA: 20579, offsetB: 20639)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkCast" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkBracketLe" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optInd" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDesc" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optPar" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkBracketRi" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optInd" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optInd" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "exprColonEqExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optPar" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "setBaseFlags" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "base" + }, + { + "kind": "nkIdent", + "ident": "NumericalBase" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "base" + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "base10" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "base2" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "incl" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nfBase2" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "base8" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "incl" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nfBase8" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "base16" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "incl" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nfBase16" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseGStrLit" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkGStrLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkCallStrLit" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStrNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkRStrLit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkGTripleStrLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkCallStrLit" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStrNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "complexOrSimpleStmt" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "simpleExpr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "pmNormal" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseIfOrWhenExpr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "semiStmtList" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "inSemiStmtList" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "withInd" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkIf" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseIfOrWhenExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkIfStmt" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkWhen" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseIfOrWhenExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkWhenStmt" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "complexOrSimpleStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkEof" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkSemiColon" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "sameInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "realInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkIdent", + "ident": "errInvalidIndentation" + }, + { + "kind": "nkStrLit", + "strVal": "semiStmtList" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "complexOrSimpleStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "debugEcho" + }, + { + "kind": "nkStrLit", + "strVal": "2" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "errExprExpected" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "dec" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "inSemiStmtList" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "transitionSonsKind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkStmtListExpr" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parsePar" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| parKeyw = \\\'discard\\\' | \\\'include\\\' | \\\'if\\\' | \\\'while\\\' | \\\'case\\\' | \\\'try\\\'\", line: 807, col: 2, offsetA: 22685, offsetB: 22753)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | \\\'finally\\\' | \\\'except\\\' | \\\'for\\\' | \\\'block\\\' | \\\'const\\\' | \\\'let\\\'\", line: 808, col: 2, offsetA: 22756, offsetB: 22825)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | \\\'when\\\' | \\\'var\\\' | \\\'mixin\\\'\", line: 809, col: 2, offsetA: 22828, offsetB: 22865)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| par = \\\'(\\\' optInd\", line: 810, col: 2, offsetA: 22868, offsetB: 22887)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| ( &parKeyw (ifExpr / complexOrSimpleStmt) ^+ \\\';\\\'\", line: 811, col: 2, offsetA: 22890, offsetB: 22951)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | \\\';\\\' (ifExpr / complexOrSimpleStmt) ^+ \\\';\\\'\", line: 812, col: 2, offsetA: 22954, offsetB: 23010)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | pragmaStmt\", line: 813, col: 2, offsetA: 23013, offsetB: 23038)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | simpleExpr ( (doBlock extraPostExprBlock*)\", line: 814, col: 2, offsetA: 23041, offsetB: 23098)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | (\\\'=\\\' expr (\\\';\\\' (ifExpr / complexOrSimpleStmt) ^+ \\\';\\\' )? )\", line: 815, col: 2, offsetA: 23101, offsetB: 23186)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | (\\\':\\\' expr (\\\',\\\' exprColonEqExpr ^+ \\\',\\\' )? ) ) )\", line: 816, col: 2, offsetA: 23189, offsetB: 23267)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| optPar \\\')\\\'\", line: 817, col: 2, offsetA: 23270, offsetB: 23293)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#\", line: 818, col: 2, offsetA: 23296, offsetB: 23297)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# unfortunately it\\\'s ambiguous: (expr: expr) vs (exprStmt); however a\", line: 819, col: 2, offsetA: 23300, offsetB: 23369)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# leading \\\';\\\' could be used to enforce a \\\'stmt\\\' context ...\", line: 820, col: 2, offsetA: 23372, offsetB: 23431)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkPar" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkDiscard" + }, + { + "kind": "nkIdent", + "ident": "tkInclude" + }, + { + "kind": "nkIdent", + "ident": "tkIf" + }, + { + "kind": "nkIdent", + "ident": "tkWhile" + }, + { + "kind": "nkIdent", + "ident": "tkCase" + }, + { + "kind": "nkIdent", + "ident": "tkTry" + }, + { + "kind": "nkIdent", + "ident": "tkDefer" + }, + { + "kind": "nkIdent", + "ident": "tkFinally" + }, + { + "kind": "nkIdent", + "ident": "tkExcept" + }, + { + "kind": "nkIdent", + "ident": "tkBlock" + }, + { + "kind": "nkIdent", + "ident": "tkConst" + }, + { + "kind": "nkIdent", + "ident": "tkLet" + }, + { + "kind": "nkIdent", + "ident": "tkWhen" + }, + { + "kind": "nkIdent", + "ident": "tkVar" + }, + { + "kind": "nkIdent", + "ident": "tkFor" + }, + { + "kind": "nkIdent", + "ident": "tkMixin" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# XXX \\\'bind\\\' used to be an expression, so we exclude it here;\", line: 832, col: 4, offsetA: 23708, offsetB: 23769)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# tests/reject/tbind2 fails otherwise.\", line: 833, col: 4, offsetA: 23774, offsetB: 23812)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "semiStmtList" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkSemiColon" + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \\\'(;\\\' enforces \\\'stmt\\\' context:\", line: 836, col: 4, offsetA: 23882, offsetB: 23913)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optInd" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "semiStmtList" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkCurlyDotLe" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseStmtPragma" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Empty tuple \\\'()\\\'\", line: 843, col: 4, offsetA: 24088, offsetB: 24106)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "transitionSonsKind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkTupleConstr" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "simpleExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkDo" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "postExprBlocks" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# special case: allow assignments\", line: 850, col: 6, offsetA: 24294, offsetB: 24327)" + ], + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "asgn" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkAsgn" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optInd" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "asgn" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "asgn" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "asgn" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkSemiColon" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "semiStmtList" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkSemiColon" + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# stmt context:\", line: 865, col: 6, offsetA: 24609, offsetB: 24624)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "semiStmtList" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "colonOrEquals" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkExprColonExpr" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "transitionSonsKind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkTupleConstr" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipComment" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 8, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# (1,) produces a tuple expression:\", line: 877, col: 8, offsetA: 24908, offsetB: 24943)" + ], + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "transitionSonsKind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkTupleConstr" + } + ] + }, + { + "kind": "nkWhileStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 8, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 879, col: 8, offsetA: 25001, offsetB: 25022)" + ], + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkEof" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "exprColonEqExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipComment" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optPar" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "identOrLiteral" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "PrimaryMode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| literal = | INT_LIT | INT8_LIT | INT16_LIT | INT32_LIT | INT64_LIT\", line: 895, col: 2, offsetA: 25370, offsetB: 25439)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | UINT_LIT | UINT8_LIT | UINT16_LIT | UINT32_LIT | UINT64_LIT\", line: 896, col: 2, offsetA: 25442, offsetB: 25516)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | FLOAT_LIT | FLOAT32_LIT | FLOAT64_LIT\", line: 897, col: 2, offsetA: 25519, offsetB: 25571)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | STR_LIT | RSTR_LIT | TRIPLESTR_LIT\", line: 898, col: 2, offsetA: 25574, offsetB: 25623)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | CHAR_LIT | CUSTOM_NUMERIC_LIT\", line: 899, col: 2, offsetA: 25626, offsetB: 25670)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | NIL\", line: 900, col: 2, offsetA: 25673, offsetB: 25691)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| generalizedLit = GENERALIZED_STR_LIT | GENERALIZED_TRIPLESTR_LIT\", line: 901, col: 2, offsetA: 25694, offsetB: 25761)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| identOrLiteral = generalizedLit | symbol | literal\", line: 902, col: 2, offsetA: 25764, offsetB: 25817)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | par | arrayConstr | setOrTableConstr | tupleConstr\", line: 903, col: 2, offsetA: 25820, offsetB: 25890)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | castExpr\", line: 904, col: 2, offsetA: 25893, offsetB: 25921)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| tupleConstr = \\\'(\\\' optInd (exprColonEqExpr comma?)* optPar \\\')\\\'\", line: 905, col: 2, offsetA: 25924, offsetB: 25988)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| arrayConstr = \\\'[\\\' optInd (exprColonEqExpr comma?)* optPar \\\']\\\'\", line: 906, col: 2, offsetA: 25991, offsetB: 26055)" + ], + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkIdent", + "ident": "tkBuiltInMagics" + }, + { + "kind": "nkIdent", + "ident": "tkOut" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIdentNodeP" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseGStrLit" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkAccent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseSymbol" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# literals\", line: 915, col: 28, offsetA: 26255, offsetB: 26265)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkIntLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIntNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkIntLit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setBaseFlags" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "base" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInt8Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIntNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkInt8Lit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setBaseFlags" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "base" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInt16Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIntNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkInt16Lit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setBaseFlags" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "base" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInt32Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIntNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkInt32Lit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setBaseFlags" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "base" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInt64Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIntNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkInt64Lit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setBaseFlags" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "base" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkUIntLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIntNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkUIntLit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setBaseFlags" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "base" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkUInt8Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIntNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkUInt8Lit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setBaseFlags" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "base" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkUInt16Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIntNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkUInt16Lit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setBaseFlags" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "base" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkUInt32Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIntNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkUInt32Lit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setBaseFlags" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "base" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkUInt64Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIntNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkUInt64Lit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setBaseFlags" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "base" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFloatLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newFloatNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkFloatLit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setBaseFlags" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "base" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFloat32Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newFloatNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkFloat32Lit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setBaseFlags" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "base" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFloat64Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newFloatNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkFloat64Lit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setBaseFlags" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "base" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFloat128Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newFloatNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkFloat128Lit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setBaseFlags" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "base" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkStrLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStrNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkStrLit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkRStrLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStrNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkRStrLit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkTripleStrLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStrNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCharLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIntNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkCharLit" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCustomLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitPos" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "iNumber" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "str" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStrNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkRStrLit" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "substr" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "splitPos" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "callee" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIdentNodeP" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getIdent" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "cache" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "substr" + } + ] + }, + { + "kind": "nkIdent", + "ident": "splitPos" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "callee" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkIdent", + "ident": "offsetA" + } + ] + }, + { + "kind": "nkIdent", + "ident": "splitPos" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkDotExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "str" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "callee" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkNil" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkNilLit" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# () constructor\", line: 1020, col: 4, offsetA: 28812, offsetB: 28828)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "pmTypeDesc" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDef" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "exprColonEqExprList" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkPar" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parsePar" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCurlyLe" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# {} constructor\", line: 1026, col: 4, offsetA: 28980, offsetB: 28996)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setOrTableConstr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkBracketLe" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# [] constructor\", line: 1029, col: 4, offsetA: 29052, offsetB: 29068)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "exprColonEqExprList" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkBracket" + }, + { + "kind": "nkIdent", + "ident": "tkBracketRi" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCast" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseCast" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "debugEcho" + }, + { + "kind": "nkStrLit", + "strVal": "1" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "errExprExpected" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# we must consume a token here to prevent endless loops!\", line: 1037, col: 14, offsetA: 29251, offsetB: 29307)" + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "namedParams" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "callee" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "endTok" + }, + { + "kind": "nkIdent", + "ident": "TokType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "callee" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 1047, col: 2, offsetA: 29491, offsetB: 29512)" + ], + "ident": "exprColonEqExprListAux" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "endTok" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "commandParam" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "isFirstParam" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "PrimaryMode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDesc" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "simpleExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "mode" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkIdent", + "ident": "isFirstParam" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "exprEqExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkDo" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "postExprBlocks" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "isFirstParam" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "commandExpr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "r" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "PrimaryMode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "pmTrySimple" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "r" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkCommand" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "r" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "isFirstParam" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress NOT guaranteed\", line: 1072, col: 4, offsetA: 30091, offsetB: 30116)" + ], + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "hasProgress" + } + ] + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commandParam" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "isFirstParam" + }, + { + "kind": "nkIdent", + "ident": "mode" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "isDotLike" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "Token" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkOpr" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 46 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 46 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "primarySuffix" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "r" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "baseIndent" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "PrimaryMode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| primarySuffix = \\\'(\\\' (exprColonEqExpr comma?)* \\\')\\\'\", line: 1083, col: 2, offsetA: 30444, offsetB: 30496)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | \\\'.\\\' optInd symbolOrKeyword (\\\'[:\\\' exprList \\\']\\\' ( \\\'(\\\' exprColonEqExpr \\\')\\\' )?)? generalizedLit?\", line: 1084, col: 2, offsetA: 30499, offsetB: 30602)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | DOTLIKEOP optInd symbolOrKeyword generalizedLit?\", line: 1085, col: 2, offsetA: 30605, offsetB: 30664)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | \\\'[\\\' optInd exprColonEqExprList optPar \\\']\\\'\", line: 1086, col: 2, offsetA: 30667, offsetB: 30719)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | \\\'{\\\' optInd exprColonEqExprList optPar \\\'}\\\'\", line: 1087, col: 2, offsetA: 30722, offsetB: 30774)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# XXX strong spaces need to be reflected above\", line: 1088, col: 2, offsetA: 30777, offsetB: 30823)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "r" + } + ] + }, + { + "kind": "nkWhileStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 1090, col: 2, offsetA: 30839, offsetB: 30860)" + ], + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkDot" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "baseIndent" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 1094, col: 6, offsetA: 30991, offsetB: 31012)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "tsLeading" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "spacing" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commandExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "mode" + } + ] + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "namedParams" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "nkCall" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkExprColonExpr" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "transitionSonsKind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkObjConstr" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkDot" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 1106, col: 6, offsetA: 31341, offsetB: 31362)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "dotExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseGStrLit" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkBracketLe" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 1112, col: 6, offsetA: 31506, offsetB: 31527)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "tsLeading" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "spacing" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commandExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "mode" + } + ] + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "namedParams" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "nkBracketExpr" + }, + { + "kind": "nkIdent", + "ident": "tkBracketRi" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCurlyLe" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 1120, col: 6, offsetA: 31717, offsetB: 31738)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "tsLeading" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "spacing" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commandExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "mode" + } + ] + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "namedParams" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "nkCurlyExpr" + }, + { + "kind": "nkIdent", + "ident": "tkCurlyRi" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkIdent", + "ident": "tkAccent" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "tkIntLit" + }, + { + "kind": "nkIdent", + "ident": "tkCustomLit" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkNil" + }, + { + "kind": "nkIdent", + "ident": "tkCast" + }, + { + "kind": "nkIdent", + "ident": "tkOpr" + }, + { + "kind": "nkIdent", + "ident": "tkDotDot" + }, + { + "kind": "nkIdent", + "ident": "tkVar" + }, + { + "kind": "nkIdent", + "ident": "tkOut" + }, + { + "kind": "nkIdent", + "ident": "tkStatic" + }, + { + "kind": "nkIdent", + "ident": "tkType" + }, + { + "kind": "nkIdent", + "ident": "tkEnum" + }, + { + "kind": "nkIdent", + "ident": "tkTuple" + }, + { + "kind": "nkIdent", + "ident": "tkObject" + }, + { + "kind": "nkIdent", + "ident": "tkProc" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# XXX: In type sections we allow the free application of the\", line: 1142, col: 6, offsetA: 32141, offsetB: 32201)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# command syntax, with the exception of expressions such as\", line: 1143, col: 6, offsetA: 32208, offsetB: 32267)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# `foo ref` or `foo ptr`. Unfortunately, these two are also\", line: 1144, col: 6, offsetA: 32274, offsetB: 32333)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# used as infix operators for the memory regions feature and\", line: 1145, col: 6, offsetA: 32340, offsetB: 32400)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the current parsing rules don\\\'t play well here.\", line: 1146, col: 6, offsetA: 32407, offsetB: 32456)" + ], + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "isDotLike2" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "isDotLike" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "isDotLike2" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "isDefined" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "nimPreviewDotLikeOps" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 8, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# synchronize with `tkDot` branch\", line: 1149, col: 8, offsetA: 32576, offsetB: 32609)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "dotLikeExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseGStrLit" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "isDotLike2" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "warnDotLikeOps" + }, + { + "kind": "nkStrLit", + "strVal": "dot-like operators will be parsed differently with `-d:nimPreviewDotLikeOps`" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "inPragma" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isUnary" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkOpr" + }, + { + "kind": "nkIdent", + "ident": "tkDotDot" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 10, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# actually parsing {.push hints:off.} as {.push(hints:off).} is a sweet\", line: 1160, col: 10, offsetA: 32994, offsetB: 33065)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 10, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# solution, but pragmas.nim can\\\'t handle that\", line: 1161, col: 10, offsetA: 33076, offsetB: 33121)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commandExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "mode" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseOperators" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "headNode" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "limit" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "PrimaryMode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "headNode" + } + ] + }, + { + "kind": "nkVarSection", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# expand while operators have priorities higher than \\\'limit\\\'\", line: 1173, col: 2, offsetA: 33329, offsetB: 33389)" + ], + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "opPrec" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getPrecedence" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "modeB" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDef" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "pmTypeDesc" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "mode" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the operator itself must not start on a new line:\", line: 1182, col: 2, offsetA: 33511, offsetB: 33562)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 1183, col: 2, offsetA: 33565, offsetB: 33586)" + ], + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkIdent", + "ident": "opPrec" + }, + { + "kind": "nkIdent", + "ident": "limit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isUnary" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "checkBinary" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "leftAssoc" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isRightAssociative" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkInfix" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "opNode" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIdentNodeP" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip operator:\", line: 1190, col: 47, offsetA: 33812, offsetB: 33828)" + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "opNode" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optPar" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkVarSection", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# read sub-expression with higher priority:\", line: 1196, col: 4, offsetA: 33904, offsetB: 33947)" + ], + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "simpleExprAux" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "opPrec" + }, + { + "kind": "nkIdent", + "ident": "leftAssoc" + } + ] + }, + { + "kind": "nkIdent", + "ident": "modeB" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "opNode" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "opPrec" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getPrecedence" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "simpleExprAux" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "limit" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "PrimaryMode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "mode" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "primary" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "mode" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "pmTrySimple" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "pmNormal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkCurlyDotLe" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "realInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "pmNormal" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pragmaExp" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkPragmaExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "pragmaExp" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "pragmaExp" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "parsePragma" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "pragmaExp" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseOperators" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "limit" + }, + { + "kind": "nkIdent", + "ident": "mode" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "simpleExpr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "pmNormal" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "simpleExprAux" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIntLit", + "intVal": -1 + }, + { + "kind": "nkIdent", + "ident": "mode" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parsePragma" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| pragma = \\\'{.\\\' optInd (exprColonEqExpr comma?)* optPar (\\\'.}\\\' | \\\'}\\\')\", line: 1229, col: 2, offsetA: 34707, offsetB: 34776)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkPragma" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "inPragma" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCurlyDotRi" + }, + { + "kind": "nkIdent", + "ident": "tkCurlyRi" + }, + { + "kind": "nkIdent", + "ident": "tkEof" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "hasProgress" + } + ] + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "exprColonEqExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "hasProgress" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optPar" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCurlyDotRi" + }, + { + "kind": "nkIdent", + "ident": "tkCurlyRi" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkStrLit", + "strVal": "expected \'.}\'" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "dec" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "inPragma" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "identVis" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "allowDot" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| identVis = symbol OPR? # postfix position\", line: 1261, col: 2, offsetA: 35389, offsetB: 35434)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| identVisDot = symbol \\\'.\\\' optInd symbolOrKeyword OPR?\", line: 1262, col: 2, offsetA: 35437, offsetB: 35492)" + ], + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseSymbol" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkOpr" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkPostfix" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIdentNodeP" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkDot" + } + ] + }, + { + "kind": "nkIdent", + "ident": "allowDot" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "dotExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "identWithPragma" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "allowDot" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| identWithPragma = identVis pragma?\", line: 1278, col: 2, offsetA: 35857, offsetB: 35894)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| identWithPragmaDot = identVisDot pragma?\", line: 1279, col: 2, offsetA: 35897, offsetB: 35940)" + ], + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "identVis" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "allowDot" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkCurlyDotLe" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkPragmaExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parsePragma" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "DeclaredIdentFlag" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "withPragma", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# identifier may have pragma\", line: 1292, col: 15, offsetA: 36210, offsetB: 36238)" + ] + }, + { + "kind": "nkIdent", + "ident": "withBothOptional", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# both \\\':\\\' and \\\'=\\\' parts are optional\", line: 1293, col: 21, offsetA: 36260, offsetB: 36297)" + ] + }, + { + "kind": "nkIdent", + "ident": "withDot", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# allow \\\'var ident.ident = value\\\'\", line: 1294, col: 12, offsetA: 36310, offsetB: 36343)" + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "DeclaredIdentFlags" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "DeclaredIdentFlag" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseIdentColonEquals" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "flags" + }, + { + "kind": "nkIdent", + "ident": "DeclaredIdentFlags" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| declColonEquals = identWithPragma (comma identWithPragma)* comma?\", line: 1299, col: 2, offsetA: 36472, offsetB: 36540)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| (\\\':\\\' optInd typeDescExpr)? (\\\'=\\\' optInd expr)?\", line: 1300, col: 2, offsetA: 36543, offsetB: 36609)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| identColonEquals = IDENT (comma IDENT)* comma?\", line: 1301, col: 2, offsetA: 36612, offsetB: 36661)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| (\\\':\\\' optInd typeDescExpr)? (\\\'=\\\' optInd expr)?)\", line: 1302, col: 2, offsetA: 36664, offsetB: 36718)" + ], + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkIdentDefs" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 1306, col: 2, offsetA: 36773, offsetB: 36794)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkIdent", + "ident": "tkAccent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "withPragma" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "identWithPragma" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "allowDot" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "withDot" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseSymbol" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkColon" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDesc" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fullExpr" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "withBothOptional" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkStrLit", + "strVal": "\':\' or \'=\' expected, but got \'$1\'" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTuple" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentAllowed" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| tupleTypeBracket = \\\'[\\\' optInd (identColonEquals (comma/semicolon)?)* optPar \\\']\\\'\", line: 1348, col: 2, offsetA: 37835, offsetB: 37917)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| tupleType = \\\'tuple\\\' tupleTypeBracket\", line: 1349, col: 2, offsetA: 37920, offsetB: 37959)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| tupleDecl = \\\'tuple\\\' (tupleTypeBracket /\", line: 1350, col: 2, offsetA: 37962, offsetB: 38004)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| COMMENT? (IND{>} identColonEquals (IND{=} identColonEquals)*)?)\", line: 1351, col: 2, offsetA: 38007, offsetB: 38077)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkTupleTy" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkBracketLe" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkWhileStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 1361, col: 4, offsetA: 38231, offsetB: 38252)" + ], + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkIdent", + "ident": "tkAccent" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseIdentColonEquals" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkCurly" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkComma" + }, + { + "kind": "nkIdent", + "ident": "tkSemiColon" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optPar" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkBracketRi" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentAllowed" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "realInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "withInd" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkWhileStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 8, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 1380, col: 8, offsetA: 38713, offsetB: 38734)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkIdent", + "ident": "tkAccent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseIdentColonEquals" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkCurly" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkEof" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "errIdentifierExpected" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "sameInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkStrLit", + "strVal": "the syntax for tuple types is \'tuple[...]\', not \'tuple(...)\'" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkTupleClassTy" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseParamList" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "retColon" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| paramList = \\\'(\\\' declColonEquals ^* (comma/semicolon) \\\')\\\'\", line: 1409, col: 2, offsetA: 39423, offsetB: 39482)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| paramListArrow = paramList? (\\\'->\\\' optInd typeDesc)?\", line: 1410, col: 2, offsetA: 39485, offsetB: 39539)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| paramListColon = paramList? (\\\':\\\' optInd typeDesc)?\", line: 1411, col: 2, offsetA: 39542, offsetB: 39595)" + ], + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkFormalParams" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# return type\", line: 1416, col: 26, offsetA: 39678, offsetB: 39691)" + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "hasParLe" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "hasParLe" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkWhileStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 1423, col: 4, offsetA: 39841, offsetB: 39862)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkIdent", + "ident": "tkAccent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseIdentColonEquals" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "withBothOptional" + }, + { + "kind": "nkIdent", + "ident": "withPragma" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkParRi" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkVar" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "errGenerated" + }, + { + "kind": "nkStrLit", + "strVal": "the syntax is \'parameter: var T\', not \'var parameter: T\'" + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkStrLit", + "strVal": "expected closing \')\'" + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipComment" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkComma" + }, + { + "kind": "nkIdent", + "ident": "tkSemiColon" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipComment" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optPar" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "hasRet" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "retColon" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkColon" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkOpr" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "->" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "hasRet" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optInd" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDesc" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkIdent", + "ident": "retColon" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkIdent", + "ident": "hasParLe" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Mark as \\\"not there\\\" in order to mark for deprecation in the semantic pass:\", line: 1463, col: 4, offsetA: 40717, offsetB: 40793)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "optPragmas" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkCurlyDotLe" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "realInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parsePragma" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseDoBlock" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkIdent", + "ident": "TLineInfo" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| doBlock = \\\'do\\\' paramListArrow pragma? colcom stmt\", line: 1475, col: 2, offsetA: 41072, offsetB: 41124)" + ], + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "params" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseParamList" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "retColon" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pragmas" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optPragmas" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newProcNode" + }, + { + "kind": "nkIdent", + "ident": "nkDo" + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "params" + }, + { + "kind": "nkIdent", + "ident": "params" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "name" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "pattern" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "genericParams" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "pragmas" + }, + { + "kind": "nkIdent", + "ident": "pragmas" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "exceptions" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseColComStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "params" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "pragmas" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "params" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "params" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkFormalParams" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "params" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# return type\", line: 1498, col: 30, offsetA: 41662, offsetB: 41675)" + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "paramsPos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "params" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "bodyPos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "body" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkIdent", + "ident": "prefix" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "prefix" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkIdent", + "ident": "mid" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "mid" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkIdent", + "ident": "postfix" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "postfix" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "body" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseProcExpr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "isExpr" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| routineExpr = (\\\'proc\\\' | \\\'func\\\' | \\\'iterator\\\') paramListColon pragma? (\\\'=\\\' COMMENT? stmt)?\", line: 1513, col: 2, offsetA: 41959, offsetB: 42050)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| routineType = (\\\'proc\\\' | \\\'iterator\\\') paramListColon pragma?\", line: 1514, col: 2, offsetA: 42053, offsetB: 42114)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# either a proc type or a anonymous proc\", line: 1515, col: 2, offsetA: 42117, offsetB: 42157)" + ], + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parLineInfo" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "hasSignature" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "params" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseParamList" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pragmas" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optPragmas" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + } + ] + }, + { + "kind": "nkIdent", + "ident": "isExpr" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newProcNode" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "params" + }, + { + "kind": "nkIdent", + "ident": "params" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "name" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "pattern" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "genericParams" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "pragmas" + }, + { + "kind": "nkIdent", + "ident": "pragmas" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "exceptions" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "bodyPos" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseComStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeI" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "nkIteratorDef" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIteratorTy" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkProcTy" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkIdent", + "ident": "hasSignature" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "pragmas" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "hasSignature" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "params" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# pragmas but no param list, implies typeclass with pragmas\", line: 1549, col: 12, offsetA: 42983, offsetB: 43042)" + ], + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "nkFuncDef" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkStrLit", + "strVal": "func keyword is not allowed in type descriptions, use proc with {.noSideEffect.} pragma instead" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pragmas" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "isExprStart" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "Parser" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkIdent", + "ident": "tkAccent" + }, + { + "kind": "nkIdent", + "ident": "tkOpr" + }, + { + "kind": "nkIdent", + "ident": "tkNot" + }, + { + "kind": "nkIdent", + "ident": "tkNil" + }, + { + "kind": "nkIdent", + "ident": "tkCast" + }, + { + "kind": "nkIdent", + "ident": "tkIf" + }, + { + "kind": "nkIdent", + "ident": "tkFor" + }, + { + "kind": "nkIdent", + "ident": "tkProc" + }, + { + "kind": "nkIdent", + "ident": "tkFunc" + }, + { + "kind": "nkIdent", + "ident": "tkIterator" + }, + { + "kind": "nkIdent", + "ident": "tkBind" + }, + { + "kind": "nkIdent", + "ident": "tkBuiltInMagics" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkIdent", + "ident": "tkBracketLe" + }, + { + "kind": "nkIdent", + "ident": "tkCurlyLe" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "tkIntLit" + }, + { + "kind": "nkIdent", + "ident": "tkCustomLit" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkVar" + }, + { + "kind": "nkIdent", + "ident": "tkRef" + }, + { + "kind": "nkIdent", + "ident": "tkPtr" + }, + { + "kind": "nkIdent", + "ident": "tkEnum" + }, + { + "kind": "nkIdent", + "ident": "tkTuple" + }, + { + "kind": "nkIdent", + "ident": "tkObject" + }, + { + "kind": "nkIdent", + "ident": "tkWhen" + }, + { + "kind": "nkIdent", + "ident": "tkCase" + }, + { + "kind": "nkIdent", + "ident": "tkOut" + }, + { + "kind": "nkIdent", + "ident": "tkTry" + }, + { + "kind": "nkIdent", + "ident": "tkBlock" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseSymbolList" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 1596, col: 2, offsetA: 43829, offsetB: 43850)" + ], + "sons": [ + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseSymbol" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "smAllowNil" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDescKAux" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "PrimaryMode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optInd" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "isTypedef" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDef" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkObject" + }, + { + "kind": "nkIdent", + "ident": "tkTuple" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isOperator" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isExprStart" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "isTypedef" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDefValue" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "primary" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "mode" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "nkDistinctTy" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# XXX document this feature!\", line: 1628, col: 4, offsetA: 44589, offsetB: 44617)" + ], + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "nodeKind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "with" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "nodeKind" + }, + { + "kind": "nkIdent", + "ident": "nkWith" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "without" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "nodeKind" + }, + { + "kind": "nkIdent", + "ident": "nkWithout" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "list" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nodeKind" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "list" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseSymbolList" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "list" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDef" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkIdent", + "ident": "isTypedef" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseOperators" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": -1 + }, + { + "kind": "nkIdent", + "ident": "mode" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseVarTuple" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseFor" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| forStmt = \\\'for\\\' ((varTuple / identWithPragma) ^+ comma) \\\'in\\\' expr colcom stmt\", line: 1652, col: 2, offsetA: 45090, offsetB: 45170)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| forExpr = forStmt\", line: 1653, col: 2, offsetA: 45173, offsetB: 45193)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTokNoInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkForStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseVarTuple" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "identWithPragma" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optInd" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseVarTuple" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "identWithPragma" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkIn" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseColComStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimprettyDontTouch" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "body", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO nimpretty leftover\", line: 1681, col: 7, offsetA: 45727, offsetB: 45752)" + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| expr = (blockExpr\", line: 1684, col: 2, offsetA: 45795, offsetB: 45815)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | ifExpr\", line: 1685, col: 2, offsetA: 45818, offsetB: 45835)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | whenExpr\", line: 1686, col: 2, offsetA: 45838, offsetB: 45857)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | caseStmt\", line: 1687, col: 2, offsetA: 45860, offsetB: 45879)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | forExpr\", line: 1688, col: 2, offsetA: 45882, offsetB: 45900)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | tryExpr)\", line: 1689, col: 2, offsetA: 45903, offsetB: 45922)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| / simpleExpr\", line: 1690, col: 2, offsetA: 45925, offsetB: 45946)" + ], + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkBlock" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimprettyDontTouch" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseBlock" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkIf" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimprettyDontTouch" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseIfOrWhenExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkIfExpr" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFor" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimprettyDontTouch" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseFor" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkWhen" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimprettyDontTouch" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseIfOrWhenExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkWhenExpr" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCase" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Currently we think nimpretty is good enough with case expressions,\", line: 1705, col: 4, offsetA: 46281, offsetB: 46349)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# so it is allowed to touch them:\", line: 1706, col: 4, offsetA: 46354, offsetB: 46387)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#nimprettyDontTouch:\", line: 1707, col: 4, offsetA: 46392, offsetB: 46412)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseCase" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkTry" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimprettyDontTouch" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTry" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "isExpr" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "simpleExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseEnum" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseObject" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeClass" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "primary" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "PrimaryMode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| simplePrimary = SIGILLIKEOP? identOrLiteral primarySuffix*\", line: 1724, col: 2, offsetA: 46748, offsetB: 46809)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| commandStart = &(\\\'`\\\'|IDENT|literal|\\\'cast\\\'|\\\'addr\\\'|\\\'type\\\'|\\\'var\\\'|\\\'out\\\'|\", line: 1725, col: 2, offsetA: 46812, offsetB: 46883)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| \\\'static\\\'|\\\'enum\\\'|\\\'tuple\\\'|\\\'object\\\'|\\\'proc\\\')\", line: 1726, col: 2, offsetA: 46886, offsetB: 46946)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| primary = simplePrimary (commandStart expr (doBlock extraPostExprBlock*)?)?\", line: 1727, col: 2, offsetA: 46949, offsetB: 47027)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| / operatorB primary\", line: 1728, col: 2, offsetA: 47030, offsetB: 47060)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| / routineExpr\", line: 1729, col: 2, offsetA: 47063, offsetB: 47087)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| / rawTypeDesc\", line: 1730, col: 2, offsetA: 47090, offsetB: 47114)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| / prefixOperator primary\", line: 1731, col: 2, offsetA: 47117, offsetB: 47152)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# XXX strong spaces need to be reflected in commandStart\", line: 1732, col: 2, offsetA: 47155, offsetB: 47211)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# command part is handled in the primarySuffix proc\", line: 1733, col: 2, offsetA: 47214, offsetB: 47265)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# prefix operators:\", line: 1734, col: 2, offsetA: 47268, offsetB: 47287)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isOperator" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Note \\\'sigil like\\\' operators are currently not reflected in the grammar\", line: 1736, col: 4, offsetA: 47316, offsetB: 47388)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# and should be removed for Nim 2.0, I don\\\'t think anybody uses them.\", line: 1737, col: 4, offsetA: 47393, offsetB: 47462)" + ], + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "isSigil" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isSigilLike" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkPrefix" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIdentNodeP" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "identOrLiteralKinds" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "tkBuiltInMagics" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkIdent", + "ident": "tkAccent" + }, + { + "kind": "nkIdent", + "ident": "tkNil" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "tkIntLit" + }, + { + "kind": "nkIdent", + "ident": "tkCustomLit" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkCast" + }, + { + "kind": "nkIdent", + "ident": "tkOut" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkIdent", + "ident": "tkBracketLe" + }, + { + "kind": "nkIdent", + "ident": "tkCurlyLe" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "isSigil" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "identOrLiteralKinds" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "baseInd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "currLineIndent" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "identOrLiteral" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "mode" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "primarySuffix" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "baseInd" + }, + { + "kind": "nkIdent", + "ident": "mode" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "primary" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "pmNormal" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkProc" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseProcExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDesc" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkLambda" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFunc" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseProcExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDesc" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkFuncDef" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkIterator" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseProcExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "mode" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDesc" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkIteratorDef" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkBind" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# legacy syntax, no-op in current nim\", line: 1785, col: 4, offsetA: 48504, offsetB: 48541)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkBind" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optInd" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "primary" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "pmNormal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkTuple" + }, + { + "kind": "nkIdent", + "ident": "tkEnum" + }, + { + "kind": "nkIdent", + "ident": "tkObject" + }, + { + "kind": "nkIdent", + "ident": "tkConcept" + }, + { + "kind": "nkIdent", + "ident": "tkVar" + }, + { + "kind": "nkIdent", + "ident": "tkOut" + }, + { + "kind": "nkIdent", + "ident": "tkRef" + }, + { + "kind": "nkIdent", + "ident": "tkPtr" + }, + { + "kind": "nkIdent", + "ident": "tkDistinct" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDesc" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "baseInd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "currLineIndent" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "identOrLiteral" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "mode" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "primarySuffix" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "baseInd" + }, + { + "kind": "nkIdent", + "ident": "mode" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "binaryNot" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkNot" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "notOpr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIdentNodeP" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optInd" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "notOpr" + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "primary" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDesc" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkInfix" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "notOpr" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDesc" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fullExpr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| rawTypeDesc = (tupleType | routineType | \\\'enum\\\' | \\\'object\\\' |\", line: 1817, col: 2, offsetA: 49278, offsetB: 49341)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| (\\\'var\\\' | \\\'out\\\' | \\\'ref\\\' | \\\'ptr\\\' | \\\'distinct\\\') typeDesc?)\", line: 1818, col: 2, offsetA: 49344, offsetB: 49418)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| (\\\'not\\\' primary)?\", line: 1819, col: 2, offsetA: 49421, offsetB: 49456)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| typeDescExpr = (routineType / simpleExpr) (\\\'not\\\' primary)?\", line: 1820, col: 2, offsetA: 49459, offsetB: 49520)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| typeDesc = rawTypeDesc / typeDescExpr\", line: 1821, col: 2, offsetA: 49523, offsetB: 49563)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newlineWasSplitting" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "fullExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "simpleExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDesc" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkTuple" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTuple" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkProc" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseProcExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "false" + }, + { + "kind": "nkIdent", + "ident": "nkLambda" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkIterator" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseProcExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "false" + }, + { + "kind": "nkIdent", + "ident": "nkIteratorDef" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkEnum" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkEnumTy" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkObject" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkObjectTy" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkConcept" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkStrLit", + "strVal": "the \'concept\' keyword is only valid in \'type\' sections" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkVar" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDescKAux" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkVarTy" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDesc" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkOut" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDescKAux" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkOutTy" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDesc" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkRef" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDescKAux" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkRefTy" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDesc" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkPtr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDescKAux" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkPtrTy" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDesc" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkDistinct" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDescKAux" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkDistinctTy" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDesc" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "simpleExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDesc" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "binaryNot" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDefValue" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| typeDefValue = ((tupleDecl | enumDecl | objectDecl | conceptDecl |\", line: 1865, col: 2, offsetA: 50650, offsetB: 50719)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| (\\\'ref\\\' | \\\'ptr\\\' | \\\'distinct\\\') (tupleDecl | objectDecl))\", line: 1866, col: 2, offsetA: 50722, offsetB: 50796)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| / (simpleExpr (exprEqExpr ^+ comma postExprBlocks?)?))\", line: 1867, col: 2, offsetA: 50799, offsetB: 50871)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| (\\\'not\\\' primary)?\", line: 1868, col: 2, offsetA: 50874, offsetB: 50908)" + ], + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkTuple" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTuple" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkRef" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDescKAux" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkRefTy" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDef" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkPtr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDescKAux" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkPtrTy" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDef" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkDistinct" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDescKAux" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkDistinctTy" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDef" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkEnum" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "prettySection" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseEnum" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkObject" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "prettySection" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseObject" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkConcept" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeClass" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "simpleExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDef" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkNot" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkCommand" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "isFirstParam" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optInd" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commandParam" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "isFirstParam" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDef" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "postExprBlocks" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "binaryNot" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "makeCall" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Creates a call if the given node isn\\\'t already a call.\", line: 1903, col: 2, offsetA: 51779, offsetB: 51836)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkCallKinds" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeI" + }, + { + "kind": "nkIdent", + "ident": "nkCall" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "postExprBlocks" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| extraPostExprBlock = ( IND{=} doBlock\", line: 1912, col: 2, offsetA: 52001, offsetB: 52041)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | IND{=} \\\'of\\\' exprList \\\':\\\' stmt\", line: 1913, col: 2, offsetA: 52044, offsetB: 52099)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | IND{=} \\\'elif\\\' expr \\\':\\\' stmt\", line: 1914, col: 2, offsetA: 52102, offsetB: 52155)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | IND{=} \\\'except\\\' optionalExprList \\\':\\\' stmt\", line: 1915, col: 2, offsetA: 52158, offsetB: 52225)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | IND{=} \\\'finally\\\' \\\':\\\' stmt\", line: 1916, col: 2, offsetA: 52228, offsetB: 52279)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | IND{=} \\\'else\\\' \\\':\\\' stmt )\", line: 1917, col: 2, offsetA: 52282, offsetB: 52332)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| postExprBlocks = (doBlock / \\\':\\\' (extraPostExprBlock / stmt)) extraPostExprBlock*\", line: 1918, col: 2, offsetA: 52335, offsetB: 52418)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "openingParams" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "openingPragmas" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkDo" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "openingParams" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseParamList" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "retColon" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "openingPragmas" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optPragmas" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkColon" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "makeCall" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkOf" + }, + { + "kind": "nkIdent", + "ident": "tkElif" + }, + { + "kind": "nkIdent", + "ident": "tkElse" + }, + { + "kind": "nkIdent", + "ident": "tkExcept" + }, + { + "kind": "nkIdent", + "ident": "tkFinally" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "sameInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "stmtList" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkStmtList" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "stmtList" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# to keep backwards compatibility (see tests/vm/tstringnil)\", line: 1940, col: 6, offsetA: 52960, offsetB: 53019)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "stmtList" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkStmtList" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "stmtList" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "stmtList" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "stmtList" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "incl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nfBlockArg" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "openingParams" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "openingPragmas" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "openingParams" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "openingParams" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkFormalParams" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "openingParams" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# return type\", line: 1949, col: 41, offsetA: 53342, offsetB: 53355)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newProcNode" + }, + { + "kind": "nkIdent", + "ident": "nkDo" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "stmtList" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkIdent", + "ident": "stmtList" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "params" + }, + { + "kind": "nkIdent", + "ident": "openingParams" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "name" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "pattern" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "genericParams" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "pragmas" + }, + { + "kind": "nkIdent", + "ident": "openingPragmas" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "exceptions" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "mid" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "move" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "mid" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "stmtList" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "sameInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextBlock" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextToken" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "nextToken" + }, + { + "kind": "nkIdent", + "ident": "tkDo" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "info" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parLineInfo" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextBlock" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseDoBlock" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextToken" + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkOf" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextBlock" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkOfBranch" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "exprList" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkIdent", + "ident": "nextBlock" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkElif" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextBlock" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkElifBranch" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optInd" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nextBlock" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextBlock" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkExcept" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextBlock" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkExceptBranch" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optionalExprList" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkIdent", + "ident": "nextBlock" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFinally" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextBlock" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkFinally" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkElse" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextBlock" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkElse" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextBlock" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextBlock" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "incl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nfBlockArg" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nextBlock" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextBlock" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkElse" + }, + { + "kind": "nkIdent", + "ident": "nkFinally" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "openingParams" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkStrLit", + "strVal": "expected \':\'" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExprStmt" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| exprStmt = simpleExpr postExprBlocks?\", line: 2017, col: 2, offsetA: 54924, offsetB: 54964)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| / simplePrimary (exprEqExpr ^+ comma) postExprBlocks?\", line: 2018, col: 2, offsetA: 54967, offsetB: 55032)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| / simpleExpr \\\'=\\\' optInd (expr postExprBlocks?)\", line: 2019, col: 2, offsetA: 55035, offsetB: 55093)" + ], + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "simpleExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "pmTrySimple" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkAsgn" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optInd" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "postExprBlocks" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "isFirstParam" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if an expression is starting here, a simplePrimary was parsed and\", line: 2035, col: 4, offsetA: 55367, offsetB: 55434)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# this is the start of a command\", line: 2036, col: 4, offsetA: 55439, offsetB: 55471)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isExprStart" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newTreeI" + }, + { + "kind": "nkIdent", + "ident": "nkCommand" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "baseIndent" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commandParam" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "isFirstParam" + }, + { + "kind": "nkIdent", + "ident": "pmNormal" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "baseIndent" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optInd" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "postExprBlocks" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseModuleName" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseImport" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| importStmt = \\\'import\\\' optInd expr\", line: 2061, col: 2, offsetA: 56072, offsetB: 56108)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| ((comma expr)*\", line: 2062, col: 2, offsetA: 56111, offsetB: 56142)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| / \\\'except\\\' optInd (expr ^+ comma))\", line: 2063, col: 2, offsetA: 56145, offsetB: 56196)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| exportStmt = \\\'export\\\' optInd expr\", line: 2064, col: 2, offsetA: 56199, offsetB: 56235)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| ((comma expr)*\", line: 2065, col: 2, offsetA: 56238, offsetB: 56269)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| / \\\'except\\\' optInd (expr ^+ comma))\", line: 2066, col: 2, offsetA: 56272, offsetB: 56323)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip `import` or `export`\", line: 2069, col: 12, offsetA: 56366, offsetB: 56393)" + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO `mid` for import?\", line: 2071, col: 34, offsetA: 56429, offsetB: 56453)" + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseModuleName" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkComma" + }, + { + "kind": "nkIdent", + "ident": "tkExcept" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkExcept" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "transitionSonsKind" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "succ" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# was: while p.tok.tokType notin {tkEof, tkSad, tkDed}:\", line: 2086, col: 6, offsetA: 56749, offsetB: 56804)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "hasProgress" + } + ] + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseModuleName" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "hasProgress" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#expectNl(p)\", line: 2101, col: 2, offsetA: 57114, offsetB: 57126)" + ], + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseIncludeStmt" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| includeStmt = \\\'include\\\' optInd expr ^+ comma\", line: 2105, col: 2, offsetA: 57191, offsetB: 57238)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkIncludeStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip `import` or `include`\", line: 2108, col: 12, offsetA: 57290, offsetB: 57318)" + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO `mid` for include?\", line: 2110, col: 34, offsetA: 57354, offsetB: 57379)" + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# was: while p.tok.tokType notin {tkEof, tkSad, tkDed}:\", line: 2112, col: 4, offsetA: 57398, offsetB: 57453)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "hasProgress" + } + ] + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "hasProgress" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#expectNl(p)\", line: 2128, col: 2, offsetA: 57734, offsetB: 57746)" + ], + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseFromStmt" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| fromStmt = \\\'from\\\' expr \\\'import\\\' optInd expr (comma expr)*\", line: 2132, col: 2, offsetA: 57808, offsetB: 57868)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkFromStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip `from`\", line: 2135, col: 12, offsetA: 57917, offsetB: 57930)" + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseModuleName" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkImportStmt" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPrefix" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO \\\'mid\\\' for from?\", line: 2143, col: 33, offsetA: 58058, offsetB: 58080)" + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#optInd(p, a);\", line: 2144, col: 16, offsetA: 58097, offsetB: 58111)" + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkImport" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# p.tok.tokType notin {tkEof, tkSad, tkDed}:\", line: 2151, col: 4, offsetA: 58198, offsetB: 58242)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "hasProgress" + } + ] + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "hasProgress" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#expectNl(p)\", line: 2166, col: 2, offsetA: 58518, offsetB: 58530)" + ], + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseReturnOrRaise" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| returnStmt = \\\'return\\\' optInd expr?\", line: 2170, col: 2, offsetA: 58614, offsetB: 58651)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| raiseStmt = \\\'raise\\\' optInd expr?\", line: 2171, col: 2, offsetA: 58654, offsetB: 58689)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| yieldStmt = \\\'yield\\\' optInd expr?\", line: 2172, col: 2, offsetA: 58692, offsetB: 58727)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| discardStmt = \\\'discard\\\' optInd expr?\", line: 2173, col: 2, offsetA: 58730, offsetB: 58769)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| breakStmt = \\\'break\\\' optInd expr?\", line: 2174, col: 2, offsetA: 58772, offsetB: 58807)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| continueStmt = \\\'continue\\\' optInd expr?\", line: 2175, col: 2, offsetA: 58810, offsetB: 58851)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# We don\\\'t split lookahead here because it might be that we end up with no\", line: 2180, col: 2, offsetA: 58897, offsetB: 58971)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# expression - in this case, we don\\\'t want the comments attached to\", line: 2181, col: 2, offsetA: 58974, offsetB: 59041)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the discard midpoint - question is, what to do with them?\", line: 2182, col: 2, offsetA: 59044, offsetB: 59103)" + ], + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isExprStart" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# NL terminates:\", line: 2185, col: 4, offsetA: 59218, offsetB: 59234)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "e" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "e" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "e" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "postExprBlocks" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "e" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "e" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "e" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseIfOrWhen" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| condStmt = expr colcom stmt COMMENT?\", line: 2201, col: 2, offsetA: 59530, offsetB: 59569)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| (IND{=} \\\'elif\\\' expr colcom stmt)*\", line: 2202, col: 2, offsetA: 59572, offsetB: 59619)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| (IND{=} \\\'else\\\' colcom stmt)?\", line: 2203, col: 2, offsetA: 59622, offsetB: 59664)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| ifStmt = \\\'if\\\' condStmt\", line: 2204, col: 2, offsetA: 59667, offsetB: 59692)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| whenStmt = \\\'when\\\' condStmt\", line: 2205, col: 2, offsetA: 59695, offsetB: 59724)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip `if`, `when`, `elif`\", line: 2208, col: 14, offsetA: 59782, offsetB: 59809)" + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkElifBranch" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseColComStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "branch" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkElif" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "sameOrNoInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkElse" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "sameOrNoInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkElse" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkElse" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseColComStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "branch" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseIfOrWhenExpr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| condExpr = expr colcom stmt optInd\", line: 2230, col: 2, offsetA: 60378, offsetB: 60415)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| (\\\'elif\\\' expr colcom stmt optInd)*\", line: 2231, col: 2, offsetA: 60418, offsetB: 60462)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| \\\'else\\\' colcom stmt\", line: 2232, col: 2, offsetA: 60465, offsetB: 60495)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| ifExpr = \\\'if\\\' condExpr\", line: 2233, col: 2, offsetA: 60498, offsetB: 60523)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| whenExpr = \\\'when\\\' condExpr\", line: 2234, col: 2, offsetA: 60526, offsetB: 60555)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip `if`, `when`, `elif`\", line: 2237, col: 14, offsetA: 60613, offsetB: 60640)" + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkElifExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseColComStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "branch" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkElif" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkElse" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkElseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkElse" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseColComStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "branch" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseWhile" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| whileStmt = \\\'while\\\' expr colcom stmt\", line: 2259, col: 2, offsetA: 61146, offsetB: 61185)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkWhileStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseColComStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseCase" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| ofBranch = \\\'of\\\' exprList colcom stmt\", line: 2270, col: 2, offsetA: 61415, offsetB: 61454)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| ofBranches = ofBranch (IND{=} ofBranch)*\", line: 2271, col: 2, offsetA: 61457, offsetB: 61500)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| (IND{=} \\\'elif\\\' expr colcom stmt)*\", line: 2272, col: 2, offsetA: 61503, offsetB: 61561)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| (IND{=} \\\'else\\\' colcom stmt)?\", line: 2273, col: 2, offsetA: 61564, offsetB: 61617)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| caseStmt = \\\'case\\\' expr \\\':\\\'? COMMENT?\", line: 2274, col: 2, offsetA: 61620, offsetB: 61659)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| (IND{>} ofBranches DED\", line: 2275, col: 2, offsetA: 61662, offsetB: 61699)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | IND{=} ofBranches)\", line: 2276, col: 2, offsetA: 61702, offsetB: 61737)" + ], + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "inElif" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "wasIndented" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkCaseStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkColon" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "oldInd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "realInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "wasIndented" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "sameInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkOf" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "inElif" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkOfBranch" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "exprList" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkElif" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "inElif" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkElifBranch" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkElse" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkElse" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseColComStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkElse" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "wasIndented" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + }, + { + "kind": "nkIdent", + "ident": "oldInd" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTry" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "isExpr" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| tryStmt = \\\'try\\\' colcom stmt &(IND{=}? \\\'except\\\'|\\\'finally\\\')\", line: 2338, col: 2, offsetA: 62784, offsetB: 62844)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| (IND{=}? \\\'except\\\' optionalExprList colcom stmt)*\", line: 2339, col: 2, offsetA: 62847, offsetB: 62909)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| (IND{=}? \\\'finally\\\' colcom stmt)?\", line: 2340, col: 2, offsetA: 62912, offsetB: 62958)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| tryExpr = \\\'try\\\' colcom stmt &(optInd \\\'except\\\'|\\\'finally\\\')\", line: 2341, col: 2, offsetA: 62961, offsetB: 63020)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| (optInd \\\'except\\\' optionalExprList colcom stmt)*\", line: 2342, col: 2, offsetA: 63023, offsetB: 63084)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| (optInd \\\'finally\\\' colcom stmt)?\", line: 2343, col: 2, offsetA: 63087, offsetB: 63132)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkTryStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "parentIndent" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# isExpr\", line: 2346, col: 31, offsetA: 63199, offsetB: 63207)" + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseColComStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "sameOrNoInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "isExpr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkIdent", + "ident": "parentIndent" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkExcept" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkExceptBranch" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optionalExprList" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFinally" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkFinally" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseColComStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkStrLit", + "strVal": "expected \'except\'" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExceptBlock" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseColComStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseBlock" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| blockStmt = \\\'block\\\' symbol? colcom stmt\", line: 2380, col: 2, offsetA: 63908, offsetB: 63950)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| blockExpr = \\\'block\\\' symbol? colcom stmt\", line: 2381, col: 2, offsetA: 63953, offsetB: 63995)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkBlockStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTokNoInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkColon" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseSymbol" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseColComStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseStaticOrDefer" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "k" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| staticStmt = \\\'static\\\' colcom stmt\", line: 2394, col: 2, offsetA: 64277, offsetB: 64313)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| deferStmt = \\\'defer\\\' colcom stmt\", line: 2395, col: 2, offsetA: 64316, offsetB: 64350)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "k" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseColComStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseAsm" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| asmStmt = \\\'asm\\\' pragma? (STR_LIT | RSTR_LIT | TRIPLESTR_LIT)\", line: 2403, col: 2, offsetA: 64494, offsetB: 64557)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkAsmStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTokNoInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkCurlyDotLe" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parsePragma" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkStrLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStrNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkStrLit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkRStrLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStrNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkRStrLit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkTripleStrLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newStrNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkStrLit", + "strVal": "the \'asm\' statement takes a string literal" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + }, + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseGenericParam" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| genericParam = symbol (comma symbol)* (colon expr)? (\\\'=\\\' optInd expr)?\", line: 2428, col: 2, offsetA: 65151, offsetB: 65224)" + ], + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkIdentDefs" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 2432, col: 2, offsetA: 65279, offsetB: 65300)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkIn" + }, + { + "kind": "nkIdent", + "ident": "tkOut" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "cache" + } + ] + }, + { + "kind": "nkIdent", + "ident": "getIdent" + } + ] + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkIn" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "in" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "out" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkPrefix" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newIdentNodeP" + }, + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "expectIdent" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseSymbol" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkIdent", + "ident": "tkAccent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseSymbol" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkColon" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO mid?\", line: 2467, col: 41, offsetA: 65964, offsetB: 65975)" + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO mid?\", line: 2474, col: 41, offsetA: 66143, offsetB: 66154)" + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseGenericParamList" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| genericParamList = \\\'[\\\' optInd\", line: 2483, col: 2, offsetA: 66305, offsetB: 66337)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| genericParam ^* (comma/semicolon) optPar \\\']\\\'\", line: 2484, col: 2, offsetA: 66340, offsetB: 66389)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkGenericParams" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkWhileStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 2492, col: 2, offsetA: 66494, offsetB: 66515)" + ], + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkIdent", + "ident": "tkAccent" + }, + { + "kind": "nkIdent", + "ident": "tkIn" + }, + { + "kind": "nkIdent", + "ident": "tkOut" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseGenericParam" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkComma" + }, + { + "kind": "nkIdent", + "ident": "tkSemiColon" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optPar" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkBracketRi" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parsePattern" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| pattern = \\\'{\\\' stmt \\\'}\\\'\", line: 2508, col: 2, offsetA: 66837, offsetB: 66862)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkCurlyLe" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkCurlyRi" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseRoutine" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| indAndComment = (IND{>} COMMENT)? | COMMENT?\", line: 2517, col: 2, offsetA: 67006, offsetB: 67053)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| routine = optInd identVis pattern? genericParamList?\", line: 2518, col: 2, offsetA: 67056, offsetB: 67111)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| paramListColon pragma? (\\\'=\\\' COMMENT? stmt)? indAndComment\", line: 2519, col: 2, offsetA: 67114, offsetB: 67176)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkProcDef" + }, + { + "kind": "nkIdent", + "ident": "nkLambda" + }, + { + "kind": "nkIdent", + "ident": "nkIteratorDef" + }, + { + "kind": "nkIdent", + "ident": "nkFuncDef" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "tokKeywordLow" + }, + { + "kind": "nkIdent", + "ident": "tokKeywordHigh" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkAccent" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# no name; lambda or proc type\", line: 2527, col: 4, offsetA: 67414, offsetB: 67444)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# in every context that we can parse a routine, we can also parse these\", line: 2528, col: 4, offsetA: 67449, offsetB: 67520)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseProcExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "nkProcDef" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkLambda" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "identVis" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkCurlyLe" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "validInd" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "parsePattern" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkBracketLe" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "validInd" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "parseGenericParamList" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "parseParamList" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkCurlyDotLe" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "validInd" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "parsePragma" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# empty exception tracking:\", line: 2557, col: 2, offsetA: 68098, offsetB: 68125)" + ], + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "maybeMissEquals" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkIdent", + "ident": "maybeMissEquals" + } + ] + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "validInd" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# debugEcho 333, p.tok.tokType\", line: 2564, col: 4, offsetA: 68301, offsetB: 68331)" + ], + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO commentlookahead\", line: 2569, col: 2, offsetA: 68400, offsetB: 68423)" + ], + "ident": "indAndComment" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "maybeMissEquals" + }, + { + "kind": "nkIdent", + "ident": "maybeMissEquals" + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkStmtList" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "comment" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkCommentStmt" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "comment" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc fn*(a: int): int = a ## foo\", line: 2575, col: 6, offsetA: 68658, offsetB: 68692)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# => moves comment `foo` to `fn`\", line: 2576, col: 6, offsetA: 68699, offsetB: 68731)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "comment" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "comment" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "comment" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#else:\", line: 2579, col: 6, offsetA: 68804, offsetB: 68810)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# assert false, p.lex.config$body.info # avoids hard to track bugs, fail early.\", line: 2580, col: 6, offsetA: 68817, offsetB: 68897)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Yeah, that worked so well. There IS a bug in this logic, now what?\", line: 2581, col: 6, offsetA: 68904, offsetB: 68972)" + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseCommentStmt" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| commentStmt = COMMENT\", line: 2586, col: 2, offsetA: 69038, offsetB: 69062)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkCommentStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "comment" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseSection" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "defparser" + }, + { + "kind": "nkProcTy", + "sons": [ + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimcall" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| section(RULE) = COMMENT? RULE / (IND{>} (RULE / COMMENT)^+IND{=} DED)\", line: 2595, col: 2, offsetA: 69266, offsetB: 69338)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "nkTypeSection" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "realInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "withInd" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "sameInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComment" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkIdent", + "ident": "tkAccent" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defparser" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkComment" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseCommentStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "errIdentifierExpected" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "errIdentifierExpected" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkIdent", + "ident": "tkAccent" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# tkParLe is allowed for ``var (x, y) = ...`` tuple parsing\", line: 2621, col: 4, offsetA: 70051, offsetB: 70110)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defparser" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "errIdentifierExpected" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseEnum" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| enumDecl = \\\'enum\\\' optInd (symbol pragma? optInd (\\\'=\\\' optInd expr COMMENT?)? comma?)+\", line: 2629, col: 2, offsetA: 70254, offsetB: 70341)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkEnumTy" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkWhileStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 2635, col: 2, offsetA: 70451, offsetB: 70472)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseSymbol" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "comments" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "symPragma" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pragma" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkCurlyDotLe" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "pragma" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optPragmas" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "symPragma" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkPragmaExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "symPragma" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "symPragma" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pragma" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "symInd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "comments" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitComments" + }, + { + "kind": "nkIdent", + "ident": "comments" + }, + { + "kind": "nkIdent", + "ident": "symPragma" + }, + { + "kind": "nkIdent", + "ident": "symInd" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "symPragma" + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "comments" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "symPragma" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "symPragma" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkEnumFieldDef" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "symPragma" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "symPragma" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "comments" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "comments" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitComments" + }, + { + "kind": "nkIdent", + "ident": "comments" + }, + { + "kind": "nkIdent", + "ident": "symPragma" + }, + { + "kind": "nkIdent", + "ident": "symInd" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "symPragma" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkEof" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "errIdentifierExpected" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseObjectPart" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseObjectWhen" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| objectWhen = \\\'when\\\' expr colcom objectPart COMMENT?\", line: 2693, col: 2, offsetA: 71867, offsetB: 71921)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| (\\\'elif\\\' expr colcom objectPart COMMENT?)*\", line: 2694, col: 2, offsetA: 71924, offsetB: 71980)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| (\\\'else\\\' colcom objectPart COMMENT?)?\", line: 2695, col: 2, offsetA: 71983, offsetB: 72034)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkRecWhen" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 2697, col: 2, offsetA: 72071, offsetB: 72092)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "sameInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip `when`, `elif`\", line: 2699, col: 14, offsetA: 72127, offsetB: 72148)" + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkElifBranch" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseObjectPart" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "branch" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkElif" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkElse" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "sameInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkElse" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkElse" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "branch" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseObjectPart" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "branch" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseObjectCase" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| objectBranch = \\\'of\\\' exprList colcom objectPart\", line: 2728, col: 2, offsetA: 72768, offsetB: 72817)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| objectBranches = objectBranch (IND{=} objectBranch)*\", line: 2729, col: 2, offsetA: 72820, offsetB: 72875)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| (IND{=} \\\'elif\\\' expr colcom objectPart)*\", line: 2730, col: 2, offsetA: 72878, offsetB: 72942)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| (IND{=} \\\'else\\\' colcom objectPart)?\", line: 2731, col: 2, offsetA: 72945, offsetB: 73004)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| objectCase = \\\'case\\\' declColonEquals \\\':\\\'? COMMENT?\", line: 2732, col: 2, offsetA: 73007, offsetB: 73059)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| (IND{>} objectBranches DED\", line: 2733, col: 2, offsetA: 73062, offsetB: 73103)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | IND{=} objectBranches)\", line: 2734, col: 2, offsetA: 73106, offsetB: 73145)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkRecCase" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTokNoInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseIdentColonEquals" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "withPragma" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkColon" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "wasIndented" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "oldInd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "realInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "wasIndented" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 2753, col: 2, offsetA: 73506, offsetB: 73527)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "sameInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkOf" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkOfBranch" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "exprList" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkElse" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkElse" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fields" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseObjectPart" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fields" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "errIdentifierExpected" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "fields" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkNilLit" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# don\\\'t break further semantic checking\", line: 2775, col: 37, offsetA: 73959, offsetB: 73998)" + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fields" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkElse" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "wasIndented" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + }, + { + "kind": "nkIdent", + "ident": "oldInd" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseObjectPart" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| objectPart = IND{>} objectPart^+IND{=} DED\", line: 2787, col: 2, offsetA: 74178, offsetB: 74223)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| / objectWhen / objectCase / \\\'nil\\\' / \\\'discard\\\' / declColonEquals\", line: 2788, col: 2, offsetA: 74226, offsetB: 74303)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "realInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkRecList" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "withInd" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "sameInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCase" + }, + { + "kind": "nkIdent", + "ident": "tkWhen" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkIdent", + "ident": "tkAccent" + }, + { + "kind": "nkIdent", + "ident": "tkNil" + }, + { + "kind": "nkIdent", + "ident": "tkDiscard" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseObjectPart" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "errIdentifierExpected" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "sameOrNoInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkWhen" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseObjectWhen" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCase" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseObjectCase" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkIdent", + "ident": "tkAccent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseIdentColonEquals" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "withPragma" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkNil" + }, + { + "kind": "nkIdent", + "ident": "tkDiscard" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkNilLit" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseObject" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| objectDecl = \\\'object\\\' (\\\'of\\\' typeDesc)? COMMENT? objectPart\", line: 2822, col: 2, offsetA: 75093, offsetB: 75154)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkObjectTy" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# compatibility with old pragma node\", line: 2826, col: 26, offsetA: 75229, offsetB: 75265)" + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkOf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkOfInherit" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDesc" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an initial IND{>} HAS to follow:\", line: 2837, col: 2, offsetA: 75487, offsetB: 75521)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "realInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Any comments just after `object` are assumed to be part of the object,\", line: 2841, col: 4, offsetA: 75583, offsetB: 75655)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# not the fields that follow\", line: 2842, col: 4, offsetA: 75660, offsetB: 75688)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitComments" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseObjectPart" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeClassParam" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "modifier" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkOut" + }, + { + "kind": "nkIdent", + "ident": "tkVar" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkVarTy" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkPtr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkPtrTy" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkRef" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkRefTy" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkStatic" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkStaticTy" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkType" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkTypeOfExpr" + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "modifier" + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "modifier" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "parseSymbol" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "parseSymbol" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeClass" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| conceptParam = (\\\'var\\\' | \\\'out\\\')? symbol\", line: 2875, col: 2, offsetA: 76292, offsetB: 76333)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| conceptDecl = \\\'concept\\\' conceptParam ^* \\\',\\\' (pragma)? (\\\'of\\\' typeDesc ^* \\\',\\\')?\", line: 2876, col: 2, offsetA: 76336, offsetB: 76416)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| &IND{>} stmt\", line: 2877, col: 2, offsetA: 76419, offsetB: 76448)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkTypeClassTy" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComment" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipComment" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "args" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkArgList" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "args" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "args" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "parseTypeClassParam" + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "args" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "parseTypeClassParam" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# see ast.isNewStyleConcept\", line: 2892, col: 28, offsetA: 76805, offsetB: 76832)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkCurlyDotLe" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "validInd" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parsePragma" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkOf" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkOfInherit" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkWhileStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 2901, col: 4, offsetA: 77056, offsetB: 77077)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDesc" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComment" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipComment" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# an initial IND{>} HAS to follow:\", line: 2914, col: 2, offsetA: 77307, offsetB: 77341)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "realInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "isNewStyleConcept" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkStrLit", + "strVal": "routine expected, but found \'$1\' (empty new-styled concepts are not allowed)" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDef" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#|\", line: 2930, col: 2, offsetA: 77662, offsetB: 77664)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| typeDef = identVisDot genericParamList? pragma \\\'=\\\' optInd typeDefValue\", line: 2931, col: 2, offsetA: 77667, offsetB: 77740)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| indAndComment?\", line: 2932, col: 2, offsetA: 77743, offsetB: 77772)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkTypeDef" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "identifier" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "identVis" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "allowDot" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "identPragma" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "identifier" + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pragma" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "genericParam" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "next" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "identifier" + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "comments" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkBracketLe" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "validInd" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitComments" + }, + { + "kind": "nkIdent", + "ident": "comments" + }, + { + "kind": "nkIdent", + "ident": "identifier" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "genericParam" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseGenericParamList" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "comments" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "next" + }, + { + "kind": "nkIdent", + "ident": "genericParam" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "genericParam" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# pragma = optPragmas(p)\", line: 2948, col: 2, offsetA: 78265, offsetB: 78289)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkCurlyDotLe" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "realInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitComments" + }, + { + "kind": "nkIdent", + "ident": "comments" + }, + { + "kind": "nkIdent", + "ident": "next" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "pragma" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parsePragma" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "comments" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "next" + }, + { + "kind": "nkIdent", + "ident": "pragma" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "pragma" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "pragma" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "identPragma" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkPragmaExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "identPragma" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "identifier" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "identPragma" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "pragma" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "identPragma" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "genericParam" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parLineInfo" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "comments" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkIdent", + "ident": "comments" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDefValue" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "comments" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitComments" + }, + { + "kind": "nkIdent", + "ident": "comments" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseVarTuple" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| varTupleLhs = \\\'(\\\' optInd (identWithPragma / varTupleLhs) ^+ comma optPar \\\')\\\'\", line: 2985, col: 2, offsetA: 79142, offsetB: 79221)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| varTuple = varTupleLhs \\\'=\\\' optInd expr\", line: 2986, col: 2, offsetA: 79224, offsetB: 79265)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkVarTuple" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# skip \\\'(\\\'\", line: 2989, col: 12, offsetA: 79314, offsetB: 79324)" + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 2992, col: 2, offsetA: 79362, offsetB: 79383)" + ], + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkIdent", + "ident": "tkAccent" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseVarTuple" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "identWithPragma" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "allowDot" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# no type desc\", line: 3009, col: 26, offsetA: 79741, offsetB: 79755)" + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optPar" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseVariable" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| colonBody = colcom stmt postExprBlocks?\", line: 3015, col: 2, offsetA: 79847, offsetB: 79889)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| variable = (varTuple / identColonEquals) colonBody? indAndComment\", line: 3016, col: 2, offsetA: 79892, offsetB: 79960)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseVarTuple" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseIdentColonEquals" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "withPragma" + }, + { + "kind": "nkIdent", + "ident": "withDot" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "postExprBlocks" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseConstant" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| constant = (varTuple / identWithPragma) (colon typeDesc)? \\\'=\\\' optInd expr indAndComment\", line: 3034, col: 2, offsetA: 80390, offsetB: 80480)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseVarTuple" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkConstDef" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "identWithPragma" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkColon" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTypeDesc" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clMid" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#add(result, parseStmtListExpr(p))\", line: 3052, col: 2, offsetA: 80873, offsetB: 80907)" + ], + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "postExprBlocks" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseBind" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "k" + }, + { + "kind": "nkIdent", + "ident": "TNodeKind" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| bindStmt = \\\'bind\\\' optInd qualifiedIdent ^+ comma\", line: 3060, col: 2, offsetA: 81053, offsetB: 81104)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| mixinStmt = \\\'mixin\\\' optInd qualifiedIdent ^+ comma\", line: 3061, col: 2, offsetA: 81107, offsetB: 81160)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "k" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optInd" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + }, + { + "kind": "nkWhileStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# progress guaranteed\", line: 3066, col: 2, offsetA: 81222, offsetB: 81243)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "qualifiedIdent" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipInd" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#expectNl(p)\", line: 3078, col: 2, offsetA: 81421, offsetB: 81433)" + ], + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseStmtPragma" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| pragmaStmt = pragma (\\\':\\\' COMMENT? stmt)?\", line: 3082, col: 2, offsetA: 81497, offsetB: 81540)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parsePragma" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkColon" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeI" + }, + { + "kind": "nkIdent", + "ident": "nkPragmaBlock" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO mid\", line: 3092, col: 41, offsetA: 81758, offsetB: 81768)" + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "simpleStmt" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| simpleStmt = ((returnStmt | raiseStmt | yieldStmt | discardStmt | breakStmt\", line: 3101, col: 2, offsetA: 81899, offsetB: 81977)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | continueStmt | pragmaStmt | importStmt | exportStmt | fromStmt\", line: 3102, col: 2, offsetA: 81980, offsetB: 82058)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | includeStmt | commentStmt) / exprStmt) COMMENT?\", line: 3103, col: 2, offsetA: 82061, offsetB: 82124)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#|\", line: 3104, col: 2, offsetA: 82127, offsetB: 82129)" + ], + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkReturn" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseReturnOrRaise" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkReturnStmt" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkRaise" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseReturnOrRaise" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkRaiseStmt" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkYield" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseReturnOrRaise" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkYieldStmt" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkDiscard" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseReturnOrRaise" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkDiscardStmt" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkBreak" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseReturnOrRaise" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkBreakStmt" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkContinue" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseReturnOrRaise" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkContinueStmt" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCurlyDotLe" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseStmtPragma" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkImport" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseImport" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkImportStmt" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkExport" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseImport" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkExportStmt" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFrom" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseFromStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInclude" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseIncludeStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkComment" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseCommentStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isExprStart" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExprStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "complexOrSimpleStmt" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| complexOrSimpleStmt = (ifStmt | whenStmt | whileStmt\", line: 3137, col: 2, offsetA: 82993, offsetB: 83048)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | tryStmt | forStmt\", line: 3138, col: 2, offsetA: 83051, offsetB: 83093)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | blockStmt | staticStmt | deferStmt | asmStmt\", line: 3139, col: 2, offsetA: 83096, offsetB: 83165)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | \\\'proc\\\' routine\", line: 3140, col: 2, offsetA: 83168, offsetB: 83207)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | \\\'method\\\' routine\", line: 3141, col: 2, offsetA: 83210, offsetB: 83251)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | \\\'func\\\' routine\", line: 3142, col: 2, offsetA: 83254, offsetB: 83293)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | \\\'iterator\\\' routine\", line: 3143, col: 2, offsetA: 83296, offsetB: 83339)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | \\\'macro\\\' routine\", line: 3144, col: 2, offsetA: 83342, offsetB: 83382)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | \\\'template\\\' routine\", line: 3145, col: 2, offsetA: 83385, offsetB: 83428)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | \\\'converter\\\' routine\", line: 3146, col: 2, offsetA: 83431, offsetB: 83475)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | \\\'type\\\' section(typeDef)\", line: 3147, col: 2, offsetA: 83478, offsetB: 83526)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | \\\'const\\\' section(constant)\", line: 3148, col: 2, offsetA: 83529, offsetB: 83579)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | (\\\'let\\\' | \\\'var\\\' | \\\'using\\\') section(variable)\", line: 3149, col: 2, offsetA: 83582, offsetB: 83650)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| | bindStmt | mixinStmt)\", line: 3150, col: 2, offsetA: 83653, offsetB: 83699)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| / simpleStmt\", line: 3151, col: 2, offsetA: 83702, offsetB: 83737)" + ], + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkIf" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseIfOrWhen" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkIfStmt" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkWhile" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseWhile" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCase" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseCase" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkTry" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseTry" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "isExpr" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFinally" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExceptBlock" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkFinally" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkExcept" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseExceptBlock" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkExceptBranch" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFor" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseFor" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkBlock" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseBlock" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkStatic" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseStaticOrDefer" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkStaticStmt" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkDefer" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseStaticOrDefer" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkDefer" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkAsm" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseAsm" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkProc" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseRoutine" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkProcDef" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkFunc" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseRoutine" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkFuncDef" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkMethod" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseRoutine" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkMethodDef" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkIterator" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseRoutine" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkIteratorDef" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkMacro" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseRoutine" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkMacroDef" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkTemplate" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseRoutine" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkTemplateDef" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkConverter" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseRoutine" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkConverterDef" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkType" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkTypeOfExpr" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "primary" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "pmTypeDesc" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "eat" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseOperators" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": -1 + }, + { + "kind": "nkIdent", + "ident": "pmNormal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseSection" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkTypeSection" + }, + { + "kind": "nkIdent", + "ident": "parseTypeDef" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkConst" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "prettySection" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseSection" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkConstSection" + }, + { + "kind": "nkIdent", + "ident": "parseConstant" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkLet" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "prettySection" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseSection" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkLetSection" + }, + { + "kind": "nkIdent", + "ident": "parseVariable" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkVar" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "prettySection" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseSection" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkVarSection" + }, + { + "kind": "nkIdent", + "ident": "parseVariable" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkWhen" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseIfOrWhen" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkWhenStmt" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkBind" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseBind" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkBindStmt" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkMixin" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseBind" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkMixinStmt" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkUsing" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseSection" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "nkUsingStmt" + }, + { + "kind": "nkIdent", + "ident": "parseVariable" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "simpleStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseStmt" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| stmt = (IND{>} complexOrSimpleStmt^+(IND{=} / \\\';\\\') DED)\", line: 3223, col: 2, offsetA: 85599, offsetB: 85657)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#| / simpleStmt ^+ \\\';\\\'\", line: 3224, col: 2, offsetA: 85660, offsetB: 85687)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# nimpretty support here\", line: 3226, col: 4, offsetA: 85723, offsetB: 85747)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkStmtList" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "withInd" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "clPrefix" + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComment" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkSemiColon" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 10, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO this hack causes reindentation of the comment to the \\\"current\\\"\", line: 3241, col: 10, offsetA: 86178, offsetB: 86247)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 10, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# level when the comment is indented more than the last statement\", line: 3242, col: 10, offsetA: 86258, offsetB: 86323)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkDot" + }, + { + "kind": "nkIdent", + "ident": "tkComment" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "debugEcho" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "printTok" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkIdent", + "ident": "errInvalidIndentation" + }, + { + "kind": "nkStrLit", + "strVal": "parseStmt" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCurlyRi" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + }, + { + "kind": "nkIdent", + "ident": "tkCurlyDotRi" + }, + { + "kind": "nkIdent", + "ident": "tkBracketRi" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 10, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# XXX this ensures tnamedparamanonproc still compiles;\", line: 3251, col: 10, offsetA: 86648, offsetB: 86702)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 10, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# deprecate this syntax later\", line: 3252, col: 10, offsetA: 86713, offsetB: 86742)" + ], + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "hasProgress" + } + ] + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkElse" + }, + { + "kind": "nkIdent", + "ident": "tkElif" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 8, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Allow this too, see tests/parser/tifexprs\", line: 3258, col: 8, offsetA: 86860, offsetB: 86903)" + ], + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "complexOrSimpleStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "hasProgress" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "debugEcho" + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "errExprExpected" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "comments" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "commentLookahead" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "splitComments" + }, + { + "kind": "nkIdent", + "ident": "comments" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "currInd" + } + ] + }, + { + "kind": "nkIdent", + "ident": "clPostfix" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "hasProgress" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkEof" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the case statement is only needed for better error messages:\", line: 3276, col: 4, offsetA: 87322, offsetB: 87384)" + ], + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkIf" + }, + { + "kind": "nkIdent", + "ident": "tkWhile" + }, + { + "kind": "nkIdent", + "ident": "tkCase" + }, + { + "kind": "nkIdent", + "ident": "tkTry" + }, + { + "kind": "nkIdent", + "ident": "tkFor" + }, + { + "kind": "nkIdent", + "ident": "tkBlock" + }, + { + "kind": "nkIdent", + "ident": "tkAsm" + }, + { + "kind": "nkIdent", + "ident": "tkProc" + }, + { + "kind": "nkIdent", + "ident": "tkFunc" + }, + { + "kind": "nkIdent", + "ident": "tkIterator" + }, + { + "kind": "nkIdent", + "ident": "tkMacro" + }, + { + "kind": "nkIdent", + "ident": "tkType" + }, + { + "kind": "nkIdent", + "ident": "tkConst" + }, + { + "kind": "nkIdent", + "ident": "tkWhen" + }, + { + "kind": "nkIdent", + "ident": "tkVar" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkStrLit", + "strVal": "nestable statement requires indentation" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "emptyNode" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "inSemiStmtList" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "simpleStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "debugEcho" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "errExprExpected" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkStmtList" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 10, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if p.tok.indent >= 0:\", line: 3293, col: 10, offsetA: 87895, offsetB: 87918)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 10, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# parMessage(p, errInvalidIndentation % \\\"parseStmt 2\\\")\", line: 3294, col: 10, offsetA: 87929, offsetB: 87984)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "hasProgress" + } + ] + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "simpleStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "err" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "hasProgress" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "debugEcho" + }, + { + "kind": "nkIntLit", + "intVal": 5 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "errExprExpected" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkSemiColon" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "err" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkEof" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "parseAll" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Parses the rest of the input stream held by the parser into a PNode.\", line: 3315, col: 2, offsetA: 88422, offsetB: 88493)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeP" + }, + { + "kind": "nkIdent", + "ident": "nkStmtList" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkEof" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "hasProgress" + } + ] + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "complexOrSimpleStmt" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "hasProgress" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "debugEcho" + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "errExprExpected" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# bugfix: consume a token here to prevent an endless loop:\", line: 3327, col: 6, offsetA: 88766, offsetB: 88824)" + ], + "ident": "getTok" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComment" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "debugEcho" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": " " + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkIdent", + "ident": "errInvalidIndentation" + }, + { + "kind": "nkStrLit", + "strVal": "parseAll" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "skipped" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newNodeI" + }, + { + "kind": "nkIdent", + "ident": "nkCommentStmt" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getLineInfo" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "comment" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "literal" + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "checkFirstLineIndentation" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "Parser" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "tsLeading" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + }, + { + "kind": "nkIdent", + "ident": "spacing" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "parMessage" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "%" + }, + { + "kind": "nkIdent", + "ident": "errInvalidIndentation" + }, + { + "kind": "nkStrLit", + "strVal": "checkFirstLineIndentation" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "parseString" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "cache" + }, + { + "kind": "nkIdent", + "ident": "IdentCache" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "config" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "filename" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "line" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "errorHandler" + }, + { + "kind": "nkIdent", + "ident": "ErrorHandler" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "printTokens" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Parses a string into an AST, returning the top node.\", line: 3355, col: 2, offsetA: 89524, offsetB: 89579)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## `filename` and `line`, although optional, provide info so that the\", line: 3356, col: 2, offsetA: 89582, offsetB: 89651)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## compiler can generate correct error messages referring to the original\", line: 3357, col: 2, offsetA: 89654, offsetB: 89727)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## source.\", line: 3358, col: 2, offsetA: 89730, offsetB: 89740)" + ], + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "stream" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "llStreamOpen" + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "stream" + }, + { + "kind": "nkIdent", + "ident": "lineOffset" + } + ] + }, + { + "kind": "nkIdent", + "ident": "line" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "Parser" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "lex" + } + ] + }, + { + "kind": "nkIdent", + "ident": "errorHandler" + } + ] + }, + { + "kind": "nkIdent", + "ident": "errorHandler" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "openParser" + }, + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkIdent", + "ident": "filename" + } + ] + }, + { + "kind": "nkIdent", + "ident": "stream" + }, + { + "kind": "nkIdent", + "ident": "cache" + }, + { + "kind": "nkIdent", + "ident": "config" + }, + { + "kind": "nkIdent", + "ident": "printTokens" + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fid" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "config" + }, + { + "kind": "nkIdent", + "ident": "fileInfoIdx" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "AbsoluteFile" + }, + { + "kind": "nkIdent", + "ident": "filename" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "config" + }, + { + "kind": "nkIdent", + "ident": "m" + } + ] + }, + { + "kind": "nkIdent", + "ident": "fileInfos" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fid" + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "fullContent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "parseAll" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "closeParser" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setEndInfo" + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/phrenderer.nim b/src/phrenderer.nim new file mode 100644 index 0000000..73bf449 --- /dev/null +++ b/src/phrenderer.nim @@ -0,0 +1,2542 @@ +# +# +# nimph +# (c) Copyright 2023 Jacek Sieka +# The Nim compiler +# (c) Copyright 2018 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# +# This module implements the renderer of the standard Nim representation. +# nimph version: +# * generate code that actually can be parsed by the parser +# * more lookahead formatting +# * drive comment layout from here instead of lexer +# 'import renderer' is so useful for debugging +# that Nim shouldn't produce a warning for that: + +{.used.} + +import idents, strutils, sequtils +import phlexer, phoptions, phast, phmsgs, phlineinfos +when defined(nimPreviewSlimSystem): + import + std/[syncio, assertions, formatfloat] + +type + TRenderFlag* = enum + renderNone + renderNoBody + renderNoComments + renderDocComments + renderNoPragmas + renderIds + renderNoProcDefs + renderSyms + renderRunnableExamples + renderIr + renderNonExportedFields + renderExpandUsing + + TRenderFlags* = set[TRenderFlag] + TRenderTok* = object + kind*: TokType + length*: int16 + sym*: PSym + + Section = enum + GenericParams + ObjectDef + + TRenderTokSeq* = seq[TRenderTok] + TSrcGen* = object + indent*: int + lineLen*: int + col: int + pos*: int # current position for iteration over the buffer + idx*: int # current token index for iteration over the buffer + tokens*: TRenderTokSeq + buf*: string + pendingNL*: int + # negative if not active; else contains the + # indentation value + pendingWhitespace: int + comStack*: seq[PNode] # comment stack + flags*: TRenderFlags + inside: set[Section] # Keeps track of contexts we are in + checkAnon: bool # we're in a context that can contain sfAnon + inPragma: int + inImportLike: int + pendingNewlineCount: int + fid*: FileIndex + config*: ConfigRef + mangler: seq[PSym] + +const + nkControlFlow = + {nkIfStmt, nkWhenStmt, nkForStmt, nkParForStmt, nkWhileStmt, nkCaseStmt, nkTryStmt} + +proc renderTree*( + n: PNode; renderFlags: TRenderFlags = {}; conf: ConfigRef = nil +): string + +proc isSimple(n: PNode): bool = + ## Simple nodes are those that are either identifiers or simple lists thereof + case n.kind + of nkIdent: + true + of nkStmtList, nkImportStmt, nkExportStmt: + n.allIt(isSimple(it)) + else: + false + +proc gsubAddsPar(n: PNode): bool = + # There's an ambiguity in the grammar where nkPar sometimes is turned into + # nkStmtListExpr - this helper is a stopgap solution to work around + # the parsing quirk but needs more thought put into it + n.kind == nkStmtListExpr and n.len == 1 and n[0].kind in { + nkDiscardStmt, nkIfStmt, nkBlockStmt + } + +# We render the source code in a two phases: The first +# determines how long the subtree will likely be, the second +# phase appends to a buffer that will be the output. +proc disamb(g: var TSrcGen; s: PSym): int = + # we group by 's.name.s' to compute the stable name ID. + result = 0 + for i in 0 ..< g.mangler.len: + if s == g.mangler[i]: + return result + if s.name.s == g.mangler[i].name.s: + inc result + + g.mangler.add s + +proc isKeyword*(i: PIdent): bool = + if (i.id >= ord(tokKeywordLow) - ord(tkSymbol)) and ( + i.id <= ord(tokKeywordHigh) - ord(tkSymbol) + ): + result = true + +proc isExported(n: PNode): bool = + ## Checks if an ident is exported. + ## This is meant to be used with idents in nkIdentDefs. + case n.kind + of nkPostfix: + n[0].ident.s == "*" and n[1].kind == nkIdent + of nkPragmaExpr: + n[0].isExported() + else: + false + +proc renderDefinitionName*(s: PSym; noQuotes = false): string = + ## Returns the definition name of the symbol. + ## + ## If noQuotes is false the symbol may be returned in backticks. This will + ## happen if the name happens to be a keyword or the first character is not + ## part of the SymStartChars set. + let x = s.name.s + if noQuotes or (x[0] in SymStartChars and not phrenderer.isKeyword(s.name)): + result = x + else: + result = '`' & x & '`' + +template inside(g: var TSrcGen; section: Section; body: untyped) = + ## Runs `body` with `section` included in `g.inside`. + ## Removes it at the end of the body if `g` wasn't inside it + ## before the template. + let wasntInSection = section notin g.inside + + g.inside.incl section + + body + if wasntInSection: + g.inside.excl section + +template outside(g: var TSrcGen; section: Section; body: untyped) = + ## Temporarily removes `section` from `g.inside`. Adds it back + ## at the end of the body if `g` was inside it before the template + let wasInSection = section in g.inside + + g.inside.excl section + + body + if wasInSection: + g.inside.incl section + +const + IndentWidth = 2 + longIndentWid = IndentWidth * 2 + MaxLineLen = 88 + LineCommentColumn = 30 + +proc initSrcGen(g: var TSrcGen; renderFlags: TRenderFlags; config: ConfigRef) = + g.comStack = @[] + g.tokens = @[] + g.indent = 0 + g.lineLen = 0 + g.pos = 0 + g.idx = 0 + g.buf = "" + g.flags = renderFlags + g.pendingNL = -1 + g.pendingWhitespace = -1 + g.inside = {} + g.config = config + +proc addTok(g: var TSrcGen; kind: TokType; s: string; sym: PSym = nil) = + # debugEcho "addTok ", kind, " " , s.len, " ", s + g.tokens.add TRenderTok(kind: kind, length: int16(s.len), sym: sym) + + g.buf.add(s) + if kind != tkSpaces: + inc g.col, s.len + +proc addPendingNL(g: var TSrcGen) = + if g.pendingNL >= 0: + let newlines = repeat("\n", 1 + g.pendingNewlineCount) + + g.pendingNewlineCount = 0 + + addTok(g, tkSpaces, newlines & spaces(g.pendingNL)) + + g.lineLen = g.pendingNL + g.col = g.pendingNL + g.pendingNL = -1 + g.pendingWhitespace = -1 + elif g.pendingWhitespace >= 0: + addTok(g, tkSpaces, spaces(g.pendingWhitespace)) + + g.pendingWhitespace = -1 + +proc putNL(g: var TSrcGen; indent: int) = + # debugEcho "putNL ", g.pendingNL, " ", indent + if g.pendingNL >= 0: + addPendingNL(g) + else: + addTok(g, tkSpaces, "\n") + + g.col = 0 + + g.pendingNL = indent + g.lineLen = indent + g.pendingWhitespace = -1 + +proc putNL(g: var TSrcGen) = + putNL(g, g.indent) + +proc optNL(g: var TSrcGen; indent: int) = + g.pendingNL = indent + g.lineLen = indent + g.col = g.indent # when defined(nimpretty) or defined(nimph): g.pendingNewlineCount = 0 + +proc optNL(g: var TSrcGen) = + optNL(g, g.indent) + +proc optNL(g: var TSrcGen; a, b: PNode) = + g.pendingNL = g.indent + g.lineLen = g.indent + g.col = g.indent # when defined(nimpretty) or defined(nimph): g.pendingNewlineCount = 1 + +proc endSection(g: var TSrcGen) = + g.pendingNewlineCount = 1 + +proc indentNL(g: var TSrcGen) = + inc(g.indent, IndentWidth) + + g.pendingNL = g.indent + g.lineLen = g.indent + +proc dedent(g: var TSrcGen) = + dec(g.indent, IndentWidth) + assert(g.indent >= 0) + if g.pendingNL > IndentWidth: + dec(g.pendingNL, IndentWidth) + dec(g.lineLen, IndentWidth) + +template withIndent(g: var TSrcGen; indentParam: int; body: untyped) = + g.indent += indentParam + + body + + g.indent -= indentParam + +template withIndent(g: var TSrcGen; body: untyped) = + withIndent(g, IndentWidth, body) + +proc put(g: var TSrcGen; kind: TokType; s: string; sym: PSym = nil) = + # debugEcho "put ", kind, " ", s + if kind != tkSpaces: + addPendingNL(g) + if s.len > 0 or kind in {tkHideableStart, tkHideableEnd}: + addTok(g, kind, s, sym) + else: + g.pendingWhitespace = s.len + + inc g.col, s.len + + inc(g.lineLen, s.len) + +proc putComment(g: var TSrcGen; s: string) = + if s.len == 0: + return + # var i = 0 + # let hi = s.len - 1 + # let isCode = (s.len >= 2) and (s[1] != ' ') + # let ind = g.col + # var com = "" # "## " + # while i <= hi: + # case s[i] + # of '\0': + # break + # of '\r': + # put(g, tkComment, com) + # com = "" # "## " + # inc(i) + # if i <= hi and s[i] == '\n': inc(i) + # optNL(g, ind) + # of '\n': + # put(g, tkComment, com) + # com = "" # "## " + # inc(i) + # optNL(g, ind) + # of ' ', '\t': + # com.add(s[i]) + # inc(i) + # else: + # # we may break the comment into a multi-line comment if the line + # # gets too long: + # # compute length of the following word: + # var j = i + # while j <= hi and s[j] > ' ': inc(j) + # if not isCode and (g.col + (j - i) > MaxLineLen): + # put(g, tkComment, com) + # optNL(g, ind) + # com = "" # "## " + # while i <= hi and s[i] > ' ': + # com.add(s[i]) + # inc(i) + if g.lineLen > 0 and g.pendingNL < 0 and g.pendingWhitespace < 0: + put(g, tkSpaces, " ") + + put(g, tkComment, s) + optNL(g) + +proc maxLineLength(s: string): int = + if s.len == 0: + return 0 + + var i = 0 + + let hi = s.len - 1 + + var lineLen = 0 + while i <= hi: + case s[i] + of '\0': + break + of '\r': + inc(i) + if i <= hi and s[i] == '\n': + inc(i) + + result = max(result, lineLen) + lineLen = 0 + of '\n': + inc(i) + + result = max(result, lineLen) + lineLen = 0 + else: + inc(lineLen) + inc(i) + +proc containsNL(s: string): bool = + for i in 0 ..< s.len: + case s[i] + of '\r', '\n': + return true + else: + discard + + result = false + +proc pushCom(g: var TSrcGen; n: PNode) = + setLen(g.comStack, g.comStack.len + 1) + + g.comStack[^1] = n + +proc popAllComs(g: var TSrcGen) = + setLen(g.comStack, 0) + +const + Space = " " + +proc shouldRenderComment(g: TSrcGen): bool {.inline.} = + (renderNoComments notin g.flags or renderDocComments in g.flags) + +proc shouldRenderComment(g: TSrcGen; n: PNode): bool {.inline.} = + shouldRenderComment(g) and n.comment.len > 0 + +proc gcom(g: var TSrcGen; n: PNode) = + assert(n != nil) + if shouldRenderComment(g, n): + var oneSpaceAdded = 0 + if (g.pendingNL < 0) and (g.buf.len > 0) and (g.buf[^1] != ' '): + put(g, tkSpaces, Space) + + oneSpaceAdded = 1 + # Before long comments we cannot make sure that a newline is generated, + # because this might be wrong. But it is no problem in practice. + if (g.pendingNL < 0) and (g.buf.len > 0) and (g.col < LineCommentColumn): + var ml = maxLineLength(n.comment) + if ml + LineCommentColumn <= MaxLineLen: + put(g, tkSpaces, spaces(LineCommentColumn - g.col)) + + dec g.col, oneSpaceAdded + + putComment(g, n.comment) #assert(g.comStack[high(g.comStack)] = n); + +proc gcoms(g: var TSrcGen) = + for i in 0 .. high(g.comStack): + gcom(g, g.comStack[i]) + + popAllComs(g) + +proc lsub(g: TSrcGen; n: PNode): int + +proc litAux(g: TSrcGen; n: PNode; x: BiggestInt; size: int): string = + proc skip(t: PType): PType = + result = t + while result != nil and result.kind in { + tyGenericInst, tyRange, tyVar, tyLent, tyDistinct, tyOrdinal, tyAlias, tySink + }: + result = lastSon(result) + + let typ = n.typ.skip + if typ != nil and typ.kind in {tyBool, tyEnum}: + if sfPure in typ.sym.flags: + result = typ.sym.name.s & '.' + + let enumfields = typ.n + # we need a slow linear search because of enums with holes: + for e in items(enumfields): + if e.sym.position == x: + result &= e.sym.name.s + + return + if nfBase2 in n.flags: + result = "0b" & toBin(x, size * 8) + elif nfBase8 in n.flags: + var y = + if size < sizeof(BiggestInt): + x and ((1.BiggestInt shl (size * 8)) - 1) + else: + x + + result = "0o" & toOct(y, size * 3) + elif nfBase16 in n.flags: + result = "0x" & toHex(x, size * 2) + else: + result = $x + +proc ulitAux(g: TSrcGen; n: PNode; x: BiggestInt; size: int): string = + if nfBase2 in n.flags: + result = "0b" & toBin(x, size * 8) + elif nfBase8 in n.flags: + result = "0o" & toOct(x, size * 3) + elif nfBase16 in n.flags: + result = "0x" & toHex(x, size * 2) + else: + result = $cast[BiggestUInt](x) + +proc atom(g: TSrcGen; n: PNode): string = + doAssert g.config != nil, "g.config not initialized!" + if n.info.offsetA <= n.info.offsetB: + # for some constructed tokens this can not be the case and we're better + # off to not mess with the offset then. + return fileSection(g.config, g.fid, n.info.offsetA, n.info.offsetB) + + var f: float32 + case n.kind + of nkEmpty: + result = "" + of nkIdent: + result = n.ident.s + of nkSym: + result = n.sym.name.s + of nkClosedSymChoice, nkOpenSymChoice: + result = n[0].sym.name.s + of nkStrLit: + result = "" + + result.addQuoted(n.strVal) + of nkRStrLit: + result = "r\"" & replace(n.strVal, "\"", "\"\"") & '\"' + of nkTripleStrLit: + result = "\"\"\"" & n.strVal & "\"\"\"" + of nkCharLit: + result = "\'" + + result.addEscapedChar(chr(int(n.intVal))) + + result.add '\'' + of nkIntLit: + result = litAux(g, n, n.intVal, 4) + of nkInt8Lit: + result = litAux(g, n, n.intVal, 1) & "\'i8" + of nkInt16Lit: + result = litAux(g, n, n.intVal, 2) & "\'i16" + of nkInt32Lit: + result = litAux(g, n, n.intVal, 4) & "\'i32" + of nkInt64Lit: + result = litAux(g, n, n.intVal, 8) & "\'i64" + of nkUIntLit: + result = ulitAux(g, n, n.intVal, 4) & "\'u" + of nkUInt8Lit: + result = ulitAux(g, n, n.intVal, 1) & "\'u8" + of nkUInt16Lit: + result = ulitAux(g, n, n.intVal, 2) & "\'u16" + of nkUInt32Lit: + result = ulitAux(g, n, n.intVal, 4) & "\'u32" + of nkUInt64Lit: + result = ulitAux(g, n, n.intVal, 8) & "\'u64" + of nkFloatLit: + if n.flags * {nfBase2, nfBase8, nfBase16} == {}: + result = $(n.floatVal) + else: + result = litAux(g, n, (cast[ptr int64](addr(n.floatVal)))[], 8) + of nkFloat32Lit: + if n.flags * {nfBase2, nfBase8, nfBase16} == {}: + result = $n.floatVal & "\'f32" + else: + f = n.floatVal.float32 + result = litAux(g, n, (cast[ptr int32](addr(f)))[], 4) & "\'f32" + of nkFloat64Lit: + if n.flags * {nfBase2, nfBase8, nfBase16} == {}: + result = $n.floatVal & "\'f64" + else: + result = litAux(g, n, (cast[ptr int64](addr(n.floatVal)))[], 8) & "\'f64" + of nkNilLit: + result = "nil" + of nkType: + if (n.typ != nil) and (n.typ.sym != nil): + result = n.typ.sym.name.s + else: + result = "[type node]" + else: + internalError(g.config, "renderer.atom " & $n.kind) + + result = "" + +proc lcomma(g: TSrcGen; n: PNode; start: int = 0; theEnd: int = -1): int = + assert(theEnd < 0) + + # if n.prefix.len > 0 or n.mid.len > 0 or n.postfix.len > 0: + # return MaxLineLen + 1 + result = 0 + for i in start .. n.len + theEnd: + let param = n[i] + if nfDefaultParam notin param.flags: + inc(result, lsub(g, param)) + inc(result, 2) # for ``, `` + if result > 0: + dec(result, 2) # last does not get a comma! + +proc lsons(g: TSrcGen; n: PNode; start: int = 0; theEnd: int = -1): int = + assert(theEnd < 0) + + result = 0 + # if n.prefix.len > 0 or n.mid.len > 0 or n.postfix.len > 0: + # return MaxLineLen + 1 + for i in start .. n.len + theEnd: + inc(result, lsub(g, n[i])) + +proc origUsingType(n: PNode): PSym {.inline.} = + ## Returns the type that a parameter references. Check with referencesUsing first + ## to check `n` is actually referencing a using node + # If the node is untyped the typ field will be nil + if n[0].sym.typ != nil: + n[0].sym.typ.sym + else: + nil + +proc referencesUsing(n: PNode): bool = + ## Returns true if n references a using statement. + ## e.g. proc foo(x) # x doesn't have type or def value so it references a using + result = + n.kind == nkIdentDefs and # Sometimes the node might not have been semmed (e.g. doc0) and will be nkIdent instead + n[0].kind == nkSym and # Templates/macros can have parameters with no type (But their orig type will be nil) + n.origUsingType != nil and n[1].kind == nkEmpty and n[2].kind == nkEmpty + +proc lsub(g: TSrcGen; n: PNode): int = + # computes the length of a tree + if isNil(n): + return 0 + # if n.prefix.len > 0 or n.mid.len > 0 or n.postfix.len > 0: + # return MaxLineLen + 1 + if shouldRenderComment(g, n): + return MaxLineLen + 1 + case n.kind + of nkEmpty: + result = 0 + of nkTripleStrLit: + if containsNL(n.strVal): + result = MaxLineLen + 1 + else: + result = atom(g, n).len + of succ(nkEmpty) .. pred(nkTripleStrLit), succ(nkTripleStrLit) .. nkNilLit: + result = atom(g, n).len + of nkCall, nkBracketExpr, nkCurlyExpr, nkConv, nkPattern, nkObjConstr: + result = lsub(g, n[0]) + lcomma(g, n, 1) + len("()") + of nkHiddenStdConv, nkHiddenSubConv, nkHiddenCallConv: + result = lsub(g, n[1]) + of nkCast: + result = lsub(g, n[0]) + lsub(g, n[1]) + len("cast[]()") + of nkAddr: + result = + (if n.len > 0: + lsub(g, n[0]) + len("addr()") + else: 4 + ) + of nkStaticExpr: + result = lsub(g, n[0]) + len("static_") + of nkHiddenAddr, nkHiddenDeref, nkStringToCString, nkCStringToString: + result = lsub(g, n[0]) + of nkCommand: + result = lsub(g, n[0]) + lcomma(g, n, 1) + 1 + of nkExprEqExpr, nkAsgn, nkFastAsgn: + result = lsons(g, n) + 3 + of nkPar, nkCurly, nkBracket, nkClosure: + result = lcomma(g, n) + 2 + of nkTupleConstr: + # assume the trailing comma: + result = lcomma(g, n) + 3 + of nkArgList: + result = lcomma(g, n) + of nkTableConstr: + result = + if n.len > 0: + lcomma(g, n) + 2 + else: + len("{:}") + of nkClosedSymChoice, nkOpenSymChoice: + if n.len > 0: + result += lsub(g, n[0]) + of nkTupleTy: + result = lcomma(g, n) + len("tuple[]") + of nkTupleClassTy: + result = len("tuple") + of nkDotExpr: + result = lsons(g, n) + 1 + of nkBind: + result = lsons(g, n) + len("bind_") + of nkBindStmt: + result = lcomma(g, n) + len("bind_") + of nkMixinStmt: + result = lcomma(g, n) + len("mixin_") + of nkCheckedFieldExpr: + result = lsub(g, n[0]) + of nkLambda: + result = lsons(g, n) + len("proc__=_") + of nkDo: + result = lsons(g, n) + len("do__:_") + of nkConstDef, nkIdentDefs: + result = lcomma(g, n, 0, -3) + if n.referencesUsing: + result += lsub(g, newSymNode(n.origUsingType)) + 2 + else: + if n[^2].kind != nkEmpty: + result += lsub(g, n[^2]) + 2 + if n[^1].kind != nkEmpty: + result += lsub(g, n[^1]) + 3 + of nkVarTuple: + if n[^1].kind == nkEmpty: + result = lcomma(g, n, 0, -2) + len("()") + else: + result = lcomma(g, n, 0, -3) + len("() = ") + lsub(g, lastSon(n)) + of nkChckRangeF: + result = len("chckRangeF") + 2 + lcomma(g, n) + of nkChckRange64: + result = len("chckRange64") + 2 + lcomma(g, n) + of nkChckRange: + result = len("chckRange") + 2 + lcomma(g, n) + of nkObjDownConv, nkObjUpConv: + result = 2 + if n.len >= 1: + result += lsub(g, n[0]) + + result += lcomma(g, n, 1) + of nkExprColonExpr: + result = lsons(g, n) + 2 + of nkInfix: + result = lsons(g, n) + 2 + of nkPrefix: + result = + lsons(g, n) + 1 + (if n.len > 0 and n[1].kind == nkInfix: + 2 + else: 0 + ) + of nkPostfix: + result = lsons(g, n) + of nkCallStrLit: + result = lsons(g, n) + of nkPragmaExpr: + result = lsub(g, n[0]) + lcomma(g, n, 1) + of nkRange: + result = lsons(g, n) + 2 + of nkDerefExpr: + result = lsub(g, n[0]) + 2 + of nkAccQuoted: + result = lsons(g, n) + 2 + of nkIfExpr: + result = lsub(g, n[0][0]) + lsub(g, n[0][1]) + lsons(g, n, 1) + len("if_:_") + of nkElifExpr: + result = lsons(g, n) + len("_elif_:_") + of nkElseExpr: + result = lsub(g, n[0]) + len("_else:_") # type descriptions + of nkTypeOfExpr: + result = + (if n.len > 0: + lsub(g, n[0]) + else: 0 + ) + len("typeof()") + of nkRefTy: + result = + (if n.len > 0: + lsub(g, n[0]) + 1 + else: 0 + ) + len("ref") + of nkPtrTy: + result = + (if n.len > 0: + lsub(g, n[0]) + 1 + else: 0 + ) + len("ptr") + of nkVarTy, nkOutTy: + result = + (if n.len > 0: + lsub(g, n[0]) + 1 + else: 0 + ) + len("var") + of nkDistinctTy: + result = + len("distinct") + (if n.len > 0: + lsub(g, n[0]) + 1 + else: 0 + ) + if n.len > 1: + result += (if n[1].kind == nkWith: + len("_with_") + else: len("_without_") + ) + result += lcomma(g, n[1]) + of nkStaticTy: + result = + (if n.len > 0: + lsub(g, n[0]) + else: 0 + ) + len("static[]") + of nkTypeDef: + result = lsons(g, n) + 3 + of nkOfInherit: + result = lsub(g, n[0]) + len("of_") + of nkProcTy: + result = lsons(g, n) + len("proc") + of nkIteratorTy: + result = lsons(g, n) + len("iterator_") + of nkSinkAsgn: + result = lsons(g, n) + len("`=sink`(, )") + of nkEnumTy: + if n.len > 0: + result = lsub(g, n[0]) + lcomma(g, n, 1) + len("enum_") + else: + result = len("enum") + of nkEnumFieldDef: + result = lsons(g, n) + 3 + of nkVarSection, nkLetSection: + if n.len > 1: + result = MaxLineLen + 1 + else: + result = lsons(g, n) + len("var_") + of nkUsingStmt: + if n.len > 1: + result = MaxLineLen + 1 + else: + result = lsons(g, n) + len("using_") + of nkReturnStmt: + if n.len > 0 and n[0].kind == nkAsgn: + result = len("return_") + lsub(g, n[0][1]) + else: + result = len("return_") + lsub(g, n[0]) + of nkRaiseStmt: + result = lsub(g, n[0]) + len("raise_") + of nkYieldStmt: + result = lsub(g, n[0]) + len("yield_") + of nkDiscardStmt: + result = lsub(g, n[0]) + len("discard_") + of nkBreakStmt: + result = lsub(g, n[0]) + len("break_") + of nkContinueStmt: + result = lsub(g, n[0]) + len("continue_") + of nkPragma: + result = lcomma(g, n) + len("_{..}") + of nkCommentStmt: + result = n.comment.len + of nkOfBranch: + result = lcomma(g, n, 0, -2) + lsub(g, lastSon(n)) + len("of_:_") + of nkImportAs: + result = lsub(g, n[0]) + len("_as_") + lsub(g, n[1]) + of nkElifBranch: + result = lsons(g, n) + len("elif_:_") + of nkElse: + result = lsub(g, n[0]) + len("else:_") + of nkFinally: + result = lsub(g, n[0]) + len("finally:_") + of nkGenericParams: + result = lcomma(g, n) + 2 + of nkFormalParams: + result = lcomma(g, n, 1) + 2 + if n[0].kind != nkEmpty: + result += lsub(g, n[0]) + 2 + of nkExceptBranch: + result = lcomma(g, n, 0, -2) + lsub(g, lastSon(n)) + len("except_:_") + of nkObjectTy: + result = len("object_") + else: + result = MaxLineLen + 1 + +proc fits(g: TSrcGen; x: int): bool = + result = x <= MaxLineLen + +proc fits(x: int): bool = + x <= MaxLineLen + +proc overflows(g: TSrcGen; x: int): bool = + not fits(g.lineLen + x) + +type + TSubFlag = enum + rfLongMode + rfInConstExpr + + TSubFlags = set[TSubFlag] + TContext = tuple[spacing: int, flags: TSubFlags] + +const + emptyContext: TContext = (spacing: 0, flags: {}) + +proc initContext(c: var TContext) = + c.spacing = 0 + c.flags = {} + +proc gsub(g: var TSrcGen; n: PNode; c: TContext; fromStmtList = false) + +proc gsub(g: var TSrcGen; n: PNode; fromStmtList = false) = + var c: TContext + + initContext(c) + gsub(g, n, c, fromStmtList = fromStmtList) + +proc hasCom(n: PNode): bool = + result = false + if n.isNil: + return false + if n.comment.len > 0: + return true + case n.kind + of nkEmpty .. nkNilLit: + discard + else: + for i in 0 ..< n.len: + if hasCom(n[i]): + return true + +proc putWithSpace(g: var TSrcGen; kind: TokType; s: string) = + put(g, kind, s) + put(g, tkSpaces, Space) + +proc isHideable(config: ConfigRef; n: PNode): bool = + # xxx compare `ident` directly with `getIdent(cache, wRaises)`, but + # this requires a `cache`. + case n.kind + of nkExprColonExpr: + result = + n[0].kind == nkIdent and n[0].ident.s.nimIdentNormalize in [ + "raises", "tags", "extern", "deprecated", "forbids", "stacktrace" + ] + of nkIdent: + result = n.ident.s in ["gcsafe", "deprecated"] + else: + result = false + +proc gcommaAux( + g: var TSrcGen; + n: PNode; + ind: int; + start: int = 0; + theEnd: int = -1; + separator = tkComma; + firstSticky = false +) = + let inPragma = g.inPragma == 1 # just the top-level + + var inHideable = false + + let oldInd = g.indent + + g.indent = ind + + # If a full, comma-separate list fits on one line, go for it. If not, we put + # each element on its own line unless it's a list of trivial things (so as to + # avoid wasting significant vertical space on lists of numbers and the like) + let + onePerLine = + if fits(g, g.lineLen + lcomma(g, n, start, theEnd)): + false + else: + anyIt(n.sons[start .. n.len + theEnd], not isSimple(it)) + for i in start .. n.len + theEnd: + let c = i < n.len + theEnd + let sublen = lsub(g, n[i]) + ord(c) + if (onePerLine and i > start) or (not firstSticky and overflows(g, sublen)): + optNL(g, ind) + + let oldLen = g.tokens.len + if inPragma: + if not inHideable and isHideable(g.config, n[i]): + inHideable = true + + put(g, tkHideableStart, "") + elif inHideable and not isHideable(g.config, n[i]): + inHideable = false + + put(g, tkHideableEnd, "") + + # Ugly hack to move comments past the comma - this is beyond ugly + let + postfix = move(n[i].postfix) + + gsub(g, n[i]) + if c: + if g.tokens.len > oldLen: + putWithSpace(g, separator, $separator) + if shouldRenderComment(g) and hasCom(n[i]): + gcoms(g) + optNL(g, ind) + for tok in postfix: + if tok.tokType == tkComment and g.lineLen > 0 and g.pendingNL < 0 and g.pendingWhitespace < 0: + put(g, tkSpaces, " ") + + put(g, tok.tokType, $tok) + optNL(g) + if inHideable: + put(g, tkHideableEnd, "") + + inHideable = false + + g.indent = oldInd + +proc gcomma( + g: var TSrcGen; + n: PNode; + c: TContext; + start: int = 0; + theEnd: int = -1; + indentNL = IndentWidth +) = + var ind = g.indent + indentNL + + gcommaAux(g, n, ind, start, theEnd) + +proc gcomma( + g: var TSrcGen; + n: PNode; + start: int = 0; + theEnd: int = -1; + indentNL = IndentWidth; + firstSticky = false +) = + var ind = g.indent + indentNL + + gcommaAux(g, n, ind, start, theEnd, firstSticky = firstSticky) + +proc gsons(g: var TSrcGen; n: PNode; c: TContext; start: int = 0; theEnd: int = -1) = + for i in start .. n.len + theEnd: + gsub(g, n[i], c) + +proc gsonsNL(g: var TSrcGen; n: PNode; c: TContext; start: int = 0; theEnd: int = -1) = + for i in start .. n.len + theEnd: + gsub(g, n[i], c) + g.optNL() + +proc gprefixes(g: var TSrcGen; n: PNode) = + if n.prefix.len > 1: + optNL(g) + for tok in n.prefix: + if tok.tokType == tkComment and g.lineLen > 0 and g.pendingNL < 0 and g.pendingWhitespace < 0: + put(g, tkSpaces, " ") + + put(g, tok.tokType, $tok) + optNL(g) + +proc gmids(g: var TSrcGen; n: PNode) = + if n.mid.len > 1: + optNL(g) + for tok in n.mid: + if tok.tokType == tkComment and g.lineLen > 0 and g.pendingNL < 0 and g.pendingWhitespace < 0: + put(g, tkSpaces, " ") + + put(g, tok.tokType, $tok) + optNL(g) + +proc gpostfixes(g: var TSrcGen; n: PNode) = + let indented = n.postfix.len > 1 + if indented: + g.indentNL() + for tok in n.postfix: + if tok.tokType == tkComment and g.lineLen > 0 and g.pendingNL < 0 and g.pendingWhitespace < 0: + put(g, tkSpaces, " ") + + put(g, tok.tokType, $tok) + optNL(g) + if indented: + g.dedent() + +proc glist( + g: var TSrcGen; + n: PNode; + brOpen = tkParLe; + separator = tkComma; + extra = 0; + start = 0; + theEnd = -1; + c = emptyContext; + indentNL = IndentWidth; + sepAtEnd = false +) = + # Render a list in the following preference order: + # * If everything will fit on one line, including extra chars, do so + # * If the list contents can fit on a single line, do so + # * If the list contents are simple, use compact format + # * Else use item-per-line format + let brClose = + case brOpen + of tkParLe: + tkParRi + of tkBracketLe: + tkBracketRi + of tkCurlyLe: + tkCurlyRi + of tkBracketDotLe: + tkBracketDotRi + of tkCurlyDotLe: + tkCurlyDotRi + of tkParDotLe: + tkParDotRi + else: + tkInvalid + let + brLen = + (if brClose == tkInvalid: + 0 + else: len($brClose) * 2 + ) + (if sepAtEnd: + 1 + else: 0 + ) + subLen = lcomma(g, n, start = start, theEnd = theEnd) + ind = g.indent + indentNL + withNL = overflows(g, subLen + brLen + extra) or n.mid.len > 0 + if brClose != tkInvalid: + # TODO stack all opening brackets on one line if there are many + put(g, brOpen, $brOpen) + + let oldInd = g.indent + + g.indent = ind + if withNL: + g.optNL() + gmids(g, n) + + gcommaAux(g, n, ind, start, theEnd, separator) + if sepAtEnd: + put(g, separator, $separator) + + g.indent = oldInd + if withNL: + # g.dedent() + g.optNL(g.indent) + if brClose != tkInvalid: + put(g, brClose, $brClose) + +proc gsection(g: var TSrcGen; n: PNode; c: TContext; kind: TokType; k: string) = + if n.len == 0: + return + # empty var sections are possible + + putWithSpace(g, kind, k) + gcoms(g) + indentNL(g) + gmids(g, n) + for i in 0 ..< n.len: + optNL(g) + gsub(g, n[i], c) + gcoms(g) + + dedent(g) + +proc longMode(g: TSrcGen; n: PNode; start: int = 0; theEnd: int = -1): bool = + result = shouldRenderComment(g, n) + if not result: + # check further + for i in start .. n.len + theEnd: + if (lsub(g, n[i]) > MaxLineLen): + result = true + + break + +proc gstmts(g: var TSrcGen; n: PNode; c: TContext; doIndent = true) = + if n.kind == nkEmpty: + gprefixes(g, n) + gpostfixes(g, n) + + return + if doIndent: + indentNL(g) + + gprefixes(g, n) + + var lastKind = nkStmtList + if n.kind in {nkStmtList, nkStmtListExpr, nkStmtListType}: + for i in 0 ..< n.len: + # This groups sections by their kind, giving a bit of air between "parts" + # of code - we don't do it before control flow because there, the code + # before the control flow is often part of settting it up + # TODO if the previous statement was complex (lots of lines / indent) we should + # probably add a newline even before control flow + if n.kind == nkStmtList and lastKind notin {n[i].kind, nkStmtList} and n[i].kind notin nkControlFlow: + endSection(g) + if i > 0: + optNL(g, n[i - 1], n[i]) + # else: + # optNL(g) + if n[i].kind in {nkStmtList, nkStmtListExpr, nkStmtListType}: + gstmts(g, n[i], c, doIndent = false) + else: + gsub(g, n[i], fromStmtList = true) + + gcoms(g) + + lastKind = n[i].kind + else: + gsub(g, n) + gcoms(g) + + gpostfixes(g, n) + if doIndent: + dedent(g) + + optNL(g) + +proc gcond(g: var TSrcGen; n: PNode) = + if n.kind == nkStmtListExpr and not gsubAddsPar(n): + put(g, tkParLe, "(") + + gsub(g, n) + if n.kind == nkStmtListExpr and not gsubAddsPar(n): + put(g, tkParRi, ")") + +proc gif(g: var TSrcGen; n: PNode) = + var c: TContext + + gprefixes(g, n[0]) + gcond(g, n[0][0]) + initContext(c) + putWithSpace(g, tkColon, ":") + # if longMode(g, n) or (lsub(g, n[0][1]) + g.lineLen > MaxLineLen): + # incl(c.flags, rfLongMode) + gmids(g, n[0]) + gcoms(g) # a good place for comments + # single-line if expressions get encoded withtout stmtlist + # TODO we should probably format this in a more opinionated way + gstmts(g, n[0][1], c) + gpostfixes(g, n[0]) + # if n[0][1].kind == nkStmtList: + # gstmts(g, n[0][1], c) + # else: + # gsub(g, n[0][1]) + # g.pendingWhitespace = 1 + for i in 1 ..< n.len: + optNL(g) + # if n[i-1][1].kind == nkStmtList: + # optNL(g) + # else: + # put(g, tkSpaces, Space) + gsub(g, n[i], c) + +proc gwhile(g: var TSrcGen; n: PNode) = + var c: TContext + + putWithSpace(g, tkWhile, "while") + gcond(g, n[0]) + putWithSpace(g, tkColon, ":") + initContext(c) + if longMode(g, n) or (lsub(g, n[1]) + g.lineLen > MaxLineLen): + incl(c.flags, rfLongMode) + + gcoms(g) # a good place for comments + gstmts(g, n[1], c) + +proc gpattern(g: var TSrcGen; n: PNode) = + var c: TContext + + put(g, tkCurlyLe, "{") + initContext(c) + if longMode(g, n) or (lsub(g, n[0]) + g.lineLen > MaxLineLen): + incl(c.flags, rfLongMode) + + gcoms(g) # a good place for comments + gstmts(g, n, c) + put(g, tkCurlyRi, "}") + +proc gpragmaBlock(g: var TSrcGen; n: PNode) = + var c: TContext + + gsub(g, n[0]) + putWithSpace(g, tkColon, ":") + initContext(c) + if longMode(g, n) or (lsub(g, n[1]) + g.lineLen > MaxLineLen): + incl(c.flags, rfLongMode) + + gcoms(g) # a good place for comments + gstmts(g, n[1], c) + +proc gtry(g: var TSrcGen; n: PNode) = + var c: TContext + + put(g, tkTry, "try") + putWithSpace(g, tkColon, ":") + initContext(c) + if longMode(g, n) or (lsub(g, n[0]) + g.lineLen > MaxLineLen): + incl(c.flags, rfLongMode) + + gmids(g, n) + gcoms(g) # a good place for comments + gstmts(g, n[0], c) + gsons(g, n, c, 1) + +proc gfor(g: var TSrcGen; n: PNode) = + var c: TContext + + putWithSpace(g, tkFor, "for") + initContext(c) + if longMode(g, n) or (lsub(g, n[^1]) + lsub(g, n[^2]) + 6 + g.lineLen > MaxLineLen): + incl(c.flags, rfLongMode) + + gcomma(g, n, c, 0, -3) + put(g, tkSpaces, Space) + putWithSpace(g, tkIn, "in") + gsub(g, n[^2], c) + putWithSpace(g, tkColon, ":") + gmids(g, n) + gcoms(g) + gstmts(g, n[^1], c) + +proc gcase(g: var TSrcGen; n: PNode) = + var c: TContext + + initContext(c) + if n.len == 0: + return + + var last = + if n[^1].kind == nkElse: + -2 + else: + -1 + if longMode(g, n, 0, last): + incl(c.flags, rfLongMode) + + putWithSpace(g, tkCase, "case") + gcond(g, n[0]) + gmids(g, n) + gcoms(g) + optNL(g) + gsons(g, n, c, 1, last) + if last == -2: + initContext(c) + if longMode(g, n[^1]): + incl(c.flags, rfLongMode) + + gsub(g, n[^1], c) + +proc genSymSuffix(result: var string; s: PSym) {.inline.} = + if sfGenSym in s.flags: + result.add '_' + result.addInt s.id + +proc gproc(g: var TSrcGen; n: PNode) = + var c: TContext + if n[namePos].kind == nkSym: + let s = n[namePos].sym + + var ret = renderDefinitionName(s) + + ret.genSymSuffix(s) + put(g, tkSymbol, ret) + else: + gsub(g, n[namePos]) + if n[patternPos].kind != nkEmpty: + gpattern(g, n[patternPos]) + + g.inside(GenericParams): + if renderNoBody in g.flags and n[miscPos].kind != nkEmpty and n[miscPos][1].kind != nkEmpty: + gsub(g, n[miscPos][1]) + else: + gsub(g, n[genericParamsPos]) + gsub(g, n[paramsPos]) + if renderNoPragmas notin g.flags: + gsub(g, n[pragmasPos]) + if renderNoBody notin g.flags: + if n[bodyPos].kind != nkEmpty: + put(g, tkSpaces, Space) + putWithSpace(g, tkEquals, "=") + withIndent(g): + gmids(g, n) + gcoms(g) + initContext(c) + gstmts(g, n[bodyPos], c) + else: + withIndent(g): + gmids(g, n) + gcoms(g) + +proc gTypeClassTy(g: var TSrcGen; n: PNode) = + var c: TContext + + initContext(c) + putWithSpace(g, tkConcept, "concept") + gsons(g, n[0], c) # arglist + gsub(g, n[1]) # pragmas + gsub(g, n[2]) # of + gcoms(g) + indentNL(g) + gcoms(g) + gstmts(g, n[3], c) + dedent(g) + +proc gblock(g: var TSrcGen; n: PNode) = + # you shouldn't simplify it to `n.len < 2` + # because the following codes should be executed + # even when block stmt has only one child for getting + # better error messages. + if n.len == 0: + return + + var c: TContext + + initContext(c) + if n[0].kind != nkEmpty: + putWithSpace(g, tkBlock, "block") + gsub(g, n[0]) + else: + put(g, tkBlock, "block") + # block stmt should have two children + if n.len == 1: + return + + putWithSpace(g, tkColon, ":") + if longMode(g, n) or (lsub(g, n[1]) + g.lineLen > MaxLineLen): + incl(c.flags, rfLongMode) + + gmids(g, n) + gcoms(g) + gstmts(g, n[1], c) + +proc gstaticStmt(g: var TSrcGen; n: PNode) = + var c: TContext + + put(g, tkStatic, "static") + putWithSpace(g, tkColon, ":") + initContext(c) + if longMode(g, n) or (lsub(g, n[0]) + g.lineLen > MaxLineLen): + incl(c.flags, rfLongMode) + + gmids(g, n) + gcoms(g) # a good place for comments + gstmts(g, n[0], c) + +proc gasm(g: var TSrcGen; n: PNode) = + putWithSpace(g, tkAsm, "asm") + gsub(g, n[0]) + gcoms(g) + if n.len > 1: + gsub(g, n[1]) + +proc gident(g: var TSrcGen; n: PNode) = + if GenericParams in g.inside and n.kind == nkSym: + if sfAnon in n.sym.flags or (n.typ != nil and tfImplicitTypeParam in n.typ.flags): + return + + var t: TokType + var s = atom(g, n) + if s.len > 0 and s[0] in phlexer.SymChars: + if n.kind == nkIdent: + if (n.ident.id < ord(tokKeywordLow) - ord(tkSymbol)) or ( + n.ident.id > ord(tokKeywordHigh) - ord(tkSymbol) + ): + t = tkSymbol + else: + t = TokType(n.ident.id + ord(tkSymbol)) + else: + t = tkSymbol + else: + t = tkOpr + if renderIr in g.flags and n.kind == nkSym: + let localId = disamb(g, n.sym) + if localId != 0 and n.sym.magic == mNone: + s.add '_' + s.addInt localId + if sfCursor in n.sym.flags: + s.add "_cursor" + elif n.kind == nkSym and ( + renderIds in g.flags or sfGenSym in n.sym.flags or n.sym.kind == skTemp + ): + s.add '_' + s.addInt n.sym.id + when defined(debugMagics): + s.add '_' + s.add $n.sym.magic + + put( + g, + t, + s, + if n.kind == nkSym and renderSyms in g.flags: + n.sym + else: + nil + ) + +proc doParamsAux(g: var TSrcGen; params: PNode) = + let retLen = + if params.len > 0 and params[0].kind != nkEmpty: + lsub(g, params[0]) + len(" -> ") + else: + 0 + if params.len > 1: + glist(g, params, tkParLe, tkSemiColon, extra = retLen, start = 1) + if params.len > 0 and params[0].kind != nkEmpty: + put(g, tkSpaces, Space) + putWithSpace(g, tkOpr, "->") + gsub(g, params[0]) + +proc gsub(g: var TSrcGen; n: PNode; i: int) = + if i < n.len: + gsub(g, n[i]) + else: + put(g, tkOpr, "<<" & $i & "th child missing for " & $n.kind & " >>") + +proc gsubOptNL( + g: var TSrcGen; + n: PNode; + c = emptyContext; + indentNL = IndentWidth; + fromStmtList = false +) = + # Output n on the same line if it fits, else continue on next - indentation is + # always set up in case a comment linebreaks the statement + let nl = overflows(g, lsub(g, n)) + + withIndent(g, indentNL): + if nl: + optNL(g) + + gsub(g, n, c = c, fromStmtList = fromStmtList) + +type + BracketKind = enum + bkNone + bkBracket + bkBracketAsgn + bkCurly + bkCurlyAsgn + +proc bracketKind*(g: TSrcGen; n: PNode): BracketKind = + if renderIds notin g.flags: + case n.kind + of nkClosedSymChoice, nkOpenSymChoice: + if n.len > 0: + result = bracketKind(g, n[0]) + of nkSym: + result = + case n.sym.name.s + of "[]": + bkBracket + of "[]=": + bkBracketAsgn + of "{}": + bkCurly + of "{}=": + bkCurlyAsgn + else: + bkNone + else: + result = bkNone + +proc skipHiddenNodes(n: PNode): PNode = + result = n + while result != nil: + if result.kind in {nkHiddenStdConv, nkHiddenSubConv, nkHiddenCallConv} and result.len > 1: + result = result[1] + elif result.kind in { + nkCheckedFieldExpr, nkHiddenAddr, nkHiddenDeref, nkStringToCString, + nkCStringToString + } and result.len > 0: + result = result[0] + else: + break + +proc accentedName(g: var TSrcGen; n: PNode) = + # This is for cases where ident should've really been a `nkAccQuoted`, e.g. `:tmp` + # or if user writes a macro with `ident":foo"`. It's unclear whether these should be legal. + const + backticksNeeded = OpChars + {'[', '{', '\''} + if n == nil: + return + + let ident = n.getPIdent + if ident != nil and ident.s[0] in backticksNeeded: + put(g, tkAccent, "`") + gident(g, n) + put(g, tkAccent, "`") + else: + gsub(g, n) + +proc infixArgument(g: var TSrcGen; n: PNode; i: int) = + if i < 1 or i > 2: + return + + var needsParenthesis = false + + let nNext = n[i].skipHiddenNodes + if nNext.kind == nkInfix: + if nNext[0].kind in {nkSym, nkIdent} and n[0].kind in {nkSym, nkIdent}: + let nextId = + if nNext[0].kind == nkSym: + nNext[0].sym.name + else: + nNext[0].ident + let nnId = + if n[0].kind == nkSym: + n[0].sym.name + else: + n[0].ident + if i == 1: + if getPrecedence(nextId) < getPrecedence(nnId): + needsParenthesis = true + elif i == 2: + if getPrecedence(nextId) <= getPrecedence(nnId): + needsParenthesis = true + if needsParenthesis: + put(g, tkParLe, "(") + + gcond(g, n[i]) + if needsParenthesis: + put(g, tkParRi, ")") + +const + postExprBlocks = + { + nkStmtList, nkStmtListExpr, nkOfBranch, nkElifBranch, nkElse, nkExceptBranch, + nkFinally, nkDo + } + +proc postStatements(g: var TSrcGen; n: PNode; i: int; skipDo: bool) = + var i = i + if n[i].kind in {nkStmtList, nkStmtListExpr}: + if skipDo: + put(g, tkColon, ":") + else: + put(g, tkSpaces, Space) + put(g, tkDo, "do") + put(g, tkColon, ":") + + gsub(g, n, i) + + i.inc + for j in i ..< n.len: + if n[j].kind == nkDo: + optNL(g) + elif n[j].kind in {nkStmtList, nkStmtListExpr}: + optNL(g) + put(g, tkDo, "do") + put(g, tkColon, ":") + + gsub(g, n, j) + +proc isCustomLit(n: PNode): bool = + if n.len == 2 and n[0].kind == nkRStrLit: + let ident = n[1].getPIdent + + result = ident != nil and ident.s.startsWith('\'') + +proc gsub(g: var TSrcGen; n: PNode; c: TContext; fromStmtList = false) = + if isNil(n): + return + if n.kind in {nkStmtList, nkStmtListExpr, nkStmtListType} and not gsubAddsPar(n): + gstmts(g, n, emptyContext) + + return + + gprefixes(g, n) + + var a: TContext + if shouldRenderComment(g, n): + pushCom(g, n) + case n.kind # atoms: + of nkTripleStrLit: + put(g, tkTripleStrLit, atom(g, n)) + of nkEmpty: + discard + of nkType: + put(g, tkInvalid, atom(g, n)) + of nkSym, nkIdent: + gident(g, n) + of nkIntLit: + put(g, tkIntLit, atom(g, n)) + of nkInt8Lit: + put(g, tkInt8Lit, atom(g, n)) + of nkInt16Lit: + put(g, tkInt16Lit, atom(g, n)) + of nkInt32Lit: + put(g, tkInt32Lit, atom(g, n)) + of nkInt64Lit: + put(g, tkInt64Lit, atom(g, n)) + of nkUIntLit: + put(g, tkUIntLit, atom(g, n)) + of nkUInt8Lit: + put(g, tkUInt8Lit, atom(g, n)) + of nkUInt16Lit: + put(g, tkUInt16Lit, atom(g, n)) + of nkUInt32Lit: + put(g, tkUInt32Lit, atom(g, n)) + of nkUInt64Lit: + put(g, tkUInt64Lit, atom(g, n)) + of nkFloatLit: + put(g, tkFloatLit, atom(g, n)) + of nkFloat32Lit: + put(g, tkFloat32Lit, atom(g, n)) + of nkFloat64Lit: + put(g, tkFloat64Lit, atom(g, n)) + of nkFloat128Lit: + put(g, tkFloat128Lit, atom(g, n)) + of nkStrLit: + put(g, tkStrLit, atom(g, n)) + of nkRStrLit: + put(g, tkRStrLit, atom(g, n)) + of nkCharLit: + put(g, tkCharLit, atom(g, n)) + of nkNilLit: + put(g, tkNil, atom(g, n)) # complex expressions + of nkCall, nkConv, nkDotCall, nkPattern, nkObjConstr: + if n.len > 1 and n.lastSon.kind in postExprBlocks: + accentedName(g, n[0]) + + var i = 1 + while i < n.len and n[i].kind notin postExprBlocks: + i.inc + if i > 1: + glist(g, n, tkParLe, start = 1, theEnd = i - 1 - n.len) + + postStatements(g, n, i, fromStmtList) + elif n.len >= 1: + case bracketKind(g, n[0]) + of bkBracket: + gsub(g, n, 1) + glist(g, n, tkBracketLe, start = 2) + of bkBracketAsgn: + gsub(g, n, 1) + glist(g, n, tkBracketLe, extra = len(" = "), start = 2, theEnd = -2) + put(g, tkSpaces, Space) + putWithSpace(g, tkEquals, "=") + gsubOptNL(g, n[n.len - 1]) + of bkCurly: + gsub(g, n, 1) + glist(g, n, tkCurlyLe, start = 2) + of bkCurlyAsgn: + gsub(g, n, 1) + glist(g, n, tkCurlyLe, extra = len(" = "), start = 2, theEnd = -2) + put(g, tkSpaces, Space) + putWithSpace(g, tkEquals, "=") + gsubOptNL(g, n[n.len - 1]) + of bkNone: + accentedName(g, n[0]) + glist(g, n, tkParLe, start = 1) + else: + put(g, tkParLe, "(") + put(g, tkParRi, ")") + of nkCallStrLit: + if n.len > 0: + accentedName(g, n[0]) + if n.len > 1 and n[1].kind == nkRStrLit: + put(g, tkRStrLit, '\"' & replace(n[1].strVal, "\"", "\"\"") & '\"') + else: + gsub(g, n, 1) + of nkHiddenStdConv, nkHiddenSubConv: + if n.len >= 2: + when false: + # if {renderIds, renderIr} * g.flags != {}: + put(g, tkSymbol, "(conv)") + put(g, tkParLe, "(") + gsub(g, n[1]) + put(g, tkParRi, ")") + else: + gsub(g, n[1]) + else: + put(g, tkSymbol, "(wrong conv)") + of nkHiddenCallConv: + if {renderIds, renderIr} * g.flags != {}: + accentedName(g, n[0]) + put(g, tkParLe, "(") + gcomma(g, n, 1) + put(g, tkParRi, ")") + elif n.len >= 2: + gsub(g, n[1]) + else: + put(g, tkSymbol, "(wrong conv)") + of nkCast: + put(g, tkCast, "cast") + if n.len > 0 and n[0].kind != nkEmpty: + put(g, tkBracketLe, "[") + gsub(g, n, 0) + put(g, tkBracketRi, "]") + + put(g, tkParLe, "(") + gsub(g, n, 1) + put(g, tkParRi, ")") + of nkAddr: + put(g, tkAddr, "addr") + if n.len > 0: + put(g, tkParLe, "(") + gsub(g, n[0]) + put(g, tkParRi, ")") + of nkStaticExpr: + put(g, tkStatic, "static") + put(g, tkSpaces, Space) + gsub(g, n, 0) + of nkBracketExpr: + gcond(g, n[0]) + put(g, tkBracketLe, "[") + gcomma(g, n, 1) + put(g, tkBracketRi, "]") + of nkCurlyExpr: + gcond(g, n[0]) + put(g, tkCurlyLe, "{") + gcomma(g, n, 1) + put(g, tkCurlyRi, "}") + of nkPragmaExpr: + gsub(g, n, 0) + gcomma(g, n, 1) + of nkCommand: + accentedName(g, n[0]) + put(g, tkSpaces, Space) + if n.len > 1 and n.lastSon.kind in postExprBlocks: + var i = 1 + while i < n.len and n[i].kind notin postExprBlocks: + i.inc + if i > 1: + gcomma(g, n, 1, i - 1 - n.len, indentNL = IndentWidth, firstSticky = true) + + # when parsing nkCommand, the compiler inserts `nkCall` to arguments if + # ":" is present so it looks like we can skip the `do` here :/ this needs + # deeper investigation - see also `nkPar` which sometimes removes the + # parenthesis from the AST + postStatements(g, n, i, true) + else: + # The first argument must not be line-broken, or command syntax breaks! + if n.len > 1: + gcomma(g, n, 1, indentNL = IndentWidth, firstSticky = true) + of nkExprEqExpr, nkAsgn, nkFastAsgn: + gsub(g, n, 0) + put(g, tkSpaces, Space) + putWithSpace(g, tkEquals, "=") + gsubOptNL(g, n[1]) + of nkSinkAsgn: + put(g, tkSymbol, "`=sink`") + put(g, tkParLe, "(") + gcomma(g, n) + put(g, tkParRi, ")") + of nkChckRangeF: + put(g, tkSymbol, "chckRangeF") + put(g, tkParLe, "(") + gcomma(g, n) + put(g, tkParRi, ")") + of nkChckRange64: + put(g, tkSymbol, "chckRange64") + put(g, tkParLe, "(") + gcomma(g, n) + put(g, tkParRi, ")") + of nkChckRange: + put(g, tkSymbol, "chckRange") + put(g, tkParLe, "(") + gcomma(g, n) + put(g, tkParRi, ")") + of nkObjDownConv, nkObjUpConv: + let typ = + if (n.typ != nil) and (n.typ.sym != nil): + n.typ.sym.name.s + else: + "" + + put(g, tkParLe, typ & "(") + if n.len >= 1: + gsub(g, n[0]) + + put(g, tkParRi, ")") + of nkClosedSymChoice, nkOpenSymChoice: + if renderIds in g.flags: + put(g, tkParLe, "(") + for i in 0 ..< n.len: + if i > 0: + put(g, tkOpr, "|") + if n[i].kind == nkSym: + let s = n[i].sym + if s.owner != nil: + put g, tkSymbol, n[i].sym.owner.name.s + put g, tkOpr, "." + + put g, tkSymbol, n[i].sym.name.s + else: + gsub(g, n[i], c) + + put( + g, + tkParRi, + if n.kind == nkOpenSymChoice: + "|...)" + else: + ")" + ) + else: + gsub(g, n, 0) + of nkPar, nkClosure: + glist(g, n, tkParLe, c = c) + of nkTupleConstr: + glist(g, n, tkParLe, c = c, sepAtEnd = n.len == 1 and n[0].kind != nkExprColonExpr) + of nkCurly: + glist(g, n, tkCurlyLe, c = c) + of nkArgList: + glist(g, n, tkInvalid, c = c) + of nkTableConstr: + if n.len > 0: + glist(g, n, tkCurlyLe, c = c) + else: + put(g, tkCurlyLe, "{") + put(g, tkColon, ":") + put(g, tkCurlyRi, "}") + of nkBracket: + glist(g, n, tkBracketLe, c = c) + of nkDotExpr: + if isCustomLit(n): + put(g, tkCustomLit, n[0].strVal) + gsub(g, n, 1) + else: + gsub(g, n, 0) + put(g, tkDot, ".") + + assert n.len == 2, $n.len + + accentedName(g, n[1]) + of nkBind: + putWithSpace(g, tkBind, "bind") + gsub(g, n, 0) + of nkCheckedFieldExpr, nkHiddenAddr, nkHiddenDeref, nkStringToCString, + nkCStringToString: + if renderIds in g.flags: + put(g, tkAddr, $n.kind) + put(g, tkParLe, "(") + + gsub(g, n, 0) + if renderIds in g.flags: + put(g, tkParRi, ")") + of nkLambda: + putWithSpace(g, tkProc, "proc") + gsub(g, n, paramsPos) + gsub(g, n, pragmasPos) + put(g, tkSpaces, Space) + putWithSpace(g, tkEquals, "=") + gmids(g, n) + gsubOptNL(g, n[bodyPos]) + of nkDo: + putWithSpace(g, tkDo, " do") # TODO space here is ugly + if paramsPos < n.len: + doParamsAux(g, n[paramsPos]) + + gsub(g, n, pragmasPos) + put(g, tkColon, ":") + gmids(g, n) + gsub(g, n, bodyPos) + of nkIdentDefs: + # Skip if this is a property in a type and its not exported + # (While also not allowing rendering of non exported fields) + # if ObjectDef in g.inside and (not n[0].isExported() and renderNonExportedFields notin g.flags): + # return + # We render the identDef without being inside the section incase we render something like + # y: proc (x: string) # (We wouldn't want to check if x is exported) + g.outside(ObjectDef): + gcomma(g, n, 0, -3, indentNL = 0) + if n.len >= 2 and n[^2].kind != nkEmpty: + putWithSpace(g, tkColon, ":") + gsub(g, n[^2], c) + elif n.referencesUsing and renderExpandUsing in g.flags: + putWithSpace(g, tkColon, ":") + gsub(g, newSymNode(n.origUsingType), c) + if n.len >= 1 and n[^1].kind != nkEmpty: + put(g, tkSpaces, Space) + putWithSpace(g, tkEquals, "=") + # TODO this is a hack to make `valueOr` in `let ... ` drop the `do` but + # it is dubious if it is correct - there's a parsing ambiguity + # in nkPar / nkCommand / nkCall that needs resolving + gsubOptNL(g, n[^1], c, fromStmtList = true) + of nkConstDef: + gcomma(g, n, 0, -3) + if n.len >= 2 and n[^2].kind != nkEmpty: + putWithSpace(g, tkColon, ":") + gsub(g, n[^2], c) + if n.len >= 1 and n[^1].kind != nkEmpty: + put(g, tkSpaces, Space) + putWithSpace(g, tkEquals, "=") + gsubOptNL(g, n[^1], c) + of nkVarTuple: + if n[^1].kind == nkEmpty: + glist(g, n, tkParLe, theEnd = -2) + else: + glist(g, n, tkParLe, extra = len(" = "), theEnd = -3) + put(g, tkSpaces, Space) + putWithSpace(g, tkEquals, "=") + gsubOptNL(g, n[^1], c) + of nkExprColonExpr: + gsub(g, n[0], c) + putWithSpace(g, tkColon, ":") + gsubOptNL(g, n[1], c) + of nkInfix: + if n.len < 3: + put(g, tkOpr, "Too few children for nkInfix") + + return + + let oldLineLen = g.lineLen # we cache this because lineLen gets updated below + + infixArgument(g, n, 1) + + let spaces = g.inImportLike == 0 or n[0].kind != nkIdent or n[0].ident.s != "/" + if spaces: + put(g, tkSpaces, Space) + + gsub(g, n, 0) # binary operator + # e.g.: `n1 == n2` decompses as following sum: + if false and n.len == 3 and not fits( + g, oldLineLen + lsub(g, n[1]) + lsub(g, n[2]) + lsub(g, n[0]) + len(" ") + ): + optNL(g, g.indent + longIndentWid) + elif spaces: + put(g, tkSpaces, Space) + + g.indent += IndentWidth + + infixArgument(g, n, 2) + + g.indent -= IndentWidth + if n.len > 3 and n.lastSon.kind in postExprBlocks: + var i = 3 + while i < n.len and n[i].kind notin postExprBlocks: + i.inc + + postStatements(g, n, i, fromStmtList) + of nkPrefix: + gsub(g, n, 0) + if n.len > 1: + let opr = + if n[0].kind == nkIdent: + n[0].ident + elif n[0].kind == nkSym: + n[0].sym.name + elif n[0].kind in {nkOpenSymChoice, nkClosedSymChoice}: + n[0][0].sym.name + else: + nil + let nNext = skipHiddenNodes(n[1]) + if nNext.kind == nkPrefix or (opr != nil and phrenderer.isKeyword(opr)): + put(g, tkSpaces, Space) + if nNext.kind == nkInfix: + put(g, tkParLe, "(") + gsub(g, n[1]) + put(g, tkParRi, ")") + else: + gsub(g, n[1]) + if n.len > 2 and n.lastSon.kind in postExprBlocks: + var i = 2 + while i < n.len and n[i].kind notin postExprBlocks: + i.inc + + postStatements(g, n, i, fromStmtList) + of nkPostfix: + gsub(g, n, 1) + gsub(g, n, 0) + of nkRange: + gsub(g, n, 0) + put(g, tkDotDot, "..") + gsub(g, n, 1) + of nkDerefExpr: + gsub(g, n, 0) + put(g, tkOpr, "[]") + of nkAccQuoted: + put(g, tkAccent, "`") + for i in 0 ..< n.len: + proc isAlpha(n: PNode): bool = + if n.kind in {nkIdent, nkSym}: + let tmp = n.getPIdent.s + + result = tmp.len > 0 and tmp[0] in {'a' .. 'z', 'A' .. 'Z'} + + var useSpace = false + if i == 1 and n[0].kind == nkIdent and n[0].ident.s in ["=", "'"]: + if not n[1].isAlpha: # handle `=destroy`, `'big' + useSpace = true + elif i == 1 and n[1].kind == nkIdent and n[1].ident.s == "=": + if not n[0].isAlpha: # handle setters, e.g. `foo=` + useSpace = true + elif i > 0: + useSpace = true + if useSpace: + put(g, tkSpaces, Space) + + gsub(g, n[i]) + + put(g, tkAccent, "`") + of nkIfExpr: + putWithSpace(g, tkIf, "if") + if n.len > 0: + gcond(g, n[0][0]) + + putWithSpace(g, tkColon, ":") + if n.len > 0: + gmids(g, n[0]) + gsub(g, n[0], 1) + optNL(g) + + gsons(g, n, emptyContext, 1) + of nkElifExpr: + putWithSpace(g, tkElif, "elif") + gcond(g, n[0]) + putWithSpace(g, tkColon, ":") + gmids(g, n) + gsub(g, n, 1) + optNL(g) + of nkElseExpr: + put(g, tkElse, "else") + putWithSpace(g, tkColon, ":") + gmids(g, n) + gsub(g, n, 0) + optNL(g) + of nkTypeOfExpr: + put(g, tkType, "typeof") + put(g, tkParLe, "(") + if n.len > 0: + gsub(g, n[0]) + + put(g, tkParRi, ")") + of nkRefTy: + if n.len > 0: + putWithSpace(g, tkRef, "ref") + gsub(g, n[0]) + else: + put(g, tkRef, "ref") + of nkPtrTy: + if n.len > 0: + putWithSpace(g, tkPtr, "ptr") + gsub(g, n[0]) + else: + put(g, tkPtr, "ptr") + of nkVarTy: + if n.len > 0: + putWithSpace(g, tkVar, "var") + gsub(g, n[0]) + else: + put(g, tkVar, "var") + of nkOutTy: + if n.len > 0: + putWithSpace(g, tkOut, "out") + gsub(g, n[0]) + else: + put(g, tkOut, "out") + of nkDistinctTy: + if n.len > 0: + putWithSpace(g, tkDistinct, "distinct") + gsub(g, n[0]) + if n.len > 1: + if n[1].kind == nkWith: + putWithSpace(g, tkSymbol, " with") + else: + putWithSpace(g, tkSymbol, " without") + + gcomma(g, n[1]) + else: + put(g, tkDistinct, "distinct") + of nkTypeDef: + if n[0].kind == nkPragmaExpr: + # generate pragma after generic + gsub(g, n[0], 0) + if n[0].postfix.len > 0: + g.indentNL() + + gsub(g, n, 1) + gsub(g, n[0], 1) + else: + gsub(g, n, 0) + if n[0].postfix.len > 0: + g.indentNL() + + gsub(g, n, 1) + + put(g, tkSpaces, Space) + if n.len > 2 and n[2].kind != nkEmpty: + putWithSpace(g, tkEquals, "=") + if n[2].kind in {nkObjectTy, nkEnumTy, nkRefTy}: + gsub(g, n[2]) + else: + gsubOptNL(g, n[2]) + if n[0].postfix.len > 0: + g.dedent() + of nkObjectTy: + if n.len > 0: + putWithSpace(g, tkObject, "object") + g.inside(ObjectDef): + gsub(g, n[0]) + gsub(g, n[1]) + withIndent(g): + gmids(g, n) + gcoms(g) + gsub(g, n[2]) + endSection(g) + else: + put(g, tkObject, "object") + of nkRecList: + indentNL(g) + gmids(g, n) + for i in 0 ..< n.len: + optNL(g) + gsub(g, n[i], c) + gcoms(g) + + dedent(g) + of nkOfInherit: + putWithSpace(g, tkOf, "of") + gsub(g, n, 0) + of nkProcTy: + if n.len > 0: + put(g, tkProc, "proc") + gsub(g, n, 0) + gsub(g, n, 1) + else: + put(g, tkProc, "proc") + of nkIteratorTy: + if n.len > 0: + putWithSpace(g, tkIterator, "iterator") + gsub(g, n, 0) + gsub(g, n, 1) + else: + put(g, tkIterator, "iterator") + of nkStaticTy: + put(g, tkStatic, "static") + put(g, tkBracketLe, "[") + if n.len > 0: + gsub(g, n[0]) + + put(g, tkBracketRi, "]") + of nkEnumTy: + if n.len > 0: + putWithSpace(g, tkEnum, "enum") + gsub(g, n[0]) + withIndent(g): + gmids(g, n) + gcoms(g) + indentNL(g) + gsonsNL(g, n, emptyContext, 1) + gcoms(g) # BUGFIX: comment for the last enum field + dedent(g) + endSection(g) + else: + put(g, tkEnum, "enum") + of nkEnumFieldDef: + gsub(g, n, 0) + put(g, tkSpaces, Space) + putWithSpace(g, tkEquals, "=") + gsub(g, n, 1) + of nkStmtList, nkStmtListExpr, nkStmtListType: + if gsubAddsPar(n): + put(g, tkParLe, "(") + gsub(g, n[0]) + put(g, tkParRi, ")") + else: + raiseAssert "Handled above with gstmts" + of nkIfStmt: + putWithSpace(g, tkIf, "if") + gif(g, n) + of nkWhen, nkRecWhen: + putWithSpace(g, tkWhen, "when") + gif(g, n) + of nkWhileStmt: + gwhile(g, n) + of nkPragmaBlock: + gpragmaBlock(g, n) + of nkCaseStmt, nkRecCase: + gcase(g, n) + of nkTryStmt, nkHiddenTryStmt: + gtry(g, n) + of nkForStmt, nkParForStmt: + gfor(g, n) + of nkBlockStmt, nkBlockExpr: + gblock(g, n) + of nkStaticStmt: + gstaticStmt(g, n) + of nkAsmStmt: + gasm(g, n) + of nkProcDef: + if renderNoProcDefs notin g.flags: + putWithSpace(g, tkProc, "proc") + + gproc(g, n) + endSection(g) + of nkFuncDef: + if renderNoProcDefs notin g.flags: + putWithSpace(g, tkFunc, "func") + + gproc(g, n) + endSection(g) + of nkConverterDef: + if renderNoProcDefs notin g.flags: + putWithSpace(g, tkConverter, "converter") + + gproc(g, n) + endSection(g) + of nkMethodDef: + if renderNoProcDefs notin g.flags: + putWithSpace(g, tkMethod, "method") + + gproc(g, n) + endSection(g) + of nkIteratorDef: + if renderNoProcDefs notin g.flags: + putWithSpace(g, tkIterator, "iterator") + + gproc(g, n) + endSection(g) + of nkMacroDef: + if renderNoProcDefs notin g.flags: + putWithSpace(g, tkMacro, "macro") + + gproc(g, n) + endSection(g) + of nkTemplateDef: + if renderNoProcDefs notin g.flags: + putWithSpace(g, tkTemplate, "template") + + gproc(g, n) + endSection(g) + of nkTypeSection: + gsection(g, n, emptyContext, tkType, "type") + endSection(g) + of nkConstSection: + initContext(a) + incl(a.flags, rfInConstExpr) + gsection(g, n, a, tkConst, "const") + of nkVarSection, nkLetSection, nkUsingStmt: + if n.len == 0: + return + if n.kind == nkVarSection: + putWithSpace(g, tkVar, "var") + elif n.kind == nkLetSection: + putWithSpace(g, tkLet, "let") + else: + putWithSpace(g, tkUsing, "using") + if n.len > 1 or n.prefix.len > 0 or n.mid.len > 0 or n[0].prefix.len > 0: + gcoms(g) + indentNL(g) + gmids(g, n) + for i in 0 ..< n.len: + optNL(g) + gsub(g, n[i]) + gcoms(g) + + dedent(g) + else: + gsub(g, n[0]) + of nkReturnStmt: + putWithSpace(g, tkReturn, "return") + withIndent(g): + gmids(g, n) + if n.len > 0 and n[0].kind == nkAsgn: + gsub(g, n[0], 1) + else: + gsub(g, n, 0) + of nkRaiseStmt: + putWithSpace(g, tkRaise, "raise") + withIndent(g): + gmids(g, n) + gsub(g, n, 0) + of nkYieldStmt: + putWithSpace(g, tkYield, "yield") + withIndent(g): + gmids(g, n) + gsub(g, n, 0) + of nkDiscardStmt: + putWithSpace(g, tkDiscard, "discard") + withIndent(g): + gmids(g, n) + gsub(g, n, 0) + of nkBreakStmt: + putWithSpace(g, tkBreak, "break") + withIndent(g): + gmids(g, n) + gsub(g, n, 0) + of nkContinueStmt: + putWithSpace(g, tkContinue, "continue") + withIndent(g): + gmids(g, n) + gsub(g, n, 0) + of nkPragma: + if g.inPragma <= 0: + inc g.inPragma + + put(g, tkSpaces, Space) + glist(g, n, tkCurlyDotLe, c = emptyContext, indentNL = longIndentWid) + + dec g.inPragma + else: + gcomma(g, n, emptyContext) + of nkImportStmt, nkExportStmt: + g.inImportLike += 1 + if n.kind == nkImportStmt: + putWithSpace(g, tkImport, "import") + else: + putWithSpace(g, tkExport, "export") + + gcoms(g) + + # Simple imports on single line + let + indent = not isSimple(n) or not fits(g, g.linelen + lcomma(g, n)) + if indent: + indentNL(g) + + gcommaAux(g, n, g.indent) + if indent: + dedent(g) + + g.inImportLike -= 1 + of nkImportExceptStmt, nkExportExceptStmt: + g.inImportLike += 1 + if n.kind == nkImportExceptStmt: + putWithSpace(g, tkImport, "import") + else: + putWithSpace(g, tkExport, "export") + + gsub(g, n, 0) + put(g, tkSpaces, Space) + putWithSpace(g, tkExcept, "except") + gcommaAux(g, n, g.indent, 1) + gcoms(g) + optNL(g) + + g.inImportLike -= 1 + of nkFromStmt: + g.inImportLike += 1 + + putWithSpace(g, tkFrom, "from") + gsub(g, n, 0) + put(g, tkSpaces, Space) + putWithSpace(g, tkImport, "import") + gcomma(g, n, emptyContext, 1) + optNL(g) + + g.inImportLike -= 1 + of nkIncludeStmt: + g.inImportLike += 1 + + putWithSpace(g, tkInclude, "include") + gcoms(g) + indentNL(g) + gcommaAux(g, n, g.indent) + dedent(g) + optNL(g) + + g.inImportLike -= 1 + of nkCommentStmt: + gcoms(g) + optNL(g) + of nkOfBranch: + optNL(g) + putWithSpace(g, tkOf, "of") + gcomma(g, n, c, 0, -2) + putWithSpace(g, tkColon, ":") + gmids(g, n) + gcoms(g) + gstmts(g, lastSon(n), c) + of nkImportAs: + gsub(g, n, 0) + put(g, tkSpaces, Space) + putWithSpace(g, tkAs, "as") + gsub(g, n, 1) + of nkBindStmt: + putWithSpace(g, tkBind, "bind") + gcomma(g, n, c) + of nkMixinStmt: + putWithSpace(g, tkMixin, "mixin") + gcomma(g, n, c) + of nkElifBranch: + optNL(g) + putWithSpace(g, tkElif, "elif") + gcond(g, n[0]) + putWithSpace(g, tkColon, ":") + gmids(g, n) + gcoms(g) + gstmts(g, n[1], c) + of nkElse: + optNL(g) + put(g, tkElse, "else") + putWithSpace(g, tkColon, ":") + gmids(g, n) + gcoms(g) + gstmts(g, n[0], c) + of nkFinally, nkDefer: + optNL(g) + if n.kind == nkFinally: + put(g, tkFinally, "finally") + else: + put(g, tkDefer, "defer") + + putWithSpace(g, tkColon, ":") + gcoms(g) + gstmts(g, n[0], c) + of nkExceptBranch: + optNL(g) + if n.len != 1: + putWithSpace(g, tkExcept, "except") + else: + put(g, tkExcept, "except") + + gcomma(g, n, 0, -2) + putWithSpace(g, tkColon, ":") + gcoms(g) + gstmts(g, lastSon(n), c) + of nkGenericParams: + proc hasExplicitParams(gp: PNode): bool = + for p in gp: + if p.typ == nil or tfImplicitTypeParam notin p.typ.flags: + return true + + return false + + if n.hasExplicitParams: + glist(g, n, tkBracketLe, tkSemiColon, indentNL = longIndentWid) + of nkFormalParams: + # Need to add empty parens here, or nkProcTy parsing becomes non-equal - + # see hasSignature - it would be nicer to remove them when unncessary + if n.len >= 1: + let retExtra = + if n.len > 0 and n[0].kind != nkEmpty: + len(": ") + lsub(g, n[0]) + else: + 0 + + # Semi-colon here is ugly but necessary for semantic equality, else we + # get different groupings of nkIdentDefs and their descendants + # TODO relaxing this to semantic equivalence would allow the use of `,` + # sometimes - nobody really wants `;` + glist( + g, + n, + tkParLe, + tkSemiColon, + extra = retExtra, + start = 1, + indentNL = longIndentWid + ) + if n.len > 0 and n[0].kind != nkEmpty: + putWithSpace(g, tkColon, ":") + gsubOptNL(g, n[0], indentNL = longIndentWid) + of nkTupleTy: + put(g, tkTuple, "tuple") + glist(g, n, tkBracketLe) + of nkTupleClassTy: + put(g, tkTuple, "tuple") + of nkComesFrom: + put(g, tkParLe, "(ComesFrom|") + gsub(g, n, 0) + put(g, tkParRi, ")") + of nkGotoState: + var c: TContext + + initContext c + putWithSpace g, tkSymbol, "goto" + + gsons(g, n, c) + of nkState: + var c: TContext + + initContext c + putWithSpace g, tkSymbol, "state" + + gsub(g, n[0], c) + putWithSpace(g, tkColon, ":") + indentNL(g) + gsons(g, n, c, 1) + dedent(g) + of nkBreakState: + put(g, tkTuple, "breakstate") + if renderIds in g.flags: + gsons(g, n, c, 0) + of nkTypeClassTy: + gTypeClassTy(g, n) + of nkError: + putWithSpace(g, tkSymbol, "error") + #gcomma(g, n, c) + gsub(g, n[0], c) + else: + #nkNone, nkExplicitTypeListCall: + internalError(g.config, n.info, "renderer.gsub(" & $n.kind & ')') + + gpostfixes(g, n) + +proc renderTree*( + n: PNode; renderFlags: TRenderFlags = {}; conf: ConfigRef = nil +): string = + if n == nil: + return "" + + var g: TSrcGen + + initSrcGen( + g, + renderFlags, + if conf == nil: + newPartialConfigRef() + else: + conf + ) + # do not indent the initial statement list so that + # writeFile("file.nim", repr n) + # produces working Nim code: + if n.kind in {nkStmtList, nkStmtListExpr, nkStmtListType}: + gstmts(g, n, emptyContext, doIndent = false) + else: + gsub(g, n) + + result = g.buf + +proc `$`*(n: PNode): string = + n.renderTree diff --git a/src/phrenderer.nim.nimph.yaml b/src/phrenderer.nim.nimph.yaml new file mode 100644 index 0000000..ff7ba5f --- /dev/null +++ b/src/phrenderer.nim.nimph.yaml @@ -0,0 +1,61076 @@ +{ + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# nimph" + }, + { + "kind": "nkCommentStmt", + "comment": "# (c) Copyright 2023 Jacek Sieka" + }, + { + "kind": "nkCommentStmt", + "comment": "# The Nim compiler" + }, + { + "kind": "nkCommentStmt", + "comment": "# (c) Copyright 2018 Andreas Rumpf" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# See the file \"copying.txt\", included in this" + }, + { + "kind": "nkCommentStmt", + "comment": "# distribution, for details about the copyright." + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# This module implements the renderer of the standard Nim representation." + }, + { + "kind": "nkCommentStmt", + "comment": "# nimph version:" + }, + { + "kind": "nkCommentStmt", + "comment": "# * generate code that actually can be parsed by the parser" + }, + { + "kind": "nkCommentStmt", + "comment": "# * more lookahead formatting" + }, + { + "kind": "nkCommentStmt", + "comment": "# * drive comment layout from here instead of lexer" + }, + { + "kind": "nkCommentStmt", + "comment": "# \'import renderer\' is so useful for debugging" + }, + { + "kind": "nkCommentStmt", + "comment": "# that Nim shouldn\'t produce a warning for that:" + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "used" + } + ] + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "idents" + }, + { + "kind": "nkIdent", + "ident": "strutils" + }, + { + "kind": "nkIdent", + "ident": "sequtils" + } + ] + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "phlexer" + }, + { + "kind": "nkIdent", + "ident": "phoptions" + }, + { + "kind": "nkIdent", + "ident": "phast" + }, + { + "kind": "nkIdent", + "ident": "phmsgs" + }, + { + "kind": "nkIdent", + "ident": "phlineinfos" + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "nimPreviewSlimSystem" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkIdent", + "ident": "std" + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "syncio" + }, + { + "kind": "nkIdent", + "ident": "assertions" + }, + { + "kind": "nkIdent", + "ident": "formatfloat" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TRenderFlag" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "renderNone" + }, + { + "kind": "nkIdent", + "ident": "renderNoBody" + }, + { + "kind": "nkIdent", + "ident": "renderNoComments" + }, + { + "kind": "nkIdent", + "ident": "renderDocComments" + }, + { + "kind": "nkIdent", + "ident": "renderNoPragmas" + }, + { + "kind": "nkIdent", + "ident": "renderIds" + }, + { + "kind": "nkIdent", + "ident": "renderNoProcDefs" + }, + { + "kind": "nkIdent", + "ident": "renderSyms" + }, + { + "kind": "nkIdent", + "ident": "renderRunnableExamples" + }, + { + "kind": "nkIdent", + "ident": "renderIr" + }, + { + "kind": "nkIdent", + "ident": "renderNonExportedFields" + }, + { + "kind": "nkIdent", + "ident": "renderExpandUsing" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TRenderFlags" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "TRenderFlag" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TRenderTok" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TokType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "length" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int16" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "Section" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "GenericParams" + }, + { + "kind": "nkIdent", + "ident": "ObjectDef" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TRenderTokSeq" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "TRenderTok" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "col" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# current position for iteration over the buffer\", line: 57, col: 14, offsetA: 1297, offsetB: 1345)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "idx" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# current token index for iteration over the buffer\", line: 58, col: 14, offsetA: 1360, offsetB: 1411)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "tokens" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TRenderTokSeq" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "pendingNL" + } + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# negative if not active; else contains the\", line: 62, col: 6, offsetA: 1482, offsetB: 1525)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# indentation value\", line: 63, col: 6, offsetA: 1532, offsetB: 1551)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pendingWhitespace" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "comStack" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "PNode" + } + ] + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# comment stack\", line: 65, col: 26, offsetA: 1605, offsetB: 1620)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "TRenderFlags" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "inside" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "Section" + } + ] + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Keeps track of contexts we are in\", line: 67, col: 25, offsetA: 1671, offsetB: 1706)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "checkAnon" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# we\\\'re in a context that can contain sfAnon\", line: 68, col: 20, offsetA: 1727, offsetB: 1771)" + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "inPragma" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "inImportLike" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "pendingNewlineCount" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "fid" + } + ] + }, + { + "kind": "nkIdent", + "ident": "FileIndex" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "mangler" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "seq" + }, + { + "kind": "nkIdent", + "ident": "PSym" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkControlFlow" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIfStmt" + }, + { + "kind": "nkIdent", + "ident": "nkWhenStmt" + }, + { + "kind": "nkIdent", + "ident": "nkForStmt" + }, + { + "kind": "nkIdent", + "ident": "nkParForStmt" + }, + { + "kind": "nkIdent", + "ident": "nkWhileStmt" + }, + { + "kind": "nkIdent", + "ident": "nkCaseStmt" + }, + { + "kind": "nkIdent", + "ident": "nkTryStmt" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "renderTree" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "renderFlags" + }, + { + "kind": "nkIdent", + "ident": "TRenderFlags" + }, + { + "kind": "nkCurly" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "isSimple" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Simple nodes are those that are either identifiers or simple lists thereof\", line: 85, col: 2, offsetA: 2152, offsetB: 2229)" + ], + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIdent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkStmtList" + }, + { + "kind": "nkIdent", + "ident": "nkImportStmt" + }, + { + "kind": "nkIdent", + "ident": "nkExportStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "allIt" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isSimple" + }, + { + "kind": "nkIdent", + "ident": "it" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsubAddsPar" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# There\\\'s an ambiguity in the grammar where nkPar sometimes is turned into\", line: 95, col: 2, offsetA: 2394, offsetB: 2468)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# nkStmtListExpr - this helper is a stopgap solution to work around\", line: 96, col: 2, offsetA: 2471, offsetB: 2538)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# the parsing quirk but needs more thought put into it\", line: 97, col: 2, offsetA: 2541, offsetB: 2595)" + ], + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkStmtListExpr" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkDiscardStmt" + }, + { + "kind": "nkIdent", + "ident": "nkIfStmt" + }, + { + "kind": "nkIdent", + "ident": "nkBlockStmt" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# We render the source code in a two phases: The first\", line: 102, col: 0, offsetA: 2711, offsetB: 2765)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# determines how long the subtree will likely be, the second\", line: 103, col: 0, offsetA: 2766, offsetB: 2826)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# phase appends to a buffer that will be the output.\", line: 104, col: 0, offsetA: 2827, offsetB: 2879)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "disamb" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# we group by \\\'s.name.s\\\' to compute the stable name ID.\", line: 106, col: 2, offsetA: 2926, offsetB: 2981)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "mangler" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "mangler" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "mangler" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "mangler" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "isKeyword" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "PIdent" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "tokKeywordLow" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "tokKeywordHigh" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "isExported" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Checks if an ident is exported.\", line: 123, col: 2, offsetA: 3353, offsetB: 3387)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## This is meant to be used with idents in nkIdentDefs.\", line: 124, col: 2, offsetA: 3390, offsetB: 3445)" + ], + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkPostfix" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "*" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkIdent" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkPragmaExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "isExported" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "renderDefinitionName" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "noQuotes" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Returns the definition name of the symbol.\", line: 134, col: 2, offsetA: 3651, offsetB: 3696)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"##\", line: 135, col: 2, offsetA: 3699, offsetB: 3701)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## If noQuotes is false the symbol may be returned in backticks. This will\", line: 136, col: 2, offsetA: 3704, offsetB: 3778)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## happen if the name happens to be a keyword or the first character is not\", line: 137, col: 2, offsetA: 3781, offsetB: 3856)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## part of the SymStartChars set.\", line: 138, col: 2, offsetA: 3859, offsetB: 3892)" + ], + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkIdent", + "ident": "noQuotes" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "SymStartChars" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "phrenderer" + }, + { + "kind": "nkIdent", + "ident": "isKeyword" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkCharLit", + "intVal": 96 + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 96 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "inside" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "section" + }, + { + "kind": "nkIdent", + "ident": "Section" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkIdent", + "ident": "untyped" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Runs `body` with `section` included in `g.inside`.\", line: 146, col: 2, offsetA: 4111, offsetB: 4164)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Removes it at the end of the body if `g` wasn\\\'t inside it\", line: 147, col: 2, offsetA: 4167, offsetB: 4227)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## before the template.\", line: 148, col: 2, offsetA: 4230, offsetB: 4253)" + ], + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "wasntInSection" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "section" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inside" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inside" + } + ] + }, + { + "kind": "nkIdent", + "ident": "incl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "section" + } + ] + }, + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "wasntInSection" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inside" + } + ] + }, + { + "kind": "nkIdent", + "ident": "excl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "section" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "outside" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "section" + }, + { + "kind": "nkIdent", + "ident": "Section" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkIdent", + "ident": "untyped" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Temporarily removes `section` from `g.inside`. Adds it back\", line: 158, col: 2, offsetA: 4451, offsetB: 4513)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## at the end of the body if `g` was inside it before the template\", line: 159, col: 2, offsetA: 4516, offsetB: 4582)" + ], + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "wasInSection" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "section" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inside" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inside" + } + ] + }, + { + "kind": "nkIdent", + "ident": "excl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "section" + } + ] + }, + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "wasInSection" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inside" + } + ] + }, + { + "kind": "nkIdent", + "ident": "incl" + } + ] + }, + { + "kind": "nkIdent", + "ident": "section" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "IndentWidth" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "longIndentWid" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "IndentWidth" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "MaxLineLen" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 88 + } + ] + }, + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "LineCommentColumn" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 30 + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "initSrcGen" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "renderFlags" + }, + { + "kind": "nkIdent", + "ident": "TRenderFlags" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "config" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "comStack" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tokens" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "@" + }, + { + "kind": "nkBracket" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "idx" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "renderFlags" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNL" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingWhitespace" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inside" + } + ] + }, + { + "kind": "nkCurly" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "addTok" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TokType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "sym" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# debugEcho \\\"addTok \\\", kind, \\\" \\\" , s.len, \\\" \\\", s\", line: 189, col: 2, offsetA: 5171, offsetB: 5219)" + ], + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tokens" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkObjConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "TRenderTok" + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "length" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "int16" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "sym" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "addPendingNL" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNL" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "newlines" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "repeat" + }, + { + "kind": "nkStrLit", + "strVal": "\u000A" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIntLit", + "intVal": 1 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNewlineCount" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNewlineCount" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "addTok" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkIdent", + "ident": "newlines" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "spaces" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNL" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNL" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNL" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNL" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingWhitespace" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingWhitespace" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "addTok" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "spaces" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingWhitespace" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingWhitespace" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "putNL" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# debugEcho \\\"putNL \\\", g.pendingNL, \\\" \\\", indent\", line: 214, col: 2, offsetA: 5821, offsetB: 5867)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNL" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "addPendingNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "addTok" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkStrLit", + "strVal": "\u000A" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNL" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingWhitespace" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "putNL" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putNL" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNL" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# when defined(nimpretty) or defined(nimph): g.pendingNewlineCount = 0\", line: 232, col: 19, offsetA: 6193, offsetB: 6263)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNL" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# when defined(nimpretty) or defined(nimph): g.pendingNewlineCount = 1\", line: 240, col: 19, offsetA: 6425, offsetB: 6495)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "endSection" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNewlineCount" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentNL" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "IndentWidth" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNL" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "dedent" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "dec" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "IndentWidth" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNL" + } + ] + }, + { + "kind": "nkIdent", + "ident": "IndentWidth" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "dec" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNL" + } + ] + }, + { + "kind": "nkIdent", + "ident": "IndentWidth" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "dec" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + }, + { + "kind": "nkIdent", + "ident": "IndentWidth" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "withIndent" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentParam" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkIdent", + "ident": "untyped" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indentParam" + } + ] + }, + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indentParam" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "withIndent" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "body" + }, + { + "kind": "nkIdent", + "ident": "untyped" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "withIndent" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "IndentWidth" + }, + { + "kind": "nkIdent", + "ident": "body" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TokType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "sym" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# debugEcho \\\"put \\\", kind, \\\" \\\", s\", line: 269, col: 2, offsetA: 7147, offsetB: 7179)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "addPendingNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkHideableStart" + }, + { + "kind": "nkIdent", + "ident": "tkHideableEnd" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "addTok" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingWhitespace" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "putComment" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# var i = 0\", line: 284, col: 2, offsetA: 7478, offsetB: 7489)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# let hi = s.len - 1\", line: 285, col: 2, offsetA: 7492, offsetB: 7512)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# let isCode = (s.len >= 2) and (s[1] != \\\' \\\')\", line: 286, col: 2, offsetA: 7515, offsetB: 7560)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# let ind = g.col\", line: 287, col: 2, offsetA: 7563, offsetB: 7580)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# var com = \\\"\\\" # \\\"## \\\"\", line: 288, col: 2, offsetA: 7583, offsetB: 7605)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# while i <= hi:\", line: 289, col: 2, offsetA: 7608, offsetB: 7624)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# case s[i]\", line: 290, col: 2, offsetA: 7627, offsetB: 7640)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# of \\\'\\\\0\\\':\", line: 291, col: 2, offsetA: 7643, offsetB: 7655)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# break\", line: 292, col: 2, offsetA: 7658, offsetB: 7669)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# of \\\'\\\\r\\\':\", line: 293, col: 2, offsetA: 7672, offsetB: 7684)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# put(g, tkComment, com)\", line: 294, col: 2, offsetA: 7687, offsetB: 7715)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# com = \\\"\\\" # \\\"## \\\"\", line: 295, col: 2, offsetA: 7718, offsetB: 7740)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# inc(i)\", line: 296, col: 2, offsetA: 7743, offsetB: 7755)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if i <= hi and s[i] == \\\'\\\\n\\\': inc(i)\", line: 297, col: 2, offsetA: 7758, offsetB: 7799)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# optNL(g, ind)\", line: 298, col: 2, offsetA: 7802, offsetB: 7821)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# of \\\'\\\\n\\\':\", line: 299, col: 2, offsetA: 7824, offsetB: 7836)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# put(g, tkComment, com)\", line: 300, col: 2, offsetA: 7839, offsetB: 7867)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# com = \\\"\\\" # \\\"## \\\"\", line: 301, col: 2, offsetA: 7870, offsetB: 7892)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# inc(i)\", line: 302, col: 2, offsetA: 7895, offsetB: 7907)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# optNL(g, ind)\", line: 303, col: 2, offsetA: 7910, offsetB: 7929)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# of \\\' \\\', \\\'\\\\t\\\':\", line: 304, col: 2, offsetA: 7932, offsetB: 7949)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# com.add(s[i])\", line: 305, col: 2, offsetA: 7952, offsetB: 7971)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# inc(i)\", line: 306, col: 2, offsetA: 7974, offsetB: 7986)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# else:\", line: 307, col: 2, offsetA: 7989, offsetB: 7998)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# # we may break the comment into a multi-line comment if the line\", line: 308, col: 2, offsetA: 8001, offsetB: 8071)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# # gets too long:\", line: 309, col: 2, offsetA: 8074, offsetB: 8096)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# # compute length of the following word:\", line: 310, col: 2, offsetA: 8099, offsetB: 8144)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# var j = i\", line: 311, col: 2, offsetA: 8147, offsetB: 8162)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# while j <= hi and s[j] > \\\' \\\': inc(j)\", line: 312, col: 2, offsetA: 8165, offsetB: 8207)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if not isCode and (g.col + (j - i) > MaxLineLen):\", line: 313, col: 2, offsetA: 8210, offsetB: 8265)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# put(g, tkComment, com)\", line: 314, col: 2, offsetA: 8268, offsetB: 8298)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# optNL(g, ind)\", line: 315, col: 2, offsetA: 8301, offsetB: 8322)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# com = \\\"\\\" # \\\"## \\\"\", line: 316, col: 2, offsetA: 8325, offsetB: 8349)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# while i <= hi and s[i] > \\\' \\\':\", line: 317, col: 2, offsetA: 8352, offsetB: 8387)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# com.add(s[i])\", line: 318, col: 2, offsetA: 8390, offsetB: 8411)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# inc(i)\", line: 319, col: 2, offsetA: 8414, offsetB: 8428)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNL" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingWhitespace" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkStrLit", + "strVal": " " + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkComment" + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "maxLineLength" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "hi" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "lineLen" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "hi" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 0 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 13 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "hi" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 10 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "max" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "lineLen" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 10 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "max" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "lineLen" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "containsNL" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 13 + }, + { + "kind": "nkCharLit", + "intVal": 10 + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "pushCom" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setLen" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "comStack" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "comStack" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "comStack" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "popAllComs" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "setLen" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "comStack" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "Space" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStrLit", + "strVal": " " + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "shouldRenderComment" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "TSrcGen" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "renderNoComments" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "renderDocComments" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "shouldRenderComment" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "TSrcGen" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "shouldRenderComment" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "comment" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcom" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "shouldRenderComment" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "oneSpaceAdded" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNL" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 32 + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "oneSpaceAdded" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Before long comments we cannot make sure that a newline is generated,\", line: 390, col: 6, offsetA: 9812, offsetB: 9883)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# because this might be wrong. But it is no problem in practice.\", line: 391, col: 6, offsetA: 9890, offsetB: 9954)" + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNL" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + }, + { + "kind": "nkIdent", + "ident": "LineCommentColumn" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ml" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "maxLineLength" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "comment" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "ml" + }, + { + "kind": "nkIdent", + "ident": "LineCommentColumn" + } + ] + }, + { + "kind": "nkIdent", + "ident": "MaxLineLen" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "spaces" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "LineCommentColumn" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "dec" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "col" + } + ] + }, + { + "kind": "nkIdent", + "ident": "oneSpaceAdded" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putComment" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "comment" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#assert(g.comStack[high(g.comStack)] = n);\", line: 399, col: 29, offsetA: 10244, offsetB: 10286)" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "high" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "comStack" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "comStack" + } + ] + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "popAllComs" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "TSrcGen" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "litAux" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "TSrcGen" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "BiggestInt" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "size" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "skip" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "PType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "t" + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyGenericInst" + }, + { + "kind": "nkIdent", + "ident": "tyRange" + }, + { + "kind": "nkIdent", + "ident": "tyVar" + }, + { + "kind": "nkIdent", + "ident": "tyLent" + }, + { + "kind": "nkIdent", + "ident": "tyDistinct" + }, + { + "kind": "nkIdent", + "ident": "tyOrdinal" + }, + { + "kind": "nkIdent", + "ident": "tyAlias" + }, + { + "kind": "nkIdent", + "ident": "tySink" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lastSon" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "skip" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "tyBool" + }, + { + "kind": "nkIdent", + "ident": "tyEnum" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "sfPure" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 46 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "enumfields" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# we need a slow linear search because of enums with holes:\", line: 423, col: 4, offsetA: 10899, offsetB: 10958)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "e" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "items" + }, + { + "kind": "nkIdent", + "ident": "enumfields" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "e" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "position" + } + ] + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&=" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "e" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + }, + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "nfBase2" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "0b" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toBin" + }, + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "size" + }, + { + "kind": "nkIntLit", + "intVal": 8 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "nfBase8" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "y" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "size" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "sizeof" + }, + { + "kind": "nkIdent", + "ident": "BiggestInt" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "shl" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 1 + }, + { + "kind": "nkIdent", + "ident": "BiggestInt" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "size" + }, + { + "kind": "nkIntLit", + "intVal": 8 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "0o" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toOct" + }, + { + "kind": "nkIdent", + "ident": "y" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "size" + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "nfBase16" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "0x" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toHex" + }, + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "size" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "ulitAux" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "TSrcGen" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "BiggestInt" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "size" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "nfBase2" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "0b" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toBin" + }, + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "size" + }, + { + "kind": "nkIntLit", + "intVal": 8 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "nfBase8" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "0o" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toOct" + }, + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "size" + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "nfBase16" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "0x" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "toHex" + }, + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "size" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkCast", + "sons": [ + { + "kind": "nkIdent", + "ident": "BiggestUInt" + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "TSrcGen" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "doAssert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "g.config not initialized!" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkIdent", + "ident": "offsetA" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkIdent", + "ident": "offsetB" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for some constructed tokens this can not be the case and we\\\'re better\", line: 457, col: 4, offsetA: 11864, offsetB: 11935)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# off to not mess with the offset then.\", line: 458, col: 4, offsetA: 11940, offsetB: 11979)" + ], + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fileSection" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "fid" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkIdent", + "ident": "offsetA" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkIdent", + "ident": "offsetB" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkIdent", + "ident": "float32" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIdent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkSym" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkClosedSymChoice" + }, + { + "kind": "nkIdent", + "ident": "nkOpenSymChoice" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkStrLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addQuoted" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkRStrLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "r\"" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "replace" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\"" + }, + { + "kind": "nkStrLit", + "strVal": "\"\"" + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 34 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "\"\"\"" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\"\"\"" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCharLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkStrLit", + "strVal": "\'" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addEscapedChar" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "chr" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 39 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIntLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "litAux" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkInt8Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "litAux" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\'i8" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkInt16Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "litAux" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\'i16" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkInt32Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "litAux" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\'i32" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkInt64Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "litAux" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 8 + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\'i64" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkUIntLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ulitAux" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\'u" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkUInt8Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ulitAux" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\'u8" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkUInt16Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ulitAux" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\'u16" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkUInt32Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ulitAux" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\'u32" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkUInt64Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ulitAux" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "intVal" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 8 + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\'u64" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkFloatLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nfBase2" + }, + { + "kind": "nkIdent", + "ident": "nfBase8" + }, + { + "kind": "nkIdent", + "ident": "nfBase16" + } + ] + } + ] + }, + { + "kind": "nkCurly" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "litAux" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkCast", + "sons": [ + { + "kind": "nkPtrTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "int64" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "addr" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 8 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkFloat32Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nfBase2" + }, + { + "kind": "nkIdent", + "ident": "nfBase8" + }, + { + "kind": "nkIdent", + "ident": "nfBase16" + } + ] + } + ] + }, + { + "kind": "nkCurly" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\'f32" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + }, + { + "kind": "nkIdent", + "ident": "float32" + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "litAux" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkCast", + "sons": [ + { + "kind": "nkPtrTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "int32" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "addr" + }, + { + "kind": "nkIdent", + "ident": "f" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\'f32" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkFloat64Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nfBase2" + }, + { + "kind": "nkIdent", + "ident": "nfBase8" + }, + { + "kind": "nkIdent", + "ident": "nfBase16" + } + ] + } + ] + }, + { + "kind": "nkCurly" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\'f64" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "litAux" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkCast", + "sons": [ + { + "kind": "nkPtrTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "int64" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "addr" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "floatVal" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 8 + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\'f64" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkNilLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkStrLit", + "strVal": "nil" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkType" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkStrLit", + "strVal": "[type node]" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "internalError" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "renderer.atom " + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "TSrcGen" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "theEnd" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "theEnd" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if n.prefix.len > 0 or n.mid.len > 0 or n.postfix.len > 0:\", line: 536, col: 2, offsetA: 14157, offsetB: 14217)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# return MaxLineLen + 1\", line: 537, col: 2, offsetA: 14220, offsetB: 14245)" + ], + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIdent", + "ident": "theEnd" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "param" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "nfDefaultParam" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "param" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "param" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for ``, ``\", line: 543, col: 21, offsetA: 14412, offsetB: 14424)" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "dec" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# last does not get a comma!\", line: 545, col: 19, offsetA: 14461, offsetB: 14489)" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "TSrcGen" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "theEnd" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "theEnd" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkForStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if n.prefix.len > 0 or n.mid.len > 0 or n.postfix.len > 0:\", line: 551, col: 2, offsetA: 14602, offsetB: 14662)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# return MaxLineLen + 1\", line: 552, col: 2, offsetA: 14665, offsetB: 14690)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIdent", + "ident": "theEnd" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "origUsingType" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Returns the type that a parameter references. Check with referencesUsing first\", line: 557, col: 2, offsetA: 14809, offsetB: 14890)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## to check `n` is actually referencing a using node\", line: 558, col: 2, offsetA: 14893, offsetB: 14945)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# If the node is untyped the typ field will be nil\", line: 559, col: 2, offsetA: 14948, offsetB: 14998)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "referencesUsing" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Returns true if n references a using statement.\", line: 566, col: 2, offsetA: 15104, offsetB: 15154)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## e.g. proc foo(x) # x doesn\\\'t have type or def value so it references a using\", line: 567, col: 2, offsetA: 15157, offsetB: 15236)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Templates/macros can have parameters with no type (But their orig type will be nil)\", line: 570, col: 29, offsetA: 15395, offsetB: 15480)" + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Sometimes the node might not have been semmed (e.g. doc0) and will be nkIdent instead\", line: 569, col: 30, offsetA: 15278, offsetB: 15365)" + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkIdentDefs" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "origUsingType" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "TSrcGen" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# computes the length of a tree\", line: 574, col: 2, offsetA: 15602, offsetB: 15633)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isNil" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if n.prefix.len > 0 or n.mid.len > 0 or n.postfix.len > 0:\", line: 577, col: 2, offsetA: 15664, offsetB: 15724)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# return MaxLineLen + 1\", line: 578, col: 2, offsetA: 15727, offsetB: 15752)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "shouldRenderComment" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "MaxLineLen" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "containsNL" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "MaxLineLen" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "succ" + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "pred" + }, + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "succ" + }, + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCall" + }, + { + "kind": "nkIdent", + "ident": "nkBracketExpr" + }, + { + "kind": "nkIdent", + "ident": "nkCurlyExpr" + }, + { + "kind": "nkIdent", + "ident": "nkConv" + }, + { + "kind": "nkIdent", + "ident": "nkPattern" + }, + { + "kind": "nkIdent", + "ident": "nkObjConstr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "()" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkHiddenStdConv" + }, + { + "kind": "nkIdent", + "ident": "nkHiddenSubConv" + }, + { + "kind": "nkIdent", + "ident": "nkHiddenCallConv" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCast" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "cast[]()" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkAddr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkStmtListExpr", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "addr()" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkStaticExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "static_" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkHiddenAddr" + }, + { + "kind": "nkIdent", + "ident": "nkHiddenDeref" + }, + { + "kind": "nkIdent", + "ident": "nkStringToCString" + }, + { + "kind": "nkIdent", + "ident": "nkCStringToString" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCommand" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkExprEqExpr" + }, + { + "kind": "nkIdent", + "ident": "nkAsgn" + }, + { + "kind": "nkIdent", + "ident": "nkFastAsgn" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkPar" + }, + { + "kind": "nkIdent", + "ident": "nkCurly" + }, + { + "kind": "nkIdent", + "ident": "nkBracket" + }, + { + "kind": "nkIdent", + "ident": "nkClosure" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkTupleConstr" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# assume the trailing comma:\", line: 614, col: 4, offsetA: 16867, offsetB: 16895)" + ], + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkArgList" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkTableConstr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "{:}" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkClosedSymChoice" + }, + { + "kind": "nkIdent", + "ident": "nkOpenSymChoice" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkTupleTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "tuple[]" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkTupleClassTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "tuple" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkDotExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkBind" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "bind_" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkBindStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "bind_" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkMixinStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "mixin_" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCheckedFieldExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkLambda" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "proc__=_" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkDo" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "do__:_" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkConstDef" + }, + { + "kind": "nkIdent", + "ident": "nkIdentDefs" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIntLit", + "intVal": -3 + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "referencesUsing" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSymNode" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "origUsingType" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkVarTuple" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIntLit", + "intVal": -2 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "()" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIntLit", + "intVal": -3 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "() = " + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lastSon" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkChckRangeF" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "chckRangeF" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkChckRange64" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "chckRange64" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkChckRange" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "chckRange" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkObjDownConv" + }, + { + "kind": "nkIdent", + "ident": "nkObjUpConv" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkExprColonExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkInfix" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkPrefix" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtListExpr", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkInfix" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkPostfix" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCallStrLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkPragmaExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkRange" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkDerefExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkAccQuoted" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIfExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "if_:_" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkElifExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "_elif_:_" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkElseExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "_else:_" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# type descriptions\", line: 698, col: 44, offsetA: 19184, offsetB: 19203)" + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkTypeOfExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkStmtListExpr", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "typeof()" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkRefTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkStmtListExpr", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "ref" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkPtrTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkStmtListExpr", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "ptr" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkVarTy" + }, + { + "kind": "nkIdent", + "ident": "nkOutTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkStmtListExpr", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "var" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkDistinctTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "distinct" + } + ] + }, + { + "kind": "nkStmtListExpr", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkStmtListExpr", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkWith" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "_with_" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "_without_" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkStaticTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkStmtListExpr", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "static[]" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkTypeDef" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkOfInherit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "of_" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkProcTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "proc" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIteratorTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "iterator_" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkSinkAsgn" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "`=sink`(, )" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkEnumTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "enum_" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "enum" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkEnumFieldDef" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkVarSection" + }, + { + "kind": "nkIdent", + "ident": "nkLetSection" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "MaxLineLen" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "var_" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkUsingStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "MaxLineLen" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "using_" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkReturnStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkAsgn" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "return_" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "return_" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkRaiseStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "raise_" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkYieldStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "yield_" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkDiscardStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "discard_" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkBreakStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "break_" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkContinueStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "continue_" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkPragma" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "_{..}" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCommentStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "comment" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkOfBranch" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIntLit", + "intVal": -2 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lastSon" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "of_:_" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkImportAs" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "_as_" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkElifBranch" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "elif_:_" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkElse" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "else:_" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkFinally" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "finally:_" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkGenericParams" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkFormalParams" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkExceptBranch" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIntLit", + "intVal": -2 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lastSon" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "except_:_" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkObjectTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": "object_" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "MaxLineLen" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "fits" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "TSrcGen" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "MaxLineLen" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "fits" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "MaxLineLen" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "overflows" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "TSrcGen" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fits" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSubFlag" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "rfLongMode" + }, + { + "kind": "nkIdent", + "ident": "rfInConstExpr" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSubFlags" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "set" + }, + { + "kind": "nkIdent", + "ident": "TSubFlag" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkTupleTy", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "spacing" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "flags" + }, + { + "kind": "nkIdent", + "ident": "TSubFlags" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "emptyContext" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkTupleConstr", + "sons": [ + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "spacing" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "flags" + }, + { + "kind": "nkCurly" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "initContext" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TContext" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "spacing" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkCurly" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fromStmtList" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fromStmtList" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initContext" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fromStmtList" + }, + { + "kind": "nkIdent", + "ident": "fromStmtList" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hasCom" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "isNil" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "comment" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "hasCom" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TokType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "isHideable" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "config" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# xxx compare `ident` directly with `getIdent(cache, wRaises)`, but\", line: 861, col: 2, offsetA: 23103, offsetB: 23170)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# this requires a `cache`.\", line: 862, col: 2, offsetA: 23173, offsetB: 23199)" + ], + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkExprColonExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkIdent" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nimIdentNormalize" + } + ] + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "raises" + }, + { + "kind": "nkStrLit", + "strVal": "tags" + }, + { + "kind": "nkStrLit", + "strVal": "extern" + }, + { + "kind": "nkStrLit", + "strVal": "deprecated" + }, + { + "kind": "nkStrLit", + "strVal": "forbids" + }, + { + "kind": "nkStrLit", + "strVal": "stacktrace" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIdent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "gcsafe" + }, + { + "kind": "nkStrLit", + "strVal": "deprecated" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcommaAux" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ind" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "theEnd" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "separator" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "firstSticky" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "inPragma" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inPragma" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# just the top-level\", line: 883, col: 33, offsetA: 23691, offsetB: 23711)" + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "inHideable" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "oldInd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ind" + } + ] + }, + { + "kind": "nkLetSection", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# If a full, comma-separate list fits on one line, go for it. If not, we put\", line: 891, col: 2, offsetA: 23784, offsetB: 23860)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# each element on its own line unless it\\\'s a list of trivial things (so as to\", line: 892, col: 2, offsetA: 23863, offsetB: 23940)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# avoid wasting significant vertical space on lists of numbers and the like)\", line: 893, col: 2, offsetA: 23943, offsetB: 24019)" + ], + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "onePerLine" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fits" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIdent", + "ident": "theEnd" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "anyIt" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "sons" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIdent", + "ident": "theEnd" + } + ] + } + ] + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isSimple" + }, + { + "kind": "nkIdent", + "ident": "it" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIdent", + "ident": "theEnd" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIdent", + "ident": "theEnd" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "sublen" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "onePerLine" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "start" + } + ] + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkIdent", + "ident": "firstSticky" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "overflows" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "sublen" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "ind" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "oldLen" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tokens" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "inPragma" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkIdent", + "ident": "inHideable" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isHideable" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "inHideable" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkHideableStart" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "inHideable" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isHideable" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "inHideable" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkHideableEnd" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Ugly hack to move comments past the comma - this is beyond ugly\", line: 917, col: 4, offsetA: 24693, offsetB: 24758)" + ], + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "postfix" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "move" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "postfix" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tokens" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIdent", + "ident": "oldLen" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "separator" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "separator" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "shouldRenderComment" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "hasCom" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "ind" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "postfix" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComment" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNL" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingWhitespace" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkStrLit", + "strVal": " " + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "inHideable" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkHideableEnd" + }, + { + "kind": "nkStrLit", + "strVal": "" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "inHideable" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "oldInd" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcomma" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "theEnd" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentNL" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "IndentWidth" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ind" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indentNL" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcommaAux" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "ind" + }, + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIdent", + "ident": "theEnd" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcomma" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "theEnd" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentNL" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "IndentWidth" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "firstSticky" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ind" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indentNL" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcommaAux" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "ind" + }, + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIdent", + "ident": "theEnd" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "firstSticky" + }, + { + "kind": "nkIdent", + "ident": "firstSticky" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsons" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "theEnd" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIdent", + "ident": "theEnd" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsonsNL" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "theEnd" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIdent", + "ident": "theEnd" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "optNL" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gprefixes" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "prefix" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "prefix" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComment" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNL" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingWhitespace" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkStrLit", + "strVal": " " + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "mid" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "mid" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComment" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNL" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingWhitespace" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkStrLit", + "strVal": " " + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gpostfixes" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indented" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "postfix" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "indented" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indentNL" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "postfix" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkIdent", + "ident": "tkComment" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingNL" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "pendingWhitespace" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkStrLit", + "strVal": " " + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tok" + }, + { + "kind": "nkIdent", + "ident": "tokType" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "tok" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "indented" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "dedent" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "glist" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "brOpen" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "separator" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "tkComma" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "extra" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "theEnd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "emptyContext" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentNL" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "IndentWidth" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "sepAtEnd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Render a list in the following preference order:\", line: 1019, col: 2, offsetA: 27144, offsetB: 27194)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# * If everything will fit on one line, including extra chars, do so\", line: 1020, col: 2, offsetA: 27197, offsetB: 27265)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# * If the list contents can fit on a single line, do so\", line: 1021, col: 2, offsetA: 27268, offsetB: 27324)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# * If the list contents are simple, use compact format\", line: 1022, col: 2, offsetA: 27327, offsetB: 27382)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# * Else use item-per-line format\", line: 1023, col: 2, offsetA: 27385, offsetB: 27418)" + ], + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "brClose" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "brOpen" + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkParRi" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkBracketLe" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkBracketRi" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCurlyLe" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCurlyRi" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkBracketDotLe" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkBracketDotRi" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCurlyDotLe" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkCurlyDotRi" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkParDotLe" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkParDotRi" + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "tkInvalid" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "brLen" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkStmtListExpr", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "brClose" + }, + { + "kind": "nkIdent", + "ident": "tkInvalid" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "brClose" + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtListExpr", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "sepAtEnd" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "subLen" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIdent", + "ident": "start" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "theEnd" + }, + { + "kind": "nkIdent", + "ident": "theEnd" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ind" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "indentNL" + } + ] + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "withNL" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "overflows" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "subLen" + }, + { + "kind": "nkIdent", + "ident": "brLen" + } + ] + }, + { + "kind": "nkIdent", + "ident": "extra" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "mid" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "brClose" + }, + { + "kind": "nkIdent", + "ident": "tkInvalid" + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO stack all opening brackets on one line if there are many\", line: 1053, col: 4, offsetA: 28037, offsetB: 28100)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "brOpen" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "brOpen" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "oldInd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ind" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "withNL" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "optNL" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcommaAux" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "ind" + }, + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIdent", + "ident": "theEnd" + }, + { + "kind": "nkIdent", + "ident": "separator" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "sepAtEnd" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "separator" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "separator" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "oldInd" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "withNL" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# g.dedent()\", line: 1069, col: 4, offsetA: 28352, offsetB: 28366)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "optNL" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "brClose" + }, + { + "kind": "nkIdent", + "ident": "tkInvalid" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "brClose" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "brClose" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsection" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "TokType" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "k" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# empty var sections are possible\", line: 1077, col: 2, offsetA: 28558, offsetB: 28591)" + ], + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "kind" + }, + { + "kind": "nkIdent", + "ident": "k" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "dedent" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "longMode" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "TSrcGen" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "theEnd" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "shouldRenderComment" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkIdent", + "ident": "result" + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# check further\", line: 1093, col: 4, offsetA: 28880, offsetB: 28895)" + ], + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIdent", + "ident": "theEnd" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "MaxLineLen" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + }, + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gstmts" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "doIndent" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gprefixes" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gpostfixes" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "doIndent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gprefixes" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "lastKind" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "nkStmtList" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkStmtList" + }, + { + "kind": "nkIdent", + "ident": "nkStmtListExpr" + }, + { + "kind": "nkIdent", + "ident": "nkStmtListType" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# This groups sections by their kind, giving a bit of air between \\\"parts\\\"\", line: 1114, col: 6, offsetA: 29330, offsetB: 29403)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# of code - we don\\\'t do it before control flow because there, the code\", line: 1115, col: 6, offsetA: 29410, offsetB: 29480)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# before the control flow is often part of settting it up\", line: 1116, col: 6, offsetA: 29487, offsetB: 29544)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO if the previous statement was complex (lots of lines / indent) we should\", line: 1117, col: 6, offsetA: 29551, offsetB: 29630)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# probably add a newline even before control flow\", line: 1118, col: 6, offsetA: 29637, offsetB: 29691)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkStmtList" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "lastKind" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkStmtList" + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkControlFlow" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "endSection" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# else:\", line: 1123, col: 6, offsetA: 29877, offsetB: 29884)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# optNL(g)\", line: 1124, col: 6, offsetA: 29891, offsetB: 29903)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkStmtList" + }, + { + "kind": "nkIdent", + "ident": "nkStmtListExpr" + }, + { + "kind": "nkIdent", + "ident": "nkStmtListType" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gstmts" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "doIndent" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fromStmtList" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "lastKind" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gpostfixes" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "doIndent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "dedent" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcond" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkStmtListExpr" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsubAddsPar" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkStrLit", + "strVal": "(" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkStmtListExpr" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsubAddsPar" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + }, + { + "kind": "nkStrLit", + "strVal": ")" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gif" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gprefixes" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcond" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initContext" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if longMode(g, n) or (lsub(g, n[0][1]) + g.lineLen > MaxLineLen):\", line: 1158, col: 2, offsetA: 30574, offsetB: 30641)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# incl(c.flags, rfLongMode)\", line: 1159, col: 2, offsetA: 30644, offsetB: 30673)" + ], + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a good place for comments\", line: 1161, col: 11, offsetA: 30702, offsetB: 30729)" + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# single-line if expressions get encoded withtout stmtlist\", line: 1162, col: 2, offsetA: 30732, offsetB: 30790)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO we should probably format this in a more opinionated way\", line: 1163, col: 2, offsetA: 30793, offsetB: 30856)" + ], + "ident": "gstmts" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gpostfixes" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if n[0][1].kind == nkStmtList:\", line: 1166, col: 2, offsetA: 30905, offsetB: 30937)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# gstmts(g, n[0][1], c)\", line: 1167, col: 2, offsetA: 30940, offsetB: 30965)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# else:\", line: 1168, col: 2, offsetA: 30968, offsetB: 30975)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# gsub(g, n[0][1])\", line: 1169, col: 2, offsetA: 30978, offsetB: 30998)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# g.pendingWhitespace = 1\", line: 1170, col: 2, offsetA: 31001, offsetB: 31028)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 1 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if n[i-1][1].kind == nkStmtList:\", line: 1173, col: 4, offsetA: 31070, offsetB: 31104)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# optNL(g)\", line: 1174, col: 4, offsetA: 31109, offsetB: 31121)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# else:\", line: 1175, col: 4, offsetA: 31126, offsetB: 31133)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# put(g, tkSpaces, Space)\", line: 1176, col: 4, offsetA: 31138, offsetB: 31165)" + ], + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gwhile" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkWhile" + }, + { + "kind": "nkStrLit", + "strVal": "while" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcond" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initContext" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "longMode" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "MaxLineLen" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "incl" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "rfLongMode" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a good place for comments\", line: 1189, col: 11, offsetA: 31456, offsetB: 31483)" + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gstmts" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gpattern" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkCurlyLe" + }, + { + "kind": "nkStrLit", + "strVal": "{" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initContext" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "longMode" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "MaxLineLen" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "incl" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "rfLongMode" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a good place for comments\", line: 1200, col: 11, offsetA: 31716, offsetB: 31743)" + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gstmts" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkCurlyRi" + }, + { + "kind": "nkStrLit", + "strVal": "}" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gpragmaBlock" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initContext" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "longMode" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "MaxLineLen" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "incl" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "rfLongMode" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a good place for comments\", line: 1213, col: 11, offsetA: 32025, offsetB: 32052)" + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gstmts" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gtry" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkTry" + }, + { + "kind": "nkStrLit", + "strVal": "try" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initContext" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "longMode" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "MaxLineLen" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "incl" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "rfLongMode" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a good place for comments\", line: 1226, col: 11, offsetA: 32325, offsetB: 32352)" + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gstmts" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gfor" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkFor" + }, + { + "kind": "nkStrLit", + "strVal": "for" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initContext" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "longMode" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 6 + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "MaxLineLen" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "incl" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "rfLongMode" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIntLit", + "intVal": -3 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkIn" + }, + { + "kind": "nkStrLit", + "strVal": "in" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gstmts" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcase" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initContext" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "last" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkElse" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIntLit", + "intVal": -2 + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIntLit", + "intVal": -1 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "longMode" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIdent", + "ident": "last" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "incl" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "rfLongMode" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkCase" + }, + { + "kind": "nkStrLit", + "strVal": "case" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcond" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIntLit", + "intVal": 1 + }, + { + "kind": "nkIdent", + "ident": "last" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "last" + }, + { + "kind": "nkIntLit", + "intVal": -2 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initContext" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "longMode" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "incl" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "rfLongMode" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "genSymSuffix" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "PSym" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "inline" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "sfGenSym" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 95 + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "addInt" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gproc" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "namePos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "namePos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ret" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "renderDefinitionName" + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ret" + }, + { + "kind": "nkIdent", + "ident": "genSymSuffix" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkIdent", + "ident": "ret" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "namePos" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "patternPos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gpattern" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "patternPos" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inside" + } + ] + }, + { + "kind": "nkIdent", + "ident": "GenericParams" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "renderNoBody" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "miscPos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "miscPos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "miscPos" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "genericParamsPos" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "paramsPos" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "renderNoPragmas" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "pragmasPos" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "renderNoBody" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "bodyPos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + }, + { + "kind": "nkStrLit", + "strVal": "=" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "withIndent" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initContext" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gstmts" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "bodyPos" + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "withIndent" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gTypeClassTy" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initContext" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkConcept" + }, + { + "kind": "nkStrLit", + "strVal": "concept" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# arglist\", line: 1321, col: 20, offsetA: 34442, offsetB: 34451)" + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# pragmas\", line: 1322, col: 16, offsetA: 34468, offsetB: 34477)" + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# of\", line: 1323, col: 16, offsetA: 34494, offsetB: 34498)" + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gstmts" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "dedent" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gblock" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# you shouldn\\\'t simplify it to `n.len < 2`\", line: 1331, col: 2, offsetA: 34611, offsetB: 34653)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# because the following codes should be executed\", line: 1332, col: 2, offsetA: 34656, offsetB: 34704)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# even when block stmt has only one child for getting\", line: 1333, col: 2, offsetA: 34707, offsetB: 34760)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# better error messages.\", line: 1334, col: 2, offsetA: 34763, offsetB: 34787)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initContext" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkBlock" + }, + { + "kind": "nkStrLit", + "strVal": "block" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkBlock" + }, + { + "kind": "nkStrLit", + "strVal": "block" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# block stmt should have two children\", line: 1346, col: 2, offsetA: 34975, offsetB: 35012)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "longMode" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "MaxLineLen" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "incl" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "rfLongMode" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gstmts" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gstaticStmt" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkStatic" + }, + { + "kind": "nkStrLit", + "strVal": "static" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initContext" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "longMode" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "MaxLineLen" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "incl" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "rfLongMode" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# a good place for comments\", line: 1368, col: 11, offsetA: 35480, offsetB: 35507)" + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gstmts" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gasm" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkAsm" + }, + { + "kind": "nkStrLit", + "strVal": "asm" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gident" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "GenericParams" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inside" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "sfAnon" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "tfImplicitTypeParam" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "TokType" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "phlexer" + }, + { + "kind": "nkIdent", + "ident": "SymChars" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkIdent" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "tokKeywordLow" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "tokKeywordHigh" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "TokType" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "ord" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "tkOpr" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "renderIr" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "localId" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "disamb" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "localId" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "magic" + } + ] + }, + { + "kind": "nkIdent", + "ident": "mNone" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 95 + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "addInt" + } + ] + }, + { + "kind": "nkIdent", + "ident": "localId" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "sfCursor" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "_cursor" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "renderIds" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "sfGenSym" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "skTemp" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 95 + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "addInt" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "id" + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "debugMagics" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 95 + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "magic" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "t" + }, + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "renderSyms" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "doParamsAux" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "params" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "retLen" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "params" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "params" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "params" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": " -> " + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "params" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "glist" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "params" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkIdent", + "ident": "tkSemiColon" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "extra" + }, + { + "kind": "nkIdent", + "ident": "retLen" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "params" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "params" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkOpr" + }, + { + "kind": "nkStrLit", + "strVal": "->" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "params" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkOpr" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "<<" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "th child missing for " + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStrLit", + "strVal": " >>" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsubOptNL" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "emptyContext" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentNL" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "IndentWidth" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fromStmtList" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Output n on the same line if it fits, else continue on next - indentation is\", line: 1449, col: 2, offsetA: 37483, offsetB: 37561)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# always set up in case a comment linebreaks the statement\", line: 1450, col: 2, offsetA: 37564, offsetB: 37622)" + ], + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "nl" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "overflows" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "withIndent" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indentNL" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nl" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fromStmtList" + }, + { + "kind": "nkIdent", + "ident": "fromStmtList" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "BracketKind" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "bkNone" + }, + { + "kind": "nkIdent", + "ident": "bkBracket" + }, + { + "kind": "nkIdent", + "ident": "bkBracketAsgn" + }, + { + "kind": "nkIdent", + "ident": "bkCurly" + }, + { + "kind": "nkIdent", + "ident": "bkCurlyAsgn" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "bracketKind" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "BracketKind" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "TSrcGen" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "renderIds" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkClosedSymChoice" + }, + { + "kind": "nkIdent", + "ident": "nkOpenSymChoice" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "bracketKind" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkSym" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "[]" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "bkBracket" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "[]=" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "bkBracketAsgn" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "{}" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "bkCurly" + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "{}=" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "bkCurlyAsgn" + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "bkNone" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "bkNone" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipHiddenNodes" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkHiddenStdConv" + }, + { + "kind": "nkIdent", + "ident": "nkHiddenSubConv" + }, + { + "kind": "nkIdent", + "ident": "nkHiddenCallConv" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCheckedFieldExpr" + }, + { + "kind": "nkIdent", + "ident": "nkHiddenAddr" + }, + { + "kind": "nkIdent", + "ident": "nkHiddenDeref" + }, + { + "kind": "nkIdent", + "ident": "nkStringToCString" + }, + { + "kind": "nkIdent", + "ident": "nkCStringToString" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBreakStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "accentedName" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# This is for cases where ident should\\\'ve really been a `nkAccQuoted`, e.g. `:tmp`\", line: 1503, col: 2, offsetA: 38787, offsetB: 38869)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# or if user writes a macro with `ident\\\":foo\\\"`. It\\\'s unclear whether these should be legal.\", line: 1504, col: 2, offsetA: 38872, offsetB: 38963)" + ], + "sons": [ + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "backticksNeeded" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "OpChars" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkCharLit", + "intVal": 91 + }, + { + "kind": "nkCharLit", + "intVal": 123 + }, + { + "kind": "nkCharLit", + "intVal": 39 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ident" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "getPIdent" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "ident" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ident" + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "backticksNeeded" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkAccent" + }, + { + "kind": "nkStrLit", + "strVal": "`" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gident" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkAccent" + }, + { + "kind": "nkStrLit", + "strVal": "`" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "infixArgument" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "needsParenthesis" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "nNext" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "skipHiddenNodes" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "nNext" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkInfix" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "nNext" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkSym" + }, + { + "kind": "nkIdent", + "ident": "nkIdent" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkSym" + }, + { + "kind": "nkIdent", + "ident": "nkIdent" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "nextId" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "nNext" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "nNext" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "nNext" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "nnId" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getPrecedence" + }, + { + "kind": "nkIdent", + "ident": "nextId" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getPrecedence" + }, + { + "kind": "nkIdent", + "ident": "nnId" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "needsParenthesis" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getPrecedence" + }, + { + "kind": "nkIdent", + "ident": "nextId" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "getPrecedence" + }, + { + "kind": "nkIdent", + "ident": "nnId" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "needsParenthesis" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "needsParenthesis" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkStrLit", + "strVal": "(" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcond" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "needsParenthesis" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + }, + { + "kind": "nkStrLit", + "strVal": ")" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkConstSection", + "sons": [ + { + "kind": "nkConstDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "postExprBlocks" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkStmtList" + }, + { + "kind": "nkIdent", + "ident": "nkStmtListExpr" + }, + { + "kind": "nkIdent", + "ident": "nkOfBranch" + }, + { + "kind": "nkIdent", + "ident": "nkElifBranch" + }, + { + "kind": "nkIdent", + "ident": "nkElse" + }, + { + "kind": "nkIdent", + "ident": "nkExceptBranch" + }, + { + "kind": "nkIdent", + "ident": "nkFinally" + }, + { + "kind": "nkIdent", + "ident": "nkDo" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "postStatements" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipDo" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkStmtList" + }, + { + "kind": "nkIdent", + "ident": "nkStmtListExpr" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipDo" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkDo" + }, + { + "kind": "nkStrLit", + "strVal": "do" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "inc" + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "j" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "j" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkDo" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "j" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkStmtList" + }, + { + "kind": "nkIdent", + "ident": "nkStmtListExpr" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkDo" + }, + { + "kind": "nkStrLit", + "strVal": "do" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "j" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "isCustomLit" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkRStrLit" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ident" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "getPIdent" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "ident" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ident" + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkIdent", + "ident": "startsWith" + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 39 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkVarTy", + "sons": [ + { + "kind": "nkIdent", + "ident": "TSrcGen" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "fromStmtList" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isNil" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkStmtList" + }, + { + "kind": "nkIdent", + "ident": "nkStmtListExpr" + }, + { + "kind": "nkIdent", + "ident": "nkStmtListType" + } + ] + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsubAddsPar" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gstmts" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "emptyContext" + } + ] + }, + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gprefixes" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "shouldRenderComment" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "pushCom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# atoms:\", line: 1599, col: 14, offsetA: 41172, offsetB: 41180)" + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkTripleStrLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkTripleStrLit" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkType" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkInvalid" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkSym" + }, + { + "kind": "nkIdent", + "ident": "nkIdent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gident" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIntLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkIntLit" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkInt8Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkInt8Lit" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkInt16Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkInt16Lit" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkInt32Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkInt32Lit" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkInt64Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkInt64Lit" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkUIntLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkUIntLit" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkUInt8Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkUInt8Lit" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkUInt16Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkUInt16Lit" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkUInt32Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkUInt32Lit" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkUInt64Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkUInt64Lit" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkFloatLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkFloatLit" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkFloat32Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkFloat32Lit" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkFloat64Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkFloat64Lit" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkFloat128Lit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkFloat128Lit" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkStrLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkStrLit" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkRStrLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkRStrLit" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCharLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkCharLit" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkNilLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkNil" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "atom" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# complex expressions\", line: 1643, col: 30, offsetA: 42285, offsetB: 42306)" + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCall" + }, + { + "kind": "nkIdent", + "ident": "nkConv" + }, + { + "kind": "nkIdent", + "ident": "nkDotCall" + }, + { + "kind": "nkIdent", + "ident": "nkPattern" + }, + { + "kind": "nkIdent", + "ident": "nkObjConstr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "lastSon" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "postExprBlocks" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "accentedName" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "postExprBlocks" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "inc" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "glist" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "theEnd" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "postStatements" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "fromStmtList" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCaseStmt", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "bracketKind" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "bkBracket" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "glist" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "tkBracketLe" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "bkBracketAsgn" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "glist" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "tkBracketLe" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "extra" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": " = " + } + ] + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "theEnd" + }, + { + "kind": "nkIntLit", + "intVal": -2 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + }, + { + "kind": "nkStrLit", + "strVal": "=" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsubOptNL" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "bkCurly" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "glist" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "tkCurlyLe" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "bkCurlyAsgn" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "glist" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "tkCurlyLe" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "extra" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": " = " + } + ] + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "theEnd" + }, + { + "kind": "nkIntLit", + "intVal": -2 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + }, + { + "kind": "nkStrLit", + "strVal": "=" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsubOptNL" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "bkNone" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "accentedName" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "glist" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkStrLit", + "strVal": "(" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + }, + { + "kind": "nkStrLit", + "strVal": ")" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCallStrLit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "accentedName" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkRStrLit" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkRStrLit" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkCharLit", + "intVal": 34 + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "replace" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "\"" + }, + { + "kind": "nkStrLit", + "strVal": "\"\"" + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 34 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkHiddenStdConv" + }, + { + "kind": "nkIdent", + "ident": "nkHiddenSubConv" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 8, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if {renderIds, renderIr} * g.flags != {}:\", line: 1691, col: 8, offsetA: 43784, offsetB: 43827)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkStrLit", + "strVal": "(conv)" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkStrLit", + "strVal": "(" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + }, + { + "kind": "nkStrLit", + "strVal": ")" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkStrLit", + "strVal": "(wrong conv)" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkHiddenCallConv" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "renderIds" + }, + { + "kind": "nkIdent", + "ident": "renderIr" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkCurly" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "accentedName" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkStrLit", + "strVal": "(" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + }, + { + "kind": "nkStrLit", + "strVal": ")" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkStrLit", + "strVal": "(wrong conv)" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCast" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkCast" + }, + { + "kind": "nkStrLit", + "strVal": "cast" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkBracketLe" + }, + { + "kind": "nkStrLit", + "strVal": "[" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkBracketRi" + }, + { + "kind": "nkStrLit", + "strVal": "]" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkStrLit", + "strVal": "(" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + }, + { + "kind": "nkStrLit", + "strVal": ")" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkAddr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkAddr" + }, + { + "kind": "nkStrLit", + "strVal": "addr" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkStrLit", + "strVal": "(" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + }, + { + "kind": "nkStrLit", + "strVal": ")" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkStaticExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkStatic" + }, + { + "kind": "nkStrLit", + "strVal": "static" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkBracketExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcond" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkBracketLe" + }, + { + "kind": "nkStrLit", + "strVal": "[" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkBracketRi" + }, + { + "kind": "nkStrLit", + "strVal": "]" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCurlyExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcond" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkCurlyLe" + }, + { + "kind": "nkStrLit", + "strVal": "{" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkCurlyRi" + }, + { + "kind": "nkStrLit", + "strVal": "}" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkPragmaExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCommand" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "accentedName" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "lastSon" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "postExprBlocks" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "postExprBlocks" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "inc" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentNL" + }, + { + "kind": "nkIdent", + "ident": "IndentWidth" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "firstSticky" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# when parsing nkCommand, the compiler inserts `nkCall` to arguments if\", line: 1753, col: 6, offsetA: 45355, offsetB: 45426)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# \\\":\\\" is present so it looks like we can skip the `do` here :/ this needs\", line: 1754, col: 6, offsetA: 45433, offsetB: 45506)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# deeper investigation - see also `nkPar` which sometimes removes the\", line: 1755, col: 6, offsetA: 45513, offsetB: 45582)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# parenthesis from the AST\", line: 1756, col: 6, offsetA: 45589, offsetB: 45615)" + ], + "ident": "postStatements" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# The first argument must not be line-broken, or command syntax breaks!\", line: 1759, col: 6, offsetA: 45668, offsetB: 45739)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentNL" + }, + { + "kind": "nkIdent", + "ident": "IndentWidth" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "firstSticky" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkExprEqExpr" + }, + { + "kind": "nkIdent", + "ident": "nkAsgn" + }, + { + "kind": "nkIdent", + "ident": "nkFastAsgn" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + }, + { + "kind": "nkStrLit", + "strVal": "=" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsubOptNL" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkSinkAsgn" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkStrLit", + "strVal": "`=sink`" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkStrLit", + "strVal": "(" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + }, + { + "kind": "nkStrLit", + "strVal": ")" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkChckRangeF" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkStrLit", + "strVal": "chckRangeF" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkStrLit", + "strVal": "(" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + }, + { + "kind": "nkStrLit", + "strVal": ")" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkChckRange64" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkStrLit", + "strVal": "chckRange64" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkStrLit", + "strVal": "(" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + }, + { + "kind": "nkStrLit", + "strVal": ")" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkChckRange" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkStrLit", + "strVal": "chckRange" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkStrLit", + "strVal": "(" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + }, + { + "kind": "nkStrLit", + "strVal": ")" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkObjDownConv" + }, + { + "kind": "nkIdent", + "ident": "nkObjUpConv" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkIdent", + "ident": "typ" + }, + { + "kind": "nkStrLit", + "strVal": "(" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + }, + { + "kind": "nkStrLit", + "strVal": ")" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkClosedSymChoice" + }, + { + "kind": "nkIdent", + "ident": "nkOpenSymChoice" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "renderIds" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkStrLit", + "strVal": "(" + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkOpr" + }, + { + "kind": "nkStrLit", + "strVal": "|" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "s" + }, + { + "kind": "nkIdent", + "ident": "owner" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "owner" + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkOpr" + }, + { + "kind": "nkStrLit", + "strVal": "." + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkOpenSymChoice" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "|...)" + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkStrLit", + "strVal": ")" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkPar" + }, + { + "kind": "nkIdent", + "ident": "nkClosure" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "glist" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkTupleConstr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "glist" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "sepAtEnd" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkExprColonExpr" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCurly" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "glist" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "tkCurlyLe" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkArgList" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "glist" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "tkInvalid" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkTableConstr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "glist" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "tkCurlyLe" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkCurlyLe" + }, + { + "kind": "nkStrLit", + "strVal": "{" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkCurlyRi" + }, + { + "kind": "nkStrLit", + "strVal": "}" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkBracket" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "glist" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "tkBracketLe" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkDotExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isCustomLit" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkCustomLit" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "strVal" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkDot" + }, + { + "kind": "nkStrLit", + "strVal": "." + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "assert" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "accentedName" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkBind" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkBind" + }, + { + "kind": "nkStrLit", + "strVal": "bind" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCheckedFieldExpr" + }, + { + "kind": "nkIdent", + "ident": "nkHiddenAddr" + }, + { + "kind": "nkIdent", + "ident": "nkHiddenDeref" + }, + { + "kind": "nkIdent", + "ident": "nkStringToCString" + }, + { + "kind": "nkIdent", + "ident": "nkCStringToString" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "renderIds" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkAddr" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkStrLit", + "strVal": "(" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "renderIds" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + }, + { + "kind": "nkStrLit", + "strVal": ")" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkLambda" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkProc" + }, + { + "kind": "nkStrLit", + "strVal": "proc" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "paramsPos" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "pragmasPos" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + }, + { + "kind": "nkStrLit", + "strVal": "=" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsubOptNL" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "bodyPos" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkDo" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkDo" + }, + { + "kind": "nkStrLit", + "strVal": " do" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO space here is ugly\", line: 1874, col: 33, offsetA: 48554, offsetB: 48579)" + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "paramsPos" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "doParamsAux" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "paramsPos" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "pragmasPos" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "bodyPos" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIdentDefs" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Skip if this is a property in a type and its not exported\", line: 1883, col: 4, offsetA: 48756, offsetB: 48815)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# (While also not allowing rendering of non exported fields)\", line: 1884, col: 4, offsetA: 48820, offsetB: 48880)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if ObjectDef in g.inside and (not n[0].isExported() and renderNonExportedFields notin g.flags):\", line: 1885, col: 4, offsetA: 48885, offsetB: 48982)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# return\", line: 1886, col: 4, offsetA: 48987, offsetB: 48997)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# We render the identDef without being inside the section incase we render something like\", line: 1887, col: 4, offsetA: 49002, offsetB: 49091)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# y: proc (x: string) # (We wouldn\\\'t want to check if x is exported)\", line: 1888, col: 4, offsetA: 49096, offsetB: 49164)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "outside" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ObjectDef" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIntLit", + "intVal": -3 + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentNL" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "referencesUsing" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "renderExpandUsing" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newSymNode" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "origUsingType" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + }, + { + "kind": "nkStrLit", + "strVal": "=" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 8, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO this is a hack to make `valueOr` in `let ... ` drop the `do` but\", line: 1900, col: 8, offsetA: 49617, offsetB: 49688)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 8, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# it is dubious if it is correct - there\\\'s a parsing ambiguity\", line: 1901, col: 8, offsetA: 49697, offsetB: 49764)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 8, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# in nkPar / nkCommand / nkCall that needs resolving\", line: 1902, col: 8, offsetA: 49773, offsetB: 49830)" + ], + "ident": "gsubOptNL" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "fromStmtList" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkConstDef" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIntLit", + "intVal": -3 + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + }, + { + "kind": "nkStrLit", + "strVal": "=" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsubOptNL" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkVarTuple" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "glist" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "theEnd" + }, + { + "kind": "nkIntLit", + "intVal": -2 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "glist" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "extra" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": " = " + } + ] + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "theEnd" + }, + { + "kind": "nkIntLit", + "intVal": -3 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + }, + { + "kind": "nkStrLit", + "strVal": "=" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsubOptNL" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkExprColonExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsubOptNL" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkInfix" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkOpr" + }, + { + "kind": "nkStrLit", + "strVal": "Too few children for nkInfix" + } + ] + }, + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "oldLineLen" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "lineLen" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# we cache this because lineLen gets updated below\", line: 1931, col: 31, offsetA: 50656, offsetB: 50706)" + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "infixArgument" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "spaces" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inImportLike" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkIdent" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "/" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "spaces" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# binary operator\", line: 1939, col: 18, offsetA: 50884, offsetB: 50901)" + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# e.g.: `n1 == n2` decompses as following sum:\", line: 1940, col: 4, offsetA: 50906, offsetB: 50952)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "false" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fits" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIdent", + "ident": "oldLineLen" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": " " + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "longIndentWid" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "spaces" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "IndentWidth" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "infixArgument" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "IndentWidth" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "lastSon" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "postExprBlocks" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 3 + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "postExprBlocks" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "inc" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "postStatements" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "fromStmtList" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkPrefix" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "opr" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkIdent" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkOpenSymChoice" + }, + { + "kind": "nkIdent", + "ident": "nkClosedSymChoice" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "sym" + } + ] + }, + { + "kind": "nkIdent", + "ident": "name" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "nNext" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "skipHiddenNodes" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "nNext" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkPrefix" + } + ] + }, + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "opr" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "phrenderer" + }, + { + "kind": "nkIdent", + "ident": "isKeyword" + } + ] + }, + { + "kind": "nkIdent", + "ident": "opr" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "nNext" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkInfix" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkStrLit", + "strVal": "(" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + }, + { + "kind": "nkStrLit", + "strVal": ")" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "lastSon" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "postExprBlocks" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "postExprBlocks" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "inc" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "postStatements" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIdent", + "ident": "fromStmtList" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkPostfix" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkRange" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkDotDot" + }, + { + "kind": "nkStrLit", + "strVal": ".." + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkDerefExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkOpr" + }, + { + "kind": "nkStrLit", + "strVal": "[]" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkAccQuoted" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkAccent" + }, + { + "kind": "nkStrLit", + "strVal": "`" + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "isAlpha" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIdent" + }, + { + "kind": "nkIdent", + "ident": "nkSym" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "tmp" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "getPIdent" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tmp" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "tmp" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 97 + }, + { + "kind": "nkCharLit", + "intVal": 122 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkCharLit", + "intVal": 65 + }, + { + "kind": "nkCharLit", + "intVal": 90 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "useSpace" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkIdent" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "=" + }, + { + "kind": "nkStrLit", + "strVal": "\'" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# handle `=destroy`, `\\\'big\\\'\", line: 2007, col: 29, offsetA: 52800, offsetB: 52827)" + ], + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "isAlpha" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "useSpace" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkIdent" + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "ident" + } + ] + }, + { + "kind": "nkIdent", + "ident": "s" + } + ] + }, + { + "kind": "nkStrLit", + "strVal": "=" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# handle setters, e.g. `foo=`\", line: 2010, col: 29, offsetA: 52951, offsetB: 52980)" + ], + "sons": [ + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "isAlpha" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "useSpace" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "useSpace" + }, + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "useSpace" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkAccent" + }, + { + "kind": "nkStrLit", + "strVal": "`" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIfExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkIf" + }, + { + "kind": "nkStrLit", + "strVal": "if" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcond" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "emptyContext" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkElifExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkElif" + }, + { + "kind": "nkStrLit", + "strVal": "elif" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcond" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkElseExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkElse" + }, + { + "kind": "nkStrLit", + "strVal": "else" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkTypeOfExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkType" + }, + { + "kind": "nkStrLit", + "strVal": "typeof" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkStrLit", + "strVal": "(" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + }, + { + "kind": "nkStrLit", + "strVal": ")" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkRefTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkRef" + }, + { + "kind": "nkStrLit", + "strVal": "ref" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkRef" + }, + { + "kind": "nkStrLit", + "strVal": "ref" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkPtrTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkPtr" + }, + { + "kind": "nkStrLit", + "strVal": "ptr" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkPtr" + }, + { + "kind": "nkStrLit", + "strVal": "ptr" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkVarTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkVar" + }, + { + "kind": "nkStrLit", + "strVal": "var" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkVar" + }, + { + "kind": "nkStrLit", + "strVal": "var" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkOutTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkOut" + }, + { + "kind": "nkStrLit", + "strVal": "out" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkOut" + }, + { + "kind": "nkStrLit", + "strVal": "out" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkDistinctTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkDistinct" + }, + { + "kind": "nkStrLit", + "strVal": "distinct" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkWith" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkStrLit", + "strVal": " with" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkStrLit", + "strVal": " without" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkDistinct" + }, + { + "kind": "nkStrLit", + "strVal": "distinct" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkTypeDef" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkPragmaExpr" + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# generate pragma after generic\", line: 2091, col: 6, offsetA: 54688, offsetB: 54719)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "postfix" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indentNL" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "postfix" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indentNL" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + }, + { + "kind": "nkStrLit", + "strVal": "=" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkObjectTy" + }, + { + "kind": "nkIdent", + "ident": "nkEnumTy" + }, + { + "kind": "nkIdent", + "ident": "nkRefTy" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsubOptNL" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "postfix" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "dedent" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkObjectTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkObject" + }, + { + "kind": "nkStrLit", + "strVal": "object" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inside" + } + ] + }, + { + "kind": "nkIdent", + "ident": "ObjectDef" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "withIndent" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "endSection" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkObject" + }, + { + "kind": "nkStrLit", + "strVal": "object" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkRecList" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "dedent" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkOfInherit" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkOf" + }, + { + "kind": "nkStrLit", + "strVal": "of" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkProcTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkProc" + }, + { + "kind": "nkStrLit", + "strVal": "proc" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkProc" + }, + { + "kind": "nkStrLit", + "strVal": "proc" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIteratorTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkIterator" + }, + { + "kind": "nkStrLit", + "strVal": "iterator" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkIterator" + }, + { + "kind": "nkStrLit", + "strVal": "iterator" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkStaticTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkStatic" + }, + { + "kind": "nkStrLit", + "strVal": "static" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkBracketLe" + }, + { + "kind": "nkStrLit", + "strVal": "[" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkBracketRi" + }, + { + "kind": "nkStrLit", + "strVal": "]" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkEnumTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkEnum" + }, + { + "kind": "nkStrLit", + "strVal": "enum" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "withIndent" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsonsNL" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "emptyContext" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# BUGFIX: comment for the last enum field\", line: 2169, col: 15, offsetA: 56391, offsetB: 56432)" + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "dedent" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "endSection" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkEnum" + }, + { + "kind": "nkStrLit", + "strVal": "enum" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkEnumFieldDef" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkEquals" + }, + { + "kind": "nkStrLit", + "strVal": "=" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkStmtList" + }, + { + "kind": "nkIdent", + "ident": "nkStmtListExpr" + }, + { + "kind": "nkIdent", + "ident": "nkStmtListType" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsubAddsPar" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkStrLit", + "strVal": "(" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + }, + { + "kind": "nkStrLit", + "strVal": ")" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "raiseAssert" + }, + { + "kind": "nkStrLit", + "strVal": "Handled above with gstmts" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIfStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkIf" + }, + { + "kind": "nkStrLit", + "strVal": "if" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gif" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkWhen" + }, + { + "kind": "nkIdent", + "ident": "nkRecWhen" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkWhen" + }, + { + "kind": "nkStrLit", + "strVal": "when" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gif" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkWhileStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gwhile" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkPragmaBlock" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gpragmaBlock" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCaseStmt" + }, + { + "kind": "nkIdent", + "ident": "nkRecCase" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcase" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkTryStmt" + }, + { + "kind": "nkIdent", + "ident": "nkHiddenTryStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gtry" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkForStmt" + }, + { + "kind": "nkIdent", + "ident": "nkParForStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gfor" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkBlockStmt" + }, + { + "kind": "nkIdent", + "ident": "nkBlockExpr" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gblock" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkStaticStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gstaticStmt" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkAsmStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gasm" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkProcDef" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "renderNoProcDefs" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkProc" + }, + { + "kind": "nkStrLit", + "strVal": "proc" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gproc" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "endSection" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkFuncDef" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "renderNoProcDefs" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkFunc" + }, + { + "kind": "nkStrLit", + "strVal": "func" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gproc" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "endSection" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkConverterDef" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "renderNoProcDefs" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkConverter" + }, + { + "kind": "nkStrLit", + "strVal": "converter" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gproc" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "endSection" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkMethodDef" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "renderNoProcDefs" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkMethod" + }, + { + "kind": "nkStrLit", + "strVal": "method" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gproc" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "endSection" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIteratorDef" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "renderNoProcDefs" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkIterator" + }, + { + "kind": "nkStrLit", + "strVal": "iterator" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gproc" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "endSection" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkMacroDef" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "renderNoProcDefs" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkMacro" + }, + { + "kind": "nkStrLit", + "strVal": "macro" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gproc" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "endSection" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkTemplateDef" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "renderNoProcDefs" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkTemplate" + }, + { + "kind": "nkStrLit", + "strVal": "template" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gproc" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "endSection" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkTypeSection" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsection" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "emptyContext" + }, + { + "kind": "nkIdent", + "ident": "tkType" + }, + { + "kind": "nkStrLit", + "strVal": "type" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "endSection" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkConstSection" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initContext" + }, + { + "kind": "nkIdent", + "ident": "a" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "incl" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + }, + { + "kind": "nkIdent", + "ident": "rfInConstExpr" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsection" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "tkConst" + }, + { + "kind": "nkStrLit", + "strVal": "const" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkVarSection" + }, + { + "kind": "nkIdent", + "ident": "nkLetSection" + }, + { + "kind": "nkIdent", + "ident": "nkUsingStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkVarSection" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkVar" + }, + { + "kind": "nkStrLit", + "strVal": "var" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkLetSection" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkLet" + }, + { + "kind": "nkStrLit", + "strVal": "let" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkUsing" + }, + { + "kind": "nkStrLit", + "strVal": "using" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "prefix" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "mid" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "prefix" + } + ] + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "i" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "dedent" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkReturnStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkReturn" + }, + { + "kind": "nkStrLit", + "strVal": "return" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "withIndent" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkAsgn" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkRaiseStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkRaise" + }, + { + "kind": "nkStrLit", + "strVal": "raise" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "withIndent" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkYieldStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkYield" + }, + { + "kind": "nkStrLit", + "strVal": "yield" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "withIndent" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkDiscardStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkDiscard" + }, + { + "kind": "nkStrLit", + "strVal": "discard" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "withIndent" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkBreakStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkBreak" + }, + { + "kind": "nkStrLit", + "strVal": "break" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "withIndent" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkContinueStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkContinue" + }, + { + "kind": "nkStrLit", + "strVal": "continue" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "withIndent" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkPragma" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "<=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inPragma" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "inc" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inPragma" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "glist" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "tkCurlyDotLe" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "emptyContext" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentNL" + }, + { + "kind": "nkIdent", + "ident": "longIndentWid" + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "dec" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inPragma" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "emptyContext" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkImportStmt" + }, + { + "kind": "nkIdent", + "ident": "nkExportStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inImportLike" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkImportStmt" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkImport" + }, + { + "kind": "nkStrLit", + "strVal": "import" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkExport" + }, + { + "kind": "nkStrLit", + "strVal": "export" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkLetSection", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Simple imports on single line\", line: 2330, col: 4, offsetA: 60180, offsetB: 60211)" + ], + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "isSimple" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "not" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fits" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "linelen" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcommaAux" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "indent" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "dedent" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inImportLike" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkImportExceptStmt" + }, + { + "kind": "nkIdent", + "ident": "nkExportExceptStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inImportLike" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkImportExceptStmt" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkImport" + }, + { + "kind": "nkStrLit", + "strVal": "import" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkExport" + }, + { + "kind": "nkStrLit", + "strVal": "export" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkExcept" + }, + { + "kind": "nkStrLit", + "strVal": "except" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcommaAux" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inImportLike" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkFromStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inImportLike" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkFrom" + }, + { + "kind": "nkStrLit", + "strVal": "from" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkImport" + }, + { + "kind": "nkStrLit", + "strVal": "import" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "emptyContext" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inImportLike" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkIncludeStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inImportLike" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkInclude" + }, + { + "kind": "nkStrLit", + "strVal": "include" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcommaAux" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "indent" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "dedent" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "inImportLike" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkCommentStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkOfBranch" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkOf" + }, + { + "kind": "nkStrLit", + "strVal": "of" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIntLit", + "intVal": -2 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gstmts" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lastSon" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkImportAs" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSpaces" + }, + { + "kind": "nkIdent", + "ident": "Space" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkAs" + }, + { + "kind": "nkStrLit", + "strVal": "as" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkBindStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkBind" + }, + { + "kind": "nkStrLit", + "strVal": "bind" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkMixinStmt" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkMixin" + }, + { + "kind": "nkStrLit", + "strVal": "mixin" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkElifBranch" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkElif" + }, + { + "kind": "nkStrLit", + "strVal": "elif" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcond" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gstmts" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkElse" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkElse" + }, + { + "kind": "nkStrLit", + "strVal": "else" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gmids" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gstmts" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkFinally" + }, + { + "kind": "nkIdent", + "ident": "nkDefer" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkFinally" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkFinally" + }, + { + "kind": "nkStrLit", + "strVal": "finally" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkDefer" + }, + { + "kind": "nkStrLit", + "strVal": "defer" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gstmts" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkExceptBranch" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "optNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkExcept" + }, + { + "kind": "nkStrLit", + "strVal": "except" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkExcept" + }, + { + "kind": "nkStrLit", + "strVal": "except" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcomma" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIntLit", + "intVal": -2 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gcoms" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gstmts" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lastSon" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkGenericParams" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "hasExplicitParams" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "gp" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "gp" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "notin" + }, + { + "kind": "nkIdent", + "ident": "tfImplicitTypeParam" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "p" + }, + { + "kind": "nkIdent", + "ident": "typ" + } + ] + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "hasExplicitParams" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "glist" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "tkBracketLe" + }, + { + "kind": "nkIdent", + "ident": "tkSemiColon" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentNL" + }, + { + "kind": "nkIdent", + "ident": "longIndentWid" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkFormalParams" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Need to add empty parens here, or nkProcTy parsing becomes non-equal -\", line: 2447, col: 4, offsetA: 62789, offsetB: 62861)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# see hasSignature - it would be nicer to remove them when unncessary\", line: 2448, col: 4, offsetA: 62866, offsetB: 62935)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "retExtra" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "len" + }, + { + "kind": "nkStrLit", + "strVal": ": " + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "lsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Semi-colon here is ugly but necessary for semantic equality, else we\", line: 2456, col: 6, offsetA: 63092, offsetB: 63162)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# get different groupings of nkIdentDefs and their descendants\", line: 2457, col: 6, offsetA: 63169, offsetB: 63231)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# TODO relaxing this to semantic equivalence would allow the use of `,`\", line: 2458, col: 6, offsetA: 63238, offsetB: 63309)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# sometimes - nobody really wants `;`\", line: 2459, col: 6, offsetA: 63316, offsetB: 63358)" + ], + "ident": "glist" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkIdent", + "ident": "tkSemiColon" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "extra" + }, + { + "kind": "nkIdent", + "ident": "retExtra" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "start" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentNL" + }, + { + "kind": "nkIdent", + "ident": "longIndentWid" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ">" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "len" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkIdent", + "ident": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsubOptNL" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentNL" + }, + { + "kind": "nkIdent", + "ident": "longIndentWid" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkTupleTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkTuple" + }, + { + "kind": "nkStrLit", + "strVal": "tuple" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "glist" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "tkBracketLe" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkTupleClassTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkTuple" + }, + { + "kind": "nkStrLit", + "strVal": "tuple" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkComesFrom" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParLe" + }, + { + "kind": "nkStrLit", + "strVal": "(ComesFrom|" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkParRi" + }, + { + "kind": "nkStrLit", + "strVal": ")" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkGotoState" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "initContext" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkStrLit", + "strVal": "goto" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkState" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIdent", + "ident": "TContext" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "initContext" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkStrLit", + "strVal": "state" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkColon" + }, + { + "kind": "nkStrLit", + "strVal": ":" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "indentNL" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "dedent" + }, + { + "kind": "nkIdent", + "ident": "g" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkBreakState" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "put" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkTuple" + }, + { + "kind": "nkStrLit", + "strVal": "breakstate" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkIdent", + "ident": "renderIds" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "flags" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsons" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "c" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkTypeClassTy" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gTypeClassTy" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkOfBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkError" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "putWithSpace" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "tkSymbol" + }, + { + "kind": "nkStrLit", + "strVal": "error" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#gcomma(g, n, c)\", line: 2507, col: 4, offsetA: 64387, offsetB: 64403)" + ], + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#nkNone, nkExplicitTypeListCall:\", line: 2510, col: 4, offsetA: 64437, offsetB: 64469)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "internalError" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "config" + } + ] + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "info" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "&" + }, + { + "kind": "nkStrLit", + "strVal": "renderer.gsub(" + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCharLit", + "intVal": 41 + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gpostfixes" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "renderTree" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "renderFlags" + }, + { + "kind": "nkIdent", + "ident": "TRenderFlags" + }, + { + "kind": "nkCurly" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkIdent", + "ident": "ConfigRef" + }, + { + "kind": "nkNilLit" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkStrLit", + "strVal": "" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "TSrcGen" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "initSrcGen" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "renderFlags" + }, + { + "kind": "nkIfExpr", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "==" + }, + { + "kind": "nkIdent", + "ident": "conf" + }, + { + "kind": "nkNilLit" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "newPartialConfigRef" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "conf" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# do not indent the initial statement list so that\", line: 2531, col: 2, offsetA: 64830, offsetB: 64880)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# writeFile(\\\"file.nim\\\", repr n)\", line: 2532, col: 2, offsetA: 64883, offsetB: 64914)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# produces working Nim code:\", line: 2533, col: 2, offsetA: 64917, offsetB: 64945)" + ], + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "in" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "kind" + } + ] + }, + { + "kind": "nkCurly", + "sons": [ + { + "kind": "nkIdent", + "ident": "nkStmtList" + }, + { + "kind": "nkIdent", + "ident": "nkStmtListExpr" + }, + { + "kind": "nkIdent", + "ident": "nkStmtListType" + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gstmts" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "emptyContext" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "doIndent" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "gsub" + }, + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "n" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "g" + }, + { + "kind": "nkIdent", + "ident": "buf" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "PNode" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "n" + }, + { + "kind": "nkIdent", + "ident": "renderTree" + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/after/comments b/tests/after/comments new file mode 100755 index 0000000000000000000000000000000000000000..66b524b67f64865d52f25799541f24169a5e0153 GIT binary patch literal 85536 zcmc${34B~t^#}gag~rm7u$O&UiUqo)dka*iv;$K~AwY{D0!`brjigD)(hbt4roj$r zU_j6+DnU_;7L3XgK+3d06R^Sn{ve3U2q-TmXi%ULf%$*G=iIkVGA-)=&p&+Vn|IGW z=bn4Ed+zey+Yl){Z%|H-<@^n@K4cPO=U_ts(f| zsTVfCoa>4~0OHTN=IX6A7+2zLGw^ML!nosom>26<`PaKTt@Aq6!1NL}cX}Q3f!;b- zD_`%4M_&6r()+%Vv*m|#4U-}KwVJDgNA`%9`!S)o9;A5AHA%wwbFNPR*f;*)VfxoG zD2zMahk3CIx!%&YjvdPmSlY55#a{70PX)haIuIaaXHH0RVl`ft(WkT7~ab>0D zwQI($nK5nLv?=4OE5=Wf8ssH}|7jcNU%1d3RBt6%X4HdgPT-y}_JwfP=O0yXnwP#E zX37Y!{le0ms}ge$efY4yzIDVm|25_pb&t0aC)*$C9x?#%tSsf>Eam5CDZemFIeRit zyI;&wUYwYC!Jnrl`TmzG=S7tT9(&NY+9Po82CL>rlARo5&nsj6~elg3ZAR<10rv{u%Z z^RjGpRcTF$wQN~gZS@MPWKC&}wX$Sobx92ntIA5sdAFo;t&2Z#id9uyT3upQmo6_a zF0-zgw_yG?RVB+yt7}TC7R;YhR#9HEpm=dvi9*o!fUs+pudFCHyk8^zqW$IJ{~Y`; ze#sxkELlGDA5932gJ7%v|Axq&)WokG{C_-d9AACl)~|!qAnQ<5R(o{mXK3vc%>C^G zA7WJ~0r|HxPvuM=lm!K*eB}rE>N|R&|B+AkFJI{}UZ7F;FV|O2nDdwKD|dAa;3!`? zeb@O5`O5v{!Wdt<$k8Aa_{tq$CuoMR+!+E`9`=4=2+3jM9rXdGTQJ|?vqk0J#`(5)1z;|zj6GfNAsTEW_6{~_#0itdy2d(DfeII zJz4Ea$o*p8lf|x9x&I>XDUz-hxxa+>6h&8D?my3ailD1r?$6~tMc!2@_h<5+qV8HG z_mg-}Rdp5Np8c8l_Pp2&S4U&7M;qSkEm{znn3(uXw0YL5$1E#-_}7NzSnnfL)%z`BKgb{EJ&x8#r<{jP6%5&r2fXg$tBhs-TAk3qC5Kr zM{{;ZU--D@V3)!$Lm?BN{MOGZK_9HzLl;J4f40}57rTdEijthGp6u5i>v!M8iqKkq zG*;IaZBK;%FP&Z*Z6d3+Bce@_zGdy7J`HG0~vXl!Ah z2#M@DyeJlAaM)-?Ph1X}M01kS7o3YYAeXLy`hYBSWk!9OoDh|2#kTDRxD?VkOSM0cn})irR^FyR0E3u+R7Mj_9dO^VMk(5)h_<)xU|=J`H$f1z zY!uqKrih$UWM!iXWl&>7U*7722>cU(XgH_)JZLhKc$0Ot&Lcv+!Op*K=p!fv`CVXp z8?_eeXh`L3O4JOq^BbYDvmv`}f<*;K5`R%5Tcb_+c@IU>(Wd#SXzV#~_q!{EdT-uC zR^CGi*bAKh*WIoMccK9NEZ$CK@8@gWr{*{ zr~>x}-39C7C+J2vdSa4ROxq)MwAOBa=>lO4_eEn+RuGN75{>P)M_)I_yr zQW*Id9Df{SM4)4p5yyf}XY5Bl61C7ypq6&~5UQNE?+C)R`Gy{v52Re%0y7jd>Q-fU z^ky}qi#`N72%b{}klluEBQ6wkR76!YCRV(ahG1ebRYqDI?HaISw_t$o*~4v_!Ja--Gc%4H}{{R zjqK*W`wRb@xvz|hC?M~Exlg;izqyYQMzWdvEM+94GxoC|d~$Q&m;C-sw^6bB<@Y9v zGn&i{7uSJ@Dd?D=nQE*zAr#aWyiz5tfo0pjoL z(Zh>;g!*>R9h7S*XCVRi@srq25=c50(#04%e8IAS&I9jDAy{_8qjhL+!fy^bQeAxa zNAIabgWXoYjWO`>|M}{}>g{(1oD}?gih0moHwDaM|9Q|Nu-7JePz)n+Y<>$w(GhJA zOQ^hDuLFe26BwTm_9U%fsN_(o(Q+&zp+;|{Y7k@#GMzvW4=8E4J**Dt@f#XGdojMQ z4FRb)`Y2l9--aCkfq1+9TrDa-DiuYcVEbj3KT-oYc$q>_LtUS>W+W&GOEV*VHyrES zG#9B!E7pD2K~fcfZ9__PBrvVf<|!QD z(5l4oKBjlgQ5t*;bBNgU_721zdl^Oo$C8ZA?LRTx*h39OV~@{(Jfg7&3wUX7T!Txe zYG||3R6Xi3QH-N{b0g;@6i^jgj>!$YpgmI0g_CGgqtH>U)t}9x_DHWt09DT6J%qU= z@5V1;!bGgFU_r^69oElw?swXQqK`iL-k2}lvg^Gu(Y>!nW63DX4C!;F9&CZdsX-!{ z!#Ji|{K*msh?(PQ$!Ja@IxD@wvQ`bZzk?}a*L#?pLByW~Hz%0Vc{4xbKO zSZ|(JZ`rJNYZVMfYvnzW*wId&po?i_-~_Mc*67x}hwAH@n>5dFl~9%Q?B+r2#$2En zM}j{z*nw22krPaRv>R^kSPRlmQCUq2rClFoZd?gGSdLoXMXkJtBYzM+j}%$B9Nx|f zb*%8j!aq2qmb{qv&~4;$^MawAGSx>im>cAG@y5&hF?S-F`>Zmj&`59Bog9uy4OxX) z+hj@gb8goXj6y;Zc{ypo5fd=P zB*_+LCwmvkZr0fcRu~dFQD_imcr-}Jy(^wt*1XzRGn@M613$a^xE>HxUwSnN4;8|V z0(I2K8&`erm$Cos$i}*)ut@nNUG`ok{0Zr(QfXS4jBeaT)#W{Oh@(BOcxLAB2*QRqFLH>qjbeLeM0));Ao;j&I1iD;X&5TEiIF#B=H1k&0j=GxVA_H) z*PGSYXQRl8lo`|YH#F#VW*?sF`w;QI;pCDS8@?bC5kql?jk^hkf%w|&0NQ`u<_I7| zESg84$t7&Ep{~_hTZ!W2Qr@=VAO6)xXGU5v5k+|kZox(?qhZqi@D~&~v~>4K#(ud`jnb0qnaC4D_0Y&P5ycadasLDU4i*3WFO0PWea+BY*Z-lqAIz-#u}{#Rha79Fv8S;~;n(%Yf3 zdd0CF&f_j!g-Dy}w7pxR2f+(dsA9YM+bWfT&*7Xl8hV5^qG$4!k&Pdf!JW=~`hW>> z?=KrirZr?V*CUawVl_~IdrN|q=)zV|qW5%!Ur-Z>>U97UIIBLW`b9%<-%uB~Y7Ym2 z(wH@_ixmZDygXXig5wRt$21Aln+mc#Ifxo!b2y zK!)#cU<<1s4lcJv_a-$9Yvm#rShjzq7L;kNX2tYjBc4Q7@f?dR&hHt;9N8G}WP~#- zrpW);)-{=JRf;OwBiqh;F-)wsBE7cK0^#Bb&}xpf(8V9X91k^GZw5r<-4xDM0c2!M zbjW;Hy2I^TDlt+P2sZ@5U_s?;pdw~63T84e8CbcWOq6809JDcFT`q`5Rs>jX_y(UQy`b+`WthB#*1AfC!P67n2wndrbXwk_|Q4hXls87w9#0myMg@E`z8Og z>t!Wg#CEqs8uEzFYRy9$|J?-Ev+RE(-3cs~FM?jSf$z2#wSf-9e*zMvPS6kN1cGk2 zi_m~8A$Z?G8ru*}+U>v5ce(V7@_a4FD2K+?qY?+BYwJm55Oxn15Pr9ZL+pBYVZ3{uaC*9nk6j6NqUn-RPM^>4V57Lb z!TACzgwc>x4EcII)~VYb9>o^O#5k`k#4`J5*|X%gjjd)M7KW}Bs;(>SYa=bnjJm&1 zm{8Jd+RE;B-&`|5TS&F@9!i328?ph|j96}RCEcc>uGgwL4}DISs~4#uGgUvDrPs35 z4~2<$f0hbJR=5ZjNp}B2N@aJ@L>7A;^6Wrw7KsCLy9Q49f%aw}PWUTKpq!1q>$SNS zZ0CMP$8Gqcq_r>l-0=q1l1^QWCK7c9X>^)DVzLyJSg(Z`u=);AO1;sBU0BLGj54wt zQs-cX{nB5tc7u&Om`~mvj3(V9*}p_Rkjaw$T}(Ry!KFxoKBCv)--Ic%eFVpUt`e!b z7SXO8wSl7%3?lYy5Dy4Wi5oK*x!(qELjy)|$$T2Klef#PtKFWb2`iKhn`n-=z{>Hn z*X+bx1c5SsKK5R=E*`yK4)T2*+~ahw$ubhXUE=eV8T6m3kJW7ft6NW1^4pA^x6lU> zo?F3Xb0p57_cKflQ8Psdu8t%T7UjO>C%A5`+mcRO*6IsUq0;~m;kCkcQvsLNoRn$> z|HDq?07^OuCkfGoq zZL!CepK7@s+tn1=5_{n#JC?u#OE?+Eiro$|NiG^<1=2qKT``N4J5&@oHaB*^3faIV zV@%Q9-S27t1TpyW9&Nr2QmyqoDfw$H?rpG#G99N&e8A<*20H{^m^mh&GgVLqM~d{? zH<2WJ=AZI~{lnRr%I7|YvsbD`vZ*#Do`U$ex5_=)~(qE#nf9!qnL@uBv zFhm`WM!ghekw3!B(bo16VM?{N#Gkdb79Gah?Qg3jQaZ!JLamyB&2CcffAQ+OBMgx_ z!r*#I$Qxl2Z+UfPvz?<6>xN8S8Mbu%P1stO3q~-v7mzCg+{##+`y2ThPHgIq}y|)(S#j<5x^0e^ivd z=un&lgCUvK>?X{kV4TfGLqzWykOxzEXr|lXrW98@wQ&~-G|i0rCHP?Kh1 zwACAK+6+@mI7Ax{h*2Zlf2pYgE6JNQ(6u_l4NWE4#6n!RD6rQXb};eburq}|-iu-9 zQPi;LXtJHa>FG|9su`zFd`Cn>oY;sYQ^%u`N_(d727~<%Kvk8(Qy=9;-kwt4ya6cj zckyH|H?MU4${e(~dcVFkQX5H3q`^2bT1;Q|i&~64<7PgfdRO3|vVf(Z(wTHh$ z^hl&J?EYPkli<))Br%2bCF;oVav&EV7#w<$z*0)@{>?8XcqUeD9Co~M5w6{C|GHCj z%Qk_nQQr-=ipd2V2fLvzWz{f6O%a)!pcp~BhwAcA6W3-4c>(dt-6_6aTj*<#yeq;- z!a>{`6vra(dde(7Bb_Tvw5-=_iWnFNd(mIB+IKIecBq+}07$fH=+l3~1qm+>hzxxM zztc1m!V47sHp+IqPikm$H2DQ=B4AIz04)3CSJG*7md!P$q5p^4;ANCvlc<+5eI2bl zfGac(W4f7FBo?z}fbW35AaiCM34|30y4uZZrlNi;u)nAo&VYw>-%X>g&>0 z?MUWwX)Qocm~W}#IgLu*N-}#8Y^ddf-Ud0S%~hB7z&QRbrWe^W=WA99_pVDE0*SDZ z!+AAnQ%XmLKKt$-Y0Ptvuz!&ImNvGJLGB;evH7bHwH#q-q)wpxa<{+MBG*@uW&c2#*~b`IqRcq@ON79bD1(mIRKJ3ZVJPsl z!W|+Pg7KN7(Or@w`&5+I_z={CP9{ccCtVCpdlILz7&1UD3V7QN9yq35p6!gi(h661 z;=%(+on}b6b?eMfb9zP_?Us#o0JeTcCM2B8VS=Es86bKr7CqEu65}$UF~$_P6HVb< z&B|!MiSZeAWeV=rJp(C0ET8ozWY&}Ia#$XVny$513uC|*OP98;$1o}}5Kd4-Fvq#t8-SIp<*gSw z+jbODqEOxS;7@$oiJz#v%Jex;rl756ngz?HM3SpBq0C)IBneuhAf(>l3o@aXkLk*A zyncOuc)xwGEfwyQ4W?;#i05WB=0mzEz%!Ii_cxiEfpNW23;U1fLz48)hS$&WXRH{z z;jueEI3W5N4(dAeqoej^w%>ItUDq|k>@WB0zCTIpp+Bj#zs{8cv>4GU0C`-T$1=~_fFgqiQ)P~WDLIJKZokhtGh+*>Hg9eLcc8*s zc#oWGdWPQfm%pGI#$|V$2t(u@&T?CaihCcSdpfo%!A_m9E32-1xytp3p_tIinbt~Vw=&W_Z4lg@Wo-^^Puo2Se_(In(}Gcxe; z6X3ukGG`Yb(i~oS)6>t!o>n#xd;D_AJ&>Bs z>6CW+h!Whk3w*vhU& z{;{~3G;)ax1ncw+DZP}Xl1*(I&YxPkKz>Hlb!4Z`B+7CE_c&w`#)E8JQwHfWAZb2; zvDjfxhKOsBa|I5Ly1DSL6ynd>@){+KDkGN*&5uF%kJL_zR{j24r1nQ7d4H5eH)MKw z4t|Hs;p9x~5sJf1q&hOS_bWn0$BRTzJs(;KZI zN4B2(56fR3Jr3(9lC;98Pv7k}G2^?ARK~3BQ#( zn?;z-un2^Gk!Oi#dMn*lXw0B;&iYFY1LXo5Q2j4*sEkEgOw9_Z$t=-t;9FoLnToE| zn&_0j=3>;eU-+XJ1v5?_y{)6vK320wFA^~%55)8i;z*|1j+cP6VS6_${=)e*1|LZ= znGhuL5FwPk7s{4%fSP_aSEBZy-e}&>4#ENmrX6^GWpFe$d~;+k^u1U0J)Gz{K<^$L z@4m@CIKY3{KceTn940sW7|~0v5q?t#&=R?1+Z10Da(>p!ylm#KXkH<_oJVOChztNv zu9^B;=?ppu<0&f<&0hD1tYRIZZ0%!O{oK{UR`Q!LjP?izW3;wVWu)m`MF$rRKC}hNytzoXsM-?bOi;pUL2Cm|g=&C!dL zqT+j6QK9O4I2FR(L8?y}-VUz1kByV;`^vK)`Yhbg{^sxeJQu<4&|A#IFbA8tU&+7y zB~@^4HoqCVRk~n7+!Q3erxiU%Dct1}2)A|ker%Cr|o`hox``EqtCd$>@(G}D` zAjQz`Idxv+%Q6;3TJKZ}s3kijt>4yr+t_9b{IuTXwt_ty+{+1PuBJ7G^RXhaHLr1n zq4qtkxfN>}qWv>C2GbtUH?Bw_%e?B{M7o_(7cNv*$% zr4MLn3R=iRP8`jP?!v@!2v*9Url_PjNh@sQDhHwaM10UCS5$ynDNR05tEiys`@p31 zTOZC|iQqOD43^{wMD3SZ{)m=;a;6S7OmV3W%-ERu<;uDYh&?7{GNXdz#6_OQhE(^7 z@$Tb=$sJmuQxLVnk2wxq*1bUBPb*Q_v8t%{IP$n#u~15d2-!X)FWn)*>G0#o)J1CC zg!4G|F|YcqH4rh1_Zu-Pu0Rjr+T-K^N5JtvBJmwqkqu7V+QhZZ5=-fR-TNSIz+GY~ zkV7AJ+pN5s<1`3(@I-BU8@dkS(y`tufXwc~B*kd8YOZ1J$-MRE!3du1_Q?pEsE%lC z7RotNU6j-Tm2M^z->10L3JO!Sy;fg)PcX<$jCYTxw3Aca7O9%#wEp#PVSOyb+(nXz zN$xZ{gkS-q^{tMZ!;m<)HG)T$aD02`BA&0}Nb$V=eGrn4ej*}9I&lQ4en^YZ@;0#B zcAe^^!<@8Auu+64B<%=MBCd5`5D_L0BRfr)6k@P@gw>+gCI$zNprI@IzLRqc=i$g3 zlW<@G1lRuSIb8pH0U~B7*`{-aNaFATC?D2KujQI8}EF1E>Y zIDG>=hx71k;7mYWXJlqa@?ituMyyEA!s;Lm5KMz-xq2Xc&!Q_uYFvsiD@|+mE4{NX z17l$DShtUo6{CfLpPc=Y+6qyQR}?gcK8mAD1_9I}@J&VhfBxj`ZRbO1fhT8Q`;A{9 zMGy$QP)G0mAKII+P=xXS*`d8R&I7x?Lwg(HaQzSMeYpZ$s7%{b|4{VcK)?Da`UazD zbHFqK)nvHIr3;X}zVo8-HK^}GM}6G2#)8jk>hvNO;yOvM9h;S|Ym@FtgZse`nCyk3 zVTm%NCyES`FwqogfdPkPzmpSLx)|*^{Q`b_ho>2LKKqhiXNw%yPw&@wH(UyC1Lq&u zKd?VV`$iMgP>^|uHV_Ji*`JRP?yfK=FzkE1E%izYI2uWNKiN@gT_`ljL+EX?Q7$LV|Hc&NxiIIfz?M+<$Ab zzu99aN_KV#J1XX;<^oFF>AnoI&Bz+ij%TiUjrWlfP`TmhP(z@@LdMN^7*N6o!gzkl zN7Ra}E<|H@tkFg)b<~3m$O5Esq1K&51@$xZ+Lo`1PvMrs6slXU3!cm2noD{*&U6xQ zm%%eG*y(eCz=)+!^aX~)^Uj5w^w7W^Tpk74PD&C~pOn@eD+mv$vH_mtdly4mR~0k% zraR<0Ki3w*r24G(i9EXIc^+#6rsfF-AX>j|x-97lCx@kh4bv=%BR0WqQPX%#grG!9cn*S;^M#@w2P z5yu~-gCqNOurXpRW(8 zil}KIqF3ScZ-8j+kyx?rdVuEEb-x&$bM()i_{{$7E~XIy=6BnE&94TNIs1?f(L^tM zegc>@Cte&AoGIGWLoZl%Hph|_y% zj`7XWQSj+{A*=J^tGJ~^5-K>2a{=={1&b~~@Lmj+*LWQ(18KC6G_*@YyuyIwxJ{GE zEZXhINF->8Hi*&?Q>64+gO*{41ID>OKPR+c1YVpQqxg;?Vj&4ur%dt?k9qTp6S;iS z_Pzau(nbwW+JSAp+EwIJ5B~UtNq;~{lSPJn*?x2N!RGo$L_G#{hmo{Fmq79;b>WwE z?ZJ$Q-wGP%?Rfmtn^)%}BK83ZuWWPPeztL!yYBIdeIeG*2dK@(oJTR9X8~bI_JIn} z1{|ywr?Kmj`5O*GbGU7{ccE7ILOLen0Q@e}xdVA7f^@qb1_>xvSj&6Z!iyu`M?KjI z&U<*_`$|F<50229GzXiQWo+Bys|by^IrHSZ)Y&>s?wMq>SaM0BP4jTuu=7Og$sdys z+4|Z2L_U7oYo9g@VTDEpC9XfQ5)K!4}t5*@KXt}7sXD8&BY zDZkVff$?o%yalLj_bKBY*(bplVxDLBJn1r-!16Yk+y8ubhxQD?8Ub4adt#9yYkM-^ zrF+(lCBb6COj(R$HN~EO5kI_at#%A7kCidum&$k(U_Rbr0h4BR5zUq8Giup`1Kkdz z+a18{{JD17Hp^ov5TdSnLC>5fy%N(;)J&bOZFI=061W`C!m<8Bn8iYlvM8V6l(&be zS9!G@iVNIg77E#kZjpJa@{5qJV^~?<_`)Rc5n)^cvZ_nmom9boJ=u2;Uwji2ID0z$ z0CG>79n!NAZ{*?8>`#Rv?B)A1|K+g5uJ}+;)`&>)CD@*!c%uGfl8_{CvS-9BRTw*o zQ1hypvk<0lkw+;MHXFR48ZphZix!d)_RO=b3HRC7Xzsw}pnk^;P%!DvTY6SI=}Sz0 zJ;dczh9Yf|yy_f-hMBRtNi|_S;a!sdJ+K%uoS_nE_N_ z2UKtYsRvX5|B1BuMU8Xt=JDd73cT_R6?E&6>{r43!7i^^RABd0L6IocZ;8Lh;#$`M zB&AbChLeB_F3jwWuE;bbM(yBBs2RVPGlpTP^hs}ZhVm|~J17`ZYx+SIJ(BPR$D$J_0< zHG}j^{kO^-`CJ$5qht7~%%{!!&9H~t%Mq!%;=-fz`j=GKUpeYSjxC_;SfR?%dAdwY zkHRy?i|{!L;_J+7e%M1PNzp9Kg#p2#NqMBcgPDv* z{o^@fRk3F2a%aCThx-{?4dQjzca(R9MmoEupqk_BU&!R!aK%kahrv+;tzd92?V0p2 zdpKI^o`z1w9YpMOnhwZeAVUr&OeIf4_uP{#_L#@L5u>5!KN#BTvBwYPeX^l#9jAK# z+t9Y*mmZ^LXls`cdqHQI*28hl3}#&Jg5WWji2;GnW^-h)-G1h5jAzRqW2{HWZjRLN zxSTqITvoHNT?RfmLrs|D@u%Y?oq=tn+5~3sZs`NepVQ_w$`f5ms=-ue3*Ugj8!9}x zCyq%zqeJC238?Wc&Sn*nPdQ;Cl$7H+d7D~sOUq&3nn@FxpBl%tiQo!Z6gB(?GTiPO z2U9c$(vkV82hQA;cgu}zTxs5-42>9Fz#YX$FI%X87{jA`@#OBy(VhP~CmO?1`d++Z zZQzFc`#>cd)>&{Pp^xUX!I?>%{n;h2hhSq}ucFZD+Sing!<3CS2#kLxV0_EFh4B_f zBpEi13AYaSw^Je}Nf)t7FB%gY_#~=b&x(@O;YrjZ;$8)B{kBiLgak2j<5FEQ;BenW z=GJ|x>ukQgOSe;=gS9{6*=xGD8eKMKCxq{7+UjnmZ`F`d6iy5GO@xvnLUN-g;8iV)! zQV+**c`W%G={mN(b^g4bFMde=pHm3u-2_c{-Hjf`yYA$_gue>7SqO0uGnYV)XT7A- z*#_bT{ztmeJ$E&v_I%cq+=tUX|IE9UVg&FtA+r!m&AwprzaE76$7kV8|KUN1 z`$KdFswlX|c73Blk%5YKT! zO?U_%!wPfWg|_O6DH`VBGk3{*MxaG75Y9C(2Fl|gswZJUf~+YPqMD;P_mMudEoU_{ z-r3)Q_>e$zZRls8^s}L^1E+`%r1yATZ^N3`6EqC_1oV#v?hFzg(Y&8V5`jS0=?`SX z?NwM8?|Mo^xUkbfhIvwxCpc+V0=$`rR`oJ*z{Lx^R?`cLk#%O16nX7R7 zJV!Ll9!X5Tek{{>sQV1IQ3a=|`n{?-V*5ujcV+Q;`{GwkoTEt2igeb6K(Z4rsf4WX zR2_|w$JgbY?shCuF?M~zHUqDRz5*!@`yD{8gq*j6VNVNqFI@fxb`{0#_Rd04VPDrX zuv)Vh&xZ_nPITX9_S=)8DJEK|Yf`z4r3;?e_0%)m-bM_0`5G2xRH+Ra3WY!UF;)>{ zg0_*MDN}Tb0nBvPv8ZScii1YG-F1QV%k{N*=A@qEhQFx;*_3g$UbNB{J#m*~cyT1F z0gr19;y#b1rLN8DaR5bZ2a!t&L5tny#~fzg0nBc`5+?<0NK(e!UgKT|{Y(@JGZDA4 zmw{od7ivw|coSllI^vtHQnM2^JNubHSX_;((lNT`{DjZ#68Re-QWQ7MPb#u3uz!W4 zJxr?G!o&lm5IP=+PpIP$y=l#I*LLW>KRg}fq%A%`~4mdzisOU_-&zaXD zxO5kSxb4I+djQ4HJsP!;L`(Q~1hn$YePN~`2ypCT|Yn=gT+100;{&zn1e13ngbLW&b8U! z`Qdh52o`k>sDS6qSXLBPnuIYU>gs<91ASdHr7gE{4aP`PxNE_`C-gOnDWB=2=pog7 zzZrJHKLK;~LFQ5zH@bEW7Ut?9=T3~V(Y*P)K#fKO4$wNS6o2MRC3%}(gcqBp8Yy3n zeF6RJHm%PDhTE&z&`-tvWv9|{tIQEl=I22k&n9Y(pehu><7B9)l1)3J@m}cu(UGVw z3!@E>Q`VML7OD5IoMh!uq>W^kopk6LJ*mb0^C$pfh=IBaO|NUy%7|c+Pl#cjcAuz$ zNkppwLx9YP1Uy{9t&ZqssOUt5{*ct~Fwii2CWr1C@WwR_6Fl{I|1N!W1nNd%Xi`@m z`(c2TU~v3TfX=Wh&I~)pPsWA>BoKG_a#WhC9M(O&>mGo-@9hk5tmr$(L4@l?J#wrl zt7b1J?*XG&Ow>7oYSzXh+cLQb8dgz18po4HS~PbDp;?=c_CtMxBaMy|&KhJ3QmAc~ zj7{4Hu&uif2gYq|tf6inFY#Z8YTe}s8ft$bC@zcr6|v@A7|d2Rm}aRb)9Ko6;(&1P zw8jUHXV z9ZutC{>X2OnXg~n=I_}s`w9+y++#*LUS_sA4t+Xv7w4mA=94}=BPqQ*S>6ODD>!{d zk!cL)9$FD>fU&6Krp_>X*qQyU!%t&kh#ES@bB0Mw(yt$caz1|Qy?B~Y#U6sriA203 zvkgzxqdkm$IH)A&gpf%%6y^0zheR79y*YsOsXg{}zZDl6NHvXl0ux<>-SMqIwX=Y) zan#dJFZFsXSU|N_nXu_|jno+0mmqg9P9$_sBW*(uHp~yOK$TFH*P4yzh{zA{#0_@p z=~8q7ERyBCP4}y9Bt_{B2f*cMjE<%)$*UOUXvTc44^Huu2s3qO_)!vMP=CIC;`jYVQi;xNWk2rTZ$H*z_GKUWJ>l&?`G%nBr?WWWeM7M8UZF*U z1lNcT5K@Xs1B7Gx2{mCz{(tEkf_t!H_sPE@xK&@56I@Mw^X`n-dKN%_V7@jLOKy(* zPI@BV#z2D?oE?_;&_b4`G!n^6`DEz;oyM9%EZ_f7XDQs*|4?Tw2M$<3yZt%5wkR-i zz$DERV|w;7W<;9Sg&F4+b-gnk&Igv}x$%+hGH!eS)5J zJN#tcdv!mqulv}lnIv^-IPLZ}~BB^b3p056|ix>*bLHHaQ-GFbPN3-yujwS> zpfr6a^Di{5Du5i@?a#ojL?4I zJD^T6n=C_C?4JmOYx}%|P?r&ra%i{e@g-pW8P1>eYM8xp9vf-_>)TK@g~oBRC6YMG z^ty=knj>He`{Ux`c+ICPWemQti$g9Q1R`M;&CPC`3JQ<#_EC0ZhcpNxKW1)540!?r z7?O=KSg?R*pf7i@-jl~kj;;v+WIhDzP{P<9NcXwxxrQdf%!i{onBbqYTA*)s_HA0_ zHR>}c9#+g-Wy2y&MkWD;`Ps!QwiAujFGD=7w!Ud?Rd9x z0OBM?-g?G3u+@Ftz_sb}%~jyUoc_Kf7m+xZ+eCQ$cjBE0HqW9zae0m??vgNyg3|bB z7L_`|Unk}|y*CW+x)n%zI7i%0B+*F|9BzxxCE+!_sGsy!i_9W0X=G{;KIGTO%8?*G zQ8m~yum-mVG0q}}PVtdF8x3xC^G8oqgAPE&mmzgy?QpV8X5vB8sS&`qM|Evd#Y}VB z?8g{p-w%xLT6BIhIpJsgHV?qbnxUw55#1fMVMu(YL|!%Hx{A(K-sCY7nFkm%;jA*# zv^u~+_mJ*E-In9)a%`aQzX_eM9fkO~cB`~HQ0P4HGh*x1E<L<8XhOUwRSetpE6mzoq8tBc#?uC*id+@%v~|!)2m+Q`3QtFz!+~~0Si02_+~?P zy2Z4;&0HDeIf899*Lri^ELXEa2%_un5cc7G7~uS)hIyvOe9aFv7idj*hHMsjLdt8L zCT=Q+JGh4gZ#t9=@4%5sFj@}`*!9S7&B1Nc;dk@$^V|q>bgt?R9-}kO{dsf$HK=Wr^)0svy%bCla`7c)d5vvm zY-6<*TFtRozi-J2HCcphw`Xg$1gLdnP^(lIOraR7ja(>^6~~6e38X(|f_P#p5ZmC1 z@pHrzZ{_Mh#$^9?uu*}nV7gMsl$_T8UG zdL|j<{4JkUA!??Iq2FoRU%TC=QY$3ynw9ZF?5wVQFT%``oXOclF^UFzH&nZQK zVA&vYG4FB3z|3o#dAiFfS6&%<4hYQM)imw|o?%}~o2 zsNEp_9LG0Zp37vzw|)!5(3t+Aiolh(-FmaQxF_^Q|K;jHA0~YE*PDf#fl}NtSc3qg z9AKE@S_gZp1Hb<-QruCmlJEaA#gztOF`NjcCW4gk-8b93P!a3%xFClJIioA1w;lWZU$ zg!*>R9h6J4kmA53GCFW3Nnjnw?SOBWN0{fzGTc)42xLWh25R@A4JJx33GBk)E6M&6 z^W7tL#($y#Y|r)Obaw=|9>Wj~2H@HRsCV|Lci4S;O+ii!e7z8tNs8+Z#BYQLeDVh! zbkbkR;XZ;v*n4jBEE2DR#$bl^s>^wTJN94^F7_W|{2jrBp|KM8?t$|jmg5mQsp_ry zp)JYcc1K>}mOQrXxZLy#($81)oVI-3;u?8@@hh5_8o*~E8$V1IHl1Qx+koobFOmfWs!hVCkl{uu;JYL3>@_lb_PQOtZuj+i zgY>#xdu;$G2`Sl9@b}u+>QC4mx-FTF%ayI`t|>W*gI%m=K`*aS*NN_s3fhhta9+XY2%d0LfWh>)@*Wq;4QFy@8zJEPf-~}8 zSknb(AIQazvr}<|4fJ`_8pz5!d&Lw>{!rYG7aA4Q1kafIkxi%7z@+-26J#v=z<#YY|@*Y>~gRSNVTeTr= zhfP;`^-A_sCHvWaWWP(Y@(i(XGzfpPDoo}clCzQju0zApkt_#1|W1NX|6sIG58wgNkn?gr*I(;?4NUi zvuWg-DQxZVwQ}(*Jjua|p1HCur|W%a!54`!OQ z5wz>%f=HtafvZV4N{;(>oMaG2E5aF*1!1gQT!iz0;O*r|Ad_CTpjSSoiog{76FXQ4 z(eBpqcQ#Q-_=^07Qv>CVEYFw`cTE=SG^2}-SCoC`_>VXS3AnomH)77-#Q_Oja!&{c z7wQv1j0MENgq|4tJRy8cFDibA6`cbna*6_TxD!z3WOmGqWsK$KT)y;n{cO2ND$+VY ze!J`MP{R3w)hyfot@sV;$)4ux4XS#-92cStRnP#34C)4xbT+Ez5b%3pr@PM?ma)|T ze!L@y&TT(V3TV7TwZK!FOiwZb z1#?*i3Y>O(;-h|rhwbldAZH-p%u*etW`s5SBDR#VcK<{Y%a8V)^+F;kHVa-{UF9`0 zGXi_b=+GbW7ux^%F}&)cJ)--~<5}VGTX>Pzv&ahEH~+z2xvOajW32LRi>8quD9*ow zI3bdtmdkZxKj@+19iDa8124 zmg1_dbBn#nf;#_iv*_MkH(+b{KC5IU&UYi-PooVLFF?5TQe-(q@Pu{*Bq={z`vErT z7>Ps%aBmWir=Xex-|50F#?^D=>F5iSz8br{8sPY3a?BIMF}|`s@uUl6+b!r7*eB=m zY1!tY6iT-mR&=dSDnaHSNPQgrI3&N$bHj-_z;we zZg;jpTj}UasS}eJP|!;9H^lMr`+vA^sC(C{;l^$9W#Rr^FfOxWIVU0?1$f16DpzS! z(0FeNz9Wm33ja4`5r(?%M{UljlCLUSTa)vVB=Bm%_jZsiD(ElKSTA^Mw;O1oa;8Yy z`>op^hphG2kl1T(nKo{^i%-4+e~#kApafqI7l~*-0lyed>{GAL&`*)*2YUID(M$F( zRbI~-nNOy-n_lndOO<<<0!^cK^6NywY&)$37VfymW5?GG$d!4U^uznLm_Ko_@o{FJ z`bZvw^j0hfk{dw_0UP$o!N%MT;x$qs;~kxwpVr2=8rP6%GZsc#Kv*_Dk%4LB@k^vJ zoz)C&9fJzm>G-7p$RR&>6~p^#LoMIZCIewZ-*K{Ew-*Azbl-fbMIKnjrx$Dz2fglx zXmIfbycKed%-UJBkVVdbsK-}!^a@tHeUh%2+GxuLl@#k=MwoNVCB79etpYTKZ#qa* zs35N_aVqdwj8+1~yl13RCE5upEA(elNJye7%V8;)I)>UJ2FJL(N{>ynTWH$qs>eUl znJa}8l>*OFqwbfKInzSIYoSfWg-s~)ikD_-C_#S^LHZ%;KjJBIdD)~9wVn;<5NIC( ztvh3DmUn1H(YF`G3gkf+H3WIZ2s*&mj>wS!n1j6af_cLwn7^SHeT3uMX|74V3Tmfz za0Y1SJyicaSj#4?tNck2qypb1fNryb^W_bZjR1d3;KsTR&bK$5gq4^gRMXc1C`Nnz zHjuQ!5cAErLd;U-_r!DZA}&wu>>K2cc!!c}W;<@Hq=7GRfDe>9pGGjR$cPJ2$^Ie0 zD*?gL&5r`>Hq6L5U-yByUQ_y~ezfoopx*Uo8u07dgEn*uY%#qw#3gACb16}u@o1yB zbR~S9e^XIg6;;uiv>O2;YZ>NvjKi7yX(#_obh=z^k>SO>u5z0a%;e<(j@?}D~o^J5VfodaYJu(_(7K zyK0%xaII01J|+?ZfsmK1rro}jD;Rk2Vt3>gbWQu@enKg39?gCM3CQNiEr_7E=z{5J zLyNiHOZovf?~RP3c;^C;ASV~b>ur2gv6ill`yT8K==sZr_g=hE0d67-wq@9R8a|Y z*a}sU|80X`3lnD_AI-9Rg=^bTZ>ReGOv>aXT~Gjfz>JRmPe z_9O(Z!((PdU+V`;s1WdpJmMmb9%F(t4ANifJ|3N61|;8PUa*Ha_}(^FE&HUTrq05=dBmfVe|)2?#GIG+h-(q zY@>21ABtct_fxSrrDnpujFI+X<){e-x)G_!nGxlw`RyYTm2w-|VHe@%A?;C{n^T?2 zsjQ6Q*jiU0LLnw0-(4xKdU243k37L!?KnLoIxIvm2cJAr((_7i#Cf~p(Dx^>{sCHdQ{-2 zI9wQEkLEpu?Fjc&y-$3W*M_=Yt9Ajo8>47=E-W!hyNOgGk~qy*>=)(fQqF}zCXnLs zFY+7>P|g6T`z(>jSRb}ecH>ywuo4gDqWXBbLF!tAFBLAKEbZg3%_@hv`;|i#H+3-x zm?)a~R={iJNU_85{Tx;(CUH$QqZV<5K(%*S4V>PiJ_2iV63$5C2VPmoY4L|nnJkVm z)r=&zIc07*N!;rc$qJ85LlZw{nd2Fno6`Vw2;mT*A?7b@g>jX>8)A412bSRcNIepX zm$5jDGUt2f13swJ9@%`c%5)#A2*-0f+6yJ|siId&>D(=(>sZH3-_Im`V_m8hu{ZCQ z=e1Muvjq#C$oPz+9#n|WQle{M0!TeN@t9u{^w|CQ=Ln*$<~7Q&jiPgWwGniG&v}8V z9oBY$8OCf+1R6irDU&k@qLcWXVA%||6miPh!(j*aJe0MuE7&nkX)Xydi&Mv=UVSqO ziNxo5Wg&;g=d}#uxbw|OO?c&CEvU(xn_gku1rrxI1R4@Ww9l?1k)P3_;tL!IqbbrI zzQG}WnN!%12&<2NHD67kXbj?0Jq^8j?ex*aiP`;d)SF?~42>c1f zrtl1z*f#6}W5V-&D@5=~fRp5vXxF&3iclRgb9z}cqq{)*QS8=mM}_!Of0-;`LoV8b z5)V``fD%gmU>q%9&)3Gquhr6hi~M7RTqA)>sc+^X&L?J-cOx??>^j~kqr>PnVXpC7 zAA#oh))1^lKwrgoGmznfrM0ZVBP=x`-mVh_q_B=sB#wTBgA0bG8 zl)71YQTKGjgOGz6o6O<`UppE41-4=Rrhw_8!+_2G&=NTgjaqo%e~=DMuM*2pf~2JG0vAVPegP^vE$>N zh^ToP#}@7e3Rp0&YRY`pEa}G>W}gcTIU2docmIue9<>U6k_Ht-Vr~L>gDN5pVz_K2 z<_9`_+hSkGWZ+^34FkuDgsYBltZt7zhcz{{ICG;;s#7;jf2{4HZ64xe5NfyI_+2{P zP`77L?PQkhIDvgf@%*PjsA=S-hfoxUFW^NGBo>zAJV93>eH)ku8q8S+^H9ZHtC;J8 zm{W*(h`~G{qs>>Jk~TLeW_=LzgWmv?ePNrq2J>js=3R=}sF*hfF%!h(83JMs!GRz4 z6Fb7v&l1IKQp_zu%o~B(y*y65kp}MwgEvm`-cY;O+XX1b;N2eSVF@58Y(`-$(j(YrPaZh| zn(cSCP4<}4M7#Z+Z?Q?=#<_26y1+5i9d(a}ttXI^SoTrcFykB7Nh}3%JJ|mC^U4!I z;&TeZlPi|}hJqMlQn)u*xde46h*4ThRIw1fEc-qMbpj+-EC*1Yz!RpHeVc-kUhZG% zKMN5zd(5q<%i*}qTwBa_n_S(OwM1G_f15f-v$I^RuNak{IBY{us0rOrKYGrReD@h@ zeK;tZ%DbhC$(!cKaL@VM=$_I3?;pyiY8v|97aMNfaWIHbA+O<-Aw2G#d=feQAG~A2^6zPfDnPJhCZVV8YNhxJty$Bzfu$r^N+B)PK70I6r~5 zWqdZ%sf)=ShguVfI`$EXI@tK3Uk3umcf9INWcb1kQW*J-gDCC8xAG#b%GmRd=Y%}@ z9OYx?JAy;@`6;oYkPjn44AN&DV}sWz{Vyo}%Y*c9V{IpocUBxlF5!G4zw`>=?(?l& zaij<}brHJrlMo1pR}>4!;mr2md7NDsxfcNq{p;h!t9^*{Z|Kn%p%fB43Kb9H@4%^| z^b6gGL0hssgAgMFM(R~kMPgv&Ztp|xz-hPdyxqTafX?xQT|;lZP#Zo3tTpnt1T?(a zg>Iw2?b~T~uDRvQn_!%Gw&3AXY*v^L#T|xx(!7BNfuP@OCTgd9a4>|md_67;J>l~T zJhdpp9+`c<%{fN3Xf7Hzt=ku10$@%unv4A=sMuK8aLVlkpymL7OWJY1+(!NlPY9p0RA|l1Y=MOkc8W>ExLO6Us^#PpDp7T~o3W zjg;1`SXok2x} z({Az7rJt%EmXws0RhL{>ea)&#jvf|N6)!1)CLHNoRzX3*#DYl$lMAL4Of8sJFuh<# z!OV#T6DLlbG!ZJFICbK*iPI;}m^gD%!K8_kCQX_=Y09Ljlcr6YK553JnUf19PnXd0yrcaqMW#-g^sS~G8nmT#vl&Mpv zPMbP?>Wrx~rxi?_IBn9j$uaUwCU4kOq)5qVEV-AlcrCeK4tpU>C>i9pFU&y z%oznUCeD~NWAcnCGp5d%He>pX88c?i1dB7#{7jIZ3AC9gf^g@oD6Zn8NuQp6YnD!^ ztSVhqTvIY(Y3cIPn(Eq`(lRxA@H4NxX5PxmGE09NzMPv+#qRgP-zlG_oHQ;httcyl zhCClMEbtQc{nnp2NX$PzUV*>xg%zRdn&KtbhH7ZSi}|Z~RdH!qF(TJ+tt0=M`c}x` zW75RG@T%gn+LBO3ZB3|RS*WVGe0hli4BT2|>T9X@FBkOjHvs;bAp#8CYRQ6s1}g!- zw0vpF8mIlm6}9C{tH*{AibG2(%4>>C%S)<4rPZO5m6bJX6~p{%@U4`g&$$u)3_Z&- z_g2BPVF8Skf30w+yrL#lS{^D0jUOMACo3^bL;es?k6-ctsviyi^2i+P4;E;g73Ech&629B+Da%Xw0Lc3 zPEA$WxH+mSsc7n3)~~~I&$T1`5&zQ2`Imt}Sy{>Q;xa^wimGDtt9Z$hlIrU5p)s?e zc(@nYhESJ=mQ_`(43(Fbo#U965Hj?vu%YkcZ}z#DfWg^|%PXo@q5<%^vb4OIG97@w z7K6`qCj61V^NJ!scax(K`dLxsLzRlAzLhfgTy4Ui$fvN->t01=NmXXstZ3?6q36Q9 zwa%7*1^?WImwNdBrFa~A)*?fnt6KOYe?{}y!J^Vi1huk?>Jl*k1Gf^Uex9jcTYhbM z#p?1m6J0Fe}m26kc_{f`}sTIfBYNv|MOpQ84L)L z`c(2M$zvpcIRjHF`TO+R?KiKgEw3tBUW!m##VM7^XFf%KocUB~d1=k3DE|qW^O{P8 z`PoaCR(T9veFun`y{Knq=ve{^iB#ER2VfZt12luw{*D_61t$`QcP1zmY#?5LRg5k zw8U+uqIzzLj{%}aYnPWO?otKqiwdWY4%^NMSV%RcouvW%@tk1yfOWp2qbsLPn~r(?%h zS1GP$5ax78IFa~mIDrH&ELnZg;xAhlVN%SgumQm5FunN{<+YFXAFGOM5ViC^8B{LC zV6tR|RVD+?GOSiyT3cGf#g%gr8m~o!UQo4Gf}jRR%>R6M=vcI*xU#Sm!(Ua&b+skc zH5XM&*sAsg$$<&uw6(>+#bsRlz_ZaW1bimokNf*KsLks?;4cGyrXODG>p$SV zfRFdXOFj5@z&{2&n|mUbLKZDn}`Wu1C@S{_++t*mYp9DOIhVR(N z;17q8L$QCr?>RG_mJsH^2UU3e2fPn(o*s4a2lcw}Er9>}tnB^U4*1x!v-fY0fnOD% zf4NJ)2k=thR|eqMy6_QLynJLI@Ueh@W>z|l7s7k|R|&fIAMg<1GWT=(zsQ4^0X`b= zbNu)k9@PHeh=U)06!t1|D!$qL$Av}mriGk zKVt#^1>p2Um;T@%x%h>EpA*impE3iNLphFo2EF9Ue+%Gyfq#vk|3P1L;oAY9Handz z4#26~W{96I|9WHzX7Ry(ki|26y{Tt-=Z!F+f&&e*ILco6v z_;UgJ&$#r<0KXi2%)bl3Uvc4E06#2}PG_^BSljV}Hkz#j&DQ2?$33~izZ z@V$WZ_4}Uw#=89*fyMn?d`9Y?0RCMr{jq>=0bDX!SAQCyNWT#9-vWLx;*3Xs#2^wN zybSPP%}b~M8leAYm;M&O@4zXnto;Z4MZlj4;6LT!?*aUJ945==KRu)mxJ+$b{#Us8 zBQQ?C4tTwvK7Zqn{Er3v+`@Ev7Ykhc$6fqFz~2Ns8~rlCC(ci&mk00{yZBoGUjz85 zet5BfrTy)IuLoRC3pwo%?soOJ2k;9oN~b^c;}6>F((eKM^rCe7`2hS`7e3-Mmh~#& z)dBk`cj=D>eC#Fruz$eU0NxV7zthDp1HA9jbov1Jp)0?^IYY?+<+}y&KU|(pCj$IE z=JK~4@by=u)87cdZ*$>$0DlkgZ1U{^{Om8L)4K!sJ6-${SQ366@CO3$pStj|fUmkT zolXYezjEP)fS>xMbo%~){om`^Kj05so!!2-0R9f(Ck5npoGZWWfdBKFbUG4fKkT-@ z2k=pg(&?#wc%^_vzCD1C1Dx;m_vAm(r9a|8%bHW1J--_Z_!Jxi&KAE50q+6)cmDPV zdGW0b@NGCry*B{=hs*yKz&9*~ePNvP_*?Gg7ux~<6`piBCLrG0(+eD{~r=`{g( zwF~b7{P>mW^mhXAtuB1T2+O*&BK!C{7Vvukmpv56|1R_7TL}0)`+%1Leiz_%f&Q=Y z`VaVrfIkv|Kj6Z*1Aa$kcKPiAyzIJk`rZKkJuZF^;O_xG3FCk#-*E@90{w5qNXr_w zCOiIEz~g|o1?2Y&SAK(0%|u&V_FQysj>tZV&Lk%jJJN z;HRulr!NV>=ezJdfL{i9Hv8@Yyleyf%a4DRplkmRvaE8zi~aCHUVbqa@Sg&Hv>(3E z!!HE7C#&!4vg{vhD9{P=1>oOPt9lj{a@_Ke-GfN0nV4tc=(sP_&tCZ-@K3c zA7=Om-I9I&JQncr@pO8%zx_cv0igdB0^SJtWdZobu71k^e+=-80`Skf@GXG<74SO) z@UOe@?SPluiu^dxzc0G|+XMJLw}E~D{&^SP1Nci{OQ$&x^5pZ@U^XEBkImA%zL6b& zEa1;=O{ZTD*w+i5{{z11&UE^t0RMe1|7Cy|e>wE;%@=`rtfCA-|c{}Y)PkU z1O2OX`?m-1U3X{azX$MlzL$M|GU5=0e-PmRJ(vHnfdA_I+2{9#fUmeGoxVDNe}#)* z2KWyF&z9eA0sIZXpAU?G&wAq@;J4kIPTvurA9v~R0eskx)9I#wd~S5*(*t^@IhYuEd=~>z{mOFnqCWj8Q>*=_xj<3x?TRa z06z7;bb5{-zFxqBzn%0m;gN>HYf**vy9e;=0l(glKWLRpzX$M_0nawS8*!LrJ$`?7 z{~inYVLwf$s{-_OflT}#@MVB!9sdBow-xXJ{?#sjTLA9?JX`*}9q_WBr_)~#;NR-v z?*aUEz*h#~-u$Kq@Cm<2r}wjYbe{lCc=0AYvv}Yfm%K$$f@YDVME0OMr zeQyDL%s%k910DfjPhR<`+f8Q`Y^zCO@Cy%%{M%C-Q$32>yTo_(IL z@?jDG=w}b0-U`$k#sVh~Ki8AvZvejtaD;mgUg*K!1w5Rk9nwE+6y~}6z@Gy6ae#;Y z^so2mF93X27W(XG4d7c3O{ZIle^CB;2aWoC-hr!g>#cK+KI`zT&@zYBG79gFLIxEA8N?pT!Jx*gXo zxW0|+c3gja9Pn{{6W1PG4>=zAe@&-v#dR#MKf|>U*YP3X8pZ3l@x{j*e51zCR<>>+;!xe@aA zvtbW;Al~Z^L8|w^dmwLxEZ#RfeDxgILtbga9&$k$bRY-MgFWOdysz8}Idne$A%9W{ zdq_1JviMK<7H}bSAO|3;AnU7O4|&J}*hBstax3KZ)v$;BHRK-1gKA*^7HlAAL0$z} z1^IL>>>+p5!5(t+64*mtUJrZ7?xnDY{I82)|Mu|kho6BxWLE?1A*bT~K^x>bkQ*T{ zg4_z(4LJn44{{IWLrt)M2k|$<9>)2}gFWQQ?XZV@Eem_dIhVp7^3pEYLngan z|L*Yc4Un@S2XnB8d>yh4a&8aoAwL7T74n`nu!mf-7WR-YKo-A;cU`@(hdg*4>>*FQ z4EB)We%M0}qrJ8jGJZAeAs>L;qqf(>{(Zy`IScZsYhVv~^|i2v+;$!8Aye1G9`c_d zhai6exd*au1MEM*yP6wd4|&=~*h3yU0DH(4x4<4U`32ZR#=Z!9$SZGyJ>*q)!2Zv} z!|&Y*d&u%lu!n4hY=cbS4SUGr?}0t!I>;f&S0ML5KJZo8e>gmR)_t&teExpeLtgs; z>>DXLD)m4Acr7N-vWEcHpt?SQ2rrjL7wpt>>)#6Lm1>1$c>Q4J`8)vE4IQO zayR52$o{Xxem~l}kHQ}E^N>}LH$4t}Nb70XL#~J13OV%|*hAj>9oR!oeirs0Bi`p= z4|&aZVGp_UUttefxgGY9PeE>ld<$|2^7tRX9&#CE@n4XS&%+*aXb0>e`(A)Od7K?WULuEo#Ci*%Ths! zPb0FRYAOqwN_mTVWvmwa09zzprORUURg+OIgA;9$_|zcF5aqjn8P2NJfdg$JstKc( zPiSFDogeGf2iZdKs#cbX+ij8Z&J}AP9Hx(7)zj5tj$?-2M15L^%R72kII1+V|0lVB z++t<>r`*OZRJKjJOmzQOax&BH-QTs$k1tU^K>1C|=P7?i`5VgjC?~NT9c{{!cLzS( z^NVfK(7!6bbx92Jyv&?pLPTxUPkgElH(JKtrhO~JM;Q{VndY^hC?VCf-@@=w_Vee? zEe*_^zi`Rvfl#C*ToMXkh-yR)T@B2vX>JNsWO59c9X;JDt1pdqhQg7cRa0Nu)zi^| ze$;`M#zwELbzXgGrlTXf0^_X;1r6H@jvNUSdmX`*tRkirZOP%Va zs*)n9;D+py>k>cL^9(W05@WY#cQva{(Q+(7HTE)(Nu(Yqk$afz#KYv8#;a->tT(^x zWCd7$=TWNb-m9~OVMZ3xG5431ygmx)n0rn!%UB_u2JUMT@6UyFifC`-->PHM zx_X>6o3tLzeX6TO-P4uCMPRjLF(xon5{hGcyhYvrig1m8Fu@kJfc#pPy5ARB$687F zOLZ^m{y)K*VwwCfVYA5xm`{e=WGD_{YmR$NGLjMi$LdRv&^W3pI9&dWiK2Gxh;!sO1 z9&alCeGAh2q}@uF8+~g00N;Jqhwd@@XDE0~e&y50K9kEA(3>ulDFKC2t@P zP=76XzeoQz^35Lor^yFB`md1hCQmZ{_sIi4w1waZWjW?RUN0V=Ah$hyDY+R>uI?9V zSxesO(Z7wn-@~6KAMo&3$TxfV`{a*#_%V}o`UlAak{ZiOkni^BFD18rWQ%5y`n}{q za+5!Ikel(NhJTy9+M~aVyn#Hx`1h0dd-P90MP8Mk0S`Zye6xqA$shCZe)2&N|1$Yb z58p<<+rxiFzR$xaPS)u(Cm;QiEZA>ZxMzuv_EqK;=K^&cV+ zlAHK{NN&b$S5W`=FaM`dRX6FX?oe^bC-jao9%x zaq?=9{!hrwxata~=WX)GJo-l+!g5X?pni;ew@1I8+>EOpxlYNa{Ww4Ux09Q3)h7OD z$Ze1Q&&ka=Ym*NjkvDksk3UqWzth9dA@BF_OUMU2{Bz`+J$y6yAi2r^?~(8G=)X>G z#$B8AA5g5*Ic;Zt{+vv1#$g-%a`K=@eQY82f2A(oBGKna?`Fh&&}EQ=y=vL{+qbpS3aS68~KCeKfO|O>4So>?~=dq zNzK#L{}1wcCuyD`-$%aSQ<~pNKIt%>KW~uBH++Pddek3J*7|MKKau(qPt)8y#}nik z@@uJIW8x=oAa5g|KU2peeWwxDPu_dF=J!#56Z!FHXx>5o1o<_yH8<(`5&7%nFHrwY z@`p>bzB!L?lmD8$o%;L9e{!bQ-$s7S6rFEHASf5O@3ZX{?a*` z4^saM@|(}q{5JA0k)JY0bF<$k$S0L)zLWaDAb(=M=B6IIk9 z`{c)v-}zb1pC+G0{&=6}FOr*j^_A;1w^2V<%h}Yw@p4ew^-X>I;#)L-j{2tlx#m{QO*z@fc&@%v^CZ}@{M{t45pncHmFH1aAEb~4rO#U9Zc@L(oEbB0IJ}8tiKmtESZo)Y^juGU^M1_4^Dw!2FJ|J|M!xP)ybUA=Xr3d#h;#`Q;YeCL?XQo>ae8E#OnD4cizXarRWLsdKLcFFGu@+KMjjwH;Y-NP`7rTxG5%^# z`~%dtJ@G$6{fj*MJIEV6{14=<9zF#xB2@Y-Jn^4GUhU!Ml3(QEOTktCbb8`nNBsus zGyARE$Xm%bpP^SC1y|+aTdY^em@@=@pS*0q7R7-4TGqdl&plD|t=z$0^1T7gjsAgn z#iQb%%6i4CjAuIeAHSvbnH*~-`GY5E{s8sQC0~Au<}Z=glg~U=bMxG3C%@qg&1I|; zY;GaHYnJA}15?X=w~bpLJdoafQhLyC^k$9up$9ZxxQ)p8tp1$j(k>n!ps z$YpE*!m7zb8*I^(KFL_ikZ-Th+?1;vdG7_9zb{snbuD@JLd|9D3c~It-?d0{8M6ZZ z6#09LHJ7m};5*1W>NJ-zD&W5&KXj?)C17g#m^?*pzIUB4UFT1ohku$pOMZop#wsP> zL;ehT1^K3BwvdO&KSN%=Tyq&qg0L&e*EVQw^#6rCkkMSmjzIrW@>d%*H}#4ik)PG9 zd6?z)4f6Jtn*ST(P|JSuXp1e|HS&w{Fhl3VwdCf!2g#pp)%qtAM!xPwtuJFSz@H#ryjt@dm|9*U{{i_q8e4nGC$!l@Ogx7m0qVYY zV29>1mIE3y$&brwE@L>r_lYH1-4ud!v@Jby1I{|dQ`(SXL? zM!#3hC3wvA$hTJ_Q9^9q-S{?;3fc!r+zUpX%3K#z27Akxzd{bCdtwH#AYQ9FS&<~h= z;$xbd^3X}%_qgWLXB;-Sl3(==&84q6_#@;)PiQWE#KE_dKmIMv&jC}*Yvjt!g<7Of zHstTfcRXt=Y&{~s_+0e~eOx`y*+QfbHr7riziv=->3a=+0r|7rG%p2HOFQ{{+ibOI zT`9kiJo~ZZRPks>j;ozzs*voq0MDkpsu<+BJs$ z>tpaY$KZRx1Frlss|N!X;-`$kqu|r58CC<^*A|yD@Wa*jwe7YLQ*Nul0|oRi20sGt zF`nY_YAefXAUFLEPPMqC)9A;M&ShGxbh>WA+;mlCZCyHzS-;GLTIpPS8uOcWV5+(T zD4lM~rd!&wD>7~ACYhWo)64{2_o788fi?qv?`tH!Zc`U%zNC`hl!3d z?ak??p7!=Wn7Fpms?SEAs@+~vVt1>5Og+V!{OxX;%3sj`axQ=s9YX3BAZON9MmjSWE?yQ)HCBDLG1b^UcTG=Mq%0j7KR7mia9m9{HcuV7g_+^> z3MSd@>BelgYCh<6I<1qH?n#D%N?GPjp4W!cg^j{)1~5C7V-`*(!b;UW6aL>R|8h+@ z33_^XyW2BAJhBmqDASYH*N4=`+-zr`nryI9ODD;pL^P%+7R2o7z`3U7jCQ#z)^txO z7*%SRVoXgtKaOHNWc{5EStdxu!8$X&<3M$q#z{{Y3IBU0NX^j3a=SRTc6Dd(>fEBH zy7_C`YHPBo73*@T%-VEV3g(!>x>%1H939_Um-;cS!@=>*!=drR6F%`L;^W&VeUhK_ zi9hKVf5K<~NuTi4_~9v^{7Lzo+?3DRP5I0O&qW&w`{hH}FCWkwcl`1Y@ymyZUwMf5m4}F5PDcE4GUAt$5x<;_ z_~m58FDIjZIT`iK$*5mWM*VU!>X(zK#f*QtqkcIV^~=eqUrt8-ax&(ZlQF-XjQQnc zETXD=m<1fQJyXkDj_G+Z6?VEOp~99ocV$&ou(PdD%{P$>T4wTHW1sGcrh-YCN*tBS zE(gb>$rR=lcP3SJ1w~L5<}Bqd3QtR}Im=xEDcpTW<|=pbXfm8PbGa)B?xWoEn7cwE ziKL#@++lDF6*tq->N(EcVR(p|8PDA~5iOi1)QR#ZKX;7cFZ#l&8xVo{v`z>87@{48Fj; z$7t=Tffwn{Rn3+({4IG?pk5+$XVco(h_$e;at)5NBDN~hoL#tN(aPTXrQOSyRje*M zKe{$;b>(ua&c~F@nC{yoWVzF*Pxs)eYra(Gf_F8qqjA*w8F4Dpl8vlhR8f9ucWtgJ zwW2M$GLEU2%lxB`2Ma}=h(%4*7tCK4>n^LV?ChwmST3XXUj>S=o*y#xu}Jf?T$d zxV-tQ?9jKaY?JFWMk9EF%Vg$ivVX@Y0WXN)aDU^l5F9Gvd4{YsQ_mwK%v(zF665IN z%urXR(U(0h%$9YvbmM7Y9zu1+_&Ran zFez2lf~Ihu8xtoi2JewNoiazg6M)frLF2HQ;*Ms#Mm8LkOx@)aWQ4rhN zaEHYs2t%X7`228%MT61+VU@t;0VMA^i07T-<09RIdyV(}hLbqy&6lptbT5E&Biz>I zA?Y?k9TEO#;T57l7@n%AtfAhf?)aXasaGi49Z7YjuPvKtGI=eY9n{mnvlc{|0$(Am}82|qsYm{JB$I`IC3mPDZg z!K;1otKvis|G4Jp+z>D2@uf(fLbb}#seGVtE8t~_Q~52R5J3UUtKY)~Zxs2jz9%sM zbA6r7P5Qaro$d+aft7c9Ji&MqCRgvs1FNj3*Oj0s?os*S<-Mw&K;I|KAeB3EeT;Dq z@NQZn5eF*r3{v;^wTQ&D4J2z@a;?~|m&%rthDZ#p@o{r4j7Ne`t_7`Jb|Kp1xh|`* zJJ(gGHXyCFs!fOnTdoPoa_uvPs-(A-kr$lQriIR8IEJ<|Dl{(NnkZk&!KV{L6keFo zEOYr+al-HFued^^Xk9uFFjqiK-zaba%OlKjAQpBhVNku>ON%Qc zhIsRQwz$ILc=nC<;Nnt9;K8KYnjU{HZVlYY-QHbXL2!z8!85hD){VC;A$%;rrJwD}ITbopi_E_^BJ#K#t>vUYs$PKL zYNb!d37$XH>bdAluXf z|8@HFIh(ZSFI!l)pmMI2o?o@-yt1nFqIvUb%j?p0W#?6uqs5C?0nlI3-L2ZYT{!^w zt;+x*m5rLE+p!-DPm1QQE~_10i>&sZ4kcE~g=(!_iI-)qs4gl;dCl#(BSX2X4exiD zEJYhT`}FOGWx+~U;+3Q+3HaQvzUxafN{2XK{qw`pE$!J3rVGhWtJIpLS1!U@)2fcN zch;ZCo!l8L@)TUhqGlnOO*?If&V-nk33h`>IB(q`MWVh91_8>}!|puB?=u68SZ~I{s$)byybRe*$CJ zGQpO$Ed=PsmbWNf_oB8{pDSa(V}gw>^amyg%9isp*;$pf{rGj;e=xxo{sHX+vgQ1k z{xF7|j0CvtrypQT(DVbe#>qyJ(rf?U;D_Shq~E5!P5XXzfLJEsU#*(-quZ`58}O@C zjlG#aXplP^(rP2WjBaH6Ev#X>ysWV|^9v2I|GG&(H%InwA{fMqn)}DtoB4sBq(Oj+ z#@^@|c`w4%Tta5s%qR3y8rZZq$M4O*Zz5bVV{hhXnyw76RA^zD{d@DT65-1JJnA(} zvSqD-_NITQvOf&}Ui(@wm8Vo689!Ccj)3T1nzwkomm9m3VVz4k3k|3;(8c+94eP2jv$P(zD%CTNZGjUq$6 z*YAsC*e54yL+|s~YhMF3bM3kla1rg3Cu;ghh!}KD{+rAC0x*;JZuu@IJ)fQXSF VO-D8@dkp*c=W5MXkAY{?`X3F<_pkr} literal 0 HcmV?d00001 diff --git a/tests/after/comments.nim b/tests/after/comments.nim new file mode 100644 index 0000000..ff5cd40 --- /dev/null +++ b/tests/after/comments.nim @@ -0,0 +1,253 @@ +# +# +# Some commentary +## A doc comment +## +## +## More doc comments +## +# +# Comment +# +#[ a multiline comment +this is also part of it +and this +]# +##[ + these also come in doc variants +]## +#[ + #[ + they can be nested + ]# +]# + +x 324 + +# A comment after + +template x() = + ## A template doc comment + try: + discard + except Exception: + mixin `$` # A comment after mixin + + echo 4 + +type + SingleValueSetting* {.pure.} = enum + ## \ + ## settings resulting in a single string value + arguments ## experimental: the arguments passed after '-r' + backend + ## the backend (eg: c|cpp|objc|js); both `nim doc --backend:js` + ## and `nim js` would imply backend=js + gc {.deprecated.} ## gc selected + mm ## memory management selected + + FileSeekPos* = enum + fspEnd + ## Seek relative to end + # text file handling: + + Object = object + # comment + ## more comment + field: int # Field comment + # comment between fields + field2: int ## Field comment again + + Inherited = object of RootObj + # inherited eol comment + # inherited next line indent comments + f: int + + CaseObject = object # caseobj eol + case k: bool # casetype eol + of true, false: # of eol + v: string # case field eol + + SomeAlias* = int + ## alias eol + ## alias next + SomeAlias2 {.nodecl.} = # after pragma + int ## alias2 eol + SomeAlias3 # alias after symbol + [T] = # alias after equals + int # alias after type + SomeAlias4 = SomeAlias3[int] + ## after alias4 + ## more after alias4 + ## Some comment before whenobj + WhenObject = object # whenobject object line + when false: # when object false line + discard + + NoField0* = object of RootObj + ## comment eol + ## comment nl + + NoField1* = object of RootObj + ## comment nofield1 eol + ## comment nl + +when defined(somecond): # when colon line + # when first line + discard +# comment +else: # else colon line + # else first line + discard +if true: + # if next line + discard +else: + # else next line + discard +if true: # if colon line + discard +else: # else colon line + discard +if true: + # if dedented colon line + discard +# before else dedented +else: # else colon line + discard + +proc xxx() = # after proc before indented name + discard + +proc xxxx() = # proc eq line + # proc first line + discard + +proc x() = + ## A proc doc comment + if true: + numberOfCharsRead -= 2 # handle Ctrl+Z as EOF + for i in 0 ..< numberOfCharsRead: + discard + +proc x() = + discard + +## indented doc comment for proc +## that is long +# before module +import module # with a comment +import module ## with a comment +try: # try colon line + # try first line + discard +# try last line +except: + # except first line + discard +# except last line +finally: + # finally first line + discard +# finally last line +try: + # try first dedent line + f() +# try last dedent line +except: + # except dedent first line + discard +# except dedent last line +finally: + # finally first dedent line + discard +# finally last dedent line +for i in 0 .. 1: # for colon line + # for first line + discard +case a # case line +of true: # of colon line + # of first line + discard +else: # case else colon line + # case else first line + discard + +f do -> int: # do colon line + discard + discard + +block: # block colon line + # block first line + discard + discard + +let x = + proc (): int = # lambda eq line + # lambda first line + discard + discard +while false: + # while first line + discard + +static: # static colon line + # static first line + discard + +discard Object( + # object eol + # object first line + field: 0, # field line + field2: 42 # field colon line + ) + +a = b + +## Doc comment after assignment +## needs to be double + +proc ffff() = + result.add() + +## Doc comment after indented statement +## needs to be double +abc and # dedented comment in infix + def +abc and # indented comment in infix + def +if abc and # dedented comment in infix + def: + discard +if abc and # indented comment in infix + def: + discard + +a(b = c # comment after keyword parameter + ) +a(b = c) + +# dedented comment after keyword parameter +{.pragma # comment here + .} + +proc a(v #[block]# + : int; abc: int) + +let + # let first line indented + v = 53 # after v + +var + # var first line indented + v = 53 # after v + +discard + # discard eol + # discard first line + 54 # discard value + +block: + # also after call + # comment between the dots + f.x.z().d() diff --git a/tests/after/comments.nim.nimph.yaml b/tests/after/comments.nim.nimph.yaml new file mode 100644 index 0000000..99b4bde --- /dev/null +++ b/tests/after/comments.nim.nimph.yaml @@ -0,0 +1,2306 @@ +{ + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# Some commentary" + }, + { + "kind": "nkCommentStmt", + "comment": "## A doc comment" + }, + { + "kind": "nkCommentStmt", + "comment": "##" + }, + { + "kind": "nkCommentStmt", + "comment": "##" + }, + { + "kind": "nkCommentStmt", + "comment": "## More doc comments" + }, + { + "kind": "nkCommentStmt", + "comment": "##" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# Comment" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "#[ a multiline comment\u000Athis is also part of it\u000Aand this\u000A]#" + }, + { + "kind": "nkCommentStmt", + "comment": "##[\u000A these also come in doc variants\u000A]##" + }, + { + "kind": "nkCommentStmt", + "comment": "#[\u000A #[\u000A they can be nested\u000A ]#\u000A]#" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIntLit", + "intVal": 324 + } + ] + }, + { + "kind": "nkCommentStmt", + "comment": "# A comment after" + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## A template doc comment\", line: 30, col: 2, offsetA: 267, offsetB: 292)" + ], + "sons": [ + { + "kind": "nkTryStmt", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkExceptBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "Exception" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkMixinStmt", + "sons": [ + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# A comment after mixin\", line: 34, col: 14, offsetA: 346, offsetB: 369)" + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "echo" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPragmaExpr", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "SingleValueSetting" + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "pure" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## \\\\\", line: 40, col: 4, offsetA: 430, offsetB: 434)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## settings resulting in a single string value\", line: 41, col: 4, offsetA: 439, offsetB: 485)" + ], + "ident": "arguments", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## experimental: the arguments passed after \\\'-r\\\'\", line: 42, col: 14, offsetA: 500, offsetB: 548)" + ] + }, + { + "kind": "nkIdent", + "ident": "backend", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## the backend (eg: c|cpp|objc|js); both `nim doc --backend:js`\", line: 44, col: 6, offsetA: 567, offsetB: 630)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## and `nim js` would imply backend=js\", line: 45, col: 6, offsetA: 637, offsetB: 675)" + ] + }, + { + "kind": "nkPragmaExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "gc" + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "deprecated" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## gc selected\", line: 46, col: 22, offsetA: 698, offsetB: 712)" + ] + }, + { + "kind": "nkIdent", + "ident": "mm", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## memory management selected\", line: 47, col: 7, offsetA: 720, offsetB: 749)" + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "FileSeekPos" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "fspEnd", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Seek relative to end\", line: 51, col: 6, offsetA: 790, offsetB: 813)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# text file handling:\", line: 52, col: 6, offsetA: 820, offsetB: 841)" + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "Object" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# comment\", line: 55, col: 4, offsetA: 865, offsetB: 874)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## more comment\", line: 56, col: 4, offsetA: 879, offsetB: 894)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "field" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Field comment\", line: 57, col: 15, offsetA: 910, offsetB: 925)" + ] + }, + { + "kind": "nkIdentDefs", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# comment between fields\", line: 58, col: 4, offsetA: 930, offsetB: 954)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "field2" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Field comment again\", line: 59, col: 16, offsetA: 971, offsetB: 993)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "Inherited" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# inherited eol comment\", line: 62, col: 4, offsetA: 1031, offsetB: 1054)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# inherited next line indent comments\", line: 63, col: 4, offsetA: 1059, offsetB: 1096)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkOfInherit", + "sons": [ + { + "kind": "nkIdent", + "ident": "RootObj" + } + ] + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "CaseObject" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# caseobj eol\", line: 66, col: 22, offsetA: 1131, offsetB: 1144)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkRecCase", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "k" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# casetype eol\", line: 67, col: 17, offsetA: 1162, offsetB: 1176)" + ] + }, + { + "kind": "nkOfBranch", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# of eol\", line: 68, col: 20, offsetA: 1197, offsetB: 1205)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkIdent", + "ident": "false" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# case field eol\", line: 69, col: 18, offsetA: 1224, offsetB: 1240)" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "SomeAlias" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "int", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## alias eol\", line: 72, col: 6, offsetA: 1267, offsetB: 1279)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## alias next\", line: 73, col: 6, offsetA: 1286, offsetB: 1299)" + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPragmaExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "SomeAlias2" + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "nodecl" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# after pragma\", line: 74, col: 26, offsetA: 1326, offsetB: 1340)" + ], + "ident": "int", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## alias2 eol\", line: 75, col: 8, offsetA: 1349, offsetB: 1362)" + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "SomeAlias3", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# alias after symbol\", line: 76, col: 13, offsetA: 1376, offsetB: 1396)" + ] + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "T" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# alias after equals\", line: 77, col: 10, offsetA: 1407, offsetB: 1427)" + ], + "ident": "int", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# alias after type\", line: 78, col: 10, offsetA: 1438, offsetB: 1456)" + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "SomeAlias4" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "SomeAlias3" + }, + { + "kind": "nkIdent", + "ident": "int" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## after alias4\", line: 80, col: 6, offsetA: 1494, offsetB: 1509)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## more after alias4\", line: 81, col: 6, offsetA: 1516, offsetB: 1536)" + ] + } + ] + }, + { + "kind": "nkTypeDef", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Some comment before whenobj\", line: 82, col: 2, offsetA: 1539, offsetB: 1569)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "WhenObject" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# whenobject object line\", line: 83, col: 22, offsetA: 1592, offsetB: 1616)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkRecWhen", + "sons": [ + { + "kind": "nkElifBranch", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# when object false line\", line: 84, col: 16, offsetA: 1633, offsetB: 1657)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "NoField0" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## comment eol\", line: 88, col: 4, offsetA: 1711, offsetB: 1725)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## comment nl\", line: 89, col: 4, offsetA: 1730, offsetB: 1743)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkOfInherit", + "sons": [ + { + "kind": "nkIdent", + "ident": "RootObj" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "NoField1" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## comment nofield1 eol\", line: 92, col: 4, offsetA: 1781, offsetB: 1804)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## comment nl\", line: 93, col: 4, offsetA: 1809, offsetB: 1822)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkOfInherit", + "sons": [ + { + "kind": "nkIdent", + "ident": "RootObj" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# when colon line\", line: 95, col: 24, offsetA: 1848, offsetB: 1865)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "somecond" + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# when first line\", line: 96, col: 2, offsetA: 1868, offsetB: 1885)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# comment\", line: 98, col: 0, offsetA: 1896, offsetB: 1905)" + ], + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# else colon line\", line: 99, col: 6, offsetA: 1912, offsetB: 1929)" + ], + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# else first line\", line: 100, col: 2, offsetA: 1932, offsetB: 1949)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if next line\", line: 103, col: 2, offsetA: 1971, offsetB: 1985)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# else next line\", line: 106, col: 2, offsetA: 2004, offsetB: 2020)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if colon line\", line: 108, col: 9, offsetA: 2040, offsetB: 2055)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# else colon line\", line: 110, col: 6, offsetA: 2072, offsetB: 2089)" + ], + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if dedented colon line\", line: 113, col: 2, offsetA: 2111, offsetB: 2135)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# before else dedented\", line: 115, col: 0, offsetA: 2146, offsetB: 2168)" + ], + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# else colon line\", line: 116, col: 6, offsetA: 2175, offsetB: 2192)" + ], + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# after proc before indented name\", line: 119, col: 13, offsetA: 2217, offsetB: 2250)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "xxx" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc eq line\", line: 122, col: 14, offsetA: 2276, offsetB: 2290)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "xxxx" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc first line\", line: 123, col: 2, offsetA: 2293, offsetB: 2310)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## A proc doc comment\", line: 127, col: 2, offsetA: 2335, offsetB: 2356)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-=" + }, + { + "kind": "nkIdent", + "ident": "numberOfCharsRead" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# handle Ctrl+Z as EOF\", line: 129, col: 27, offsetA: 2395, offsetB: 2417)" + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIdent", + "ident": "numberOfCharsRead" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkImportStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## indented doc comment for proc\", line: 136, col: 0, offsetA: 2493, offsetB: 2525)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## that is long\", line: 137, col: 0, offsetA: 2526, offsetB: 2541)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# before module\", line: 138, col: 0, offsetA: 2542, offsetB: 2557)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "module", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# with a comment\", line: 139, col: 14, offsetA: 2572, offsetB: 2588)" + ] + } + ] + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "module", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## with a comment\", line: 140, col: 14, offsetA: 2603, offsetB: 2620)" + ] + } + ] + }, + { + "kind": "nkTryStmt", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# try colon line\", line: 141, col: 5, offsetA: 2626, offsetB: 2642)" + ], + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# try first line\", line: 142, col: 2, offsetA: 2645, offsetB: 2661)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkExceptBranch", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# try last line\", line: 144, col: 0, offsetA: 2672, offsetB: 2687)" + ], + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# except first line\", line: 146, col: 2, offsetA: 2698, offsetB: 2717)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkFinally", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# except last line\", line: 148, col: 0, offsetA: 2728, offsetB: 2746)" + ], + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# finally first line\", line: 150, col: 2, offsetA: 2758, offsetB: 2778)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTryStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# finally last line\", line: 152, col: 0, offsetA: 2789, offsetB: 2808)" + ], + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# try first dedent line\", line: 154, col: 2, offsetA: 2816, offsetB: 2839)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + } + ] + } + ] + }, + { + "kind": "nkExceptBranch", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# try last dedent line\", line: 156, col: 0, offsetA: 2846, offsetB: 2868)" + ], + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# except dedent first line\", line: 158, col: 2, offsetA: 2879, offsetB: 2905)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkFinally", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# except dedent last line\", line: 160, col: 0, offsetA: 2916, offsetB: 2941)" + ], + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# finally first dedent line\", line: 162, col: 2, offsetA: 2953, offsetB: 2980)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# finally last dedent line\", line: 164, col: 0, offsetA: 2991, offsetB: 3017)" + ], + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for colon line\", line: 165, col: 17, offsetA: 3035, offsetB: 3051)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for first line\", line: 166, col: 2, offsetA: 3054, offsetB: 3070)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# case line\", line: 168, col: 7, offsetA: 3088, offsetB: 3099)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkOfBranch", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# of colon line\", line: 169, col: 9, offsetA: 3109, offsetB: 3124)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# of first line\", line: 170, col: 2, offsetA: 3127, offsetB: 3142)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# case else colon line\", line: 172, col: 6, offsetA: 3159, offsetB: 3181)" + ], + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# case else first line\", line: 173, col: 2, offsetA: 3184, offsetB: 3206)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkDo", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# do colon line\", line: 176, col: 13, offsetA: 3231, offsetB: 3246)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkBlockStmt", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# block colon line\", line: 180, col: 7, offsetA: 3275, offsetB: 3293)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# block first line\", line: 181, col: 2, offsetA: 3296, offsetB: 3314)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkLambda", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# lambda eq line\", line: 186, col: 17, offsetA: 3361, offsetB: 3377)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# lambda first line\", line: 187, col: 6, offsetA: 3384, offsetB: 3403)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# while first line\", line: 191, col: 2, offsetA: 3447, offsetB: 3465)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStaticStmt", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# static colon line\", line: 194, col: 8, offsetA: 3485, offsetB: 3504)" + ], + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# static first line\", line: 195, col: 2, offsetA: 3507, offsetB: 3526)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkObjConstr", + "sons": [ + { + "kind": "nkIdent", + "ident": "Object" + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# object eol\", line: 199, col: 4, offsetA: 3558, offsetB: 3570)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# object first line\", line: 200, col: 4, offsetA: 3575, offsetB: 3594)" + ], + "ident": "field" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# field line\", line: 201, col: 14, offsetA: 3609, offsetB: 3621)" + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "field2" + }, + { + "kind": "nkIntLit", + "intVal": 42 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# field colon line\", line: 202, col: 15, offsetA: 3637, offsetB: 3655)" + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + }, + { + "kind": "nkCommentStmt", + "comment": "## Doc comment after assignment" + }, + { + "kind": "nkCommentStmt", + "comment": "## needs to be double" + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "ffff" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# dedented comment in infix\", line: 215, col: 8, offsetA: 3823, offsetB: 3850)" + ] + }, + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Doc comment after indented statement\", line: 213, col: 0, offsetA: 3753, offsetB: 3792)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## needs to be double\", line: 214, col: 0, offsetA: 3793, offsetB: 3814)" + ], + "ident": "abc" + }, + { + "kind": "nkIdent", + "ident": "def" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# indented comment in infix\", line: 217, col: 8, offsetA: 3865, offsetB: 3892)" + ] + }, + { + "kind": "nkIdent", + "ident": "abc" + }, + { + "kind": "nkIdent", + "ident": "def" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# dedented comment in infix\", line: 219, col: 11, offsetA: 3910, offsetB: 3937)" + ] + }, + { + "kind": "nkIdent", + "ident": "abc" + }, + { + "kind": "nkIdent", + "ident": "def" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# indented comment in infix\", line: 222, col: 11, offsetA: 3966, offsetB: 3993)" + ] + }, + { + "kind": "nkIdent", + "ident": "abc" + }, + { + "kind": "nkIdent", + "ident": "def" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# comment after keyword parameter\", line: 226, col: 8, offsetA: 4020, offsetB: 4053)" + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# dedented comment after keyword parameter\", line: 230, col: 0, offsetA: 4068, offsetB: 4110)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "pragma", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# comment here\", line: 231, col: 9, offsetA: 4120, offsetB: 4134)" + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"#[block]#\", line: 234, col: 9, offsetA: 4152, offsetB: 4160)" + ] + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "abc" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# let first line indented\", line: 238, col: 2, offsetA: 4190, offsetB: 4215)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 53 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# after v\", line: 239, col: 9, offsetA: 4225, offsetB: 4234)" + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# var first line indented\", line: 242, col: 2, offsetA: 4242, offsetB: 4267)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 53 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# after v\", line: 243, col: 9, offsetA: 4277, offsetB: 4286)" + ] + } + ] + }, + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkIntLit", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# discard eol\", line: 246, col: 2, offsetA: 4298, offsetB: 4311)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# discard first line\", line: 247, col: 2, offsetA: 4314, offsetB: 4334)" + ], + "intVal": 54, + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# discard value\", line: 248, col: 5, offsetA: 4340, offsetB: 4355)" + ] + } + ] + }, + { + "kind": "nkBlockStmt", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# also after call\", line: 251, col: 2, offsetA: 4366, offsetB: 4383)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# comment between the dots\", line: 252, col: 2, offsetA: 4386, offsetB: 4412)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + }, + { + "kind": "nkIdent", + "ident": "z" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "d" + } + ] + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/after/empty.nim b/tests/after/empty.nim new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/after/empty.nim @@ -0,0 +1 @@ + diff --git a/tests/after/empty.nim.nimph.yaml b/tests/after/empty.nim.nimph.yaml new file mode 100644 index 0000000..7518d23 --- /dev/null +++ b/tests/after/empty.nim.nimph.yaml @@ -0,0 +1,3 @@ +{ + "kind": "nkStmtList" +} \ No newline at end of file diff --git a/tests/after/exprs.nim b/tests/after/exprs.nim new file mode 100644 index 0000000..b0faa0e --- /dev/null +++ b/tests/after/exprs.nim @@ -0,0 +1,59 @@ +var c3 = + row[p] + (if runeA != runeB: + 1 + else: + 0 + ) +var c3 = + row[p] + (if runeA != runeB: + 1 + else: 0 + ) + +proc f(): bool = + ## Comment here + ## another + (true or false) + +proc f(): bool = + ## Comment here + ## another + if true: + false + else: + ## comment + ## comment 2 + if true: + ## comment + ## comment + (true or false) + else: + false + +for a in 0 ..< 1: + discard +for a in 0 .. 1: + discard +# needs spaces +for a in ^1 .. ^2: + discard + +template ttt*(): untyped = + (block: + xxx + )[] + +# command syntax with colon +discard xxxx "arg": + yyy + +res.add fff do: + yy() + +# we don't what `do` in let but need it in the above commend - this needs +# more investigation - this is important for templates calls like Result.valueOr +# which become ugly otherwise + +let xxx = + implicitdo: + return xxx diff --git a/tests/after/exprs.nim.nimph.yaml b/tests/after/exprs.nim.nimph.yaml new file mode 100644 index 0000000..601180e --- /dev/null +++ b/tests/after/exprs.nim.nimph.yaml @@ -0,0 +1,709 @@ +{ + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c3" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "row" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkStmtListExpr", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "runeA" + }, + { + "kind": "nkIdent", + "ident": "runeB" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c3" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "row" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkStmtListExpr", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "runeA" + }, + { + "kind": "nkIdent", + "ident": "runeB" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Comment here\", line: 14, col: 2, offsetA: 158, offsetB: 173)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## another\", line: 15, col: 2, offsetA: 176, offsetB: 186)" + ], + "sons": [ + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Comment here\", line: 19, col: 2, offsetA: 225, offsetB: 240)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## another\", line: 20, col: 2, offsetA: 243, offsetB: 253)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## comment\", line: 24, col: 4, offsetA: 287, offsetB: 297)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## comment 2\", line: 25, col: 4, offsetA: 302, offsetB: 314)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## comment\", line: 27, col: 6, offsetA: 334, offsetB: 344)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## comment\", line: 28, col: 6, offsetA: 351, offsetB: 361)" + ], + "sons": [ + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# needs spaces\", line: 37, col: 0, offsetA: 462, offsetB: 476)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "ttt" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "untyped" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkStmtListExpr", + "sons": [ + { + "kind": "nkBlockStmt", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "xxx" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkDiscardStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# command syntax with colon\", line: 46, col: 0, offsetA: 559, offsetB: 586)" + ], + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "xxxx" + }, + { + "kind": "nkStrLit", + "strVal": "arg" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "yyy" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "res" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fff" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "yy" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# we don\\\'t what `do` in let but need it in the above commend - this needs\", line: 53, col: 0, offsetA: 642, offsetB: 715)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# more investigation - this is important for templates calls like Result.valueOr\", line: 54, col: 0, offsetA: 716, offsetB: 796)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# which become ugly otherwise\", line: 55, col: 0, offsetA: 797, offsetB: 826)" + ], + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "xxx" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "implicitdo" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "xxx" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/after/import.nim b/tests/after/import.nim new file mode 100644 index 0000000..7272ffd --- /dev/null +++ b/tests/after/import.nim @@ -0,0 +1,20 @@ +import tables +import + "."/tables +import + "."/[tables, sets] +import + sets as dummies +import + "."/[ + tables, sets, long, modules, even, more, more, a_really_long_module_here, more, + more, more, more, more + ] +import tables, sets + +from tables import Xxx, yyy + +export a, b, c +export + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbb, cccccccccccccccccccc, + dddddddddddddddddd diff --git a/tests/after/import.nim.nimph.yaml b/tests/after/import.nim.nimph.yaml new file mode 100644 index 0000000..fcb3d4c --- /dev/null +++ b/tests/after/import.nim.nimph.yaml @@ -0,0 +1,232 @@ +{ + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "tables" + } + ] + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkStrLit", + "strVal": "." + }, + { + "kind": "nkIdent", + "ident": "tables" + } + ] + } + ] + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkStrLit", + "strVal": "." + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "tables" + }, + { + "kind": "nkIdent", + "ident": "sets" + } + ] + } + ] + } + ] + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "as" + }, + { + "kind": "nkIdent", + "ident": "sets" + }, + { + "kind": "nkIdent", + "ident": "dummies" + } + ] + } + ] + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkStrLit", + "strVal": "." + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "tables" + }, + { + "kind": "nkIdent", + "ident": "sets" + }, + { + "kind": "nkIdent", + "ident": "long" + }, + { + "kind": "nkIdent", + "ident": "modules" + }, + { + "kind": "nkIdent", + "ident": "even" + }, + { + "kind": "nkIdent", + "ident": "more" + }, + { + "kind": "nkIdent", + "ident": "more" + }, + { + "kind": "nkIdent", + "ident": "a_really_long_module_here" + }, + { + "kind": "nkIdent", + "ident": "more" + }, + { + "kind": "nkIdent", + "ident": "more" + }, + { + "kind": "nkIdent", + "ident": "more" + }, + { + "kind": "nkIdent", + "ident": "more" + }, + { + "kind": "nkIdent", + "ident": "more" + } + ] + } + ] + } + ] + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "tables" + }, + { + "kind": "nkIdent", + "ident": "sets" + } + ] + }, + { + "kind": "nkFromStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "tables" + }, + { + "kind": "nkIdent", + "ident": "Xxx" + }, + { + "kind": "nkIdent", + "ident": "yyy" + } + ] + }, + { + "kind": "nkExportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkExportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "bbbbbbbbbbbbbbbbbbbbbbbb" + }, + { + "kind": "nkIdent", + "ident": "cccccccccccccccccccc" + }, + { + "kind": "nkIdent", + "ident": "dddddddddddddddddd" + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/after/procs.nim b/tests/after/procs.nim new file mode 100644 index 0000000..7b49b0e --- /dev/null +++ b/tests/after/procs.nim @@ -0,0 +1,113 @@ +proc a() = + discard + +proc a(v: int) = + discard + +proc a( + aaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbb, ccccccccccccccccccccccccccc, + vvvvvvvvvvvvvvvvvvvvvv: string +) = + discard + +proc a( + aaaaaaaaaaaaaaaaaaaaaaa: int; + bbbbbbbbbbbbbbbbbbbbbb: int; + ccccccccccccccccccccccccccc: int; + vvvvvvvvvvvvvvvvvvvvvv: string +) = + discard + +proc a( + aaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbb, cccccccccccccccc: string +): Ddddddddddddddddddddddddd = + discard + +proc a(v: int) {.nimcall.} = + discard + +proc a(v: int) {. + nimcall, pragma2, pragma3, praaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaagma, + rrr +.} = + discard + +proc aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( + v: int +) = + discard + +proc aaa*(v: int) + +proc aaa[A, B, C](v: int) + +proc aaaa*[A, B, C](v: int) + +proc aaaaa[A, B, C]( + aaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbb, cccccccccccccccc, + ddddddddddddddddddd: int +) + +proc aaaa*[ + Aaaaaaaaaaaaaaaaaaaaaaaa, Bbbbbbbbbbbbbbbbbbbbbbbbbb, Cccccccccccccccccccccc, + Dddddddddddddddddddddd +](v: int) + +proc aaaaaaaaa*[ + Aaaaaaaaaaaaaaaaaaaaaaaa, Bbbbbbbbbbbbbbbbbbbbbbbbbb, Cccccccccccccccccccccc, + Dddddddddddddddddddddd +]( + aaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbb, cccccccccccccccc, + ddddddddddddddddddd: int +) + +proc aaaaaaaa[T: Aaaa](v: int) + +proc aaaaaaaa[ + Tttttttttttttttttttttttttttttttttttttttttt: Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +](v: int) + +proc aaaaaaaa[T: Aaaa; S: static int](v: int) + +proc aaaaaaaa[ + T: Aaaaaaaaaaaaaaaaaaaaaaaa | Bbbbbbbbbbbbbbbbbbbbbbbbbbbb | Cccccccccccccccccccccccccc +](v: int) + +proc aaaaaaaaaaa( + v: Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | Bbbbbbbbbbbbbbbbbbbbbbbbbbbbb | Cccccccccccccccccccccccccc +) + +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 42 + 33 + 44 + +functionCall( + aaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaa, + aaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaa +) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( + aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaa +) +aasdcsaa( + aaaaaaaaaa = bbbbbbbbbbb, + ccccccccccc = ddddddddddddd, + eeeeeeeeeeee = ffffffffffff, + gggggg, + hhhhhhhh +) + +type + Ap = proc() + +type + Bp = proc + +type + Cp = proc(v: int) + +type + Dp = proc() {.nimcall.} + +type + Ep = proc {.nimcall.} + +type + Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = proc {.bbbbbbbbbbbbbbbbbbbbbbbb.} diff --git a/tests/after/procs.nim.nimph.yaml b/tests/after/procs.nim.nimph.yaml new file mode 100644 index 0000000..43d0fba --- /dev/null +++ b/tests/after/procs.nim.nimph.yaml @@ -0,0 +1,1778 @@ +{ + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "bbbbbbbbbbbbbbbbbbbbbb" + }, + { + "kind": "nkIdent", + "ident": "ccccccccccccccccccccccccccc" + }, + { + "kind": "nkIdent", + "ident": "vvvvvvvvvvvvvvvvvvvvvv" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "bbbbbbbbbbbbbbbbbbbbbb" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ccccccccccccccccccccccccccc" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "vvvvvvvvvvvvvvvvvvvvvv" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Ddddddddddddddddddddddddd" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "bbbbbbbbbbbbbbbbbbbbbb" + }, + { + "kind": "nkIdent", + "ident": "cccccccccccccccc" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimcall" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimcall" + }, + { + "kind": "nkIdent", + "ident": "pragma2" + }, + { + "kind": "nkIdent", + "ident": "pragma3" + }, + { + "kind": "nkIdent", + "ident": "praaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaagma" + }, + { + "kind": "nkIdent", + "ident": "rrr" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "aaa" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaa" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "A" + }, + { + "kind": "nkIdent", + "ident": "B" + }, + { + "kind": "nkIdent", + "ident": "C" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "aaaa" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "A" + }, + { + "kind": "nkIdent", + "ident": "B" + }, + { + "kind": "nkIdent", + "ident": "C" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaa" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "A" + }, + { + "kind": "nkIdent", + "ident": "B" + }, + { + "kind": "nkIdent", + "ident": "C" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "bbbbbbbbbbbbbbbbbbb" + }, + { + "kind": "nkIdent", + "ident": "cccccccccccccccc" + }, + { + "kind": "nkIdent", + "ident": "ddddddddddddddddddd" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "aaaa" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "Aaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "Bbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + { + "kind": "nkIdent", + "ident": "Cccccccccccccccccccccc" + }, + { + "kind": "nkIdent", + "ident": "Dddddddddddddddddddddd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "aaaaaaaaa" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "Aaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "Bbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + { + "kind": "nkIdent", + "ident": "Cccccccccccccccccccccc" + }, + { + "kind": "nkIdent", + "ident": "Dddddddddddddddddddddd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "bbbbbbbbbbbbbbbbbbb" + }, + { + "kind": "nkIdent", + "ident": "cccccccccccccccc" + }, + { + "kind": "nkIdent", + "ident": "ddddddddddddddddddd" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaa" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "T" + }, + { + "kind": "nkIdent", + "ident": "Aaaa" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaa" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "Tttttttttttttttttttttttttttttttttttttttttt" + }, + { + "kind": "nkIdent", + "ident": "Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaa" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "T" + }, + { + "kind": "nkIdent", + "ident": "Aaaa" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "S" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "static" + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaa" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "T" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "|" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "|" + }, + { + "kind": "nkIdent", + "ident": "Aaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "Bbbbbbbbbbbbbbbbbbbbbbbbbbbb" + } + ] + }, + { + "kind": "nkIdent", + "ident": "Cccccccccccccccccccccccccc" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaa" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "|" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "|" + }, + { + "kind": "nkIdent", + "ident": "Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "Bbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + } + ] + }, + { + "kind": "nkIdent", + "ident": "Cccccccccccccccccccccccccc" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIntLit", + "intVal": 42 + }, + { + "kind": "nkIntLit", + "intVal": 33 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 44 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "functionCall" + }, + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaa" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaa" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "aasdcsaa" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "bbbbbbbbbbb" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ccccccccccc" + }, + { + "kind": "nkIdent", + "ident": "ddddddddddddd" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "eeeeeeeeeeee" + }, + { + "kind": "nkIdent", + "ident": "ffffffffffff" + } + ] + }, + { + "kind": "nkIdent", + "ident": "gggggg" + }, + { + "kind": "nkIdent", + "ident": "hhhhhhhh" + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "Ap" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkProcTy", + "sons": [ + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "Bp" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkProcTy" + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "Cp" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkProcTy", + "sons": [ + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "Dp" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkProcTy", + "sons": [ + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimcall" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "Ep" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkProcTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimcall" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkProcTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "bbbbbbbbbbbbbbbbbbbbbbbb" + } + ] + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/before/comments.nim b/tests/before/comments.nim new file mode 100644 index 0000000..b2d84d8 --- /dev/null +++ b/tests/before/comments.nim @@ -0,0 +1,278 @@ +# +# + +# Some commentary + +## A doc comment +## +## + +## More doc comments +## + +# +# Comment +# + + +#[ a multiline comment +this is also part of it +and this +]# + +##[ + these also come in doc variants +]## + +#[ + #[ + they can be nested + ]# +]# + +x 324 + # A comment after + +template x = + ## A template doc comment + try: + discard + except Exception: + mixin `$` # A comment after mixin + echo 4 + +type + SingleValueSetting* {.pure.} = enum ## \ + ## settings resulting in a single string value + arguments, ## experimental: the arguments passed after '-r' + backend ## the backend (eg: c|cpp|objc|js); both `nim doc --backend:js` + ## and `nim js` would imply backend=js + gc {.deprecated.} ## gc selected + mm ## memory management selected + + FileSeekPos* = enum + fspEnd ## Seek relative to end + # text file handling: + ## Position relative to which seek should happen. + # The values are ordered so that they match with stdio + # SEEK_SET, SEEK_CUR and SEEK_END respectively. + + Object = object # comment + ## more comment + field: int # Field comment + # comment between fields + field2: int ## Field comment again + # and here + + Inherited = object of RootObj # inherited eol comment + # inherited next line indent comments + f: int + + CaseObject = object # caseobj eol + case k: bool # casetype eol + of true, false: # of eol + v: string # case field eol + + SomeAlias* = int ## alias eol + ## alias next + + SomeAlias2 {.nodecl.} # after pragma + = int ## alias2 eol + + SomeAlias3 # alias after symbol + [T] = # alias after equals + int # alias after type + + SomeAlias4 = SomeAlias3[int] ## after alias4 + ## more after alias4 + + ## Some comment before whenobj + WhenObject = object # whenobject object line + when false: # when object false line + discard + + NoField0* = object of RootObj ## comment eol + ## comment nl + + NoField1* = object of RootObj ## comment nofield1 eol + ## comment nl + + +when defined(somecond): # when colon line + # when first line + discard +# comment +else: # else colon line + # else first line + discard + +if true: + # if next line + discard +else: + # else next line + discard + +if true: # if colon line + discard +else: # else colon line + discard + +if true: +# if dedented colon line + discard +# before else dedented +else: # else colon line + discard + +proc # after proc before indented name + xxx = discard + +proc xxxx = # proc eq line + # proc first line + discard + +proc x = + ## A proc doc comment + if true: + numberOfCharsRead -= 2 # handle Ctrl+Z as EOF + + for i in 0 ..< numberOfCharsRead: + discard + +proc x = discard + ## indented doc comment for proc + ## that is long + +# before module +import module # with a comment +import module ## with a comment + +try: # try colon line + # try first line + discard + # try last line +except: # except colon line + # except first line + discard + # except last line +finally: # Finally colon line + # finally first line + discard + # finally last line + +try: +# try first dedent line + f() +# try last dedent line +except: +# except dedent first line + discard +# except dedent last line +finally: +# finally first dedent line + discard +# finally last dedent line + + +for i in 0..1: # for colon line + # for first line + discard + +case a # case line +of true: # of colon line + # of first line + discard +else: # case else colon line + # case else first line + discard + +f do -> int: # do colon line + # do first line + discard + discard + +block: # block colon line + # block first line + discard + discard + +let x = proc(): int = # lambda eq line + # lambda first line + discard + discard +while false: # while colon line + # while first line + discard + +static: # static colon line + # static first line + discard + +discard Object( # object eol + # object first line + field: 0, # field line + field2: # field colon line + # Field colon next line + 42 +) + +a = b +## Doc comment after assignment +## needs to be double + +proc ffff = + result.add() + +## Doc comment after indented statement +## needs to be double + +abc and +# dedented comment in infix + def + +abc and + # indented comment in infix + def + +if abc and +# dedented comment in infix + def: discard + +if abc and + # indented comment in infix + def: discard + +a( + b = c # comment after keyword parameter +) + +a( + b = c +# dedented comment after keyword parameter +) + +{.pragma # comment here + .} + +proc a(v#[block]#: int, abc: int) + +let + # let first line indented + v = 53 # after v + +var + # var first line indented + v = 53 # after v + +discard # discard eol + # discard first line + 54 # discard value + +block: + f + .x + # comment between the dots + .z() + # also after call + .d() diff --git a/tests/before/comments.nim.nimph.yaml b/tests/before/comments.nim.nimph.yaml new file mode 100644 index 0000000..19485ae --- /dev/null +++ b/tests/before/comments.nim.nimph.yaml @@ -0,0 +1,2295 @@ +{ + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# Some commentary" + }, + { + "kind": "nkCommentStmt", + "comment": "## A doc comment" + }, + { + "kind": "nkCommentStmt", + "comment": "##" + }, + { + "kind": "nkCommentStmt", + "comment": "##" + }, + { + "kind": "nkCommentStmt", + "comment": "## More doc comments" + }, + { + "kind": "nkCommentStmt", + "comment": "##" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "# Comment" + }, + { + "kind": "nkCommentStmt", + "comment": "#" + }, + { + "kind": "nkCommentStmt", + "comment": "#[ a multiline comment\u000Athis is also part of it\u000Aand this\u000A]#" + }, + { + "kind": "nkCommentStmt", + "comment": "##[\u000A these also come in doc variants\u000A]##" + }, + { + "kind": "nkCommentStmt", + "comment": "#[\u000A #[\u000A they can be nested\u000A ]#\u000A]#" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkIntLit", + "intVal": 324 + } + ] + }, + { + "kind": "nkCommentStmt", + "comment": "# A comment after" + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## A template doc comment\", line: 37, col: 2, offsetA: 274, offsetB: 299)" + ], + "sons": [ + { + "kind": "nkTryStmt", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkExceptBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "Exception" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkMixinStmt", + "sons": [ + { + "kind": "nkAccQuoted", + "sons": [ + { + "kind": "nkIdent", + "ident": "$" + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "echo" + }, + { + "kind": "nkIntLit", + "intVal": 4 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPragmaExpr", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "SingleValueSetting" + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "pure" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## \\\\\", line: 45, col: 38, offsetA: 432, offsetB: 436)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 22, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## settings resulting in a single string value\", line: 46, col: 22, offsetA: 459, offsetB: 505)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "arguments", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## experimental: the arguments passed after \\\'-r\\\'\", line: 47, col: 22, offsetA: 528, offsetB: 576)" + ] + }, + { + "kind": "nkIdent", + "ident": "backend", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## the backend (eg: c|cpp|objc|js); both `nim doc --backend:js`\", line: 48, col: 22, offsetA: 599, offsetB: 662)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 22, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## and `nim js` would imply backend=js\", line: 49, col: 22, offsetA: 685, offsetB: 723)" + ] + }, + { + "kind": "nkPragmaExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "gc" + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "deprecated" + } + ] + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## gc selected\", line: 50, col: 22, offsetA: 746, offsetB: 760)" + ] + }, + { + "kind": "nkIdent", + "ident": "mm", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## memory management selected\", line: 51, col: 22, offsetA: 783, offsetB: 812)" + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "FileSeekPos" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEnumTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "fspEnd", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Seek relative to end\", line: 54, col: 11, offsetA: 847, offsetB: 870)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# text file handling:\", line: 55, col: 4, offsetA: 875, offsetB: 896)" + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "Object" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# comment\", line: 60, col: 18, offsetA: 1075, offsetB: 1084)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## more comment\", line: 61, col: 4, offsetA: 1089, offsetB: 1104)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "field" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Field comment\", line: 62, col: 15, offsetA: 1120, offsetB: 1135)" + ] + }, + { + "kind": "nkIdentDefs", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# comment between fields\", line: 63, col: 4, offsetA: 1140, offsetB: 1164)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "field2" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Field comment again\", line: 64, col: 16, offsetA: 1181, offsetB: 1203)" + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "Inherited" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# inherited eol comment\", line: 67, col: 32, offsetA: 1250, offsetB: 1273)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 32, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# inherited next line indent comments\", line: 68, col: 32, offsetA: 1306, offsetB: 1343)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkOfInherit", + "sons": [ + { + "kind": "nkIdent", + "ident": "RootObj" + } + ] + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "CaseObject" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# caseobj eol\", line: 71, col: 22, offsetA: 1378, offsetB: 1391)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkRecCase", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "k" + }, + { + "kind": "nkIdent", + "ident": "bool" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# casetype eol\", line: 72, col: 17, offsetA: 1409, offsetB: 1423)" + ] + }, + { + "kind": "nkOfBranch", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# of eol\", line: 73, col: 20, offsetA: 1444, offsetB: 1452)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkIdent", + "ident": "false" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# case field eol\", line: 74, col: 16, offsetA: 1469, offsetB: 1485)" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "SomeAlias" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "ident": "int", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## alias eol\", line: 76, col: 19, offsetA: 1506, offsetB: 1518)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## alias next\", line: 77, col: 4, offsetA: 1523, offsetB: 1536)" + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPragmaExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "SomeAlias2" + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "nodecl" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# after pragma\", line: 79, col: 24, offsetA: 1562, offsetB: 1576)" + ], + "ident": "int", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## alias2 eol\", line: 80, col: 10, offsetA: 1587, offsetB: 1600)" + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "SomeAlias3", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# alias after symbol\", line: 82, col: 13, offsetA: 1615, offsetB: 1635)" + ] + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "T" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# alias after equals\", line: 83, col: 10, offsetA: 1646, offsetB: 1666)" + ], + "ident": "int", + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# alias after type\", line: 84, col: 8, offsetA: 1675, offsetB: 1693)" + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "SomeAlias4" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "SomeAlias3" + }, + { + "kind": "nkIdent", + "ident": "int" + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## after alias4\", line: 86, col: 31, offsetA: 1726, offsetB: 1741)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## more after alias4\", line: 87, col: 4, offsetA: 1746, offsetB: 1766)" + ] + } + ] + }, + { + "kind": "nkTypeDef", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Some comment before whenobj\", line: 89, col: 2, offsetA: 1770, offsetB: 1800)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "WhenObject" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# whenobject object line\", line: 90, col: 22, offsetA: 1823, offsetB: 1847)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkRecWhen", + "sons": [ + { + "kind": "nkElifBranch", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# when object false line\", line: 91, col: 16, offsetA: 1864, offsetB: 1888)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + }, + { + "kind": "nkRecList", + "sons": [ + { + "kind": "nkNilLit" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "NoField0" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## comment eol\", line: 94, col: 32, offsetA: 1936, offsetB: 1950)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 32, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## comment nl\", line: 95, col: 32, offsetA: 1983, offsetB: 1996)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkOfInherit", + "sons": [ + { + "kind": "nkIdent", + "ident": "RootObj" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "NoField1" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkObjectTy", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## comment nofield1 eol\", line: 97, col: 32, offsetA: 2030, offsetB: 2053)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 32, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## comment nl\", line: 98, col: 32, offsetA: 2086, offsetB: 2099)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkOfInherit", + "sons": [ + { + "kind": "nkIdent", + "ident": "RootObj" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhenStmt", + "sons": [ + { + "kind": "nkElifBranch", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# when colon line\", line: 101, col: 24, offsetA: 2126, offsetB: 2143)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "defined" + }, + { + "kind": "nkIdent", + "ident": "somecond" + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# when first line\", line: 102, col: 2, offsetA: 2146, offsetB: 2163)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# comment\", line: 104, col: 0, offsetA: 2174, offsetB: 2183)" + ], + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# else colon line\", line: 105, col: 6, offsetA: 2190, offsetB: 2207)" + ], + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# else first line\", line: 106, col: 2, offsetA: 2210, offsetB: 2227)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if next line\", line: 110, col: 2, offsetA: 2250, offsetB: 2264)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# else next line\", line: 113, col: 2, offsetA: 2283, offsetB: 2299)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if colon line\", line: 116, col: 9, offsetA: 2320, offsetB: 2335)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# else colon line\", line: 118, col: 6, offsetA: 2352, offsetB: 2369)" + ], + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# if dedented colon line\", line: 122, col: 0, offsetA: 2390, offsetB: 2414)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# before else dedented\", line: 124, col: 0, offsetA: 2425, offsetB: 2447)" + ], + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# else colon line\", line: 125, col: 6, offsetA: 2454, offsetB: 2471)" + ], + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# after proc before indented name\", line: 128, col: 5, offsetA: 2488, offsetB: 2521)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "xxx" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc eq line\", line: 131, col: 12, offsetA: 2551, offsetB: 2565)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "xxxx" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# proc first line\", line: 132, col: 2, offsetA: 2568, offsetB: 2585)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## A proc doc comment\", line: 136, col: 2, offsetA: 2608, offsetB: 2629)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "-=" + }, + { + "kind": "nkIdent", + "ident": "numberOfCharsRead" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# handle Ctrl+Z as EOF\", line: 138, col: 27, offsetA: 2668, offsetB: 2690)" + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIdent", + "ident": "numberOfCharsRead" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkImportStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## indented doc comment for proc\", line: 144, col: 2, offsetA: 2764, offsetB: 2796)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## that is long\", line: 145, col: 2, offsetA: 2799, offsetB: 2814)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# before module\", line: 147, col: 0, offsetA: 2816, offsetB: 2831)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "module" + } + ] + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "module" + } + ] + }, + { + "kind": "nkTryStmt", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# try colon line\", line: 151, col: 5, offsetA: 2901, offsetB: 2917)" + ], + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# try first line\", line: 152, col: 2, offsetA: 2920, offsetB: 2936)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkExceptBranch", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# try last line\", line: 154, col: 2, offsetA: 2949, offsetB: 2964)" + ], + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# except colon line\", line: 155, col: 8, offsetA: 2973, offsetB: 2992)" + ], + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# except first line\", line: 156, col: 2, offsetA: 2995, offsetB: 3014)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkFinally", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# except last line\", line: 158, col: 2, offsetA: 3027, offsetB: 3045)" + ], + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# Finally colon line\", line: 159, col: 9, offsetA: 3055, offsetB: 3075)" + ], + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# finally first line\", line: 160, col: 2, offsetA: 3078, offsetB: 3098)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTryStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# finally last line\", line: 162, col: 2, offsetA: 3111, offsetB: 3130)" + ], + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# try first dedent line\", line: 165, col: 0, offsetA: 3137, offsetB: 3160)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + } + ] + } + ] + }, + { + "kind": "nkExceptBranch", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# try last dedent line\", line: 167, col: 0, offsetA: 3167, offsetB: 3189)" + ], + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# except dedent first line\", line: 169, col: 0, offsetA: 3198, offsetB: 3224)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkFinally", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# except dedent last line\", line: 171, col: 0, offsetA: 3235, offsetB: 3260)" + ], + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# finally first dedent line\", line: 173, col: 0, offsetA: 3270, offsetB: 3297)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# finally last dedent line\", line: 175, col: 0, offsetA: 3308, offsetB: 3334)" + ], + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for colon line\", line: 178, col: 15, offsetA: 3352, offsetB: 3368)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "i" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# for first line\", line: 179, col: 2, offsetA: 3371, offsetB: 3387)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCaseStmt", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# case line\", line: 182, col: 7, offsetA: 3406, offsetB: 3417)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkOfBranch", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# of colon line\", line: 183, col: 9, offsetA: 3427, offsetB: 3442)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# of first line\", line: 184, col: 2, offsetA: 3445, offsetB: 3460)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# case else colon line\", line: 186, col: 6, offsetA: 3477, offsetB: 3499)" + ], + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# case else first line\", line: 187, col: 2, offsetA: 3502, offsetB: 3524)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkDo", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# do colon line\", line: 190, col: 13, offsetA: 3549, offsetB: 3564)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkBlockStmt", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# block colon line\", line: 195, col: 7, offsetA: 3611, offsetB: 3629)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# block first line\", line: 196, col: 2, offsetA: 3632, offsetB: 3650)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "x" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkLambda", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# lambda eq line\", line: 200, col: 22, offsetA: 3694, offsetB: 3710)" + ], + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "int" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# lambda first line\", line: 201, col: 2, offsetA: 3713, offsetB: 3732)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkWhileStmt", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# while colon line\", line: 204, col: 13, offsetA: 3766, offsetB: 3784)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# while first line\", line: 205, col: 2, offsetA: 3787, offsetB: 3805)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkStaticStmt", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# static colon line\", line: 208, col: 8, offsetA: 3825, offsetB: 3844)" + ], + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# static first line\", line: 209, col: 2, offsetA: 3847, offsetB: 3866)" + ], + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkObjConstr", + "mid": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# object eol\", line: 212, col: 16, offsetA: 3894, offsetB: 3906)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "Object" + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# object first line\", line: 213, col: 2, offsetA: 3909, offsetB: 3928)" + ], + "ident": "field" + }, + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + }, + { + "kind": "nkExprColonExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "field2" + }, + { + "kind": "nkIntLit", + "intVal": 42 + } + ] + } + ] + } + ] + }, + { + "kind": "nkAsgn", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "b" + } + ] + }, + { + "kind": "nkCommentStmt", + "comment": "## Doc comment after assignment" + }, + { + "kind": "nkCommentStmt", + "comment": "## needs to be double" + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "ffff" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "result" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Doc comment after indented statement\", line: 227, col: 0, offsetA: 4110, offsetB: 4149)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## needs to be double\", line: 228, col: 0, offsetA: 4150, offsetB: 4171)" + ], + "ident": "abc" + }, + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# dedented comment in infix\", line: 231, col: 0, offsetA: 4181, offsetB: 4208)" + ], + "ident": "def" + } + ] + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "abc" + }, + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# indented comment in infix\", line: 235, col: 2, offsetA: 4226, offsetB: 4253)" + ], + "ident": "def" + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "abc" + }, + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# dedented comment in infix\", line: 239, col: 0, offsetA: 4272, offsetB: 4299)" + ], + "ident": "def" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "and" + }, + { + "kind": "nkIdent", + "ident": "abc" + }, + { + "kind": "nkIdent", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 3, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# indented comment in infix\", line: 243, col: 3, offsetA: 4331, offsetB: 4358)" + ], + "ident": "def" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# dedented comment after keyword parameter\", line: 252, col: 0, offsetA: 4435, offsetB: 4477)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "pragma" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "abc" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# let first line indented\", line: 261, col: 2, offsetA: 4551, offsetB: 4576)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 53 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# after v\", line: 262, col: 9, offsetA: 4586, offsetB: 4595)" + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# var first line indented\", line: 265, col: 2, offsetA: 4603, offsetB: 4628)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkIntLit", + "intVal": 53 + } + ], + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# after v\", line: 266, col: 9, offsetA: 4638, offsetB: 4647)" + ] + } + ] + }, + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkIntLit", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# discard eol\", line: 268, col: 8, offsetA: 4657, offsetB: 4670)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# discard first line\", line: 269, col: 2, offsetA: 4673, offsetB: 4693)" + ], + "intVal": 54, + "postfix": [ + "(tokType: tkComment, base: base10, spacing: {tsLeading}, indent: -1, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# discard value\", line: 270, col: 5, offsetA: 4699, offsetB: 4714)" + ] + } + ] + }, + { + "kind": "nkBlockStmt", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# also after call\", line: 277, col: 2, offsetA: 4770, offsetB: 4787)" + ], + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkDotExpr", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# comment between the dots\", line: 275, col: 2, offsetA: 4734, offsetB: 4760)" + ], + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkIdent", + "ident": "x" + } + ] + }, + { + "kind": "nkIdent", + "ident": "z" + } + ] + } + ] + }, + { + "kind": "nkIdent", + "ident": "d" + } + ] + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/before/empty.nim b/tests/before/empty.nim new file mode 100644 index 0000000..e69de29 diff --git a/tests/before/empty.nim.nimph.yaml b/tests/before/empty.nim.nimph.yaml new file mode 100644 index 0000000..7518d23 --- /dev/null +++ b/tests/before/empty.nim.nimph.yaml @@ -0,0 +1,3 @@ +{ + "kind": "nkStmtList" +} \ No newline at end of file diff --git a/tests/before/exprs.nim b/tests/before/exprs.nim new file mode 100644 index 0000000..4f4fb49 --- /dev/null +++ b/tests/before/exprs.nim @@ -0,0 +1,57 @@ +var c3 = row[p] + (if runeA != runeB: + 1 + else: + 0) + +var c3 = row[p] + (if runeA != runeB: 1 else: 0) + + +proc f: bool = + ## Comment here + ## another + (true or false) + +proc f: bool = + ## Comment here + ## another + if true: + false + else: + ## comment + ## comment 2 + if true: + ## comment + ## comment + (true or false) + else: + false + +for a in 0..<1: + discard + +for a in 0..1: + discard + +# needs spaces +for a in ^1 .. ^2: + discard + +template ttt*: untyped = + (block: + xxx)[] + + +# command syntax with colon +discard xxxx "arg": + yyy + + +res.add ( + fff() do: + yy() ) + +# we don't what `do` in let but need it in the above commend - this needs +# more investigation - this is important for templates calls like Result.valueOr +# which become ugly otherwise +let xxx = implicitdo: + return xxx \ No newline at end of file diff --git a/tests/before/exprs.nim.nimph.yaml b/tests/before/exprs.nim.nimph.yaml new file mode 100644 index 0000000..9dc56ef --- /dev/null +++ b/tests/before/exprs.nim.nimph.yaml @@ -0,0 +1,711 @@ +{ + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c3" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "row" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkStmtListExpr", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "runeA" + }, + { + "kind": "nkIdent", + "ident": "runeB" + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkVarSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "c3" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "row" + }, + { + "kind": "nkIdent", + "ident": "p" + } + ] + }, + { + "kind": "nkStmtListExpr", + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifExpr", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "!=" + }, + { + "kind": "nkIdent", + "ident": "runeA" + }, + { + "kind": "nkIdent", + "ident": "runeB" + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkElseExpr", + "sons": [ + { + "kind": "nkIntLit", + "intVal": 0 + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Comment here\", line: 10, col: 2, offsetA: 128, offsetB: 143)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## another\", line: 11, col: 2, offsetA: 146, offsetB: 156)" + ], + "sons": [ + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "f" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "bool" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## Comment here\", line: 15, col: 2, offsetA: 193, offsetB: 208)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 2, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## another\", line: 16, col: 2, offsetA: 211, offsetB: 221)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## comment\", line: 20, col: 4, offsetA: 255, offsetB: 265)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 4, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## comment 2\", line: 21, col: 4, offsetA: 270, offsetB: 282)" + ], + "sons": [ + { + "kind": "nkIfStmt", + "sons": [ + { + "kind": "nkElifBranch", + "sons": [ + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkStmtList", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## comment\", line: 23, col: 6, offsetA: 302, offsetB: 312)", + "(tokType: tkComment, base: base10, spacing: {}, indent: 6, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"## comment\", line: 24, col: 6, offsetA: 319, offsetB: 329)" + ], + "sons": [ + { + "kind": "nkPar", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "or" + }, + { + "kind": "nkIdent", + "ident": "true" + }, + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkElse", + "sons": [ + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "false" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "..<" + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkIntLit", + "intVal": 0 + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkForStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# needs spaces\", line: 35, col: 0, offsetA: 428, offsetB: 442)" + ], + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": ".." + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 1 + } + ] + }, + { + "kind": "nkPrefix", + "sons": [ + { + "kind": "nkIdent", + "ident": "^" + }, + { + "kind": "nkIntLit", + "intVal": 2 + } + ] + } + ] + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTemplateDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "ttt" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "untyped" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkBracketExpr", + "sons": [ + { + "kind": "nkStmtListExpr", + "sons": [ + { + "kind": "nkBlockStmt", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "xxx" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkDiscardStmt", + "prefix": [ + "(tokType: tkComment, base: base10, spacing: {}, indent: 0, ident: ..., iNumber: 0, fNumber: 0.0, literal: \"# command syntax with colon\", line: 44, col: 0, offsetA: 521, offsetB: 548)" + ], + "sons": [ + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "xxxx" + }, + { + "kind": "nkStrLit", + "strVal": "arg" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkIdent", + "ident": "yyy" + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkDotExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "res" + }, + { + "kind": "nkIdent", + "ident": "add" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "fff" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "yy" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkCommentStmt", + "comment": "# we don\'t what `do` in let but need it in the above commend - this needs" + }, + { + "kind": "nkCommentStmt", + "comment": "# more investigation - this is important for templates calls like Result.valueOr" + }, + { + "kind": "nkCommentStmt", + "comment": "# which become ugly otherwise" + }, + { + "kind": "nkLetSection", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "xxx" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "implicitdo" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkReturnStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "xxx" + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/before/import.nim b/tests/before/import.nim new file mode 100644 index 0000000..f05b7a1 --- /dev/null +++ b/tests/before/import.nim @@ -0,0 +1,14 @@ +import tables +import "." / tables +import "." / [tables, sets] +import sets as dummies + +import "." / [tables, sets, long, modules, even, more, more, a_really_long_module_here, more, more, more, more, more] + +import tables, sets + +from tables import Xxx, yyy + +export a, b, c + +export aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbb, cccccccccccccccccccc, dddddddddddddddddd \ No newline at end of file diff --git a/tests/before/import.nim.nimph.yaml b/tests/before/import.nim.nimph.yaml new file mode 100644 index 0000000..fcb3d4c --- /dev/null +++ b/tests/before/import.nim.nimph.yaml @@ -0,0 +1,232 @@ +{ + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "tables" + } + ] + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkStrLit", + "strVal": "." + }, + { + "kind": "nkIdent", + "ident": "tables" + } + ] + } + ] + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkStrLit", + "strVal": "." + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "tables" + }, + { + "kind": "nkIdent", + "ident": "sets" + } + ] + } + ] + } + ] + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "as" + }, + { + "kind": "nkIdent", + "ident": "sets" + }, + { + "kind": "nkIdent", + "ident": "dummies" + } + ] + } + ] + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "/" + }, + { + "kind": "nkStrLit", + "strVal": "." + }, + { + "kind": "nkBracket", + "sons": [ + { + "kind": "nkIdent", + "ident": "tables" + }, + { + "kind": "nkIdent", + "ident": "sets" + }, + { + "kind": "nkIdent", + "ident": "long" + }, + { + "kind": "nkIdent", + "ident": "modules" + }, + { + "kind": "nkIdent", + "ident": "even" + }, + { + "kind": "nkIdent", + "ident": "more" + }, + { + "kind": "nkIdent", + "ident": "more" + }, + { + "kind": "nkIdent", + "ident": "a_really_long_module_here" + }, + { + "kind": "nkIdent", + "ident": "more" + }, + { + "kind": "nkIdent", + "ident": "more" + }, + { + "kind": "nkIdent", + "ident": "more" + }, + { + "kind": "nkIdent", + "ident": "more" + }, + { + "kind": "nkIdent", + "ident": "more" + } + ] + } + ] + } + ] + }, + { + "kind": "nkImportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "tables" + }, + { + "kind": "nkIdent", + "ident": "sets" + } + ] + }, + { + "kind": "nkFromStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "tables" + }, + { + "kind": "nkIdent", + "ident": "Xxx" + }, + { + "kind": "nkIdent", + "ident": "yyy" + } + ] + }, + { + "kind": "nkExportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkIdent", + "ident": "b" + }, + { + "kind": "nkIdent", + "ident": "c" + } + ] + }, + { + "kind": "nkExportStmt", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "bbbbbbbbbbbbbbbbbbbbbbbb" + }, + { + "kind": "nkIdent", + "ident": "cccccccccccccccccccc" + }, + { + "kind": "nkIdent", + "ident": "dddddddddddddddddd" + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/before/procs.nim b/tests/before/procs.nim new file mode 100644 index 0000000..142f8aa --- /dev/null +++ b/tests/before/procs.nim @@ -0,0 +1,42 @@ +proc a = discard + +proc a(v: int) = discard +proc a(aaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbb, ccccccccccccccccccccccccccc, vvvvvvvvvvvvvvvvvvvvvv: string) = discard +proc a(aaaaaaaaaaaaaaaaaaaaaaa: int, bbbbbbbbbbbbbbbbbbbbbb: int, ccccccccccccccccccccccccccc: int, vvvvvvvvvvvvvvvvvvvvvv: string) = discard + +proc a(aaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbb, cccccccccccccccc: string): Ddddddddddddddddddddddddd = discard + +proc a(v: int) {.nimcall.} = discard +proc a(v: int) {.nimcall, pragma2, pragma3, praaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaagma, rrr.} = discard + +proc aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(v: int) = discard + + +proc aaa*(v: int) +proc aaa[A, B, C](v: int) +proc aaaa*[A, B, C](v: int) +proc aaaaa[A, B, C](aaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbb, cccccccccccccccc, ddddddddddddddddddd: int) +proc aaaa*[Aaaaaaaaaaaaaaaaaaaaaaaa, Bbbbbbbbbbbbbbbbbbbbbbbbbb, Cccccccccccccccccccccc, Dddddddddddddddddddddd](v: int) +proc aaaaaaaaa*[Aaaaaaaaaaaaaaaaaaaaaaaa, Bbbbbbbbbbbbbbbbbbbbbbbbbb, Cccccccccccccccccccccc, Dddddddddddddddddddddd](aaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbb, cccccccccccccccc, ddddddddddddddddddd: int) + +proc aaaaaaaa[T: Aaaa](v: int) +proc aaaaaaaa[Tttttttttttttttttttttttttttttttttttttttttt: Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa](v: int) +proc aaaaaaaa[T: Aaaa; S: static int](v: int) +proc aaaaaaaa[T: Aaaaaaaaaaaaaaaaaaaaaaaa | Bbbbbbbbbbbbbbbbbbbbbbbbbbbb | Cccccccccccccccccccccccccc](v: int) + +proc aaaaaaaaaaa(v: Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | Bbbbbbbbbbbbbbbbbbbbbbbbbbbbb | Cccccccccccccccccccccccccc) + +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 42 + 33 + 44 + +functionCall(aaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaa) + +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaa,aaaaaaaaaaaaaaaaa,aaaaaaaaaaaaaaaaaaaaa) + +aasdcsaa(aaaaaaaaaa = bbbbbbbbbbb, ccccccccccc = ddddddddddddd, eeeeeeeeeeee = ffffffffffff, gggggg, hhhhhhhh) + +type Ap = proc() +type Bp = proc +type Cp = proc(v: int) +type Dp = proc() {.nimcall.} +type Ep = proc {.nimcall.} +type Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = proc {.bbbbbbbbbbbbbbbbbbbbbbbb.} \ No newline at end of file diff --git a/tests/before/procs.nim.nimph.yaml b/tests/before/procs.nim.nimph.yaml new file mode 100644 index 0000000..43d0fba --- /dev/null +++ b/tests/before/procs.nim.nimph.yaml @@ -0,0 +1,1778 @@ +{ + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "bbbbbbbbbbbbbbbbbbbbbb" + }, + { + "kind": "nkIdent", + "ident": "ccccccccccccccccccccccccccc" + }, + { + "kind": "nkIdent", + "ident": "vvvvvvvvvvvvvvvvvvvvvv" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "bbbbbbbbbbbbbbbbbbbbbb" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "ccccccccccccccccccccccccccc" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "vvvvvvvvvvvvvvvvvvvvvv" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkIdent", + "ident": "Ddddddddddddddddddddddddd" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "bbbbbbbbbbbbbbbbbbbbbb" + }, + { + "kind": "nkIdent", + "ident": "cccccccccccccccc" + }, + { + "kind": "nkIdent", + "ident": "string" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimcall" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "a" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimcall" + }, + { + "kind": "nkIdent", + "ident": "pragma2" + }, + { + "kind": "nkIdent", + "ident": "pragma3" + }, + { + "kind": "nkIdent", + "ident": "praaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaagma" + }, + { + "kind": "nkIdent", + "ident": "rrr" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkStmtList", + "sons": [ + { + "kind": "nkDiscardStmt", + "sons": [ + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "aaa" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaa" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "A" + }, + { + "kind": "nkIdent", + "ident": "B" + }, + { + "kind": "nkIdent", + "ident": "C" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "aaaa" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "A" + }, + { + "kind": "nkIdent", + "ident": "B" + }, + { + "kind": "nkIdent", + "ident": "C" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaa" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "A" + }, + { + "kind": "nkIdent", + "ident": "B" + }, + { + "kind": "nkIdent", + "ident": "C" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "bbbbbbbbbbbbbbbbbbb" + }, + { + "kind": "nkIdent", + "ident": "cccccccccccccccc" + }, + { + "kind": "nkIdent", + "ident": "ddddddddddddddddddd" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "aaaa" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "Aaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "Bbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + { + "kind": "nkIdent", + "ident": "Cccccccccccccccccccccc" + }, + { + "kind": "nkIdent", + "ident": "Dddddddddddddddddddddd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkPostfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "*" + }, + { + "kind": "nkIdent", + "ident": "aaaaaaaaa" + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "Aaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "Bbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + { + "kind": "nkIdent", + "ident": "Cccccccccccccccccccccc" + }, + { + "kind": "nkIdent", + "ident": "Dddddddddddddddddddddd" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "bbbbbbbbbbbbbbbbbbb" + }, + { + "kind": "nkIdent", + "ident": "cccccccccccccccc" + }, + { + "kind": "nkIdent", + "ident": "ddddddddddddddddddd" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaa" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "T" + }, + { + "kind": "nkIdent", + "ident": "Aaaa" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaa" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "Tttttttttttttttttttttttttttttttttttttttttt" + }, + { + "kind": "nkIdent", + "ident": "Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaa" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "T" + }, + { + "kind": "nkIdent", + "ident": "Aaaa" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "S" + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "static" + }, + { + "kind": "nkIdent", + "ident": "int" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaa" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkGenericParams", + "sons": [ + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "T" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "|" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "|" + }, + { + "kind": "nkIdent", + "ident": "Aaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "Bbbbbbbbbbbbbbbbbbbbbbbbbbbb" + } + ] + }, + { + "kind": "nkIdent", + "ident": "Cccccccccccccccccccccccccc" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkProcDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaa" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "|" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "|" + }, + { + "kind": "nkIdent", + "ident": "Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "Bbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + } + ] + }, + { + "kind": "nkIdent", + "ident": "Cccccccccccccccccccccccccc" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkCommand", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkInfix", + "sons": [ + { + "kind": "nkIdent", + "ident": "+" + }, + { + "kind": "nkIntLit", + "intVal": 42 + }, + { + "kind": "nkIntLit", + "intVal": 33 + } + ] + }, + { + "kind": "nkIntLit", + "intVal": 44 + } + ] + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "functionCall" + }, + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaa" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "aaaaaaaaaaaaaaaaaaaaa" + } + ] + }, + { + "kind": "nkCall", + "sons": [ + { + "kind": "nkIdent", + "ident": "aasdcsaa" + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "aaaaaaaaaa" + }, + { + "kind": "nkIdent", + "ident": "bbbbbbbbbbb" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "ccccccccccc" + }, + { + "kind": "nkIdent", + "ident": "ddddddddddddd" + } + ] + }, + { + "kind": "nkExprEqExpr", + "sons": [ + { + "kind": "nkIdent", + "ident": "eeeeeeeeeeee" + }, + { + "kind": "nkIdent", + "ident": "ffffffffffff" + } + ] + }, + { + "kind": "nkIdent", + "ident": "gggggg" + }, + { + "kind": "nkIdent", + "ident": "hhhhhhhh" + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "Ap" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkProcTy", + "sons": [ + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "Bp" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkProcTy" + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "Cp" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkProcTy", + "sons": [ + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkIdentDefs", + "sons": [ + { + "kind": "nkIdent", + "ident": "v" + }, + { + "kind": "nkIdent", + "ident": "int" + }, + { + "kind": "nkEmpty" + } + ] + } + ] + }, + { + "kind": "nkEmpty" + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "Dp" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkProcTy", + "sons": [ + { + "kind": "nkFormalParams", + "sons": [ + { + "kind": "nkEmpty" + } + ] + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimcall" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "Ep" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkProcTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "nimcall" + } + ] + } + ] + } + ] + } + ] + }, + { + "kind": "nkTypeSection", + "sons": [ + { + "kind": "nkTypeDef", + "sons": [ + { + "kind": "nkIdent", + "ident": "Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "kind": "nkEmpty" + }, + { + "kind": "nkProcTy", + "sons": [ + { + "kind": "nkEmpty" + }, + { + "kind": "nkPragma", + "sons": [ + { + "kind": "nkIdent", + "ident": "bbbbbbbbbbbbbbbbbbbbbbbb" + } + ] + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file