next steps for the new parser/grammar
This commit is contained in:
parent
04216fc750
commit
2796121dd7
6 changed files with 286 additions and 266 deletions
|
|
@ -81,13 +81,13 @@ proc addTok(g: var TSrcGen, kind: TTokType, s: string) =
|
|||
|
||||
proc addPendingNL(g: var TSrcGen) =
|
||||
if g.pendingNL >= 0:
|
||||
addTok(g, tkInd, "\n" & repeatChar(g.pendingNL))
|
||||
addTok(g, tkSpaces, "\n" & repeatChar(g.pendingNL))
|
||||
g.lineLen = g.pendingNL
|
||||
g.pendingNL = - 1
|
||||
|
||||
proc putNL(g: var TSrcGen, indent: int) =
|
||||
if g.pendingNL >= 0: addPendingNL(g)
|
||||
else: addTok(g, tkInd, "\n")
|
||||
else: addTok(g, tkSpaces, "\n")
|
||||
g.pendingNL = indent
|
||||
g.lineLen = indent
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue