-
Notifications
You must be signed in to change notification settings - Fork 126
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
Fix error formatting bug #262
Conversation
@@ -481,15 +480,23 @@ function formatGot(input, error) { | |||
column = columnByteIndex * 3; | |||
|
|||
// Account for an extra space. | |||
if (columnByteIndex > 4) { | |||
if (columnByteIndex >= 4) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where the error occurred.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aha! i've been there before 😄
@@ -481,15 +480,23 @@ function formatGot(input, error) { | |||
column = columnByteIndex * 3; | |||
|
|||
// Account for an extra space. | |||
if (columnByteIndex > 4) { | |||
if (columnByteIndex >= 4) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aha! i've been there before 😄
var answer = Parsimmon.formatError(input, parser.parse(input)); | ||
|
||
assert.deepEqual(answer, expectation); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for the thorough tests!!
Thanks! Released as v1.11.1 |
Addresses a bug discovered by @wavebeem in issue #239
Introduces tests and minor refactoring.