@top T { expr+ }

expr { ArrowExpr | ParenExpr | Identifier }

ParenExpr { "(" expr ")" }

ArrowExpr { "(" ParamName ")" "=>" expr }

Identifier { word ~arrow }

ParamName { word ~arrow }

@skip { whitespace }

@tokens {
  whitespace { @whitespace+ }
  word { @asciiLetter+ }
}

# Arrow

(a) => b

==> T(ArrowExpr(ParamName, Identifier))

# Paren expr

(a)

==> T(ParenExpr(Identifier))
