-
Notifications
You must be signed in to change notification settings - Fork 13
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
There's a funny bug with the way newlines are handled #44
Comments
I've been able to consistently reproduce this bug with the following code: extern crate gcode;
fn main() {
let gcode_string = "G0 X1\nG1 Y2";
let parse_result: Vec<_> = gcode::parse(gcode_string).collect();
assert_eq!(parse_result.len(), 2);
} This fails with actual length 3 instead of 2. Prepending line numbers for every line seems to solve it: let gcode_string = "N0 G0 X1\nN1 G1 Y2"; This correctly returns 2 commands. Finally, the parser runs correct when i use 2 empty G-codes: let gcode_string = "G0\nG1"; This returns 2 commands. |
TL;DR:
Fails with
(note the G01 with no arguments in the middle)
The text was updated successfully, but these errors were encountered: