Commit Graph

330 Commits

Author SHA1 Message Date
Denis Zharkov 02b64ce1ed Parse const as soft modifier keyword 2015-09-23 08:20:56 +03:00
Dmitry Jemerov 4ca434da54 remove support for 'trait' keyword 2015-09-22 15:00:24 +02:00
Denis Zharkov 02aafe4262 Report syntax error on unescaped annotation
Also adjust parser testData
2015-09-18 09:34:26 +03:00
Denis Zharkov daa2c8372d Do not parse '@' as a part of modifier 2015-09-18 09:34:25 +03:00
Mikhail Glukhikh 0257f46ebb Special modifier parsing for enum entries: last of them is considered as an enum entry name #KT-9088 Fixed 2015-09-08 17:18:28 +03:00
Denis Zharkov fc447e2d2f Parse some builtin annotations as modifiers
But still resolve them as annotations.
Mostly it's needed as begin of migration path, one day they become modifiers anyway

Some tests are dropped because they supposed that `annotation` should have parameter
2015-09-08 08:53:35 +03:00
Mikhail Glukhikh 8f7b29f80a Annotation rename: target --> @Target 2015-09-07 13:42:26 +03:00
Yan Zhulanow add13cae82 lateinit modifier on property 2015-09-05 00:54:18 +03:00
Denis Zharkov 31244edec9 Deprecate deprecated in favor of Deprecated 2015-09-04 18:19:31 +03:00
Denis Zharkov 26f9bd7b63 Deprecate some of JVM flag annotations in favor of capitilized themselves 2015-09-04 18:19:31 +03:00
Yan Zhulanow a1eb544807 Parser tests for targeted annotations 2015-08-31 15:07:15 +03:00
Yan Zhulanow 1010658a85 Parse other use-site targeted annotations 2015-08-31 15:05:03 +03:00
Yan Zhulanow 2bacbc9046 Support @field: annotations 2015-08-31 15:05:02 +03:00
Yan Zhulanow 0c87639514 Fix annotation list parsing: @identifier:[a b c] 2015-08-27 18:16:06 +03:00
Mikhail Glukhikh 3f14e74b08 Drop old enum syntax. Comma / semicolon are now a syntactic part of enum entry.
Comma must present now between enum entries, semicolon between last entry & first member, constructor calls must be without colons / specifiers.
A swarm of tests fixed accordingly.
2015-08-11 10:38:10 +03:00
Nikolay Krasko 9648338b19 Enum with interface keywords leads to fail in DeclarationChecker 2015-07-17 20:59:03 +03:00
Nikolay Krasko 71b406d792 Fix class kind detector: prioritize enum over annotations. Introduce new error about enum annotations classes. 2015-07-17 20:59:02 +03:00
Dmitry Jemerov 0295b13cc7 couple more tuple leftovers 2015-07-14 17:14:33 +02:00
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