Add -f:ast1, lesser debug output

This commit is contained in:
Ganesh Viswanathan 2020-04-29 14:38:35 -05:00
commit 2278f0e49d
9 changed files with 9 additions and 16 deletions

View file

@ -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)

View file

@ -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:

View file

@ -7,7 +7,6 @@ const
flags = "--prefix=___,__,_ --suffix=__,_"
static:
cDebug()
cSkipSymbol(@[
"PRIX8", "PRIX16", "PRIX32",
"PRIXLEAST8", "PRIXLEAST16", "PRIXLEAST32",

View file

@ -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"

View file

@ -19,7 +19,6 @@ static:
cSkipSymbol @["math_errhandling", "FP_ILOGB0", "FP_ILOGBNAN"]
else:
cSkipSymbol @["math_errhandling"]
cDebug()
cDisableCaching()
cAddStdDir()

View file

@ -3,7 +3,6 @@ import nimterop/cimport
import nimterop/paths
static:
cDebug()
cDisableCaching()
cAddSearchDir testsIncludeDir()

View file

@ -3,7 +3,6 @@ import nimterop/cimport
import nimterop/paths
static:
cDebug()
cDisableCaching()
cAddSearchDir testsIncludeDir()

View file

@ -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

View file

@ -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"