mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-21 08:21:32 +00:00
PHP codegen: use nimAt for PHP 5.3 compatibility
This commit is contained in:
@@ -275,6 +275,12 @@ proc mnewString(len: int): string {.asmNoStackFrame, compilerproc.} =
|
||||
return result;
|
||||
"""
|
||||
|
||||
when defined(nimphp):
|
||||
proc nimAt(x: string; i: int): string {.asmNoStackFrame, compilerproc.} =
|
||||
asm """
|
||||
return `x`[`i`];
|
||||
"""
|
||||
|
||||
when defined(nimphp):
|
||||
proc nimSubstr(s: string; a, b: int): string {.
|
||||
asmNoStackFrame, compilerproc.} =
|
||||
|
||||
Reference in New Issue
Block a user