Open keddelzz opened 7 years ago
but disallow
def Expr: Rule1[String] = (regex("[a-z]+") : Token) : Rule1[String]
Independently of the type annotation we need to look up the definition of the token which is used in the rule. If this definition is not of type Token
(the user probably triggered the implicit to convert a RegExp
to a Token
) or the expression does not even refer to a definition (the user probably wrote regex("[a-z]+")
directly into the parser rule as seen above), the macro should not accept the grammar specification.
Allow:
and
but disallow
(No "anonymous" tokens allowed!)