aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGanesh Viswanathan <dev@genotrance.com>2019-05-06 23:45:25 -0500
committerGanesh Viswanathan <dev@genotrance.com>2019-05-06 23:45:25 -0500
commitd21ec6287be4882d14332c14bb302b50f1296c22 (patch)
tree27c11e5167ee1559bb57421f59b45467b791b24b
parentad90b586c4ecc2d99ce32bd70f458d9f41810293 (diff)
downloadnimterop-d21ec6287be4882d14332c14bb302b50f1296c22.tar.gz
nimterop-d21ec6287be4882d14332c14bb302b50f1296c22.zip
Fix enum identifier or'd, add configure support
-rw-r--r--nimterop/ast.nim4
-rw-r--r--nimterop/git.nim18
2 files changed, 20 insertions, 2 deletions
diff --git a/nimterop/ast.nim b/nimterop/ast.nim
index 0d96dfd..c66d504 100644
--- a/nimterop/ast.nim
+++ b/nimterop/ast.nim
@@ -13,7 +13,7 @@ proc saveNodeData(node: TSNode, nimState: NimState): bool =
if name == "primitive_type" and node.tsNodeParent.tsNodeType() == "sized_type_specifier":
return true
- if name == "number_literal" and $node.tsNodeParent.tsNodeType() in gExpressions:
+ if name in ["number_literal", "identifier"] and $node.tsNodeParent.tsNodeType() in gExpressions:
return true
if name in ["primitive_type", "sized_type_specifier"]:
@@ -174,4 +174,4 @@ proc printNim*(fullpath: string, root: TSNode, astTable: AstTable) =
echo &"{nimState.procStr}\n"
if nimState.debugStr.nBl:
- echo nimState.debugStr \ No newline at end of file
+ echo nimState.debugStr
diff --git a/nimterop/git.nim b/nimterop/git.nim
index b0380c2..c652d16 100644
--- a/nimterop/git.nim
+++ b/nimterop/git.nim
@@ -118,3 +118,21 @@ proc gitPull*(url: string, outdir = "", plist = "", checkout = "") =
else:
echo "Pulling repository"
discard execAction(&"cd {outdirQ} && git pull --depth=1 origin master")
+
+proc configure*(path, check: string) =
+ if (path / check).fileExists():
+ return
+
+ echo "Configuring " & path
+
+ if not fileExists(path / "configure"):
+ if fileExists(path / "autogen.sh"):
+ echo " Running autogen.sh"
+
+ discard execAction(&"cd {path.quoteShell} && bash autogen.sh")
+
+ if fileExists(path / "configure"):
+ echo " Running configure"
+
+ discard execAction(&"cd {path.quoteShell} && bash configure")
+