make tests green again
This commit is contained in:
parent
527e20fd3a
commit
9485f1c888
4 changed files with 14 additions and 9 deletions
|
|
@ -8,5 +8,7 @@
|
||||||
- Arrays of char cannot be converted to ``cstring`` anymore, pointers to
|
- Arrays of char cannot be converted to ``cstring`` anymore, pointers to
|
||||||
arrays of char can! This means ``$`` for arrays can finally exist
|
arrays of char can! This means ``$`` for arrays can finally exist
|
||||||
in ``system.nim`` and do the right thing.
|
in ``system.nim`` and do the right thing.
|
||||||
- JSON: Deprecated `getBVal`, `getFNum`, and `getNum` in favour to
|
- JSON: Deprecated `getBVal`, `getFNum`, and `getNum` in favour to
|
||||||
`getBool`, `getFloat`, `getBiggestInt`. Also `getInt` procedure was added.
|
`getBool`, `getFloat`, `getBiggestInt`. Also `getInt` procedure was added.
|
||||||
|
- ``echo`` now works with strings that contain ``\0`` (the binary zero is not
|
||||||
|
shown) and ``nil`` strings are equal to empty strings.
|
||||||
|
|
|
||||||
|
|
@ -978,9 +978,12 @@ proc genEcho(p: BProc, n: PNode) =
|
||||||
p.module.includeHeader("<base/log.h>")
|
p.module.includeHeader("<base/log.h>")
|
||||||
linefmt(p, cpsStmts, """Genode::log(""$1);$n""", args)
|
linefmt(p, cpsStmts, """Genode::log(""$1);$n""", args)
|
||||||
else:
|
else:
|
||||||
var a: TLoc
|
if n.len == 0:
|
||||||
initLocExpr(p, n, a)
|
linefmt(p, cpsStmts, "#echoBinSafe(NIM_NIL, $1);$n", n.len.rope)
|
||||||
linefmt(p, cpsStmts, "#echoBinSafe($1, $2);$n", a.rdLoc, n.len.rope)
|
else:
|
||||||
|
var a: TLoc
|
||||||
|
initLocExpr(p, n, a)
|
||||||
|
linefmt(p, cpsStmts, "#echoBinSafe($1, $2);$n", a.rdLoc, n.len.rope)
|
||||||
when false:
|
when false:
|
||||||
p.module.includeHeader("<stdio.h>")
|
p.module.includeHeader("<stdio.h>")
|
||||||
linefmt(p, cpsStmts, "printf($1$2);$n",
|
linefmt(p, cpsStmts, "printf($1$2);$n",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
discard """
|
discard """
|
||||||
output: '''nil
|
output: '''
|
||||||
nil
|
|
||||||
nil'''
|
'''
|
||||||
"""
|
"""
|
||||||
|
|
||||||
type Bar = object
|
type Bar = object
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
discard """
|
discard """
|
||||||
output: '''10
|
output: '''10
|
||||||
10
|
10
|
||||||
nil
|
|
||||||
1'''
|
1'''
|
||||||
msg: '''
|
msg: '''
|
||||||
K=string V=int
|
K=string V=int
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue