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

Windows end of line can give issues #34

Open
Wulfklaue opened this issue Jan 9, 2018 · 2 comments
Open

Windows end of line can give issues #34

Wulfklaue opened this issue Jan 9, 2018 · 2 comments

Comments

@Wulfklaue
Copy link

Wulfklaue commented Jan 9, 2018

When a file is saved under Windows to WSL, it has the default CRLF encoding instead of the expacted LF.

Compiling this results in:

macro didn't expand to a valid program, it expanded to:

================================================================================
--------------------------------------------------------------------------------
   1. __slang__ << "<html"
   2. __slang__ << ">"
.....
--------------------------------------------------------------------------------
Syntax error in expanded macro: macro_140680034121248:65: expecting '\n' after '\r'

"_slang__ << "Multi-line comment

Might be interesting to also add Windows end of line file support, as Crystal is recently making a lot of process towards a Windows version.

@jeromegn
Copy link
Owner

jeromegn commented Jan 9, 2018

That's interesting. I could either detect windows or maybe always use \r\n and there would be no harm?

I need to do some testing.

@jeromegn
Copy link
Owner

What's an easy way to test this?

I think we were missing this \r\n case in the comment section specifically. I've added it now, can you please test with master?

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

2 participants