mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 01:44:37 +00:00
* user defined integer literals; refs #17020 * updated renderer.nim * use mlexerutils helper * imported all test cases from https://github.com/nim-lang/Nim/pull/17020 * final grammar updated
9 lines
316 B
Nim
9 lines
316 B
Nim
import macros
|
|
|
|
macro lispReprStr*(a: untyped): untyped = newLit(a.lispRepr)
|
|
|
|
macro assertAST*(expected: string, struct: untyped): untyped =
|
|
var ast = newLit(struct.treeRepr)
|
|
result = quote do:
|
|
if `ast` != `expected`:
|
|
doAssert false, "\nGot:\n" & `ast`.indent(2) & "\nExpected:\n" & `expected`.indent(2) |