mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-21 16:31:39 +00:00
Fix casing in rule 'typeDesc' (#7324)
Also, leave a note in grammar.txt that it is generated.
This commit is contained in:
committed by
Andreas Rumpf
parent
8683c8a389
commit
ac10a3813a
@@ -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:
|
||||
|
||||
@@ -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?)*
|
||||
|
||||
Reference in New Issue
Block a user