I have a problem with notations with the following example:
Notation " 'foo' " := 0 (at level 2).
Definition foo := 1.
The definition simply doesn't parse because foo
has now a special role in the grammar. Is there a way around it?
I don't expect to solve this problem for notations in general, but at least for custom entries. But even adding foo
as a symbol for custom entries will yield the same problem.
foo
is now a keyword
So it can't be an IDENT
Yes, I understand the problem. Maybe I should explain what I want to do. I want to use custom entries to represent programs, and there I would like to use bool
to represent the deeply embedded boolean type, but if I do it, then bool
cannot be an indent.
The lexer is only one for all syntactic categories, so it does not matter where you add your notation
I guess it's because of the lexer.
The usual workaround is to use "'bool" or "`bool" instead of "bool"
I see. Thanks.
IIRC abbreviations, like Notation foo := 0
cannot be in a scope (but I may be wrong)
These don't add keywrods
Yeah it doesn't seem to like the (in custom entries foo)
.
That said, I don't see any good reason for abbreviations to not be in scope. So, perhaps this limitation could be lifted.
There could even be a PR doing that, CC @Hugo Herbelin
Guillaume Melquiond said:
That said, I don't see any good reason for abbreviations to not be in scope. So, perhaps this limitation could be lifted.
I would like that too
Enrico Tassi said:
There could even be a PR doing that, CC Hugo Herbelin
There are a couple of pending PRs on notations but not about abbreviations in scopes. That's probably feasible without too much trouble.
The issue with keywords having a side effect much beyond the area in which they are supposed to have a role, is otherwise a serious issue too. Probably solvable by merging lexing and parsing, as was discussed somewhere on Zulip.
Last updated: Oct 13 2024 at 01:02 UTC