undocumented feature: JS backend: unit and group separators generate hash and at symbols
This commit is contained in:
parent
ba273057e3
commit
66f37971e9
1 changed files with 9 additions and 1 deletions
|
|
@ -1234,10 +1234,18 @@ proc genPatternCall(p: PProc; n: PNode; pat: string; typ: PType;
|
||||||
genOtherArg(p, n, j, typ, generated, r)
|
genOtherArg(p, n, j, typ, generated, r)
|
||||||
inc j
|
inc j
|
||||||
inc i
|
inc i
|
||||||
|
of '\31':
|
||||||
|
# unit separator
|
||||||
|
add(r.res, "#")
|
||||||
|
inc i
|
||||||
|
of '\29':
|
||||||
|
# group separator
|
||||||
|
add(r.res, "@")
|
||||||
|
inc i
|
||||||
else:
|
else:
|
||||||
let start = i
|
let start = i
|
||||||
while i < pat.len:
|
while i < pat.len:
|
||||||
if pat[i] notin {'@', '#'}: inc(i)
|
if pat[i] notin {'@', '#', '\31', '\29'}: inc(i)
|
||||||
else: break
|
else: break
|
||||||
if i - 1 >= start:
|
if i - 1 >= start:
|
||||||
add(r.res, substr(pat, start, i - 1))
|
add(r.res, substr(pat, start, i - 1))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue