diff options
author | Araq <rumpf_a@web.de> | 2011-02-13 21:24:52 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-02-13 21:24:52 +0100 |
commit | 55c40746474cff452c09fa9c1244e3d0c7b3ad21 (patch) | |
tree | 3c3f4cf72a24b98ecabc7f259cc3018ad936ddb9 /rod/ptmplsyn.nim | |
parent | c717304ce61acdf7f980bc4ed185e7ea9e886dd5 (diff) | |
download | Nim-55c40746474cff452c09fa9c1244e3d0c7b3ad21.tar.gz |
REPL improvements
Diffstat (limited to 'rod/ptmplsyn.nim')
-rwxr-xr-x | rod/ptmplsyn.nim | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/rod/ptmplsyn.nim b/rod/ptmplsyn.nim index f428c6df8..9699f1c58 100755 --- a/rod/ptmplsyn.nim +++ b/rod/ptmplsyn.nim @@ -57,14 +57,7 @@ proc scanPar(p: var TTmplParser, d: int) = of '}': dec(p.curly) else: nil inc(i) - -proc endsWithOpr(p: TTmplParser): bool = - var i = p.x.len-1 - while i >= 0 and p.x[i] == ' ': dec(i) - if i >= 0 and p.x[i] in {'+', '-', '*', '/', '\\', '<', '>', '!', '?', '^', - '|', '%', '&', '$', '@', '~', ','}: - result = true - + proc withInExpr(p: TTmplParser): bool {.inline.} = result = p.par > 0 or p.bracket > 0 or p.curly > 0 @@ -87,7 +80,7 @@ proc parseLine(p: var TTmplParser) = inc(j) scanPar(p, j) - p.pendingExprLine = withInExpr(p) or endsWithOpr(p) + p.pendingExprLine = withInExpr(p) or llstream.endsWithOpr(p.x) case whichKeyword(keyw) of wEnd: if p.indent >= 2: |