@dekobon/tree-sitter-groovy 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -180,13 +180,34 @@ These are documented in detail in
180
180
  closure, as in Groovy: end the field with `;` to get an
181
181
  initializer block.
182
182
  - **`sealed` and `trait` are keywords where a class member can
183
- start** -- a field or enum constant named `sealed` or `trait` is an
184
- `ERROR` when it follows a modifier (`private boolean sealed`) or
185
- opens the member (`static trait = 1`, `enum E { trait }`).
186
- `boolean sealed` and `String trait`, with no modifier, parse.
183
+ start** -- a field named `sealed` or `trait` is an `ERROR` when it
184
+ follows a modifier (`private boolean sealed`) or opens the member
185
+ (`static trait = 1`). `boolean sealed` and `String trait`, with no
186
+ modifier, parse, and so does an enum constant with either name
187
+ (`enum E { trait, sealed }`).
187
188
  `record` is not affected: it is a keyword only directly before a
188
189
  record header (`record Name(`), so `private Record record` and
189
190
  `record.key()` parse.
191
+ - **A member after an enum's trailing comma must start with a
192
+ modifier, `def` or a keyword** -- Groovy up to 4.x takes any member
193
+ there. `A,` followed by `String x` or by `E() { }` is an `ERROR`
194
+ (#97).
195
+ - **Parameter modifiers have one order** -- annotations, then `final`,
196
+ then `def`, `var` or a type. `def String x`, `final @A x` and a
197
+ varargs parameter with no type (`... xs`) are an `ERROR` (#98).
198
+ - **A line break does not end a statement** -- a newline is whitespace
199
+ to the grammar. Most code is unaffected, because the next token
200
+ cannot continue the statement. Known cases that read wrongly with no
201
+ `ERROR`: a bare name followed by a literal on the next line is one
202
+ parenthesis-free call (#90); a field with a modifier and no type
203
+ followed by a typed method is a typed field and a constructor (#96);
204
+ and inside brackets, `(a)` followed by a line that starts with `-`,
205
+ `+` or `(` is not the cast Groovy reads (#99).
206
+ - **A method with modifiers and no return type is a constructor** --
207
+ `static f() { }` in a class body is a `constructor_declaration`,
208
+ and `abstract m()` is an `ERROR` (#91).
209
+ - **Annotations come before modifiers** -- `private @Autowired Foo
210
+ foo` and `public @interface X { }` are an `ERROR` (#92).
190
211
 
191
212
  ## Contributing
192
213