Clean up code
This commit is contained in:
parent
20cb567bf5
commit
7a9bcf4769
1 changed files with 7 additions and 12 deletions
|
|
@ -296,22 +296,17 @@ proc parseSymbol(p: var TParser, allowNil = false): PNode =
|
||||||
of tkAccent:
|
of tkAccent:
|
||||||
result = newNodeP(nkAccQuoted, p)
|
result = newNodeP(nkAccQuoted, p)
|
||||||
getTok(p)
|
getTok(p)
|
||||||
var bracketAccm = ""
|
var accm = ""
|
||||||
while true:
|
while true:
|
||||||
case p.tok.tokType
|
case p.tok.tokType
|
||||||
of tkIntLit..tkCharLit, tkBracketLe, tkBracketRi, tkParLe, tkParRi,
|
of tkAccent, tkEof:
|
||||||
tkCurlyRi, tkCurlyLe, tkEquals:
|
if accm == "":
|
||||||
bracketAccm.add(tokToStr(p.tok))
|
|
||||||
getTok(p)
|
|
||||||
of tokKeywordLow..tokKeywordHigh, tkSymbol, tkOpr, tkDot, tkDotDot:
|
|
||||||
add(result, newIdentNodeP(p.tok.ident, p))
|
|
||||||
getTok(p)
|
|
||||||
else:
|
|
||||||
if result.len == 0 and bracketAccm == "":
|
|
||||||
parMessage(p, errIdentifierExpected, p.tok)
|
parMessage(p, errIdentifierExpected, p.tok)
|
||||||
break
|
break
|
||||||
if bracketAccm != "":
|
else:
|
||||||
result.add(newIdentNodeP(getIdent(bracketAccm), p))
|
accm.add(tokToStr(p.tok))
|
||||||
|
getTok(p)
|
||||||
|
result.add(newIdentNodeP(getIdent(accm), p))
|
||||||
eat(p, tkAccent)
|
eat(p, tkAccent)
|
||||||
else:
|
else:
|
||||||
if allowNil and p.tok.tokType == tkNil:
|
if allowNil and p.tok.tokType == tkNil:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue