From 954029739a65d662b6381dae731bea5668907c59 Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Thu, 4 Oct 2018 17:09:28 -0400 Subject: [PATCH] Add support for new Python 3.7 attrs/builtins Fixes #151 and #126 --- .gitignore | 2 +- grammars/MagicPython.cson | 10 ++++---- grammars/MagicPython.tmLanguage | 10 ++++---- grammars/src/MagicPython.syntax.yaml | 10 ++++---- test/atom-spec/python-spec.js | 36 ++++++++++++++++++++++++++++ test/builtins/builtins7.py | 8 +++++++ test/expressions/special2.py | 16 +++++++++++++ 7 files changed, 76 insertions(+), 16 deletions(-) create mode 100644 test/builtins/builtins7.py create mode 100644 test/expressions/special2.py diff --git a/.gitignore b/.gitignore index 4377bfda..e17b261b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ node_modules .DS_Store *.cache *.pyc - +package-lock.json diff --git a/grammars/MagicPython.cson b/grammars/MagicPython.cson index 71050143..c3f182d4 100644 --- a/grammars/MagicPython.cson +++ b/grammars/MagicPython.cson @@ -1729,7 +1729,7 @@ repository: match: ''' (?x) (?match (?x) (?<!\.) \b( - __import__ | abs | all | any | ascii | bin | callable + __import__ | abs | all | any | ascii | bin | breakpoint | callable | chr | compile | copyright | credits | delattr | dir | divmod | enumerate | eval | exec | exit | filter | format | getattr | globals | hasattr | hash | help | hex | id | input @@ -2798,10 +2798,10 @@ indirectly through syntactic constructs (?x) \b( __(?: - all | bases | builtins | class | code | debug | defaults | dict - | doc | file | func | kwdefaults | members - | metaclass | methods | module | mro | name - | qualname | self | signature | slots | subclasses + all | bases | builtins | class | class_getitem | code | debug + | defaults | dict | doc | file | func | kwdefaults | members + | metaclass | methods | module | mro | mro_entries | name + | qualname | post_init | self | signature | slots | subclasses | version | weakref | wrapped | annotations | classcell | spec | path | package | future | traceback )__ diff --git a/grammars/src/MagicPython.syntax.yaml b/grammars/src/MagicPython.syntax.yaml index 536bd32e..2be48ca1 100644 --- a/grammars/src/MagicPython.syntax.yaml +++ b/grammars/src/MagicPython.syntax.yaml @@ -1294,7 +1294,7 @@ repository: match: | (?x) (?