KoffeinFlummi / armake2

Successor to armake written in Rust
GNU General Public License v2.0
50 stars 17 forks source link

Handle legacy Mac OS newlines #39

Open Krzmbrzl opened 5 years ago

Krzmbrzl commented 5 years ago

This is a "migration" of https://github.com/synixebrett/HEMTT/issues/109

The problem is that old(er) mac versions use \r (so a single carriage return character) as the newline character. This isn't handled in the current armake-version.

Krzmbrzl commented 5 years ago

When preprocessing the attached file (with old Mac newlines) this is the error message:

thread 'main' panicked at 'Failed to preprocess file: Custom { kind: Other, error: StringError("In line /home/<user>/Downloads/hemtt-example/addons/example/test.hpp:0:\n\n  a\rb\n   \u{1b}[1;31m^\u{1b}[0m\n\nUnexpected token \"\r\", expected: \"//\", \"\\\"\", \"\\\\\", \"#\", \"\\\\\\\\\", \"[ \\t]\", \"[a-zA-Z0-9_]\", \"/*\", \"(\", \"[^\\\"\\r\\n]\", \"##\", \"\\n\", \"\\r\\n\"") }', src/libcore/result.rs:997:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

test.txt