Commit Graph
132 Commits
Author SHA1 Message Date
Andrey VlasovskikhandAndrey Vlasovskikh b3eeba17f6 False, True, None made keywords for Python 2 due to typeshed's __builtins__.pyi 2017-02-02 01:24:11 +03:00
Semyon Proshev 2174c9b258 PY-20682 Fixed: await something() as function argument is not recognized by syntax analyzer
Copy `async` flag in ParsingScope.withSuite
2016-12-02 13:54:24 +03:00
Semyon Proshev cee9fd7789 PY-20770 Fixed: Support Python 3.6 asynchronous generators and comprehensions
Add tests for parsing await inside comprehensions
2016-09-30 18:06:20 +03:00
Semyon Proshev e23de0ceb6 PY-20770 Fixed: Support Python 3.6 asynchronous generators and comprehensions
Check for "for" or "async for" while parsing generators, list, dict and set literals
Highlight "async" as keyword in generators, list, dict and set literals
2016-09-30 18:05:19 +03:00
Mikhail Golubev b16311ef60 PY-18972 Initial support of f-string literals
Namely, Python lexer, compatibility inspection and unsupported
features annotator are aware of them now.
2016-09-16 08:16:26 +03:00
Mikhail Golubev 3266460142 PY-20744 Parse PEP-526 variable annotations
Annotation is preserved at the level of assignment nodes similar to
where CPython keeps them in its AST (in special "augassign" nodes).
For type annotations in form "x: int" without variable initialization
special statement PyTypeDefinitionStatement was introduced.
2016-09-16 08:16:26 +03:00
Semyon Proshev 61b92120d7 Assignment to await expressions is forbidden now 2016-07-08 13:47:38 +03:00
Semyon Proshev 673bc32291 PY-19036 Fixed: Using await in a non-asynchronous nested function not marked as a syntax error
Don't inherit async flag in ParsingScope, pass async flag to function parsing
2016-04-18 14:07:04 +03:00
Andrey Vlasovskikh 30c936a46d Fixed warnings for star unpacking in set literals 2015-09-14 15:22:58 +03:00
Andrey Vlasovskikh 045532ee74 Allow PEP 448 **expr syntax in dict literals 2015-09-14 13:48:16 +03:00
Andrey Vlasovskikh caf85e8e71 Fixed parsing decorated async functions and 'await' expressions inside them (PY-16094) 2015-09-08 17:44:21 +03:00
Andrey Vlasovskikh c855959143 Parse and highlight the 'await' keyword (PY-16094) 2015-09-08 14:21:52 +03:00
Andrey Vlasovskikh d616d70c50 Parse and highlight the 'async' keyword (PY-16094)
We had to switch to stack-based parsing contexts in order to be able
to use context-sensitive token filtering for 'async'.

Also this commit fixes the highlighting annotator issue with blinking
names of the functions and blinking 'async'.
2015-09-06 20:04:50 +03:00
Mikhail Golubev 6794f3299c PY-15653 Do not consume open parenthesis after missing identifier in class and function headers 2015-04-21 15:14:25 +03:00
Mikhail Golubev 8f30a5836a PY-15469 Delimiter "->" in Python is parsed as single token
Thanks to that, pressing enter no longer inserts backslash in the
middle of "->" sequence (and such corrupted code is properly
highlighted now on).
2015-04-08 16:28:54 +03:00
Andrey Vlasovskikh e7db2ff39c Parsing of '@' and '@=' operators (PY-15390)
We have to introduce a new lexeme '@=' and re-define '@' to become a
binary operator as well as the prefix of the decorator.
2015-03-24 17:40:42 +03:00
Mikhail Golubev 186f1fe5af PY-14408 PythonIndentingProcessor includes tabs inside PsiWhitespace elements
Also I partially reverted previous fix in PyBlock#isWhitespaceLineBreaks,
because current approach is more general and that workaround is no longer
needed (multiple whitespaces are collapsed into single element as in other
languages).
2015-01-28 13:11:03 +03:00
Andrey Vlasovskikh ae1e6ca3e7 Better error recovery for lines with single 'class' or 'def' keywords and normal functions defined below 2014-02-26 19:29:15 +04:00
Andrey Vlasovskikh a39c3b7998 Better error recovery for blocks with missing ':' and non-empty bodies 2014-02-26 18:18:15 +04:00
Andrey Vlasovskikh 09bd5b323a Fixed error recovery after empty blocks with no indent 2014-02-26 16:26:12 +04:00
Ilya.Kazakevich 2f65c96783 Python function parsing fixed: any function has statement list now 2014-02-06 19:41:01 +04:00
Ekaterina Tuzova 4e914225b4 fixed PY-11340 Invalid case for can't assign to literal inspection 2014-01-23 17:53:05 +04:00
Ekaterina Tuzova 18db741b06 fixed PY-11476 No error given for mismatched accolade and squarebracket 2013-11-25 19:39:35 +04:00
Dmitry Jemerov c6bc240104 correctly attach leading comment to statement list (PY-1909) 2013-11-12 16:12:10 +01:00
Dmitry Jemerov aa885ea720 report missing identifier after 'as' (PY-9853) 2013-11-06 19:17:42 +01:00
Dmitry Jemerov 52efcb58c5 only allow single expression after 'in'; tweak error recovery when waiting for colon (PY-9561) 2013-11-06 19:17:41 +01:00
Dmitry Jemerov 664ee85163 improve parser recovery if keyword is used as function or class name (PY-8319) 2013-11-05 19:37:49 +01:00
Dmitry Jemerov 5d6bac5b12 improve parser recovery if keyword is used as named parameter (PY-8318) 2013-11-05 19:37:49 +01:00
Dmitry Jemerov f52709b867 tweak decorator parsing so that following line comment is outside the text range of PyDecorator (PY-5912) 2013-11-05 19:37:47 +01:00
Dmitry Jemerov 56b50d1dff report parsing error if no expression was found after * (PY-10177 part 1) 2013-10-31 21:00:19 +01:00
Ekaterina Tuzova ec5f16c8e0 fixed PY-11058 False positive Statement expected, found statement break 2013-10-11 17:05:05 +04:00
Ekaterina Tuzova 0792f733cc updated test data for parsing 2013-02-22 12:22:38 +04:00
Ekaterina Tuzova 60d0628886 fixed PY-8948 Not closed quote in subscription breaks parsing for the whole file 2013-02-21 18:44:46 +04:00
Andrey Vlasovskikh 377662303c Fixed parsing ellipsis as an expression in Python 3 (PY-8257)
In Python 3 ellipsis can appear anywhere, not only in sequence slicings. The parser
now always passes ellipsis, it's incorrect use is detected at the unsupported features
annotator or compatibility inspection levels.
2013-02-18 16:08:33 +04:00
Dmitry Jemerov 38ed156b15 report missing expression in subscription (PY-8652) 2013-01-30 18:52:59 +01:00
Andrey Vlasovskikh 8e4270e44a Fixed parsing ellipsis in slice lists (PY-8606) 2013-01-28 20:49:48 +04:00
Dmitry Jemerov f51943380f parse ellipsis only in the context where it can actually be used (PY-7763) 2012-12-13 22:03:08 +01:00
Dmitry Jemerov 59d5c27308 don't parse compound statements after semicolon at top level of file (PY-7660) 2012-12-13 22:03:07 +01:00
Andrey Vlasovskikh 1d3a7823d3 Fixed parsing error in StatementParsing.parseSimpleStatement (EA-30244) 2012-09-03 19:39:05 +04:00
Dmitry Jemerov 59bd0dd4d5 fix parsing of generator in argument list to actually match Python grammaer (PY-6926) 2012-08-07 12:46:11 +02:00
Andrey Vlasovskikh 55803b0c21 Fixed false negative in parsing for empty 'if' in list comprehensions (PY-6781) 2012-06-15 20:43:26 +04:00
Andrey Vlasovskikh 776196487a Fixed false negative in parsing incomplete 'raise ... from' expression (PY-6734) 2012-06-14 15:58:36 +04:00
Andrey Vlasovskikh c28200769a Fixed false negative in parsing incomplete 'yield from' expression (PY-6733) 2012-06-14 15:32:24 +04:00
Andrey Vlasovskikh b9939f1601 Support 'yield from' syntax (PY-6702) 2012-06-05 15:41:35 +04:00
Andrey Vlasovskikh c2db96a4f0 Better syntax error recovery for unmatched braces (PY-3067) 2012-05-31 17:07:53 +04:00
Dmitry Jemerov 95350dbe11 a reference in a slice expression in the LHS of an assignment is always a reference expression, not a target expression (PY-6468) 2012-05-04 18:32:18 +02:00
Ekaterina Tuzova 81a21bea69 fixed test data 2011-12-15 14:01:33 +04:00
Ekaterina Tuzova a89dd1b950 Merge remote branch 'origin/master'
Conflicts:
	python/testData/psi/ColonBeforeEof.txt
2011-12-15 13:10:44 +04:00
Dmitry Trofimov 035ec1f140 Fixed tests. 2011-12-14 22:04:28 +01:00
Ekaterina Tuzova 3741753179 added last statement break to the python lexing 2011-12-14 14:03:19 +04:00