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

Replace '\n' with EOL from os module #9

Open
simon-p-r opened this issue Jan 29, 2019 · 3 comments
Open

Replace '\n' with EOL from os module #9

simon-p-r opened this issue Jan 29, 2019 · 3 comments

Comments

@simon-p-r
Copy link

simon-p-r commented Jan 29, 2019

Will you accept a PR for this? Also I cannot view notation of accepted EBNF format that parser will accept, I have tried parsing several simple grammer files but all fail with no real information on what is wrong with them.

@menduz
Copy link
Member

menduz commented Jan 29, 2019

You can define EOL in your grammar, you can also take a look at the tests for different grammars.

https://github.com/menduz/node-ebnf/blob/194343232fd61da549abf3995d3dabdee0b7670b/test/NewLang.spec.ts#L140

Sadly EBNF or ABNF are not compatible across every implementation out there because there is no strict standard. Every parser adds its own flavors to the grammar.

@simon-p-r
Copy link
Author

Sorry I was not clear, on this line '\n' is used when os.EOL should be used instead. I am new to grammar files and have discovered there is no common format across libraries. I will open PR to fix if you want.

@menduz
Copy link
Member

menduz commented Jan 29, 2019

As far as I can see in those files as long as \n is used for error reporting or logs we are good to go!

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