PHP codegen: use nimAt for PHP 5.3 compatibility

This commit is contained in:
Andreas Rumpf
2016-03-04 21:59:58 +01:00
parent 180a4b7657
commit 92cf673f37
2 changed files with 17 additions and 2 deletions

View File

@@ -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.} =