Commit Graph

344 Commits

Author SHA1 Message Date
Victor Petukhov b69fb6779f Basic support of partially specified type arguments though a new underscore operator for type arguments
^KT-13394
2021-11-01 12:25:07 +03:00
Nikolay Lunyak f6ae6af741 [FIR] Add test data 2021-09-11 22:05:43 +03:00
Nikolay Lunyak a0982341ee [FIR] Update parser test data 2021-09-11 22:05:28 +03:00
Denis.Zharkov 302eacbf59 Support new form of definitely non-nullable types: T & Any
^KT-26245 In Progress
2021-08-31 15:41:11 +03:00
Dmitriy Novozhilov c9cd49d34f [Test] Temporary remove test for KT-22379
This is needed because this test breaks IDE when whit file is indexed.
This test will be returned after release of new kotlin plugins for IDEA
2021-05-11 19:45:43 +03:00
Dmitriy Novozhilov 3532ce7fbc [Parser] Fix OOM in parsing of incorrect string literals
^KT-46455 Fixed
KT-34410
KT-46564
2021-05-11 16:43:29 +03:00
Denis.Zharkov 16ca8ddbbd Do not parse !! as part of annotation type
^KT-26245 Related
2021-04-09 13:06:38 +03:00
Denis.Zharkov b9d2a1842a Support definitely-not-null generic T!! types in Parsing and FE1.0
^KT-26245 In Progress
2021-04-09 13:06:28 +03:00
Denis.Zharkov cbb8459e4e Fix AE: No receiver found on incomplete code with $-signs
^KT-24158 Fixed
2020-12-24 14:06:20 +03:00
Ilmir Usmanov 11b2a07a59 Value classes: Support 'value' modifier in parser 2020-11-27 23:52:04 +01:00
Arsen Nagdalian 86e07cd626 Parser tests: move the contract description blocks tests to a separate folder and add a test for property accessors' contracts 2020-08-25 12:58:38 +03:00
Arsen Nagdalian 32a64b888e [Parser] Add parsing of function's contract either before or after type constraints 2020-08-25 12:58:34 +03:00
Arsen Nagdalian 1b57889773 Clean the code 2020-08-25 12:58:34 +03:00
Arsen Nagdalian f781a9993b Parser tests: add tests for contract description blocks 2020-08-25 12:58:34 +03:00
Ilya Kirillov 1535873c07 Do not try to lazy parse a block without opening bracket
It can consume the whole file in such case
which will result PsiBuilder going crazy

#KT-36191 fixed
2020-04-16 15:40:21 +03:00
Victor Petukhov cec747349e Fix PSI tests for correct parsing them by the ANTLR grammar 2020-04-02 19:02:31 +03:00
Mikhail Zarechenskiy 4aa195e912 FIC: Parse fun keyword in front of interface as a modifier 2020-01-17 19:35:05 +03:00
Ilya Chernikov 7bb9f97b11 Allow to separate top-level script declarations and statements with semicolon
This fix allows to write one-liner scripts like "val x = 3; println(x)", which
were previously rejected by the parser.
2019-12-02 16:46:54 +01:00
victor.petukhov 62d204f4d6 Support trailing comma
^KT-34743 Fixed
2019-11-01 19:40:20 +03:00
victor.petukhov 6a679d86ab Support non-parenthesized annotations on functional types without receiver
^KT-31734 Fixed
2019-07-17 16:18:15 +03:00
Igor Yakovlev da4d8a8c90 Parser invalid error advancing for postfix type parameters list #KT-30835 Fixed 2019-04-05 19:50:42 +03:00
Yaroslav Russkih 028a311949 Use https everywhere - tests and test data 2019-02-19 21:35:36 +01:00
Denis Zharkov 82537cdc8b Add recovery for missing comma between arguments
^KT-13497 Fixed
2019-01-17 14:58:01 +03:00
Denis Zharkov db53c4bea4 Add test for obsolete recovery case (semi-finished extension)
^KT-7405 Obsolete
2019-01-17 14:56:42 +03:00
Denis Zharkov 65e6e21d0f Add recovery for import lists in the middle of the file
Note, that it only works for top-level declarations

^KT-7185 Fixed
2019-01-17 14:56:42 +03:00
Denis Zharkov e6710b6fa2 Add recovery for value parameter without type or name
The case for KT-7237 belongs to /NoGTInTypeArguments test
It was fixed implicitly: before it recovery was working but the name for
the next parameter was attached to type argument list.
After that change, parameter without name gets parsed correctly (with an
error of course)

^KT-13731 Fixed
^KT-7237 Fixed
2019-01-17 14:56:42 +03:00
Denis Zharkov 5437a0e478 Add recovery for enum declaration without 'class' keyword
^KT-13703 Fixed
2019-01-17 14:56:42 +03:00
Denis Zharkov 3707812fc2 Revert "Temporary remove some tests after a fix for KT-24937"
This reverts commit ddb4e8b128.
2019-01-15 12:35:12 +03:00
Denis Zharkov ddb4e8b128 Temporary remove some tests after a fix for KT-24937
Otherwise, our project is failed to be indexed
2018-12-11 09:45:39 +03:00
Denis Zharkov 5992896d76 Relax assertion in parser for a recovery case with annotations
^KT-24937 Fixed
2018-12-11 09:45:14 +03:00
Nikolay Krasko 449069b1b7 Attach preceding line comments to property accessors (KT-25417)
#KT-25417 Fixed
2018-08-02 14:38:25 +03:00
Mikhail Zarechenskiy a765ee41d7 Introduce uL/UL suffix to represent numbers of unsigned long type
#KT-24663 Fixed
2018-06-27 14:21:12 +03:00
Mikhail Zarechenskiy 7c44992016 Allow any case for u suffix
#KT-24663 In Progress
2018-06-27 14:21:07 +03:00
Dmitry Petrov 67247ee490 'val' in 'when' subject can't have modifiers (annotations are ok) 2018-06-20 14:06:34 +03:00
Dmitry Petrov 53fd883e2a Additional parser tests for both subject val and expression in 'when' 2018-06-20 14:06:34 +03:00
Dmitry Petrov 8aec99f4b5 Fix parsing variable declaration in when subject
- parse destructuring declarations
- parse annotations on variable declaration in when subject
2018-06-20 14:06:34 +03:00
Mikhail Zarechenskiy bf5f710f39 Parse integers with unsigned ('u') suffix 2018-06-04 18:19:34 +03:00
Mikhail Zarechenskiy 8f8143d3ed Fix IAE for wrong use-site @file annotation
#EA-100189 Fixed
2017-08-07 18:49:57 +03:00
Nikolay Krasko 7d66af6583 Always assign shebang comment to same position before package 2017-08-07 12:17:20 +03:00
Nikolay Krasko 8d226594ff Put comments and whitespaces under body in script files
It's more consistent to normal function body for IDE.
Doc comments in file beginning are now sticks to declarations
correctly.
Moving declarations at the end of scripts is fixed
2017-08-07 12:17:17 +03:00
Nikolay Krasko 0cd3e4f3a4 Minor: JetFile -> KtFile 2017-05-18 20:00:17 +03:00
Alexey Sedunov 5d87276cff PSI: Introduce KtImportAlias element 2017-05-16 13:10:35 +03:00
Mikhail Zarechenskiy d3fd96ceed Parse collection literals as atomic expressions 2017-03-22 17:59:58 +03:00
Nikolay Krasko afc0892d1f Synchronize state of parser and lexer for LONG_TEMPLATE_ENTRY (KT-14865)
Lexer monitors "long string template" state end and will produce
LONG_TEMPLATE_ENTRY_END token when it is reached. If parser continues
without waiting for it, it will eventually get handling token that
will produce irrelevant error. Such behaviour also breaks lazy
elements (LAMBDA_EXPRESSION in this case) contract: range of parsed text
in eager mode should be same to one parsed in lazy mode.

 #KT-14865 Fixed
2017-03-20 17:47:29 +03:00
Mikhail Zarechenskiy da53317357 Fix exception when type parameters appear in object declaration
#KT-14536 Fixed
2017-03-14 01:10:00 +03:00
Dmitry Petrov a974ed1049 Support custom accessors for top-level properties in scripts. 2017-01-26 10:12:13 +03:00
Dmitry Petrov b9f9894310 KT-15677 KT-15775
Update parser & descriptor renderer to handle parenthesized types and function types properly.
Resolve annotations in parenthesized types.

AnnotationsImpl.isEmpty() returned false for targeted annotations only
(e.g., 'fun @receiver:Ann C?.foo()').
Properly keep track of targeted annotations.
2017-01-19 09:53:17 +03:00
Dmitry Petrov a3338b2230 Allow only 'out' modifier for value parameter modifiers in functional type
(comments also mention 'lazy' and 'ref'; these value parameter modifiers are unsupported, anyway).
2016-12-15 23:58:02 +03:00
Stanislav Erokhin 42440f50dc Remove soft keyword coroutine & isCoroutine from ValueParameterDescriptor. 2016-12-15 23:57:56 +03:00
Dmitry Petrov cf4fb1eb25 Since '@A R.() -> T' is now parsed as '@A (R.() -> T)',
receiver type with modifiers or annotations should be surrounded in parentheses on rendering: '(@A R).() -> T'

This also fixes stub builder tests (which check that stubs are consistent with rendered descriptors).
2016-12-15 23:57:42 +03:00