Commit Graph

9 Commits

Author SHA1 Message Date
Kaushal Modi
f8cef575b3 Improve dumpLisp macro (#9515)
* Improve dumpLisp macro

- Remove commas from the lisp representation of the AST.
- Make the dumpLisp output "pretty" and indented.
- Improve docs of `dumpTree` and `dumpLisp` macros.

With:

    dumpLisp:
      echo "Hello, World!"

Output before this commit:

    StmtList(Command(Ident("echo"), StrLit("Hello, World!")))

Output after this commit:

    (StmtList
     (Command
      (Ident "echo")
      (StrLit "Hello, World!")))

* Re-use the traverse proc inside treeRepr for lispRepr too

- Add module-local `treeTraverse` proc.
- Also fix treeRepr/dumpTree not printing nnkCommentStmt node contents.

* More doc string updates

* Allow unindented lispRepr output for tests

* Update a test affected by the lispRepr change

* Fix dumpTree

* Add note about lispRepr and dumpLisp to changelog [ci skip]
2018-10-27 14:10:05 +01:00
LemonBoy
f559e62e45 Adjust some tests to make them pass
The non-scoped behaviour of static blocks was exploited by those tests,
replace all the variables declared whithin one with compileTime marked
ones.
2018-06-25 15:56:13 +02:00
Arne Döring
6baca58693 Get symbol kind (#7491) 2018-04-11 16:48:01 +02:00
Arne Döring
5d46e1eaa2 Fixes #7473 (#7475)
* removed code duplication
* changelog entry, adopt tests for changes
2018-04-04 15:37:07 +02:00
Andreas Rumpf
2ad49836d9 make tests green again 2017-11-19 20:09:38 +01:00
Andreas Rumpf
414e7eff04 make tests green again 2017-09-26 23:07:37 +02:00
Fredrik Høisæther Rasch
6652ae9741 Creating and setting comment nodes in macros (#5850)
* strVal assingnable comment statement ast nodes
* Set comment instead of strVal for comment nodes
* Added test code for creating and setting comment nodes
* Modified the AST spec documentation for documentation comments
2017-05-31 13:08:08 +02:00
Arne Döring
e8a00b805f fix seq add for nim node in VM (#5253)
fixes #4821
2017-01-19 20:10:01 +01:00
Arne Döring
130f30ddb2 make quote ast a ref type (#5246)
* make quote ast a ref type
* recursive set flag isRef for quoted ast
2017-01-19 16:39:18 +01:00