Handle comments in #defines
This commit is contained in:
parent
e245e17488
commit
9387de8638
1 changed files with 3 additions and 0 deletions
|
|
@ -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]+$"):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue