question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Optional line endings for `GrammarError.format`

See original GitHub issue

Also in peg$SyntaxError.prototype.format in generate-js.js. We always use "\n" for line endings. Although this probably works in modern Windows, for most cases, it’s probably better to have a default second parameter for lineEnding. From the CLI, we can pass in node’s os.EOL. We can’t use os in the generated code, since it needs to run in the browser.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
hildjjcommented, Jul 23, 2022

peg.js supported many old browsers, and there are a good number of people using it there, from what I can tell. Some of them should probably be pre-compiling their grammars, and we should probably change the docs to make that more clear. Since peg.js supported it, and we care about backward-compatibility, we need to support it too. If nothing else, the online playground is a useful tool for people to learn about Peggy.

I’m open to dropping support for IE 11, which I’ll probably argue for in 3.0, which will mean we will be able to modernize the browser-bound JS quite a bit.

Note that we do use node libraries in the CLI, where we know that the environment is going to be node.

0reactions
tornikeshavishvilicommented, Jul 24, 2022

I thought regarding new line and does not seem to be very important at this point, because existing implementation has proved itself as is.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring Git to handle line endings - GitHub Docs
Refreshing a repository after changing line endings ... You can use it as a template for your repositories: ... This is a good...
Read more >
Lexical grammar - JavaScript - MDN Web Docs
This page describes JavaScript's lexical grammar. JavaScript source text is just a sequence of characters — in order for the interpreter to ...
Read more >
Grammar Reference - Lark documentation - Read the Docs
Grammars in Lark are based on EBNF syntax, with several enhancements. EBNF is basically a short-hand for common BNF patterns. Optionals are expanded:...
Read more >
intro comp Flashcards - Quizlet
17) What feature must be turned on for you to see paragraph breaks, line breaks, spaces, tabs, and other formatting symbols? D. Show/Hide....
Read more >
Word 2016 Basic - Quick Reference Card
and click at the end of a text block. ... Select a Line of Text: Click in the left margin for ... Ignore...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found