Handle comments in #defines

This commit is contained in:
Ganesh Viswanathan 2019-05-27 17:19:47 -05:00
commit 9387de8638

View file

@ -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]+$"):