summary refs log tree commit diff stats
path: root/doc/grammar.txt
Commit message (Expand)AuthorAgeFilesLines
* type annotations for variable tuple unpacking, better error messages (#22611)metagn2023-09-011-1/+1
* Fix grammar top rule (#22325)Khaled Hammouda2023-07-241-1/+1
* make binary `not` not parse complex expressions on right side (#22078)metagn2023-06-121-3/+3
* post expr blocks colon fix + correct grammar (#21983)metagn2023-06-061-11/+15
* make grammar a bit more honest (#21655)metagn2023-04-141-9/+10
* tuple unpacking for vars as just sugar, allowing nesting (#21563)metagn2023-03-281-1/+2
* fix issue #20922 by handling missing expr in `exprList` for `tkOf` (#20930)Vindaar2022-12-081-3/+4
* Named arguments in commands + many grammar fixes (#20994)metagn2022-12-061-21/+30
* correct grammar (ref #20199) and add check for grammar.txt (#20494)ringabout2022-10-061-2/+1
* add default field support for object in ARC/ORC (#20480)ringabout2022-10-041-1/+1
* remove deprecated type pragma syntax, fix bugs that required it (#20199)metagn2022-09-031-1/+1
* Allow full commands and blocks in type sections (#19181)hlaaftana2022-01-021-2/+3
* fixes grammar typos [backport] (#19289)Andreas Rumpf2021-12-271-3/+3
* formal grammar updates [backport:1.2] (#18803)Andreas Rumpf2021-09-041-21/+16
* fix RFC #341: dot-like operators are now parsed with same precedence as `.` (...Timothee Cour2021-08-251-0/+2
* custom integer literals (#17489)Andreas Rumpf2021-03-241-1/+2
* small fix in grammar.txt [ci skip]narimiran2021-01-281-1/+1
* implements https://github.com/nim-lang/RFCs/issues/258 (#15503)Andreas Rumpf2020-10-061-11/+11
* make `from` an operator (#14241)hlaaftana2020-05-081-1/+1
* Update grammar.txt with `func` and `as` (#14147) [backport]hlaaftana2020-04-281-1/+2
* fixes #10665 (#13141) [backport]Andreas Rumpf2020-01-141-23/+25
* parser/grammar sync; fixes #9608 [backport]Andreas Rumpf2018-11-071-4/+5
* added the 'x.p[:T]' notation for explicit generic instantiations in combinati...Araq2018-04-061-2/+3
* Fix casing in rule 'typeDesc' (#7324)Robert Hencke2018-03-121-1/+2
* Block expressions (#6695)Fabian Keller2017-11-061-1/+3
* parser enhancement: allow keywords after dotsAndreas Rumpf2017-07-111-6/+6
* assignments support ': stmtList' like let/var doAndreas Rumpf2017-04-041-1/+1
* update grammar.txtAndreas Rumpf2017-04-021-1/+2
* grammar updateAndreas Rumpf2017-03-311-4/+2
* first version of .partial objectsAndreas Rumpf2016-02-281-1/+3
* 'out T' is an alias for 'var T'Araq2015-11-261-6/+9
* fixes #2533Araq2015-04-241-1/+1
* breaking change: 'concept' is now a keyword and used instead of 'generic'Araq2015-03-231-6/+6
* fixes #1805Araq2015-03-211-14/+10
* 'discard' can be used instead of 'nil' for empty case object branchesAraq2015-01-121-1/+1
* compiler\parser.nimAraq2014-12-081-11/+12
* implements 'defer'Araq2014-12-041-1/+2
* fixes #1161Araq2014-07-011-1/+4
* Regenerate docsflaviut2014-06-081-1/+1
* fix overlooked grammer commentflaviut2014-06-081-0/+1
* updated grammer, fixed oversightflaviut2014-06-041-2/+1
* cleaned up command expressionsAraq2014-02-021-2/+1
* typeClasses now documented in grammar.txtAraq2014-01-231-0/+4
* updated grammar.txtAraq2014-01-201-14/+16
* support for multiple modules of the same name; niminst supports 'platforms'; ...Araq2013-09-241-3/+4
* fixes semicolon parsing issueAraq2013-06-031-1/+1
* 'inject' for 'for' loop variablesAraq2013-05-141-2/+2
* more intuitive behaviour for 'discardable' in expression bodiesAraq2013-05-041-3/+11
* new parsing scheme is documentedAraq2013-04-211-203/+180
* Removes executable bit for text files.Grzegorz Adam Hankiewicz2013-03-161-0/+0
/span>.repr sort(results, cmp[string]) let res = results.join("\n") & "\n" echo res if expected.len > 0: assert res == expected echo "End symchoice." else: echo "Non-symbol node: ", sym.kind if expected.len > 0: assert $sym.kind == expected macro inspectUntyped(sym: untyped, expected: static[string]): untyped = let res = sym.repr echo "Untyped node: ", res assert res == expected inspectSymbol templateWithtouParams, "nnkCommand" # this template is expanded, because bindSym was not used # the end result is the template body (nnkCommand) inspectSymbol bindSym("templateWithtouParams"), """ template templateWithtouParams() = echo 10 """ inspectSymbol macroWithoutParams, "nnkEmpty" # Just like the template above, the macro was expanded inspectSymbol bindSym("macroWithoutParams"), """ macro macroWithoutParams(): untyped = discard """ inspectSymbol normalMacro, """ macro normalMacro(x: int): untyped = discard """ # Since the normalMacro has params, it's automatically # treated as a symbol here (no need for `bindSym`) inspectSymbol bindSym("normalMacro"), """ macro normalMacro(x: int): untyped = discard """ inspectSymbol normalTemplate, """ template normalTemplate(x: int) = echo x """ inspectSymbol bindSym("normalTemplate"), """ template normalTemplate(x: int) = echo x """ inspectSymbol overloadedTemplate, """ template overloadedTemplate(x: int) = echo x template overloadedTemplate(x: string) = echo x """ inspectSymbol bindSym("overloadedTemplate"), """ template overloadedTemplate(x: int) = echo x template overloadedTemplate(x: string) = echo x """ inspectUntyped bindSym("overloadedTemplate"), """bindSym("overloadedTemplate")""" # binSym is active only in the presense of `typed` params. # `untyped` params still get the raw AST inspectSymbol normalProc, """ proc normalProc(x: int) = echo [x] """ inspectSymbol bindSym("normalProc"), """ proc normalProc(x: int) = echo [x] """ inspectSymbol overloadedProc, """ proc overloadedProc(x: int) = echo [x] proc overloadedProc(x: string) = echo [x] proc overloadedProc[T](x: T) = echo x """ # XXX: There seems to be a repr rendering problem above. # Notice that `echo [x]` inspectSymbol overloadedProc[float], """ proc overloadedProc(x: T) = echo [x] """ # As expected, when we select a specific generic, the # AST is no longer a symChoice inspectSymbol bindSym("overloadedProc"), """ proc overloadedProc(x: int) = echo [x] proc overloadedProc(x: string) = echo [x] proc overloadedProc[T](x: T) = echo x """