From c27bec10d30575171ba897844f6643574d719239 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sun, 11 Jun 2017 13:55:41 +1000 Subject: [PATCH] Rename typeExprU8 to typeExprPlaceholder. --- lang/check/check.go | 4 +++- lang/check/type.go | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lang/check/check.go b/lang/check/check.go index e155fb17..2c85bb52 100644 --- a/lang/check/check.go +++ b/lang/check/check.go @@ -59,7 +59,9 @@ func trimQuotes(s string) string { var ( typeExprBool = a.NewTypeExpr(0, t.IDBool, 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. diff --git a/lang/check/type.go b/lang/check/type.go index 4688bc44..aa1b7eec 100644 --- a/lang/check/type.go +++ b/lang/check/type.go @@ -336,7 +336,7 @@ func (q *checker) tcheckExprOther(n *a.Expr, depth uint32) error { return err } } - n.SetMType(typeExprU8) // HACK. + n.SetMType(typeExprPlaceholder) // HACK. return nil } // 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 } n.LHS().SetTypeChecked() - n.LHS().Expr().SetMType(typeExprU8) // HACK. + n.LHS().Expr().SetMType(typeExprPlaceholder) // HACK. for _, o := range n.Args() { if err := q.tcheckArg(o.Arg(), depth); err != nil { 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 // buf1 type. // - // Another hack is using TypeExprU8 until a TypeExpr can represent - // function types. - n.SetMType(typeExprU8) + // Another hack is using typeExprPlaceholder until a TypeExpr can + // represent function types. + n.SetMType(typeExprPlaceholder) return nil default: s = q.c.structs[name].Struct