Merge pull request #1205 from kylebarron/python-syntax-fixes

Use symbol.operator and symbol.brackets scopes correctly in Python syntax file
This commit is contained in:
Zachary Yedidia 2018-12-10 14:28:21 -05:00 committed by GitHub
commit 5c2fc92332
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -23,9 +23,9 @@ rules:
# decorators
- brightgreen: "@.*[(]"
# operators
- statement: "([.:;,+*|=!\\%@]|<|>|/|-|&)"
- symbol.operator: "([.:;,+*|=!\\%@]|<|>|/|-|&)"
# parentheses
- statement: "([(){}]|\\[|\\])"
- symbol.brackets: "([(){}]|\\[|\\])"
# numbers
- constant.number: "\\b[0-9]+\\b"

View file

@ -16,15 +16,15 @@ rules:
# types
- type: "\\b(bool|bytearray|bytes|classmethod|complex|dict|enumerate|filter|float|frozenset|int|list|map|memoryview|object|property|range|reversed|set|slice|staticmethod|str|super|tuple|type|zip)\\b"
# definitions
- identifier: "def [a-zA-Z_0-9]+"
- identifier: "def [a-zA-Z_0-9]+"
# keywords
- statement: "\\b(and|as|assert|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield)\\b"
- statement: "\\b(and|as|assert|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield)\\b"
# decorators
- brightgreen: "@.*[(]"
# operators
- statement: "([.:;,+*|=!\\%@]|<|>|/|-|&)"
- symbol.operator: "([.:;,+*|=!\\%@]|<|>|/|-|&)"
# parentheses
- statement: "([(){}]|\\[|\\])"
- symbol.brackets: "([(){}]|\\[|\\])"
# numbers
- constant.number: "\\b[0-9]+\\b"