Skip to content
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

[Python] Fix mapping element starting with 'for' #1896

merged 2 commits into from Mar 19, 2019
Changes from 1 commit
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.


Just for now


[Python] Fix mapping element starting with 'for'

Add missing \b to capture inline for inside a dict.
Add relevant test.
  • Loading branch information...
Clamsax committed Mar 9, 2019
commit c0d0c4753162c2f4aef417c1f29fc17ff5a73e60
@@ -1003,7 +1003,7 @@ contexts:
- match: ','
scope: punctuation.separator.mapping.python
set: inside-dictionary
- match: (?=for)
- match: (?=for\b)
- match: (?=\})
pop: true
@@ -950,6 +950,10 @@ def __call__(self, *args, **kwds):
# ^ invalid.illegal.expected-colon.python
# ^ punctuation.section.mapping.end - meta.mapping.key

mydict = { 'a' : xform, 'b' : form, 'c' : frm }
# ^ meta.mapping.python punctuation.separator.mapping.python
# ^ punctuation.separator.mapping.key-value.python

myset = {"key", True, key2, [-1], {}:1}
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.set
# ^ punctuation.section.set.begin.python
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.