Rename typeExprU8 to typeExprPlaceholder.

This commit is contained in:
Nigel Tao committed 2017-06-11 13:55:41 +10:00
1 parent e5736cadf6
commit c27bec10d3
2 files changed
+8 -6

No files matched your search

+3 -1
View File
@@ -59,7 +59,9 @@ func trimQuotes(s string) string {
var ( var (
typeExprBool = a.NewTypeExpr(0, t.IDBool, nil, nil, nil) typeExprBool = a.NewTypeExpr(0, t.IDBool, nil, nil, nil)
typeExprIdeal = a.NewTypeExpr(0, t.IDDoubleZ, nil, nil, nil) typeExprIdeal = a.NewTypeExpr(0, t.IDDoubleZ, nil, nil, nil)
typeExprU8 = a.NewTypeExpr(0, t.IDU8, nil, nil, nil)
// TODO: delete this.
typeExprPlaceholder = a.NewTypeExpr(0, t.IDU8, nil, nil, nil)
) )
// TypeMap maps from variable names (as token IDs) to types. // TypeMap maps from variable names (as token IDs) to types.
+5 -5
View File
@@ -336,7 +336,7 @@ func (q *checker) tcheckExprOther(n *a.Expr, depth uint32) error {
return err return err
} }
} }
n.SetMType(typeExprU8) // HACK. n.SetMType(typeExprPlaceholder) // HACK.
return nil return nil
} }
// TODO: delete this hack that only matches "foo.low_bits(etc)". // TODO: delete this hack that only matches "foo.low_bits(etc)".
@@ -346,7 +346,7 @@ func (q *checker) tcheckExprOther(n *a.Expr, depth uint32) error {
return err return err
} }
n.LHS().SetTypeChecked() n.LHS().SetTypeChecked()
n.LHS().Expr().SetMType(typeExprU8) // HACK. n.LHS().Expr().SetMType(typeExprPlaceholder) // HACK.
for _, o := range n.Args() { for _, o := range n.Args() {
if err := q.tcheckArg(o.Arg(), depth); err != nil { if err := q.tcheckArg(o.Arg(), depth); err != nil {
return err return err
@@ -456,9 +456,9 @@ func (q *checker) tcheckDot(n *a.Expr, depth uint32) error {
// TODO: remove this hack and be more principled about the built-in // TODO: remove this hack and be more principled about the built-in
// buf1 type. // buf1 type.
// //
// Another hack is using TypeExprU8 until a TypeExpr can represent // Another hack is using typeExprPlaceholder until a TypeExpr can
// function types. // represent function types.
n.SetMType(typeExprU8) n.SetMType(typeExprPlaceholder)
return nil return nil
default: default:
s = q.c.structs[name].Struct s = q.c.structs[name].Struct