Commit Graph

25 Commits

Author SHA1 Message Date
Nikolay Krasko 0cd3e4f3a4 Minor: JetFile -> KtFile 2017-05-18 20:00:17 +03:00
Dmitry Petrov a15d423db4 Support modifiers on types in parser
(required for 'suspend' on functional types).

TYPE_REFERENCE element now has MODIFIER_LIST child, which hosts annotations and modifiers for the corresponding type reference.

Annotations and modifiers written before an extension function type are now parsed as annotations and modifiers for the functional type, not the receiver type.
So, '@Ann A.(B) -> C' was '(@Ann A).(B) -> C', and became '@Ann (A.(B) -> C)'.
NB: DSL_SCOPE_VIOLATION testData updated accordingly.

Type projection variance modifiers ('in', 'out') belong to a separate modifier list under corresponding type projection (not under a type reference).
'A<in suspend T>' is 'A<(in (suspend T))>', 'A<suspend in T>' is an error.

In stub builder, create a modifier list node to host annotations and modifiers (none so far; TODO properly serialize/deserialize types with modifiers).
2016-12-15 23:57:41 +03:00
Denis Zharkov 3aa1a56cb9 Extend recovery set when expecting property accessor
#KT-12987 Fixed
2016-07-08 16:06:47 +03:00
Dmitry Petrov ec94893189 KT-11588 Type aliases
Parse type aliases as top-level, member, and local declarations.
2016-05-20 14:17:24 +03:00
Valentin Kipyatkov 68853fecc3 Removed support for "typealias" declarations from the parser
#KT-10683 Fixed
2016-01-19 19:31:44 +03:00
Dmitry Jemerov 009e3f9cd7 rename PSI classes according to current terminology:
KtMultiDeclaration(Entry) -> KtDestructuringDeclaration(Entry)
KtFunctionLiteralExpression -> KtLambdaExpression
KtFunctionLiteralArgument -> KtLambdaArgument
KtDelegationSpecifierList -> KtSuperTypeList
KtDelegationSpecifier -> KtSuperTypeListEntry
KtDelegatorToSuperClass -> KtSuperTypeEntry
KtDelegatorToSuperCall -> KtSuperTypeCallEntry
KtDelegationByExpressionSpecifier ->KtDelegatedSuperTypeEntry
2015-12-10 16:15:13 +01:00
Anton Sukhonosenko 5bc70b3150 #KT-10124 Fixed 2015-12-02 20:03:13 +03:00
Yan Zhulanow a3ff3ffc45 Fix tests: "Placing function type parameters after the function name" error 2015-11-27 15:51:11 +03:00
Dmitry Jemerov bf35099e0c use "destructuring declarations" term instead of "multi-declarations" 2015-11-17 18:43:26 +01:00
Valentin Kipyatkov 98dc8f234e Drop suppport for annotation syntax without '@' from parser 2015-10-15 19:20:07 +03:00
Denis Zharkov 02aafe4262 Report syntax error on unescaped annotation
Also adjust parser testData
2015-09-18 09:34:26 +03:00
Denis Zharkov cf4b1ab7cd Drop obsolete annotations syntax 2015-06-12 09:55:00 +03:00
Pavel V. Talanov 07d35d305e Create import list psi element even if no directives are present
Fix a problem where deleting last import directive via "optimize imports" could lead to incorrect psi structure resulting in CCE, see EA-64291
New imports are inserted at the head (after package directive if present) of the file (before any comments) if no imports were present
Add test for inserting import to file where a first statement is a comment
Drop code dealing with non-existing import list in ImportInsertHelperImpl
AbstractQuickFixTest: check for unexpected actions before changes to the file are made as it relies on the first line having specific format
2015-06-08 20:51:04 +03:00
Valentin Kipyatkov 00fbf41bd8 More correct recovery after '.' in user type 2015-05-16 17:15:15 +03:00
Valentin Kipyatkov 60b0236101 Corrected parser: incomplete code should never cause brace disbalance
Fixed KT-7539 fq name inserted when completing nested traits name

 #KT-7539
2015-05-16 17:15:12 +03:00
Stanislav Erokhin a235110d44 Fixed function expression recovery 2015-03-12 17:11:45 +03:00
Valentin Kipyatkov 9dd4b5598e Comments binding (not complete yet) 2014-10-31 21:07:44 +03:00
Pavel V. Talanov 951ce827a6 Parser: allow function types as receiver type for function 2014-10-30 16:47:03 +03:00
Andrey Breslav 2bf6db003a Error message corrected: packages can't be nested any more 2014-10-15 12:22:35 +04:00
Andrey Breslav cc68ed894b "type" is not a keyword anymore ("typealias" reserved instead) 2014-10-13 15:41:13 +04:00
Evgeny Gerashchenko 791b5bb84c JetNamespaceHeader → JetPackageDirective. 2014-01-14 18:06:48 +04:00
Alexey Sedunov 28b3db53fe Fix irregular PSI structure for classes without body 2013-10-15 18:43:59 +04:00
Evgeny Gerashchenko e338cda06d Changed extension in parsing test data (jet -> kt) 2013-09-17 18:10:00 +04:00
Evgeny Gerashchenko 2ee3d22ab9 Generated missing test data. 2013-09-17 18:10:00 +04:00
Dmitry Jemerov ec6dec0d37 separate compiler and plugin tests 2011-10-20 16:21:18 +02:00