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

Error message underlines incorrect position if the pattern includes "\t" #407

Closed
cr0sh opened this issue Aug 19, 2019 · 0 comments · Fixed by #408
Closed

Error message underlines incorrect position if the pattern includes "\t" #407

cr0sh opened this issue Aug 19, 2019 · 0 comments · Fixed by #408

Comments

@cr0sh
Copy link
Contributor

cr0sh commented Aug 19, 2019

repro: https://pest.rs/?bin=1exjwj#editor
grammar:

inner = {"b" ~ "c"}
rule = {("ax" | "a\t") ~ inner}

input:
a xbc # ("a\txbc")
output message:

 --> 1:3
  |
1 | a	xbc
  |   ^---
  |
  = expected inner

(maybe) expected output:

 --> 1:3
  |
1 | a	xbc
  |  	^---
  |
  = expected inner

Edit: updated repro for clarity
Anyway, thanks for an amazing crate 😄

bors bot added a commit that referenced this issue Aug 24, 2019
408: Fix incorrect align when underlining lines with tab... r=dragostis a=cr0sh

...character

Fixes #407

Note: `Error::underline` now prints not only prefixes space but tabs if underlining line contains it, so I'm concerned about if this commit breaks backwards compatibility.

Co-authored-by: Nam Jeonghyun <[email protected]>
@bors bors bot closed this as completed in 1aa8cdc Aug 24, 2019
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

Successfully merging a pull request may close this issue.

1 participant