From 9387de8638d7805130c2c9dc53e83541eb399f6b Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Mon, 27 May 2019 17:19:47 -0500 Subject: Handle comments in #defines --- nimterop/getters.nim | 3 +++ 1 file changed, 3 insertions(+) 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]+$"): -- cgit v1.2.3