From fec9de14aff1066769a0b1564ff72760ad9ba692 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Sat, 8 Apr 2017 10:08:07 +0200 Subject: [PATCH] moved isInt proc to jstrutils --- jstrutils.nim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jstrutils.nim b/jstrutils.nim index b398537..c69e2fa 100644 --- a/jstrutils.nim +++ b/jstrutils.nim @@ -16,3 +16,8 @@ proc `&`*(s: int): cstring {.importcpp: "((#)+'')", nodecl.} proc `&`*(s: bool): cstring {.importcpp: "((#)+'')", nodecl.} proc `&`*(s: cstring): cstring {.importcpp: "(#)", nodecl.} + +proc isInt*(s: cstring): bool {.asmNoStackFrame.} = + asm """ + return s.match(/^[0-9]+$/); + """