the parser finally parses 'echo {1,2}' as it should
This commit is contained in:
parent
b2c358be96
commit
ddc131cf07
18 changed files with 26 additions and 38 deletions
|
|
@ -255,13 +255,6 @@ proc isUnary(p: TParser): bool =
|
||||||
p.tok.strongSpaceB == 0 and
|
p.tok.strongSpaceB == 0 and
|
||||||
p.tok.strongSpaceA > 0:
|
p.tok.strongSpaceA > 0:
|
||||||
result = true
|
result = true
|
||||||
# versions prior to 0.13.0 used to do this:
|
|
||||||
when false:
|
|
||||||
if p.strongSpaces:
|
|
||||||
result = true
|
|
||||||
else:
|
|
||||||
parMessage(p, warnDeprecated,
|
|
||||||
"will be parsed as unary operator; inconsistent spacing")
|
|
||||||
|
|
||||||
proc checkBinary(p: TParser) {.inline.} =
|
proc checkBinary(p: TParser) {.inline.} =
|
||||||
## Check if the current parser token is a binary operator.
|
## Check if the current parser token is a binary operator.
|
||||||
|
|
@ -700,12 +693,7 @@ proc primarySuffix(p: var TParser, r: PNode, baseIndent: int): PNode =
|
||||||
result = r
|
result = r
|
||||||
|
|
||||||
template somePar() =
|
template somePar() =
|
||||||
if p.tok.strongSpaceA > 0:
|
if p.tok.strongSpaceA > 0: break
|
||||||
if p.strongSpaces:
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
parMessage(p, warnDeprecated,
|
|
||||||
"a [b] will be parsed as command syntax; spacing")
|
|
||||||
# progress guaranteed
|
# progress guaranteed
|
||||||
while p.tok.indent < 0 or
|
while p.tok.indent < 0 or
|
||||||
(p.tok.tokType == tkDot and p.tok.indent >= baseIndent):
|
(p.tok.tokType == tkDot and p.tok.indent >= baseIndent):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue