:= templatable; lexer improvements
This commit is contained in:
parent
e487c0a249
commit
48dd9679bd
11 changed files with 117 additions and 166 deletions
|
|
@ -44,7 +44,6 @@ proc newStrNodeP*(kind: TNodeKind, strVal: string, p: TParser): PNode
|
|||
proc newIdentNodeP*(ident: PIdent, p: TParser): PNode
|
||||
proc expectIdentOrKeyw*(p: TParser)
|
||||
proc ExpectIdent*(p: TParser)
|
||||
proc expectIdentOrOpr*(p: TParser)
|
||||
proc parLineInfo*(p: TParser): TLineInfo
|
||||
proc Eat*(p: var TParser, TokType: TTokType)
|
||||
proc skipInd*(p: var TParser)
|
||||
|
|
@ -101,10 +100,6 @@ proc ExpectIdent(p: TParser) =
|
|||
if p.tok.tokType != tkSymbol:
|
||||
lexMessage(p.lex[], errIdentifierExpected, tokToStr(p.tok))
|
||||
|
||||
proc expectIdentOrOpr(p: TParser) =
|
||||
if not (p.tok.tokType in tokOperators):
|
||||
lexMessage(p.lex[], errOperatorExpected, tokToStr(p.tok))
|
||||
|
||||
proc Eat(p: var TParser, TokType: TTokType) =
|
||||
if p.tok.TokType == TokType: getTok(p)
|
||||
else: lexMessage(p.lex[], errTokenExpected, TokTypeToStr[tokType])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue