Add lzw_decoder.set_literal_width.

This commit is contained in:
Nigel Tao committed 2017-06-11 14:02:05 +10:00
1 parent c27bec10d3
commit 019e83f190
8 files changed
+170 -31

No files matched your search

+1 -1
View File
@@ -457,7 +457,7 @@ const MaxTypeExprDepth = 63
// refined as "foo[LHS..MHS]". LHS and MHS are Expr's, possibly nil. For
// example, the LHS for "u32[..4095]" is nil.
//
// TODO: function / method types.
// TODO: function / method types, struct types.
type TypeExpr Node
func (n *TypeExpr) Node() *Node { return (*Node)(n) }
+13
View File
@@ -659,6 +659,19 @@ func (q *checker) bcheckExprOther(n *a.Expr, depth uint32) (*big.Int, *big.Int,
return nil, nil, fmt.Errorf("check: unrecognized token.Key (0x%X) for bcheckExprOther", n.ID0().Key())
case t.KeyDot:
// TODO: delete this hack that only matches "in".
if n.LHS().Expr().ID1().Key() == t.KeyIn {
for _, o := range q.f.Func.In().Fields() {
o := o.Field()
if o.Name() == n.ID1() {
return q.bcheckTypeExpr(o.XType())
}
}
lTyp := n.LHS().Expr().MType()
return nil, nil, fmt.Errorf("check: no field named %q found in struct type %q for expression %q",
n.ID1().String(q.tm), lTyp.Name().String(q.tm), n.String(q.tm))
}
if _, _, err := q.bcheckExpr(n.LHS().Expr(), depth); err != nil {
return nil, nil, err
}