Merge branch 'master' of https://github.com/genotrance/nimterop
This commit is contained in:
commit
9c206fea4f
3 changed files with 6 additions and 1 deletions
|
|
@ -239,7 +239,8 @@ proc genNimAst(root: TSNode) =
|
|||
case $node.tsNodeType():
|
||||
of "ERROR":
|
||||
let (line, col) = getLineCol(node)
|
||||
echo &"# Potentially invalid syntax at line {line} column {col}"
|
||||
let file = gStateRT.sourceFile
|
||||
echo &"# [toast] Potentially invalid syntax at {file}:{line}:{col}"
|
||||
of "preproc_def":
|
||||
pPreprocDef(node)
|
||||
of "type_definition":
|
||||
|
|
@ -253,6 +254,7 @@ proc genNimAst(root: TSNode) =
|
|||
if $node.tsNodeParent.tsNodeType() notin ["type_definition", "declaration"]:
|
||||
pEnumSpecifier(node)
|
||||
else:
|
||||
# TODO: log
|
||||
discard
|
||||
else:
|
||||
return
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ type
|
|||
consts*, procs*, types*: seq[string]
|
||||
|
||||
code*, constStr*, currentHeader*, mode*, procStr*, typeStr*: string
|
||||
sourceFile*: string # eg, C or C++ source or header file
|
||||
|
||||
var
|
||||
gStateCT* {.compiletime.}: State
|
||||
|
|
|
|||
|
|
@ -63,6 +63,8 @@ proc process(path: string) =
|
|||
defer:
|
||||
parser.tsParserDelete()
|
||||
|
||||
gStateRT.sourceFile = path
|
||||
|
||||
if gStateRT.mode.len == 0:
|
||||
gStateRT.mode = modeDefault
|
||||
elif ext in [".h", ".c"]:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue