Repository navigation
Conversation
The newline rule gave '\r\n' a higher entering priority than '\r', so Ragel dropped the transition that ends a newline at a lone '\r', and the lexer rejected it as an unexpected character. PHP treats '\r', '\n' and '\r\n' all as newlines. A '\r' at the end of the input also read past the data in the new_line action. The older scanner's .rl still imported the pre-extraction module path, so regenerating it did not build; it now imports pkg/token from this module.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PHP treats
\r,\nand\r\nall as newlines, but the lexer rejects a lone\rbetween tokens (Unexpected character in input: '' (ASCII=13)), and a\rat the very end of the input panics with index out of range.newlinerule gave'\r\n'a higher entering priority than'\r', so Ragel dropped the transition that ends a newline at a lone\r. Removed the priorities.new_lineaction readlex.data[lex.p+1]past the end of the input.internal/scanner/scanner.rlstill importedgithub.com/TomasVotruba/reco/pkg/token, so the regenerated scanner didn't build.Both scanners are regenerated with ragel 6.10 (
ragel -Z -G2, then the Makefile'ssedandgofmt -s), so most of the diff is renumbered state tables. Added a test to each scanner.