Commit Graph

362 Commits

Author SHA1 Message Date
Dmitry Jemerov 55c11539f8 drop tuples support from parser 2015-07-14 17:06:17 +02:00
Mikhail Glukhikh 1eac4d67de "annotation" is now parsed as an identifier. It is no longer a soft keyword.
Sometimes it's allowed to parse "annotation" unescaped even if other annotations must be escaped.
A set of annotations and their options tests.
A swarm of existing tests fixed (mostly kotlin.annotation.annotation() added to txt-files).
STUB_VERSION increased. Some quick fixes slightly changed.
2015-07-14 16:24:55 +03:00
Pavel V. Talanov 997a6f1381 Fix import resolution for some cases of malformed imports ("import some.")
Fix parsing import directives in case of non-identifier after "import"
Add diagnostics test for malformed imports
2015-06-23 15:19:14 +03:00
Alexey Sedunov 3266d8c29a Parser: Disable joining complex tokens while parsing type references
#KT-8141 Fixed
2015-06-19 21:45:13 +03:00
Mikhail Glukhikh e623aadf00 Exception fix: more accurate parsing of class base type #EA-65509 Fixed 2015-06-15 14:43:37 +03:00
Denis Zharkov cf4b1ab7cd Drop obsolete annotations syntax 2015-06-12 09:55:00 +03:00
Denis Zharkov cdba1c2dbe Parsing: allow accessors with '@' annotation on the same line 2015-06-12 09:23:31 +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
Denis Zharkov 9c574469ca Parsing: allow primary ctor in object syntactically
It's needed for better recovering for cases of changes like 'class' -> 'object'

The only sensible case when it's may be bad:
class A {
   object B
   constructor() : super()
}

But it seems to be rare, and ';' can be used to separate object from secondary ctor
2015-06-02 14:07:48 +03:00
Denis Zharkov 19e4127f4f Do not wrap primary ctor of object into ErrorElement
It helps to resolve them as for classes
Diagnostic with same content will be reported instead
2015-06-02 13:18:53 +03:00
Denis Zharkov dd14b36921 Prohibit unescaped annotations on primary constructor of local class 2015-05-20 09:24:56 +03:00
Denis Zharkov e4f54b5d2e Parsing: support '@[ann1 ann2]', '@file:ann' and '@file:[ann]' cases 2015-05-20 09:24:56 +03:00
Denis Zharkov f6aadec7e2 Minor, rename tests onFile -> onFileObsolete 2015-05-20 09:24:56 +03:00
Denis Zharkov 083966389a Minor, get rid of repeating parsing semantics 2015-05-20 09:24:55 +03:00
Denis Zharkov 805a811d91 Change parsing rules for primary constructor
- Parse 'constructor' keyword before value arguments
- Allow unescaped annotations
2015-05-20 09:24:54 +03:00
Denis Zharkov d058a07ce2 Parsing: allow semicolon between declarations 2015-05-20 09:24:54 +03:00
Valentin Kipyatkov 617fe9b49d No duplicate "Expecting ')'" when parsing accessor 2015-05-16 17:15:16 +03:00
Valentin Kipyatkov 00fbf41bd8 More correct recovery after '.' in user type 2015-05-16 17:15:15 +03:00
Valentin Kipyatkov a05ffafc84 Added a test 2015-05-16 17:15:14 +03:00
Valentin Kipyatkov c94dc6d5f7 Better parsing of block after missing "->" after "else" in when 2015-05-16 17:15:14 +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
Mikhail Glukhikh 4e1a90ee61 Diagnostics for incorrect enum members order, when enum entry follows enum member. A few diagnostic tests.
Now incorrect enum members order is treated as a warning.
2015-05-15 16:13:46 +03:00
Mikhail Glukhikh 983339e1c9 Detection of semicolon between enum entries together with the correct delimiter quick fix for this case.
Error message reported directly on semicolon.
2015-05-15 16:13:41 +03:00
Mikhail Glukhikh 1a312140e9 New enum syntax: Short constructor syntax introduced for entries, optional commas between entries, semicolon after entries. #KT-7605 Fixed.
Grammar changed accordingly.
Semicolons prohibited after an entry except the last one.
Only one initializer is allowed per entry.
EnumReferenceExpression AST node introduced.
Some tests fixed, a pair of new tests written. Kotlin code inside project fixed.
Formatter and intendation tests fixed accordingly.
Stub version is incremented.
2015-05-15 16:13:32 +03:00
Mikhail Glukhikh cf741cb868 Enum parsing changed: first entries, then members. Grammar fixed accordingly.
A set of compiler tests and some plugin tests changed accordingly.
Compiler Kotlin code changed accordingly.
2015-05-15 16:13:27 +03:00
Alexander Udalov 2fe05c6f11 Parse and resolve annotations on supertypes 2015-05-14 18:58:08 +03:00
Dmitry Jemerov 4bdf598bfe compiler testdata: s/trait/interface 2015-05-12 19:43:17 +02:00
Denis Zharkov 585a437b2e Parse '@' annotations on enum entries
Just drop truncating builder's creation as we parse only escaped annotations
and will not `eat` entry identifier
2015-05-07 22:36:17 +03:00
Denis Zharkov 3d810ffe61 Parse modifier list of multi-declaration and for parameters 2015-05-07 22:36:16 +03:00
Denis Zharkov b72a3de86e Parse annotations on lambda-argument 2015-05-07 22:36:15 +03:00
Denis Zharkov 7d8351abc6 Implement parsing annotations and modifiers starting with '@' 2015-05-07 22:36:15 +03:00
Denis Zharkov b13e932c3c Parse label reference with spaces before '@'
But still report error
2015-05-07 22:36:15 +03:00
Denis Zharkov bcee052302 Revert "Temporary parse label definitions with both syntax versions"
This reverts commit 3e3535f8cf.
2015-04-30 10:16:42 +03:00
Dmitry Jemerov ee60ce8369 understand "interface" keyword as synonym for "trait" 2015-04-29 16:50:14 +02:00
Dmitry Jemerov 98b8784ab0 drop deprecated syntax for anonymous initializer blocks 2015-04-29 14:07:04 +02:00
Denis Zharkov 3e3535f8cf Temporary parse label definitions with both syntax versions
Should be reverted after bootstrap
2015-04-29 14:03:11 +03:00
Denis Zharkov 507eefcaa5 Implement new parsing rules for labels
See changes in expressions.grm
2015-04-29 14:03:10 +03:00
Dmitry Jemerov cbbb2fcd48 fix JetParsingTestGenerated 2015-04-27 15:14:33 +02:00
Dmitry Jemerov 5bbbadeb37 add a token for inline Markdown links; add test for identifier links with labels 2015-04-15 19:48:46 +02:00
Evgeny Gerashchenko 508c7a58b6 KT-7377 Throwable: Empty PSI elements should not be passed to createDescriptor from UnusedReceiverParameterInspection
#KT-7377 fixed
2015-04-13 15:04:00 +03:00
Alexey Sedunov 4af608ef84 Parser: Recovery for parameter with missing name 2015-04-09 13:49:17 +03:00
Pavel V. Talanov a986d913c3 Remove traces of class object constraints feature from parser, frontend, tests and psi 2015-04-01 20:09:34 +03:00
Denis Zharkov af2bcfb524 Parse primary constructor into separate PSI element 2015-03-31 20:20:22 +03:00
Denis Zharkov 8c048c3e43 Refine recovery for constructors 2015-03-27 16:09:41 +03:00
Denis Zharkov 01e5ee718f Allow secondary constructors without body
#KT-6967 Fixed
2015-03-27 16:09:40 +03:00
Alexey Sedunov 4ec1b9971f Parser: Do not produce JetQualifiedExpression without receiver
#KT-7122 Fixed
2015-03-26 23:11:50 +03:00
Denis Zharkov eefea26d54 Recovery for initializer if no LBRACE
- If no LBRACE after 'init' keyword parse initializer without body
- Made getBody() nullable, appropriate checks added
2015-03-18 19:59:25 +03:00
Stanislav Erokhin c24c3daf54 Allowed shorthand parameter list with type reference in lambda. 2015-03-18 16:06:44 +03:00
Stanislav Erokhin 7a8341d0f1 Added parser test for function with initializer. 2015-03-18 16:06:44 +03:00
Pavel V. Talanov 06916d98c6 default -> companion: replace all mentions of default and default object 2015-03-17 15:47:39 +03:00