-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🪲Variable is not highlighted if followed by an exclamation mark #5089
Comments
shouldn't the output be |
That is a great point but that shows you think like a programmer haha! We thought that for a kid this behaviour makes sense (and thus it should be highlighted) |
) This PR addresses a syntax highlighting issue in Level 2. Previously, if an exclamation mark followed a variable, it was still considered valid, but the syntax highlighter did not reflect this correctly. For instance, in the command: ` name is Hedy print name is name ` The keyword **name** was highlighted in blue in all occurrences. However, if an exclamation mark was added to the end of the command: `name is Hedy print name is name! ` The keyword **name** was only highlighted in blue in the first occurrence. To resolve this issue, I have introduced a SpecialChar token to the grammar file. This token includes an exclamation mark (!), question mark (?), and period (.) characters. With this change, the syntax highlighter correctly recognizes and highlights the variable name even when a special character follows it. Fixes #5089 **How to test** Follow these steps to verify this PR works as intended: * Go to http://localhost:8080/hedy/2#is_command * Type: ``` name is Hedy print name is name! ``` * Check that name is highlighted in all occurences ![image](https://github.com/hedyorg/hedy/assets/65734671/e93f3271-bdaa-4af5-9a91-0d869908b22b)
Describe the bug
On level 2 if a variable if followed by an exclamation mark it is still valid, and the syntax highlighter it should reflect this:
The text was updated successfully, but these errors were encountered: