diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-03-04 21:59:58 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-03-04 21:59:58 +0100 |
commit | 92cf673f37c077a90cc8e95f641810ae31a6fbc7 (patch) | |
tree | 4a174b84051098820f4adade68f43ae41a5a4f7b /lib/system/jssys.nim | |
parent | 180a4b7657260af5411a4bea58240d3cac2ea0fe (diff) | |
download | Nim-92cf673f37c077a90cc8e95f641810ae31a6fbc7.tar.gz |
PHP codegen: use nimAt for PHP 5.3 compatibility
Diffstat (limited to 'lib/system/jssys.nim')
-rw-r--r-- | lib/system/jssys.nim | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/system/jssys.nim b/lib/system/jssys.nim index ceeb5563f..c96f2f958 100644 --- a/lib/system/jssys.nim +++ b/lib/system/jssys.nim @@ -276,6 +276,12 @@ proc mnewString(len: int): string {.asmNoStackFrame, compilerproc.} = """ 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.} = asm """return substr(`s`,`a`,`b`-`a`+1);""" |