Support for time_t

This commit is contained in:
Ganesh Viswanathan 2019-01-15 23:54:25 -06:00
commit 80b47c9d4e

View file

@ -1,3 +1,5 @@
{.experimental: "codeReordering".}
import macros, os, strformat, strutils, tables import macros, os, strformat, strutils, tables
import regex import regex
@ -44,14 +46,15 @@ const gTypeMap = {
"unsigned char": "cuchar", "unsigned char": "cuchar",
"unsigned short": "cushort", "unsigned short": "cushort",
"unsigned int": "cuint", "unsigned int": "cuint",
"unsigned long long": "culonglong" "unsigned long long": "culonglong",
"time_t": "int32"
}.toTable() }.toTable()
proc sanitizePath*(path: string): string = proc sanitizePath*(path: string): string =
path.multiReplace([("\\\\", $DirSep), ("\\", $DirSep), ("//", $DirSep)]) path.multiReplace([("\\\\", $DirSep), ("\\", $DirSep), ("//", $DirSep)])
proc getIdentifier*(str: string): string = proc getIdentifier*(str: string): string =
result = str.strip(chars={'_'}).replace(re"_+", "_") result = str.strip(chars={'_'}).replace(re"_+", "_").getType()
if result in gReserved: if result in gReserved:
result = &"`{result}`" result = &"`{result}`"