tree-sitter-muttrc 0.0.1 → 0.0.2

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/Cargo.toml CHANGED
@@ -1,7 +1,7 @@
1
1
  [package]
2
2
  name = "tree-sitter-muttrc"
3
3
  description = "muttrc grammar for the tree-sitter parsing library"
4
- version = "0.0.1"
4
+ version = "0.0.2"
5
5
  keywords = ["incremental", "parsing", "muttrc"]
6
6
  categories = ["parsing", "text-editors"]
7
7
  repository = "https://github.com/Freed-Wu/tree-sitter-muttrc"
package/grammar.js CHANGED
@@ -427,19 +427,15 @@ module.exports = grammar({
427
427
  ),
428
428
  unhook_directive: ($) => command($, "unhook", choice("*", $.hook_type)),
429
429
 
430
- set_directive: ($) =>
431
- command(
432
- $,
433
- "set",
434
- choice(
435
- seq(
436
- $.option,
437
- optional(" "),
438
- choice("+=", "-=", "="),
439
- optional(" "),
440
- choice($.int, $.quadoption, $._string)
441
- ),
442
- $._options2
430
+ set_directive: ($) => command($, "set", choice($._options2, $._options3)),
431
+ _options3: ($) =>
432
+ spaceSep1(
433
+ seq(
434
+ $.option,
435
+ optional(" "),
436
+ choice("+=", "-=", "="),
437
+ optional(" "),
438
+ choice($.int, $.quadoption, $._string)
443
439
  )
444
440
  ),
445
441
  _options2: ($) => spaceSep1(seq(optional(choice("&", "?")), $.option)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tree-sitter-muttrc",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "muttrc grammar for tree-sitter",
5
5
  "main": "bindings/node",
6
6
  "keywords": [
package/src/grammar.json CHANGED
@@ -3193,77 +3193,165 @@
3193
3193
  "type": "CHOICE",
3194
3194
  "members": [
3195
3195
  {
3196
- "type": "SEQ",
3196
+ "type": "SYMBOL",
3197
+ "name": "_options2"
3198
+ },
3199
+ {
3200
+ "type": "SYMBOL",
3201
+ "name": "_options3"
3202
+ }
3203
+ ]
3204
+ }
3205
+ ]
3206
+ },
3207
+ "_options3": {
3208
+ "type": "SEQ",
3209
+ "members": [
3210
+ {
3211
+ "type": "SEQ",
3212
+ "members": [
3213
+ {
3214
+ "type": "SYMBOL",
3215
+ "name": "option"
3216
+ },
3217
+ {
3218
+ "type": "CHOICE",
3197
3219
  "members": [
3198
3220
  {
3199
- "type": "SYMBOL",
3200
- "name": "option"
3221
+ "type": "STRING",
3222
+ "value": " "
3201
3223
  },
3202
3224
  {
3203
- "type": "CHOICE",
3204
- "members": [
3205
- {
3206
- "type": "STRING",
3207
- "value": " "
3208
- },
3209
- {
3210
- "type": "BLANK"
3211
- }
3212
- ]
3225
+ "type": "BLANK"
3226
+ }
3227
+ ]
3228
+ },
3229
+ {
3230
+ "type": "CHOICE",
3231
+ "members": [
3232
+ {
3233
+ "type": "STRING",
3234
+ "value": "+="
3213
3235
  },
3214
3236
  {
3215
- "type": "CHOICE",
3216
- "members": [
3217
- {
3218
- "type": "STRING",
3219
- "value": "+="
3220
- },
3221
- {
3222
- "type": "STRING",
3223
- "value": "-="
3224
- },
3225
- {
3226
- "type": "STRING",
3227
- "value": "="
3228
- }
3229
- ]
3237
+ "type": "STRING",
3238
+ "value": "-="
3230
3239
  },
3231
3240
  {
3232
- "type": "CHOICE",
3233
- "members": [
3234
- {
3235
- "type": "STRING",
3236
- "value": " "
3237
- },
3238
- {
3239
- "type": "BLANK"
3240
- }
3241
- ]
3241
+ "type": "STRING",
3242
+ "value": "="
3243
+ }
3244
+ ]
3245
+ },
3246
+ {
3247
+ "type": "CHOICE",
3248
+ "members": [
3249
+ {
3250
+ "type": "STRING",
3251
+ "value": " "
3242
3252
  },
3243
3253
  {
3244
- "type": "CHOICE",
3245
- "members": [
3246
- {
3247
- "type": "SYMBOL",
3248
- "name": "int"
3249
- },
3250
- {
3251
- "type": "SYMBOL",
3252
- "name": "quadoption"
3253
- },
3254
- {
3255
- "type": "SYMBOL",
3256
- "name": "_string"
3257
- }
3258
- ]
3254
+ "type": "BLANK"
3259
3255
  }
3260
3256
  ]
3261
3257
  },
3262
3258
  {
3263
- "type": "SYMBOL",
3264
- "name": "_options2"
3259
+ "type": "CHOICE",
3260
+ "members": [
3261
+ {
3262
+ "type": "SYMBOL",
3263
+ "name": "int"
3264
+ },
3265
+ {
3266
+ "type": "SYMBOL",
3267
+ "name": "quadoption"
3268
+ },
3269
+ {
3270
+ "type": "SYMBOL",
3271
+ "name": "_string"
3272
+ }
3273
+ ]
3265
3274
  }
3266
3275
  ]
3276
+ },
3277
+ {
3278
+ "type": "REPEAT",
3279
+ "content": {
3280
+ "type": "SEQ",
3281
+ "members": [
3282
+ {
3283
+ "type": "STRING",
3284
+ "value": " "
3285
+ },
3286
+ {
3287
+ "type": "SEQ",
3288
+ "members": [
3289
+ {
3290
+ "type": "SYMBOL",
3291
+ "name": "option"
3292
+ },
3293
+ {
3294
+ "type": "CHOICE",
3295
+ "members": [
3296
+ {
3297
+ "type": "STRING",
3298
+ "value": " "
3299
+ },
3300
+ {
3301
+ "type": "BLANK"
3302
+ }
3303
+ ]
3304
+ },
3305
+ {
3306
+ "type": "CHOICE",
3307
+ "members": [
3308
+ {
3309
+ "type": "STRING",
3310
+ "value": "+="
3311
+ },
3312
+ {
3313
+ "type": "STRING",
3314
+ "value": "-="
3315
+ },
3316
+ {
3317
+ "type": "STRING",
3318
+ "value": "="
3319
+ }
3320
+ ]
3321
+ },
3322
+ {
3323
+ "type": "CHOICE",
3324
+ "members": [
3325
+ {
3326
+ "type": "STRING",
3327
+ "value": " "
3328
+ },
3329
+ {
3330
+ "type": "BLANK"
3331
+ }
3332
+ ]
3333
+ },
3334
+ {
3335
+ "type": "CHOICE",
3336
+ "members": [
3337
+ {
3338
+ "type": "SYMBOL",
3339
+ "name": "int"
3340
+ },
3341
+ {
3342
+ "type": "SYMBOL",
3343
+ "name": "quadoption"
3344
+ },
3345
+ {
3346
+ "type": "SYMBOL",
3347
+ "name": "_string"
3348
+ }
3349
+ ]
3350
+ }
3351
+ ]
3352
+ }
3353
+ ]
3354
+ }
3267
3355
  }
3268
3356
  ]
3269
3357
  },
@@ -4868,7 +4868,7 @@
4868
4868
  "named": true,
4869
4869
  "fields": {
4870
4870
  "content": {
4871
- "multiple": false,
4871
+ "multiple": true,
4872
4872
  "required": false,
4873
4873
  "types": [
4874
4874
  {