Skip to content

fix: removed unnecessary char casting#200

Merged
ObserverOfTime merged 1 commit intotree-sitter-grammars:split_parserfrom
Anaritus:split_parser
Jun 7, 2025
Merged

fix: removed unnecessary char casting#200
ObserverOfTime merged 1 commit intotree-sitter-grammars:split_parserfrom
Anaritus:split_parser

Conversation

@Anaritus
Copy link
Copy Markdown
Contributor

@Anaritus Anaritus commented Jun 6, 2025

Scanner did some unnecessary casting of int32_t to char. That casting truncated every character to 8 bits (ascii), while it should be unicode. Because of that symbols like Ш would be parsed as ( and therefore would not parse as emphasis when it should.

This simple commit fixes that.

@Anaritus
Copy link
Copy Markdown
Contributor Author

Anaritus commented Jun 6, 2025

Before:

Screen.Recording.2025-06-07.at.02.52.35.mov

After:

Screen.Recording.2025-06-07.at.02.55.59.mov

Also docs state that lookahead returns int32_t so there really is no reason to cast it to char

@ObserverOfTime ObserverOfTime merged commit 9dca2b6 into tree-sitter-grammars:split_parser Jun 7, 2025
2 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants