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

Always skip CR explicitly #1112

Merged
merged 1 commit into from
Sep 20, 2022
Merged

Always skip CR explicitly #1112

merged 1 commit into from
Sep 20, 2022

Conversation

soutaro
Copy link
Member

@soutaro soutaro commented Sep 20, 2022

Fixes #1111

  • Newline in Windows is \r\n, but WSL is \n
  • This causes a confusion when: the source code is written in Windows and read in WSL

This PR explicitly ignores \r even in non-windows environment.

Note that this workaround is unnecessary when everything is done correctly: the source code is written in Windows and read in Windows because Ruby converts \r\n to \n automatically when reading with text mode API. (And rbs parse reads the source in text mode.) (This assumption is unrealistic especially for newbies, according to #1111 and I agree with it.)

@soutaro soutaro enabled auto-merge September 20, 2022 02:59
@soutaro soutaro merged commit e070dc8 into master Sep 20, 2022
@soutaro soutaro deleted the skip-cr branch September 20, 2022 03:05
@@ -641,4 +641,10 @@ def test_parse_method_type2
assert_equal "foo?: String, bar!: Integer", method_type.type.param_to_s
end
end

def test_neline_inconsitency
Copy link
Contributor

@ParadoxV5 ParadoxV5 Sep 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait.

Suggested change
def test_neline_inconsitency
def test_newline_inconsistency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

rbs parse prints (ErrorToken) Syntax error at CR+LF line ending
2 participants