Don't highlight match and case as keywords in contexts where they probably aren't used as keywords#122
Closed
jpe wants to merge 2 commits intoScintillaOrg:masterfrom
Closed
Don't highlight match and case as keywords in contexts where they probably aren't used as keywords#122jpe wants to merge 2 commits intoScintillaOrg:masterfrom
jpe wants to merge 2 commits intoScintillaOrg:masterfrom
Conversation
they probably aren't used as keywords
nyamatongwe
pushed a commit
that referenced
this pull request
Dec 26, 2022
…y probably aren't used as keywords
Member
|
Committed with reformatting and added 'const's. |
Member
|
Added 012a4bb which replaces call to isdigit with IsADigit as the character was not checked for ASCII first. |
Member
|
Fixed in 5.2.2. |
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.
Changes the python lever to classify match and case as keywords if they are in the keywords set and are in a position where they are probably keywords and not identifiers -- at the start of the line and not followed by a '=' or '.'.
There are ambiguous cases where match / case could be a keyword or identifier that are classified as a keyword. This could be resolved by scanning ahead for a terminating ':', but it would require something close to a python tokenizer and the match / case should probably be classified as keywords while the line is being entered. An example are the lines 'match (x)' and 'match (x):' -- match is an identifier in the first, but a keyword in the second.
There are cases where the statement starts on the prior line that aren't handled correctly, but should be rare and would be difficult to fix within the current approach.
I opted not to add an option to control this, but could if someone wants to highlight all match and case symbols as keywords.
Note that match and case were added to python/SciTE.properties for the tests; this doesn't seem to affect the other tests.