Commit Graph

220 Commits

Author SHA1 Message Date
victor.petukhov a2b7912db9 Add expect and actual modifiers to the grammar (KT-25477) 2018-10-16 16:18:32 +03:00
victor.petukhov 205bd3f829 Replace the invalid rule name element to expression in the collectionLiteral grammar rule 2018-10-16 16:16:18 +03:00
James Wald b7d0d20739 Fix typo in expression precedence table 2018-10-08 14:00:51 +03:00
Sergey Igushkin 32df9c00ee Update literals in the grammar reference
Add missing long literal suffix
Add binary integer literals
Introduce IntegerLiteral lexer rule, which is closer to the actual lexer

Issue #KT-22713 Fixed
2018-03-12 18:02:22 +03:00
Sergey Igushkin 41044cd277 Fix the rule for valueArguments 2018-03-12 18:02:08 +03:00
Alexey Belkov 4b5b9b40e7 Grammar: Fix "object" rule (KT-22676) 2018-03-12 18:02:08 +03:00
Alexey Belkov d98c454806 Grammar: Fix "LabelName" rule (KT-22676) 2018-03-12 18:02:08 +03:00
Alexey Belkov 4ffd4f8060 Grammar: Fix "labelDefinition" rule in precedence table (KT-22676) 2018-03-12 18:02:08 +03:00
Alexey Belkov 2b9f26a0da Grammar: Fix "functionType" rule (KT-22676) 2018-03-12 18:02:08 +03:00
Alexey Belkov d0f3001fd5 Grammar: Fix "optionalProjection" rule (KT-22676) 2018-03-12 18:02:08 +03:00
Alexey Belkov d6496814b2 Grammar: Fix "enumEntry" rule (KT-22676) 2018-03-12 18:02:08 +03:00
Alexey Belkov 8f88bc0a3c Grammar: Fix broken link (KT-22676) 2018-03-12 18:02:08 +03:00
Alexey Belkov 3cb952df5d Grammar: Add terminating semicolons (KT-22676) 2018-03-12 18:02:08 +03:00
Alexey Belkov 6fa87f98ca Grammar: Improve wording (KT-22676) 2018-03-12 18:02:08 +03:00
Alexey Belkov c0866e7ba2 Grammar: Fix rule headings in section "Lexical structure" (KT-22676) 2018-03-12 18:02:08 +03:00
Nikolas Havrikov 3d8b15d9db Fixed trailing underscores in numeric literals (#1264)
This change prohibits such illegal numeric literals as 13_37_ or 0xCAFE_BABE_ (note the trailing underscore).
2017-08-26 16:07:35 +03:00
igorini 00a5ff2364 Fix inline block in notation.grm 2017-05-28 17:12:52 +01:00
Mikhail Zarechenskiy d3fd96ceed Parse collection literals as atomic expressions 2017-03-22 17:59:58 +03:00
Alexander Udalov 3ad4f18e1a Update grammar to Kotlin 1.1
Also drop obsolete comments and inline some trivial rules
2017-03-01 14:50:36 +03:00
Dmitry Jemerov e68dcdcc1e Fix companion object definition in the grammar (KT-8566) 2016-11-10 13:40:57 +01:00
Dmitry Jemerov 2c989b5671 Fix enumEntries definition in grammar (KT-14261) 2016-11-10 13:40:49 +01:00
Dmitry Jemerov a0b6b3c248 Fix labelDefinition link in grammar (KT-14262) 2016-11-10 13:40:31 +01:00
Denis Zharkov bec84b1d7b Change parsing of annotations on block level expressions
Attach annotations to the closest prefix expression instead of
whole statement if no new line found after annotations

The motivation is for a simple annotated expression like '@ann x + y'
its syntax form must not change after prepending 'val z = ' just before it
2016-10-12 11:39:04 +03:00
Denis Zharkov 9ff439e39e Change annotations parsing in bodies of operators
This change only matters in cases of if/when/for/while having braceless
blocks

Annotations on them are parsed now as on block-level expressions, i.e.
they're attached to the whole expression
2016-10-12 11:39:04 +03:00
Denis Zharkov 7353b08f09 Change parsing of statements starting with annotations
If a block statement starts with annotations treat them as they
belong to node of the statement rather than to the closest prefix expression

 #KT-10210 Fixed
2016-10-05 10:29:29 +03:00
Denis Zharkov 75a51d915f Implement parsing of desctructuring declarations in lambdas
#KT-5828 In Progress
2016-09-19 20:22:57 +03:00
Mikhail Glukhikh 8bdc88f763 Grammar: obsolete 'annotationEntry' changed to 'unescapedAnnotation' in a few places
(cherry picked from commit d9818bd)
2016-07-19 15:09:17 +03:00
Mikhail Glukhikh 75832f9d80 Grammar: obsolete 'package' element removed #KT-8429 Fixed
(cherry picked from commit 7bdf556)
2016-07-19 15:09:08 +03:00
Mikhail Glukhikh 23ae042154 A set of soft modifiers added to grammar #KT-13143 Fixed
(cherry picked from commit 904a18c)
2016-07-19 15:08:58 +03:00
Andrey Breslav 8544b9a1d6 Rule for function literals fixed: parameter types are allowed 2016-06-02 20:09:28 +03:00
Alexander Udalov 1339286261 Drop undocumented absolute name specification feature with 'package.' 2016-06-01 19:30:03 +03:00
Yan Zhulanow 4298559858 Minor: fix sparam -> setparam 2016-04-22 19:48:28 +03:00
Alexander Udalov 66417ed329 Parse type arguments after callable reference as error
Is likely to be supported in the future
2015-10-15 18:25:42 +03:00
Denis Zharkov 5f69789636 Stop parsing lambdas with deprecated syntax 2015-09-25 08:29:25 +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 daa2c8372d Do not parse '@' as a part of modifier 2015-09-18 09:34:25 +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
Denis Zharkov 9d87638a11 Clarify grammar rules for annotations 2015-06-12 09:55:01 +03:00
Dmitry Jemerov 18753a16d7 a bunch of fixes to the grammar 2015-06-08 14:46:28 +02: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 e4f54b5d2e Parsing: support '@[ann1 ann2]', '@file:ann' and '@file:[ann]' cases 2015-05-20 09:24:56 +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
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
Denis Zharkov aa7bae213d Introduce ++ operator into grammar 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 507eefcaa5 Implement new parsing rules for labels
See changes in expressions.grm
2015-04-29 14:03:10 +03:00
Andrey Breslav a389d694d8 Merge pull request #605 from JetBrains/rr/yole/delete-confluence-grammar-generator
delete old grammar generator
2015-03-20 15:16:33 +03:00