tree-sitter-muttrc 0.0.4 → 0.0.6

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
@@ -1,3 +1,5 @@
1
+ /// <reference types="tree-sitter-cli/dsl" />
2
+
1
3
  module.exports = grammar({
2
4
  name: "muttrc",
3
5
 
@@ -258,7 +260,7 @@ module.exports = grammar({
258
260
  optional($._attributes),
259
261
  $.foreground,
260
262
  $.background,
261
- $._regex
263
+ optional($._regex)
262
264
  ),
263
265
  seq(
264
266
  "compose",
@@ -467,7 +469,6 @@ module.exports = grammar({
467
469
  quoted_string('"', $.shell),
468
470
  quoted_string("`", $.shell),
469
471
  alias($._word, $.shell),
470
- "\n"
471
472
  ),
472
473
  _regex: ($) =>
473
474
  choice(
@@ -475,7 +476,6 @@ module.exports = grammar({
475
476
  quoted_string('"', $.regex),
476
477
  quoted_string("`", $.shell),
477
478
  alias($._word, $.regex),
478
- "\n"
479
479
  ),
480
480
  _word: (_) => /(\\\r?\n|[^"'`\s])(\S|\\\s)*/,
481
481
 
@@ -508,7 +508,7 @@ function quoted_string(char, name) {
508
508
  return seq(
509
509
  char,
510
510
  alias(
511
- field("content", new RegExp("([^" + char + "]|\\\\" + char + ")+")),
511
+ field("content", new RegExp("([^" + char + "]|\\\\" + char + ")*")),
512
512
  name
513
513
  ),
514
514
  char
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tree-sitter-muttrc",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Muttrc grammar for tree-sitter",
5
5
  "repository": "github:tree-sitter/tree-sitter-muttrc",
6
6
  "license": "MIT",
package/src/grammar.json CHANGED
@@ -1498,8 +1498,16 @@
1498
1498
  "name": "background"
1499
1499
  },
1500
1500
  {
1501
- "type": "SYMBOL",
1502
- "name": "_regex"
1501
+ "type": "CHOICE",
1502
+ "members": [
1503
+ {
1504
+ "type": "SYMBOL",
1505
+ "name": "_regex"
1506
+ },
1507
+ {
1508
+ "type": "BLANK"
1509
+ }
1510
+ ]
1503
1511
  }
1504
1512
  ]
1505
1513
  },
@@ -3719,7 +3727,7 @@
3719
3727
  "name": "content",
3720
3728
  "content": {
3721
3729
  "type": "PATTERN",
3722
- "value": "([^']|\\\\')+"
3730
+ "value": "([^']|\\\\')*"
3723
3731
  }
3724
3732
  },
3725
3733
  "named": true,
@@ -3745,7 +3753,7 @@
3745
3753
  "name": "content",
3746
3754
  "content": {
3747
3755
  "type": "PATTERN",
3748
- "value": "([^\"]|\\\\\")+"
3756
+ "value": "([^\"]|\\\\\")*"
3749
3757
  }
3750
3758
  },
3751
3759
  "named": true,
@@ -3771,7 +3779,7 @@
3771
3779
  "name": "content",
3772
3780
  "content": {
3773
3781
  "type": "PATTERN",
3774
- "value": "([^`]|\\\\`)+"
3782
+ "value": "([^`]|\\\\`)*"
3775
3783
  }
3776
3784
  },
3777
3785
  "named": true,
@@ -3791,10 +3799,6 @@
3791
3799
  },
3792
3800
  "named": true,
3793
3801
  "value": "shell"
3794
- },
3795
- {
3796
- "type": "STRING",
3797
- "value": "\n"
3798
3802
  }
3799
3803
  ]
3800
3804
  },
@@ -3815,7 +3819,7 @@
3815
3819
  "name": "content",
3816
3820
  "content": {
3817
3821
  "type": "PATTERN",
3818
- "value": "([^']|\\\\')+"
3822
+ "value": "([^']|\\\\')*"
3819
3823
  }
3820
3824
  },
3821
3825
  "named": true,
@@ -3841,7 +3845,7 @@
3841
3845
  "name": "content",
3842
3846
  "content": {
3843
3847
  "type": "PATTERN",
3844
- "value": "([^\"]|\\\\\")+"
3848
+ "value": "([^\"]|\\\\\")*"
3845
3849
  }
3846
3850
  },
3847
3851
  "named": true,
@@ -3867,7 +3871,7 @@
3867
3871
  "name": "content",
3868
3872
  "content": {
3869
3873
  "type": "PATTERN",
3870
- "value": "([^`]|\\\\`)+"
3874
+ "value": "([^`]|\\\\`)*"
3871
3875
  }
3872
3876
  },
3873
3877
  "named": true,
@@ -3887,10 +3891,6 @@
3887
3891
  },
3888
3892
  "named": true,
3889
3893
  "value": "regex"
3890
- },
3891
- {
3892
- "type": "STRING",
3893
- "value": "\n"
3894
3894
  }
3895
3895
  ]
3896
3896
  },
@@ -6866,10 +6866,6 @@
6866
6866
  ]
6867
6867
  }
6868
6868
  },
6869
- {
6870
- "type": "\n",
6871
- "named": false
6872
- },
6873
6869
  {
6874
6870
  "type": " ",
6875
6871
  "named": false