-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test for nested comments. #84
Conversation
So I guess this settles the alternative given in metamath/metamath-book#233. |
To the extent that I was thinking about this at any level deeper than asking what metamath has always (for some value of always) done, I was just thinking that |
BTW @jkingdon, which mailing list post were you referring to initially?
Is that what you are referring to? |
I was thinking of https://groups.google.com/g/metamath/c/DDvCuVRev0M/m/fCo-hzvCAwAJ which is I think the message right above the one you linked to, which is almost written in test case format in the sense that it says |
So I guess this settles the alternative given in
metamath/metamath-book#233
<metamath/metamath-book#233>. I'll modify
mmverify.py to raise on $( $( $) (only one line to add). As for the EBNF
grammar with the proposal I described there, I don't remember if we edit
metamath.tex or leave it that way and edit the errata.md (or edit both).
To the extent that I was thinking about this at any level deeper than
asking what metamath has always (for some value of always) done, I was just
thinking that $( inside a comment is usually a mistake. But if people
want to change the implementation/test to match the spec in the book, well
we could discuss that although I guess the current implementation seems
like the practical choice to me.
My proposal above is rather to change the EBNF grammar in the book (and
mmverify.py) to match metamath.c. For mmverify.py, I can add that extra
one-line check soon. For the book, I'll edit errata.md ? Also metamath.tex
or not ?
Also: the EBNF grammar and mmverify.py still won't match exactly the
behavior of metamath.c described by @digama0: metamath.c detects
opening/closing tags within words, e.g. ` $( a$( $) ` will trigger an
error. This would need a little bit more change in the EBNF grammar, and
the separation lexing/parsing would be less clear, so maybe we could be
content with my above proposal and not go further. We could consider
metamath.c's behavior as an extra "bonus" check that tells the user he
might have forgotten a space. I can implement that check in mmverify.py by
simply adding `ìf '$(' in tok or '$)' in tok: raise ...` in the while-loop
of the method `readc()`.
Message ID: ***@***.***>
|
Fixed mmverify.py to be closer to metamath.c's behavior (see david-a-wheeler/mmverify.py#14). Now, my two questions remain:
|
I think that the rule should be the one implemented in metamath.c: a comment must not contain a token that has a |
Ahh, you drive a hard bargain ! But fair enough. What about:
This looks a bit complex. Or you have another suggestion ? Edit: or maybe,
(instead of the current production rule for |
Who knew there was a price for formal exactness :-) ? |
If you want a change to the spec in the book, that needs to be here: |
@david-a-wheeler : As I wrote above, I will do a PR, but as I asked above, I would like to know before if I should modify |
@benjub - at a *minimum, do errata.md. Bonus points if you also edit metamath.tex, but that should probably be a separate PR. No one expected Norm to pass so soon, so book update plans are, well, unknown. Thankfully the licensing means that we can do an update without licensing problems. It might be good to have a longer discussion how when/how to update the book. |
As discussed on the mailing list.