def keyword
import bolt@1.27.0.0/src/rules/tokens.bend as Tokensimport 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
89# is the first node the keyword?
90def keyword(nn: Tree.Node, +word: String) -> Bool:
91 match nn:
92 case Tree.NCons{Tree.Leaf{Lex.Tok{Lex.TKey{}, +t, l, c}}, rest}:
93 String.eq(t, word)
94 case other:
95 False{}