Nimsuggest now defines the backends symbol (#21083)
* Add testcase * Define the backend symbol * Remove unneeded whitespace
This commit is contained in:
parent
4388636010
commit
b0a850adbf
3 changed files with 13 additions and 2 deletions
|
|
@ -27,7 +27,7 @@ import compiler / [options, commands, modules, sem,
|
||||||
passes, passaux, msgs,
|
passes, passaux, msgs,
|
||||||
sigmatch, ast,
|
sigmatch, ast,
|
||||||
idents, modulegraphs, prefixmatches, lineinfos, cmdlinehelper,
|
idents, modulegraphs, prefixmatches, lineinfos, cmdlinehelper,
|
||||||
pathutils]
|
pathutils, condsyms]
|
||||||
|
|
||||||
when defined(nimPreviewSlimSystem):
|
when defined(nimPreviewSlimSystem):
|
||||||
import std/typedthreads
|
import std/typedthreads
|
||||||
|
|
@ -553,6 +553,7 @@ proc mainCommand(graph: ModuleGraph) =
|
||||||
registerPass graph, verbosePass
|
registerPass graph, verbosePass
|
||||||
registerPass graph, semPass
|
registerPass graph, semPass
|
||||||
conf.setCmd cmdIdeTools
|
conf.setCmd cmdIdeTools
|
||||||
|
defineSymbol(conf.symbols, $conf.backend)
|
||||||
wantMainModule(conf)
|
wantMainModule(conf)
|
||||||
|
|
||||||
if not fileExists(conf.projectFull):
|
if not fileExists(conf.projectFull):
|
||||||
|
|
@ -952,10 +953,12 @@ else:
|
||||||
proc mockCommand(graph: ModuleGraph) =
|
proc mockCommand(graph: ModuleGraph) =
|
||||||
retval = graph
|
retval = graph
|
||||||
let conf = graph.config
|
let conf = graph.config
|
||||||
|
conf.setCmd cmdIdeTools
|
||||||
|
defineSymbol(conf.symbols, $conf.backend)
|
||||||
clearPasses(graph)
|
clearPasses(graph)
|
||||||
registerPass graph, verbosePass
|
registerPass graph, verbosePass
|
||||||
registerPass graph, semPass
|
registerPass graph, semPass
|
||||||
conf.setCmd cmdIdeTools
|
|
||||||
wantMainModule(conf)
|
wantMainModule(conf)
|
||||||
|
|
||||||
if not fileExists(conf.projectFull):
|
if not fileExists(conf.projectFull):
|
||||||
|
|
|
||||||
7
nimsuggest/tests/t20440.nim
Normal file
7
nimsuggest/tests/t20440.nim
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
when not defined(js):
|
||||||
|
{.fatal: "Crash".}
|
||||||
|
echo 4
|
||||||
|
|
||||||
|
discard """
|
||||||
|
$nimsuggest --v3 --tester $file
|
||||||
|
"""
|
||||||
1
nimsuggest/tests/t20440.nims
Normal file
1
nimsuggest/tests/t20440.nims
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
switch("backend", "js")
|
||||||
Loading…
Add table
Add a link
Reference in a new issue