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

Comment newlines are preserved in CRLF files #133

Open
Wilfred opened this issue Sep 10, 2022 · 0 comments
Open

Comment newlines are preserved in CRLF files #133

Wilfred opened this issue Sep 10, 2022 · 0 comments

Comments

@Wilfred
Copy link

Wilfred commented Sep 10, 2022

Given the file foo.elm:

-- stuff
x = 1

Convert to CRLF line endings:

$ unix2dos foo.elm

And dump the parse tree:

file (0, 0) - (2, 0)
  line_comment (0, 0) - (0, 9) "-- stuff\r"
  value_declaration (1, 0) - (1, 5)
    function_declaration_left (1, 0) - (1, 1)
      lower_case_identifier (1, 0) - (1, 1) "x"
    eq (1, 2) - (1, 3) "="
    number_constant_expr (1, 4) - (1, 5)
      number_literal (1, 4) - (1, 5) "1"

Note the unwanted "\r" in the line_comment.

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

1 participant