mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 08:47:28 +01:00
Raise built-in ident capacity from 96 to 768
This commit is contained in:
1 parent
1702c1e303
commit
e8eeee371a
8 files changed
+129
-105
No files matched your search
@@ -22,7 +22,7 @@ import (
|
||||
t "github.com/google/wuffs/lang/token"
|
||||
)
|
||||
|
||||
var numTypeBounds = [256][2]*big.Int{
|
||||
var numTypeBounds = [...][2]*big.Int{
|
||||
t.IDI8: {big.NewInt(-1 << 7), big.NewInt(1<<7 - 1)},
|
||||
t.IDI16: {big.NewInt(-1 << 15), big.NewInt(1<<15 - 1)},
|
||||
t.IDI32: {big.NewInt(-1 << 31), big.NewInt(1<<31 - 1)},
|
||||
|
||||
@@ -278,7 +278,7 @@ func (q *checker) optimizeIOMethodAdvance(n *a.Expr, receiver *a.Expr, advance *
|
||||
})
|
||||
}
|
||||
|
||||
var ioMethodAdvances = [256]*big.Int{
|
||||
var ioMethodAdvances = [...]*big.Int{
|
||||
t.IDReadU8: one,
|
||||
t.IDReadU16BE: two,
|
||||
t.IDReadU16LE: two,
|
||||
|
||||
+2
-2
@@ -846,7 +846,7 @@ func (q *checker) tcheckExprBinaryOp(n *a.Expr, depth uint32) error {
|
||||
n.SetConstValue(ncv)
|
||||
}
|
||||
|
||||
if comparisonOps[0xFF&op] {
|
||||
if (op < t.ID(len(comparisonOps))) && comparisonOps[op] {
|
||||
n.SetMType(typeExprBool)
|
||||
} else if !lTyp.IsIdeal() {
|
||||
n.SetMType(lTyp.Unrefined())
|
||||
@@ -1036,7 +1036,7 @@ swtch:
|
||||
return nil
|
||||
}
|
||||
|
||||
var comparisonOps = [256]bool{
|
||||
var comparisonOps = [...]bool{
|
||||
t.IDXBinaryNotEq: true,
|
||||
t.IDXBinaryLessThan: true,
|
||||
t.IDXBinaryLessEq: true,
|
||||
|
||||
Reference in new issue
Block a user