Explicitly setting the line number fixes #44 #54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I added a bunch of tests code for the various parts of the tool. I stepped through the failing tests with a debugger. I found that the test at the beginning of the parser line loop does not correctly break the loop at the next line as the current line is still empty. This is because the gcode will only be pushed by the next mnemonic, there is no comment and the line number is none. Therefore it helps to immediately set the line number when processing the first word. Unfortunately this seems to break the "G\n" case in the docs. I personally do not care for this case at all so I did not look into it. Now it parses Fusion360 generated code perfectly and that matters to me.