tree-sitter-java-orchard 0.5.10 → 0.5.16

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/grammar.js CHANGED
@@ -269,6 +269,7 @@ export default grammar({
269
269
  $._reserved_identifier,
270
270
  $.field_access,
271
271
  $.array_access,
272
+ $.parenthesized_expression,
272
273
  )),
273
274
  field('operator', choice('=', '+=', '-=', '*=', '/=', '&=', '|=', '^=', '%=', '<<=', '>>=', '>>>=')),
274
275
  field('right', $.expression),
@@ -1079,12 +1080,14 @@ export default grammar({
1079
1080
  field('body', $.class_body),
1080
1081
  ),
1081
1082
 
1082
- annotation_type_declaration: $ => seq(
1083
+ // disambiguate vs compact constructor w/ marker-annotation "interface"
1084
+ annotation_type_declaration: $ => prec.dynamic(1, seq(
1083
1085
  optional($.modifiers),
1084
- '@interface',
1086
+ '@',
1087
+ 'interface',
1085
1088
  field('name', $.identifier),
1086
1089
  field('body', $.annotation_type_body),
1087
- ),
1090
+ )),
1088
1091
 
1089
1092
  annotation_type_body: $ => seq(
1090
1093
  '{',
@@ -1338,7 +1341,7 @@ export default grammar({
1338
1341
  super: _ => 'super',
1339
1342
 
1340
1343
  // https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-IdentifierChars
1341
- identifier: _ => /[\p{XID_Start}_$][\p{XID_Continue}\u00A2_$]*/,
1344
+ identifier: _ => /[\p{ID_Start}\p{Nl}\p{Sc}\p{Pc}][\p{ID_Continue}\p{Nl}\p{Sc}\p{Pc}\p{Cf}]*/u,
1342
1345
 
1343
1346
  line_comment: _ => token(prec(PREC.COMMENT, seq('//', /[^\n]*/))),
1344
1347
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tree-sitter-java-orchard",
3
- "version": "0.5.10",
3
+ "version": "0.5.16",
4
4
  "description": "Java grammar for tree-sitter",
5
5
  "type": "module",
6
6
  "repository": {
@@ -37,7 +37,7 @@
37
37
  "devDependencies": {
38
38
  "prebuildify": "^6.0.1",
39
39
  "tree-sitter": "^0.25.0",
40
- "tree-sitter-cli": "^0.26.11"
40
+ "tree-sitter-cli": "^0.26.12"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "tree-sitter": "^0.25.0"
package/src/grammar.json CHANGED
@@ -1506,6 +1506,10 @@
1506
1506
  {
1507
1507
  "type": "SYMBOL",
1508
1508
  "name": "array_access"
1509
+ },
1510
+ {
1511
+ "type": "SYMBOL",
1512
+ "name": "parenthesized_expression"
1509
1513
  }
1510
1514
  ]
1511
1515
  }
@@ -6508,41 +6512,49 @@
6508
6512
  ]
6509
6513
  },
6510
6514
  "annotation_type_declaration": {
6511
- "type": "SEQ",
6512
- "members": [
6513
- {
6514
- "type": "CHOICE",
6515
- "members": [
6516
- {
6515
+ "type": "PREC_DYNAMIC",
6516
+ "value": 1,
6517
+ "content": {
6518
+ "type": "SEQ",
6519
+ "members": [
6520
+ {
6521
+ "type": "CHOICE",
6522
+ "members": [
6523
+ {
6524
+ "type": "SYMBOL",
6525
+ "name": "modifiers"
6526
+ },
6527
+ {
6528
+ "type": "BLANK"
6529
+ }
6530
+ ]
6531
+ },
6532
+ {
6533
+ "type": "STRING",
6534
+ "value": "@"
6535
+ },
6536
+ {
6537
+ "type": "STRING",
6538
+ "value": "interface"
6539
+ },
6540
+ {
6541
+ "type": "FIELD",
6542
+ "name": "name",
6543
+ "content": {
6517
6544
  "type": "SYMBOL",
6518
- "name": "modifiers"
6519
- },
6520
- {
6521
- "type": "BLANK"
6545
+ "name": "identifier"
6546
+ }
6547
+ },
6548
+ {
6549
+ "type": "FIELD",
6550
+ "name": "body",
6551
+ "content": {
6552
+ "type": "SYMBOL",
6553
+ "name": "annotation_type_body"
6522
6554
  }
6523
- ]
6524
- },
6525
- {
6526
- "type": "STRING",
6527
- "value": "@interface"
6528
- },
6529
- {
6530
- "type": "FIELD",
6531
- "name": "name",
6532
- "content": {
6533
- "type": "SYMBOL",
6534
- "name": "identifier"
6535
- }
6536
- },
6537
- {
6538
- "type": "FIELD",
6539
- "name": "body",
6540
- "content": {
6541
- "type": "SYMBOL",
6542
- "name": "annotation_type_body"
6543
6555
  }
6544
- }
6545
- ]
6556
+ ]
6557
+ }
6546
6558
  },
6547
6559
  "annotation_type_body": {
6548
6560
  "type": "SEQ",
@@ -7792,7 +7804,8 @@
7792
7804
  },
7793
7805
  "identifier": {
7794
7806
  "type": "PATTERN",
7795
- "value": "[\\p{XID_Start}_$][\\p{XID_Continue}\\u00A2_$]*"
7807
+ "value": "[\\p{ID_Start}\\p{Nl}\\p{Sc}\\p{Pc}][\\p{ID_Continue}\\p{Nl}\\p{Sc}\\p{Pc}\\p{Cf}]*",
7808
+ "flags": "u"
7796
7809
  },
7797
7810
  "line_comment": {
7798
7811
  "type": "TOKEN",
@@ -766,6 +766,10 @@
766
766
  {
767
767
  "type": "identifier",
768
768
  "named": true
769
+ },
770
+ {
771
+ "type": "parenthesized_expression",
772
+ "named": true
769
773
  }
770
774
  ]
771
775
  },
@@ -4312,10 +4316,6 @@
4312
4316
  "type": "@",
4313
4317
  "named": false
4314
4318
  },
4315
- {
4316
- "type": "@interface",
4317
- "named": false
4318
- },
4319
4319
  {
4320
4320
  "type": "[",
4321
4321
  "named": false