diff options
author | Robert Hencke <robert.hencke@gmail.com> | 2018-03-12 04:27:36 -0400 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-03-12 09:27:36 +0100 |
commit | ac10a3813a272ae25b3a9702b2e6facc00b023e4 (patch) | |
tree | 3731a5de01b0fdc36ba1a6ca93ad327dfc1f9f5a | |
parent | 8683c8a3891b1d05ed9316d6c1417ba66ada1739 (diff) | |
download | Nim-ac10a3813a272ae25b3a9702b2e6facc00b023e4.tar.gz |
Fix casing in rule 'typeDesc' (#7324)
Also, leave a note in grammar.txt that it is generated.
-rw-r--r-- | compiler/parser.nim | 4 | ||||
-rw-r--r-- | doc/grammar.txt | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/compiler/parser.nim b/compiler/parser.nim index 4974abcc3..1ae7646cd 100644 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -17,6 +17,8 @@ # In fact the grammar is generated from this file: when isMainModule: + # Leave a note in grammar.txt that it is generated: + #| # This file is generated by compiler/parser.nim. import pegs var outp = open("doc/grammar.txt", fmWrite) for line in lines("compiler/parser.nim"): @@ -1675,7 +1677,7 @@ proc parseSection(p: var TParser, kind: TNodeKind, parMessage(p, errIdentifierExpected, p.tok) proc parseConstant(p: var TParser): PNode = - #| constant = identWithPragma (colon typedesc)? '=' optInd expr indAndComment + #| constant = identWithPragma (colon typeDesc)? '=' optInd expr indAndComment result = newNodeP(nkConstDef, p) addSon(result, identWithPragma(p)) if p.tok.tokType == tkColon: diff --git a/doc/grammar.txt b/doc/grammar.txt index eae3694a0..f25b079f4 100644 --- a/doc/grammar.txt +++ b/doc/grammar.txt @@ -1,3 +1,4 @@ +# This file is generated by compiler/parser.nim. module = stmt ^* (';' / IND{=}) comma = ',' COMMENT? semicolon = ';' COMMENT? @@ -155,7 +156,7 @@ routine = optInd identVis pattern? genericParamList? paramListColon pragma? ('=' COMMENT? stmt)? indAndComment commentStmt = COMMENT section(p) = COMMENT? p / (IND{>} (p / COMMENT)^+IND{=} DED) -constant = identWithPragma (colon typedesc)? '=' optInd expr indAndComment +constant = identWithPragma (colon typeDesc)? '=' optInd expr indAndComment enum = 'enum' optInd (symbol optInd ('=' optInd expr COMMENT?)? comma?)+ objectWhen = 'when' expr colcom objectPart COMMENT? ('elif' expr colcom objectPart COMMENT?)* |