Table.array_sized: def of bolt@1.27.0.0 Import: import bolt@1.27.0.0/src/rules/table.bend as Table Lines 37-50 of bolt@1.27.0.0/src/rules/table.bend: https://jend.leeeet.dev/read.txt?path=bolt@1.27.0.0/src/rules/table.bend&start_line=37&end_line=50 import Base import bolt@1.27.0.0/src/syntax/lex.bend as Lex import bolt@1.27.0.0/src/syntax/tree.bend as Tree # `[v : T*n]` or `[v : T^d]`, and the size is a number def array_sized(nn: Tree.Node) -> Bool: match nn: case Tree.NCons{Tree.Leaf{Lex.Tok{Lex.TOp{}, +op, l, c}}, Tree.NCons{Tree.Leaf{Lex.Tok{Lex.TNum{}, t, l2, c2}}, rest}}: +here = Bool.or(String.eq(op, "*"), String.eq(op, "^")) +more = array_sized(rest) Bool.or(here, more) case Tree.NCons{Tree.Group{open, kids, close}, rest}: array_sized(rest) case Tree.NCons{h, rest}: array_sized(rest) case other: False{} Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.eq https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/syntax/lex.bend&name=Tok https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/syntax/lex.bend&name=TokKind https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/syntax/tree.bend&name=Node