mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
fixes #3300
This commit is contained in:
@@ -3042,7 +3042,7 @@ template spliceImpl(s, a, L, b: expr): stmt {.immediate.} =
|
||||
# fill the hole:
|
||||
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.} =
|
||||
## slice operation for strings.
|
||||
result = s.substr(x.a, x.b)
|
||||
|
||||
Reference in New Issue
Block a user