You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defa := "hello"
macro (priority := high) "0" : term => `(a)
#eval0-- 0
The parser above is bogus, but Lean does not report an error.
Note that the parser always parses numerals as numLit independently of tokens defined by the user. I think this is a sensible behavior, but we should probably report an error at macro definition time.
BTW, we can create variants of this issue using different kinds of built-in literals: char, string, scientific, etc.
Example:
Consider the following example
The parser above is bogus, but Lean does not report an error.
Note that the parser always parses numerals as
numLit
independently of tokens defined by the user. I think this is a sensible behavior, but we should probably report an error at macro definition time.BTW, we can create variants of this issue using different kinds of built-in literals: char, string, scientific, etc.
Example:
Remark: users can overload individual numerals using the
OfNat
type class.The text was updated successfully, but these errors were encountered: