preparations for dealing with the 'echo $foo' gotcha
This commit is contained in:
parent
7720c0aafd
commit
e80840c40a
4 changed files with 19 additions and 9 deletions
|
|
@ -241,9 +241,15 @@ proc isOperator(tok: TToken): bool =
|
|||
|
||||
proc isUnary(p: TParser): bool =
|
||||
## Check if the current parser token is a unary operator
|
||||
p.strongSpaces and p.tok.tokType in {tkOpr, tkDotDot} and
|
||||
p.tok.strongSpaceB == 0 and
|
||||
p.tok.strongSpaceA > 0
|
||||
if p.tok.tokType in {tkOpr, tkDotDot} and
|
||||
p.tok.strongSpaceB == 0 and
|
||||
p.tok.strongSpaceA > 0:
|
||||
# XXX change this after 0.10.4 is out
|
||||
if p.strongSpaces:
|
||||
result = true
|
||||
else:
|
||||
parMessage(p, warnDeprecated,
|
||||
"will be parsed as unary operator; inconsistent spacing")
|
||||
|
||||
proc checkBinary(p: TParser) {.inline.} =
|
||||
## Check if the current parser token is a binary operator.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue