NimScript support now works
This commit is contained in:
parent
2cf03313fd
commit
740a1551d0
1 changed files with 6 additions and 3 deletions
|
|
@ -24,7 +24,7 @@ proc isStrLit(n: PNode): bool = n.kind in {nkStrLit..nkTripleStrLit}
|
||||||
proc getGlobal(ident: string): string =
|
proc getGlobal(ident: string): string =
|
||||||
let n = vm.globalCtx.getGlobalValue(getSysSym ident)
|
let n = vm.globalCtx.getGlobalValue(getSysSym ident)
|
||||||
if n.isStrLit:
|
if n.isStrLit:
|
||||||
result = n.strVal
|
result = if n.strVal.isNil: "" else: n.strVal
|
||||||
else:
|
else:
|
||||||
raiseVariableError(ident, "string")
|
raiseVariableError(ident, "string")
|
||||||
|
|
||||||
|
|
@ -34,7 +34,7 @@ proc getGlobalAsSeq(ident: string): seq[string] =
|
||||||
if n.kind == nkBracket:
|
if n.kind == nkBracket:
|
||||||
for x in n:
|
for x in n:
|
||||||
if x.isStrLit:
|
if x.isStrLit:
|
||||||
result.add n.strVal
|
result.add x.strVal
|
||||||
else:
|
else:
|
||||||
raiseVariableError(ident, "seq[string]")
|
raiseVariableError(ident, "seq[string]")
|
||||||
else:
|
else:
|
||||||
|
|
@ -54,6 +54,7 @@ proc extractRequires(result: var seq[PkgTuple]) =
|
||||||
raiseVariableError("requiresData", "seq[(string, VersionReq)]")
|
raiseVariableError("requiresData", "seq[(string, VersionReq)]")
|
||||||
|
|
||||||
proc readPackageInfoFromNims*(scriptName: string; result: var PackageInfo) =
|
proc readPackageInfoFromNims*(scriptName: string; result: var PackageInfo) =
|
||||||
|
setDefaultLibpath()
|
||||||
passes.gIncludeFile = includeModule
|
passes.gIncludeFile = includeModule
|
||||||
passes.gImportModule = importModule
|
passes.gImportModule = importModule
|
||||||
initDefines()
|
initDefines()
|
||||||
|
|
@ -103,7 +104,9 @@ proc readPackageInfoFromNims*(scriptName: string; result: var PackageInfo) =
|
||||||
result.bin.add(i.addFileExt(ExeExt))
|
result.bin.add(i.addFileExt(ExeExt))
|
||||||
|
|
||||||
let backend = getGlobal("backend")
|
let backend = getGlobal("backend")
|
||||||
if cmpIgnoreStyle(backend, "javascript") == 0:
|
if backend.len == 0:
|
||||||
|
result.backend = "c"
|
||||||
|
elif cmpIgnoreStyle(backend, "javascript") == 0:
|
||||||
result.backend = "js"
|
result.backend = "js"
|
||||||
else:
|
else:
|
||||||
result.backend = backend.toLower()
|
result.backend = backend.toLower()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue