Packages: Python Syntax: Python Identifiers containing keywords as substrings confuse highlighter

Created on 14 Mar 2019  路  4Comments  路  Source: sublimehq/Packages

In a dict literal, using a variable that contains a keyword (such as in, yield, for, ...) as a substring in a variable name confuses the syntax highlighter, causing it to mark the comma as an error.

For example:
python-syntax-issue

# For copy/pasting:
{
    "a": something,
    "b": form,  # includes `for`
    "c": defend,  # includes `def`
    "d": fine,  # includes `in`
    "e": asynchronous,  # inclues `async`
}

Using build 3200 on linux.

Most helpful comment

To be fixed by #1896. Only the line with "for" causes this behavior, as removing that causes the invalid scopes on the commas to disappear.

2019-03-14_14-50-43

All 4 comments

This is #1896, right? Edit: Whoops! I think that's a "yes, but with lots more reserved words"

@michaelblyons Yes, that appears to be the same issue.

To be fixed by #1896. Only the line with "for" causes this behavior, as removing that causes the invalid scopes on the commas to disappear.

2019-03-14_14-50-43

This issue has been solved by a previous commit, hence it is being closed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

okdana picture okdana  路  3Comments

mouse07410 picture mouse07410  路  3Comments

jcberquist picture jcberquist  路  4Comments

kylebebak picture kylebebak  路  3Comments

evandrocoan picture evandrocoan  路  3Comments