aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nimterop/getters.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/nimterop/getters.nim b/nimterop/getters.nim
index 1051e4f..51d63a7 100644
--- a/nimterop/getters.nim
+++ b/nimterop/getters.nim
@@ -161,6 +161,9 @@ proc getPtrType*(str: string): string =
str
proc getLit*(str: string): string =
+ let
+ str = str.replace(re"//.*?$", "").replace(re"/\*.*?\*/", "").strip()
+
if str.contains(re"^[\-]?[\d]+$") or
str.contains(re"^[\-]?[\d]*\.[\d]+$") or
str.contains(re"^0x[\d]+$"):