You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Did you search the repository issues?:yes (kind of)
Did you check the forums?:no (what forums?)
Did you perform a web search (google, yahoo, etc)?:yes
Description
So, as it stands, grammar action errors are about as vague than C++ segfaults.
For example, take this small grammar:
{
const def1 = 1
const def2 = 2
const a = [def1 def2]
}
line = i / l
i = [ \t\n\r+]
l = [a-z]i
The error output is: missing ] after element list
Now, while this is fine in such a small example (its easy to spot), errors like this in a large grammar file is a headache.
I'd like to request the action errors to be reported the same as grammar errors, for example:
line = i / l
i = [ \t\n\r+
l = [a-z]i
outputs Line 3, column 5: Expected "!", "$", "&", "(", ".", character class, comment, end of line, identifier, literal, or whitespace but "[" found., which is magnitudes more helpful.
I think a good solution to this would be to at least include the line number for the action errors
Steps to Reproduce
Make a grammar file
Make a small typo (or other mistake) in javascript action
Observe cryptographically secure error message
Example code:
Oops, provided above in description
Expected behavior:
I'd expect errors in action contexts to at least be descriptive enough to find the error Actual behavior:
Errors in action context are vague and not helpful
Software
PEG.js: ^0.10.0
Node.js: v14.16.0
NPM or Yarn: yarn (primary) 1.22.10, npm 6.14.11
Browser: N/A
OS: Windows 8.1 32 bit os, 64 bit processor
Editor: Sublime 3.2.2 all day
The text was updated successfully, but these errors were encountered:
Issue type
Prerequisites
Description
So, as it stands, grammar action errors are about as vague than C++ segfaults.
For example, take this small grammar:
The error output is:
missing ] after element list
Now, while this is fine in such a small example (its easy to spot), errors like this in a large grammar file is a headache.
I'd like to request the action errors to be reported the same as grammar errors, for example:
outputs
Line 3, column 5: Expected "!", "$", "&", "(", ".", character class, comment, end of line, identifier, literal, or whitespace but "[" found.
, which is magnitudes more helpful.I think a good solution to this would be to at least include the line number for the action errors
Steps to Reproduce
Example code:
Oops, provided above in description
Expected behavior:
I'd expect errors in action contexts to at least be descriptive enough to find the error
Actual behavior:
Errors in action context are vague and not helpful
Software
The text was updated successfully, but these errors were encountered: