parent
016a8ccd7a
commit
87229e272e
6 changed files with 24 additions and 4 deletions
|
|
@ -60,6 +60,10 @@
|
||||||
|
|
||||||
- Removed `.travis.yml`, `appveyor.yml.disabled`, `.github/workflows/ci.yml.disabled`.
|
- Removed `.travis.yml`, `appveyor.yml.disabled`, `.github/workflows/ci.yml.disabled`.
|
||||||
|
|
||||||
|
- Nim compiler now adds ASCII unit separator `\31` before a newline for every generated
|
||||||
|
message (potentially multiline), so tooling can tell when messages start and end.
|
||||||
|
|
||||||
|
|
||||||
## Standard library additions and changes
|
## Standard library additions and changes
|
||||||
- Added support for parenthesized expressions in `strformat`
|
- Added support for parenthesized expressions in `strformat`
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -349,7 +349,8 @@ proc mainCommand*(graph: ModuleGraph) =
|
||||||
(key: "warnings", val: warnings),
|
(key: "warnings", val: warnings),
|
||||||
]
|
]
|
||||||
|
|
||||||
msgWriteln(conf, $dumpdata, {msgStdout, msgSkipHook})
|
msgWriteln(conf, $dumpdata, {msgStdout, msgSkipHook, msgNoUnitSep})
|
||||||
|
# `msgNoUnitSep` to avoid generating invalid json, refs bug #17853
|
||||||
else:
|
else:
|
||||||
msgWriteln(conf, "-- list of currently defined symbols --",
|
msgWriteln(conf, "-- list of currently defined symbols --",
|
||||||
{msgStdout, msgSkipHook, msgNoUnitSep})
|
{msgStdout, msgSkipHook, msgNoUnitSep})
|
||||||
|
|
|
||||||
|
|
@ -291,6 +291,7 @@ proc `??`* (conf: ConfigRef; info: TLineInfo, filename: string): bool =
|
||||||
|
|
||||||
const
|
const
|
||||||
UnitSep = "\31"
|
UnitSep = "\31"
|
||||||
|
# this needs care to avoid issues similar to https://github.com/nim-lang/Nim/issues/17853
|
||||||
|
|
||||||
type
|
type
|
||||||
MsgFlag* = enum ## flags altering msgWriteln behavior
|
MsgFlag* = enum ## flags altering msgWriteln behavior
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ type # please make sure we have under 32 options
|
||||||
optImportHidden
|
optImportHidden
|
||||||
|
|
||||||
TOptions* = set[TOption]
|
TOptions* = set[TOption]
|
||||||
TGlobalOption* = enum # **keep binary compatible**
|
TGlobalOption* = enum
|
||||||
gloptNone, optForceFullMake,
|
gloptNone, optForceFullMake,
|
||||||
optWasNimscript, # redundant with `cmdNimscript`, could be removed
|
optWasNimscript, # redundant with `cmdNimscript`, could be removed
|
||||||
optListCmd, optCompileOnly, optNoLinking,
|
optListCmd, optCompileOnly, optNoLinking,
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,7 @@ ret=[s1:foobar s2:foobar age:25 pi:3.14]
|
||||||
|
|
||||||
else: # don't run twice the same test
|
else: # don't run twice the same test
|
||||||
import std/strutils
|
import std/strutils
|
||||||
|
import std/json
|
||||||
template check2(msg) = doAssert msg in output, output
|
template check2(msg) = doAssert msg in output, output
|
||||||
|
|
||||||
block: # tests with various options `nim doc --project --index --docroot`
|
block: # tests with various options `nim doc --project --index --docroot`
|
||||||
|
|
@ -317,3 +318,13 @@ compiling: v3
|
||||||
running: v3
|
running: v3
|
||||||
running: v2
|
running: v2
|
||||||
""", ret
|
""", ret
|
||||||
|
|
||||||
|
block: # nim dump
|
||||||
|
let cmd = fmt"{nim} dump --dump.format:json -d:D20210428T161003 --hints:off ."
|
||||||
|
let (ret, status) = execCmdEx(cmd)
|
||||||
|
doAssert status == 0
|
||||||
|
let j = ret.parseJson
|
||||||
|
# sanity checks
|
||||||
|
doAssert "D20210428T161003" in j["defined_symbols"].to(seq[string])
|
||||||
|
doAssert j["version"].to(string) == NimVersion
|
||||||
|
doAssert j["nimExe"].to(string) == getCurrentCompilerExe()
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,18 @@
|
||||||
discard """
|
discard """
|
||||||
output: '''Error: cannot open 'a.nim'\31
|
output: '''
|
||||||
|
Error: cannot open 'a.nim'\31
|
||||||
Error: cannot open 'b.nim'\31
|
Error: cannot open 'b.nim'\31
|
||||||
'''
|
'''
|
||||||
targets: "c"
|
targets: "c"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import osproc
|
import osproc
|
||||||
|
from std/os import getCurrentCompilerExe
|
||||||
|
|
||||||
var ps: seq[Process] # compile & run 2 progs in parallel
|
var ps: seq[Process] # compile & run 2 progs in parallel
|
||||||
|
const nim = getCurrentCompilerExe()
|
||||||
for prog in ["a", "b"]:
|
for prog in ["a", "b"]:
|
||||||
ps.add startProcess("nim", "",
|
ps.add startProcess(nim, "",
|
||||||
["r", "--hint[Conf]=off", "--hint[Processing]=off", prog],
|
["r", "--hint[Conf]=off", "--hint[Processing]=off", prog],
|
||||||
options = {poUsePath, poDaemon, poStdErrToStdOut})
|
options = {poUsePath, poDaemon, poStdErrToStdOut})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue