fixes #3300
This commit is contained in:
parent
f1a17990be
commit
5eaf68882e
1 changed files with 1 additions and 1 deletions
|
|
@ -3042,7 +3042,7 @@ template spliceImpl(s, a, L, b: expr): stmt {.immediate.} =
|
||||||
# fill the hole:
|
# fill the hole:
|
||||||
for i in 0 .. <b.len: s[i+a] = b[i]
|
for i in 0 .. <b.len: s[i+a] = b[i]
|
||||||
|
|
||||||
when hasAlloc:
|
when hasAlloc or defined(nimscript):
|
||||||
proc `[]`*(s: string, x: Slice[int]): string {.inline.} =
|
proc `[]`*(s: string, x: Slice[int]): string {.inline.} =
|
||||||
## slice operation for strings.
|
## slice operation for strings.
|
||||||
result = s.substr(x.a, x.b)
|
result = s.substr(x.a, x.b)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue