Skip to content

Fix a bug that causes syntax to not highlight correctly in editor.#21

Open
zxq5-dev wants to merge 2 commits intop4ymak:mainfrom
zxq5-dev:main
Open

Fix a bug that causes syntax to not highlight correctly in editor.#21
zxq5-dev wants to merge 2 commits intop4ymak:mainfrom
zxq5-dev:main

Conversation

@zxq5-dev
Copy link
Copy Markdown

@zxq5-dev zxq5-dev commented Jun 16, 2025

while trying to setup syntax highlighting for an additional programming language for one of my own projects, I noticed that some symbols were not being highlighted correctly (such as keywords and variables)

the solution ended up being to replace the .to_ascii_uppercase() methods to their lowercase equivalent in src/syntax/mod.rs, as in the inbuilt languages most of the keywords are defined in lowercase, meaning many tokens would not match due to the difference in case.

the bug didn't seem to affect the normal programming languages much but was quite noticeable for assembly.

before fix:
image
image

after fix:
image
image

zxq5-dev added 2 commits June 16, 2025 20:20
changed from upper case to lowercase to fix a bug where syntax is not highlighted correctly. will also need to change special vals to lowercase in another file
lowercased register names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant