mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 08:52:18 +01:00
Add some ast.Expr.IsEtc methods
This commit is contained in:
1 parent
b645180357
commit
41e407a774
7 files changed
+58
-48
No files matched your search
+6
-5
@@ -391,12 +391,13 @@ func (c *Checker) checkConst(node *a.Node) error {
|
||||
func (c *Checker) checkConstElement(n *a.Expr, nb bounds, nLists int) error {
|
||||
if nLists > 0 {
|
||||
nLists--
|
||||
if n.Operator() != t.IDComma {
|
||||
if args, ok := n.IsList(); !ok {
|
||||
return fmt.Errorf("invalid const value %q", n.Str(c.tm))
|
||||
}
|
||||
for _, o := range n.Args() {
|
||||
if err := c.checkConstElement(o.AsExpr(), nb, nLists); err != nil {
|
||||
return err
|
||||
} else {
|
||||
for _, o := range args {
|
||||
if err := c.checkConstElement(o.AsExpr(), nb, nLists); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in new issue
Block a user