Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix(Ruby): Reorder operators to correctly tokenize <=>#3137

Open
fiona3758 wants to merge 3 commits into
pygments:masterfrom
Trung6405:fix-ruby-operators
Open

Fix(Ruby): Reorder operators to correctly tokenize <=>#3137
fiona3758 wants to merge 3 commits into
pygments:masterfrom
Trung6405:fix-ruby-operators

Conversation

@fiona3758

Copy link
Copy Markdown

Summary

Fixes #2791

Fixes operator tokenization in the Ruby lexer where <=> was being incorrectly split into < + => or < + = + > due to shorter patterns matching first. Fixed by reordering the regex alternations so that longer operators like <=> are matched before shorter overlapping ones (<, <=, >). Also, added => as a recognized operator token which was previously missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant