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

BNF comments not supported #2

Open
mmoderau opened this issue Jun 3, 2020 · 4 comments
Open

BNF comments not supported #2

mmoderau opened this issue Jun 3, 2020 · 4 comments

Comments

@mmoderau
Copy link

mmoderau commented Jun 3, 2020

According to specification, a comment in a BNF file starts with a semicolon (;) and extends to the end of the line.

This extension supports only line comments starting with # and block comments between (* and *). The latter is EBNF-style comment, the former is not copatible with neither BNF, EBNF or ABNF.

@vallentin
Copy link
Owner

vallentin commented Jun 3, 2020

Originally, I excluded ; for comments as it is also used for termination in EBNF.
I guess, whether it is highlighted as a comment, doesn't really matter for EBNF, as text wouldn't be written after it. So I can change it to comments instead, if that is more desired?

@mmoderau
Copy link
Author

mmoderau commented Jun 3, 2020

Actually, EBNF allows multiple rules per line, separated by a semicolon.

EBNF and BNF syntaxes are not very compatible. I think, in the long run, it's better to create two separate languages in the extension.

@mmoderau
Copy link
Author

mmoderau commented Jun 3, 2020

After reading more about BNF, I guess there is not much of a specification, contrary to EBNF. Every source has its own variants and extensions and presents it as "the BNF".

As such, I guess support for BNF should not be the top priority.

I switched to EBNF for my project, anyway.

@vallentin
Copy link
Owner

EBNF allows multiple rules per line, separated by a semicolon

Makes sense, but honestly never tried that, so I don't even know if the extension currently supports that.

All in all, I guess it would be best to just leave it be as is? Maybe in the future add an option to be able to toggle between BNF and EBNF, but that's beyond what I currently have time for.

I'll leave the issue open.

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