mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 08:55:11 +01:00
Add a built-in token.ID for the 0 literal.
This commit is contained in:
1 parent
1bfd5804bf
commit
a0a9975815
2 files changed
+5
-2
No files matched your search
@@ -28,7 +28,7 @@ var (
|
||||
one = big.NewInt(1)
|
||||
ffff = big.NewInt(0xFFFF)
|
||||
|
||||
zeroExpr = a.NewExpr(a.FlagsTypeChecked, 0, t.IDUnderscore, nil, nil, nil, nil)
|
||||
zeroExpr = a.NewExpr(a.FlagsTypeChecked, 0, t.IDZero, nil, nil, nil, nil)
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -168,7 +168,7 @@ func (q *checker) bcheckStatement(n *a.Node) error {
|
||||
lhs.SetMType(n.XType())
|
||||
rhs := n.Value()
|
||||
if rhs == nil {
|
||||
// "var x T" has an implicit "= _".
|
||||
// "var x T" has an implicit "= 0".
|
||||
//
|
||||
// TODO: check that T is an integer type.
|
||||
rhs = zeroExpr
|
||||
|
||||
Reference in new issue
Block a user