diff --git a/cmd/puffs-c/internal/cgen/expr.go b/cmd/puffs-c/internal/cgen/expr.go index 51fdb378..d09e1031 100644 --- a/cmd/puffs-c/internal/cgen/expr.go +++ b/cmd/puffs-c/internal/cgen/expr.go @@ -168,7 +168,7 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, rp replacementPolicy, pp pare b.writes(")") return nil } - if isInSrc(g.tm, n, t.KeyLimitt, 1) { + if isInSrc(g.tm, n, t.KeyLimit, 1) { return fmt.Errorf("TODO: in.src.limit") } if isInSrc(g.tm, n, t.KeyMark, 0) { @@ -182,7 +182,7 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, rp replacementPolicy, pp pare aPrefix, aPrefix, bPrefix, aPrefix) return nil } - if isInDst(g.tm, n, t.KeyLimitt, 1) { + if isInDst(g.tm, n, t.KeyLimit, 1) { return fmt.Errorf("TODO: in.dst.limit") } if isInDst(g.tm, n, t.KeyMark, 0) { @@ -303,7 +303,7 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, rp replacementPolicy, pp pare b.writes(")\n") return nil } - if isThatMethod(g.tm, n, t.KeyLimitt, 1) { + if isThatMethod(g.tm, n, t.KeyLimit, 1) { // TODO: don't hard-code v_r or b_rptr_src. b.printf("puffs_base__reader1__limit(&v_r, b_rptr_src,") if err := g.writeExpr(b, n.Args()[0].Arg().Value(), rp, parenthesesOptional, depth); err != nil { diff --git a/cmd/puffs-c/internal/cgen/statement.go b/cmd/puffs-c/internal/cgen/statement.go index d33bd8b5..4fc33297 100644 --- a/cmd/puffs-c/internal/cgen/statement.go +++ b/cmd/puffs-c/internal/cgen/statement.go @@ -671,7 +671,7 @@ func (g *gen) writeReadUXX(b *buffer, n *a.Expr, name string, size uint32, endia func isInSrc(tm *t.Map, n *a.Expr, methodName t.Key, nArgs int) bool { callSuspendible := methodName != t.KeySinceMark && methodName != t.KeyMark && - methodName != t.KeyLimitt + methodName != t.KeyLimit if n.ID0().Key() != t.KeyOpenParen || n.CallSuspendible() != callSuspendible || len(n.Args()) != nArgs { return false } @@ -694,7 +694,7 @@ func isInDst(tm *t.Map, n *a.Expr, methodName t.Key, nArgs int) bool { methodName != t.KeyCopyFromSlice && methodName != t.KeySinceMark && methodName != t.KeyMark && - methodName != t.KeyLimitt + methodName != t.KeyLimit // TODO: check that n.Args() is "(x:bar)". if n.ID0().Key() != t.KeyOpenParen || n.CallSuspendible() != callSuspendible || len(n.Args()) != nArgs { return false diff --git a/lang/check/bounds.go b/lang/check/bounds.go index bb51ffae..8d258a4e 100644 --- a/lang/check/bounds.go +++ b/lang/check/bounds.go @@ -717,7 +717,7 @@ func (q *checker) bcheckExprOther(n *a.Expr, depth uint32) (*big.Int, *big.Int, isInSrc(q.tm, n, t.KeyReadU16BE, 0) || isInSrc(q.tm, n, t.KeyReadU32BE, 0) || isInSrc(q.tm, n, t.KeyReadU32BE, 0) || isInSrc(q.tm, n, t.KeyReadU32LE, 0) || isInSrc(q.tm, n, t.KeySkip32, 1) || isInSrc(q.tm, n, t.KeySinceMark, 0) || - isInSrc(q.tm, n, t.KeyMark, 0) || isInSrc(q.tm, n, t.KeyLimitt, 1) || + isInSrc(q.tm, n, t.KeyMark, 0) || isInSrc(q.tm, n, t.KeyLimit, 1) || isInDst(q.tm, n, t.KeyCopyFromSlice, 1) || isInDst(q.tm, n, t.KeyCopyFromSlice32, 2) || isInDst(q.tm, n, t.KeyCopyFromReader32, 2) || isInDst(q.tm, n, t.KeyCopyFromHistory32, 2) || isInDst(q.tm, n, t.KeyWriteU8, 1) || isInDst(q.tm, n, t.KeySinceMark, 0) || @@ -728,7 +728,7 @@ func (q *checker) bcheckExprOther(n *a.Expr, depth uint32) (*big.Int, *big.Int, isThisMethod(q.tm, n, "decode_blocks", 2) || isThisMethod(q.tm, n, "init_fixed_huffman", 0) || isThisMethod(q.tm, n, "init_dynamic_huffman", 1) || isThisMethod(q.tm, n, "init_huff", 4) || - isThatMethod(q.tm, n, t.KeyMark, 0) || isThatMethod(q.tm, n, t.KeyLimitt, 1) || + isThatMethod(q.tm, n, t.KeyMark, 0) || isThatMethod(q.tm, n, t.KeyLimit, 1) || isThatMethod(q.tm, n, t.KeySinceMark, 0) { for _, o := range n.Args() { diff --git a/lang/check/type.go b/lang/check/type.go index ad58d90c..0ec27cff 100644 --- a/lang/check/type.go +++ b/lang/check/type.go @@ -427,7 +427,7 @@ func (q *checker) tcheckExprOther(n *a.Expr, depth uint32) error { isInSrc(q.tm, n, t.KeyReadU16BE, 0) || isInSrc(q.tm, n, t.KeyReadU32BE, 0) || isInSrc(q.tm, n, t.KeyReadU32BE, 0) || isInSrc(q.tm, n, t.KeyReadU32LE, 0) || isInSrc(q.tm, n, t.KeySkip32, 1) || isInSrc(q.tm, n, t.KeySinceMark, 0) || - isInSrc(q.tm, n, t.KeyMark, 0) || isInSrc(q.tm, n, t.KeyLimitt, 1) || + isInSrc(q.tm, n, t.KeyMark, 0) || isInSrc(q.tm, n, t.KeyLimit, 1) || isInDst(q.tm, n, t.KeyCopyFromSlice, 1) || isInDst(q.tm, n, t.KeyCopyFromSlice32, 2) || isInDst(q.tm, n, t.KeyCopyFromReader32, 2) || isInDst(q.tm, n, t.KeyCopyFromHistory32, 2) || isInDst(q.tm, n, t.KeyWriteU8, 1) || isInDst(q.tm, n, t.KeySinceMark, 0) || @@ -438,7 +438,7 @@ func (q *checker) tcheckExprOther(n *a.Expr, depth uint32) error { isThisMethod(q.tm, n, "decode_blocks", 2) || isThisMethod(q.tm, n, "init_fixed_huffman", 0) || isThisMethod(q.tm, n, "init_dynamic_huffman", 1) || isThisMethod(q.tm, n, "init_huff", 4) || - isThatMethod(q.tm, n, t.KeyMark, 0) || isThatMethod(q.tm, n, t.KeyLimitt, 1) || + isThatMethod(q.tm, n, t.KeyMark, 0) || isThatMethod(q.tm, n, t.KeyLimit, 1) || isThatMethod(q.tm, n, t.KeySinceMark, 0) { if err := q.tcheckExpr(n.LHS().Expr(), depth); err != nil { @@ -658,7 +658,7 @@ func (q *checker) tcheckExprOther(n *a.Expr, depth uint32) error { func isInSrc(tm *t.Map, n *a.Expr, methodName t.Key, nArgs int) bool { callSuspendible := methodName != t.KeySinceMark && methodName != t.KeyMark && - methodName != t.KeyLimitt + methodName != t.KeyLimit if n.ID0().Key() != t.KeyOpenParen || n.CallSuspendible() != callSuspendible || len(n.Args()) != nArgs { return false } @@ -681,7 +681,7 @@ func isInDst(tm *t.Map, n *a.Expr, methodName t.Key, nArgs int) bool { methodName != t.KeyCopyFromSlice && methodName != t.KeySinceMark && methodName != t.KeyMark && - methodName != t.KeyLimitt + methodName != t.KeyLimit // TODO: check that n.Args() is "(x:bar)". if n.ID0().Key() != t.KeyOpenParen || n.CallSuspendible() != callSuspendible || len(n.Args()) != nArgs { return false diff --git a/lang/token/list.go b/lang/token/list.go index 8dff7fe6..3b6eec73 100644 --- a/lang/token/list.go +++ b/lang/token/list.go @@ -300,7 +300,7 @@ const ( KeyAvailable = Key(IDAvailable >> KeyShift) KeyPrefix = Key(IDPrefix >> KeyShift) KeySuffix = Key(IDSuffix >> KeyShift) - KeyLimitt = Key(IDLimitt >> KeyShift) // TODO: rename Limitt to Limit. + KeyLimit = Key(IDLimit >> KeyShift) KeyXUnaryPlus = Key(IDXUnaryPlus >> KeyShift) KeyXUnaryMinus = Key(IDXUnaryMinus >> KeyShift) @@ -487,7 +487,7 @@ const ( IDAvailable = ID(0xCA<