aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGanesh Viswanathan <dev@genotrance.com>2020-04-29 14:38:35 -0500
committerGanesh Viswanathan <dev@genotrance.com>2020-04-29 14:38:35 -0500
commit2278f0e49d4da012370bb8e907640b9d89ae54fa (patch)
tree28b4d7af64304c42069b7b3178daa7a2d2cc7841
parent0098947a8161f4d832bffae34ac7a0b0a5341312 (diff)
downloadnimterop-2278f0e49d4da012370bb8e907640b9d89ae54fa.tar.gz
nimterop-2278f0e49d4da012370bb8e907640b9d89ae54fa.zip
Add -f:ast1, lesser debug output
-rw-r--r--nimterop/globals.nim4
-rw-r--r--nimterop/toast.nim12
-rw-r--r--tests/lzma.nim1
-rw-r--r--tests/tast2.nim1
-rw-r--r--tests/tmath.nim1
-rw-r--r--tests/tnimterop_c.nim1
-rw-r--r--tests/tnimterop_cpp.nim1
-rw-r--r--tests/tpcre.nim1
-rw-r--r--tests/zlib.nim3
9 files changed, 9 insertions, 16 deletions
diff --git a/nimterop/globals.nim b/nimterop/globals.nim
index 5db17a3..b9352a4 100644
--- a/nimterop/globals.nim
+++ b/nimterop/globals.nim
@@ -106,7 +106,7 @@ type
nodeBranch*: seq[string]
Feature* = enum
- ast2
+ ast1, ast2
var
gStateCT {.compiletime, used.} = new(State)
@@ -123,7 +123,7 @@ when not declared(CIMPORT):
# Redirect output to file when required
template gecho*(args: string) =
if gState.outputHandle.isNil:
- echo args
+ stdout.writeLine(args)
else:
gState.outputHandle.writeLine(args)
diff --git a/nimterop/toast.nim b/nimterop/toast.nim
index 98045bf..7a41874 100644
--- a/nimterop/toast.nim
+++ b/nimterop/toast.nim
@@ -21,7 +21,7 @@ proc process(gState: State, path: string, astTable: AstTable) =
elif gState.pnim:
if Feature.ast2 in gState.feature:
ast2.parseNim(gState, path, root)
- else:
+ elif Feature.ast1 in gState.feature:
ast.parseNim(gState, path, root, astTable)
elif gState.preprocess:
gecho gState.code
@@ -33,7 +33,7 @@ proc main(
debug = false,
defines: seq[string] = @[],
dynlib: string = "",
- feature: seq[Feature] = @[],
+ feature: seq[Feature] = @[Feature.ast1],
includeHeader = false,
includeDirs: seq[string] = @[],
mode = "",
@@ -118,13 +118,13 @@ proc main(
# Process grammar into AST
let
astTable =
- if Feature.ast2 notin gState.feature:
+ if Feature.ast1 in gState.feature:
parseGrammar()
else:
nil
if pgrammar:
- if Feature.ast2 notin gState.feature:
+ if Feature.ast1 in gState.feature:
# Print AST of grammar
gState.printGrammar(astTable)
elif source.nBl:
@@ -137,8 +137,10 @@ proc main(
if gState.pnim:
if Feature.ast2 in gState.feature:
ast2.printNim(gState)
- else:
+ elif Feature.ast1 in gState.feature:
ast.printNim(gState)
+ gecho """{.hint: "The legacy wrapper generation algorithm is deprecated and will be removed in the next release of Nimterop.".}"""
+ gecho """{.hint: "Refer to CHANGES.md for details on migrating to the new backend.".}"""
# Close outputFile
if outputFile.len != 0:
diff --git a/tests/lzma.nim b/tests/lzma.nim
index 1cc6aa0..f30b974 100644
--- a/tests/lzma.nim
+++ b/tests/lzma.nim
@@ -7,7 +7,6 @@ const
flags = "--prefix=___,__,_ --suffix=__,_"
static:
- cDebug()
cSkipSymbol(@[
"PRIX8", "PRIX16", "PRIX32",
"PRIXLEAST8", "PRIXLEAST16", "PRIXLEAST32",
diff --git a/tests/tast2.nim b/tests/tast2.nim
index 4cfbeac..273d3e3 100644
--- a/tests/tast2.nim
+++ b/tests/tast2.nim
@@ -7,7 +7,6 @@ static:
# the VM does not support it
when (NimMajor, NimMinor, NimPatch) < (1, 0, 0):
cSkipSymbol @["CASTEXPR"]
- cDebug()
const
path = currentSourcePath.parentDir() / "include" / "tast2.h"
diff --git a/tests/tmath.nim b/tests/tmath.nim
index 6c7999a..8f947b2 100644
--- a/tests/tmath.nim
+++ b/tests/tmath.nim
@@ -19,7 +19,6 @@ static:
cSkipSymbol @["math_errhandling", "FP_ILOGB0", "FP_ILOGBNAN"]
else:
cSkipSymbol @["math_errhandling"]
- cDebug()
cDisableCaching()
cAddStdDir()
diff --git a/tests/tnimterop_c.nim b/tests/tnimterop_c.nim
index 8428489..20c1678 100644
--- a/tests/tnimterop_c.nim
+++ b/tests/tnimterop_c.nim
@@ -3,7 +3,6 @@ import nimterop/cimport
import nimterop/paths
static:
- cDebug()
cDisableCaching()
cAddSearchDir testsIncludeDir()
diff --git a/tests/tnimterop_cpp.nim b/tests/tnimterop_cpp.nim
index 14c8c8f..3f44e86 100644
--- a/tests/tnimterop_cpp.nim
+++ b/tests/tnimterop_cpp.nim
@@ -3,7 +3,6 @@ import nimterop/cimport
import nimterop/paths
static:
- cDebug()
cDisableCaching()
cAddSearchDir testsIncludeDir()
diff --git a/tests/tpcre.nim b/tests/tpcre.nim
index 4a426c4..51530c1 100644
--- a/tests/tpcre.nim
+++ b/tests/tpcre.nim
@@ -9,7 +9,6 @@ const
static:
if not pcreH.fileExists():
downloadUrl("https://github.com/svn2github/pcre/raw/master/pcre.h.in", baseDir)
- cDebug()
cDisableCaching()
const
diff --git a/tests/zlib.nim b/tests/zlib.nim
index 09a6df2..febc6b1 100644
--- a/tests/zlib.nim
+++ b/tests/zlib.nim
@@ -5,9 +5,6 @@ import nimterop/[build, cimport]
const
baseDir = getProjectCacheDir("nimterop" / "tests" / "zlib")
-static:
- cDebug()
-
proc zlibPreBuild(outdir, path: string) =
let
mf = outdir / "Makefile"