summary refs log tree commit diff stats
path: root/lib/system/jssys.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-03-04 21:59:58 +0100
committerAndreas Rumpf <rumpf_a@web.de>2016-03-04 21:59:58 +0100
commit92cf673f37c077a90cc8e95f641810ae31a6fbc7 (patch)
tree4a174b84051098820f4adade68f43ae41a5a4f7b /lib/system/jssys.nim
parent180a4b7657260af5411a4bea58240d3cac2ea0fe (diff)
downloadNim-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.nim6
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);"""