Nimsuggest now defines the backends symbol (#21083)

* Add testcase

* Define the backend symbol

* Remove unneeded whitespace
This commit is contained in:
Jake Leahy
2022-12-13 08:19:02 +11:00
committed by GitHub
parent 4388636010
commit b0a850adbf
3 changed files with 13 additions and 2 deletions

View File

@@ -27,7 +27,7 @@ import compiler / [options, commands, modules, sem,
passes, passaux, msgs,
sigmatch, ast,
idents, modulegraphs, prefixmatches, lineinfos, cmdlinehelper,
pathutils]
pathutils, condsyms]
when defined(nimPreviewSlimSystem):
import std/typedthreads
@@ -553,6 +553,7 @@ proc mainCommand(graph: ModuleGraph) =
registerPass graph, verbosePass
registerPass graph, semPass
conf.setCmd cmdIdeTools
defineSymbol(conf.symbols, $conf.backend)
wantMainModule(conf)
if not fileExists(conf.projectFull):
@@ -952,10 +953,12 @@ else:
proc mockCommand(graph: ModuleGraph) =
retval = graph
let conf = graph.config
conf.setCmd cmdIdeTools
defineSymbol(conf.symbols, $conf.backend)
clearPasses(graph)
registerPass graph, verbosePass
registerPass graph, semPass
conf.setCmd cmdIdeTools
wantMainModule(conf)
if not fileExists(conf.projectFull):

View File

@@ -0,0 +1,7 @@
when not defined(js):
{.fatal: "Crash".}
echo 4
discard """
$nimsuggest --v3 --tester $file
"""

View File

@@ -0,0 +1 @@
switch("backend", "js")