Skip to content
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

Formal grammar (comments) #233

Open
benjub opened this issue Jan 16, 2022 · 2 comments
Open

Formal grammar (comments) #233

benjub opened this issue Jan 16, 2022 · 2 comments

Comments

@benjub
Copy link
Contributor

benjub commented Jan 16, 2022

Comments should not nest, but the corresponding production rule in Appendix E reads:
_COMMENT ::= '$(' (_WHITECHAR+ (PRINTABLE-SEQUENCE - '$)')* _WHITECHAR+ '$)' _WHITECHAR

which allows for instance $( $( $) as a single comment (whereas metamath.c returns an error). A rule forbidding nesting would be:
_COMMENT ::= '$(' (_WHITECHAR+ (PRINTABLE-SEQUENCE - ('$(' | '$)')))* _WHITECHAR+ '$)' _WHITECHAR

That being said, the above fix is in order to conform to metamath.c. I wouldn't be opposed, if it makes the grammar simpler, to modify the program instead.

@david-a-wheeler
Copy link
Member

Should we mandate that tools detect the $( ... $( ... case? I suspect many validators don't check for that.

@benjub
Copy link
Contributor Author

benjub commented Jan 16, 2022

Should we mandate that tools detect the $( ... $( ... case? I suspect many validators don't check for that.

I do not know if we should require it (for instance, mmverify.py does not check it, and is in accordance with the grammar rule currently in Appendix E). But this is a separate question from the above (which is about conformance of App. E with metamath.c).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants