mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 16:47:28 +01:00
Add a nullptr literal
This commit is contained in:
1 parent
fdf152f8b3
commit
15f2f42b77
8 files changed
+88
-44
No files matched your search
@@ -45,8 +45,10 @@ func (g *gen) writeExpr(b *buffer, n *a.Expr, rp replacementPolicy, depth uint32
|
||||
}
|
||||
|
||||
if cv := n.ConstValue(); cv != nil {
|
||||
if !n.MType().IsBool() {
|
||||
if typ := n.MType(); typ.IsNumTypeOrIdeal() {
|
||||
b.writes(cv.String())
|
||||
} else if typ.IsNullptr() {
|
||||
b.writes("NULL")
|
||||
} else if cv.Cmp(zero) == 0 {
|
||||
b.writes("false")
|
||||
} else if cv.Cmp(one) == 0 {
|
||||
|
||||
Reference in new issue
Block a user