tree-sitter-bynk 0.140.0 → 0.141.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/grammar.js +15 -0
- package/package.json +1 -1
- package/queries/highlights.scm +1 -0
- package/src/grammar.json +82 -0
- package/src/node-types.json +171 -0
- package/src/parser.c +27811 -27077
package/grammar.js
CHANGED
|
@@ -544,6 +544,9 @@ module.exports = grammar({
|
|
|
544
544
|
// v0.131 (ADR 0158): the optional `cors { }` policy, in header position
|
|
545
545
|
// before the handlers (a `from http` concern; the checker restricts it).
|
|
546
546
|
optional(field("cors", $.cors_policy)),
|
|
547
|
+
// v0.141 (ADR 0164): the optional `security { }` policy, likewise a
|
|
548
|
+
// header-position `from http` concern restricted by the checker.
|
|
549
|
+
optional(field("security", $.security_policy)),
|
|
547
550
|
repeat($.handler),
|
|
548
551
|
"}",
|
|
549
552
|
),
|
|
@@ -559,6 +562,18 @@ module.exports = grammar({
|
|
|
559
562
|
),
|
|
560
563
|
cors_field: ($) =>
|
|
561
564
|
seq(field("name", $.identifier), ":", field("value", $._expression)),
|
|
565
|
+
// v0.141: `security { <name>: <value>, … }`. `security` is a contextual
|
|
566
|
+
// keyword (like `cors`); field names (`hsts`/`nosniff`) are ordinary
|
|
567
|
+
// identifiers matched against the closed set by the checker.
|
|
568
|
+
security_policy: ($) =>
|
|
569
|
+
seq(
|
|
570
|
+
"security",
|
|
571
|
+
"{",
|
|
572
|
+
repeat(seq($.security_field, optional(","))),
|
|
573
|
+
"}",
|
|
574
|
+
),
|
|
575
|
+
security_field: ($) =>
|
|
576
|
+
seq(field("name", $.identifier), ":", field("value", $._expression)),
|
|
562
577
|
// v0.44: `from <protocol>` on the service header.
|
|
563
578
|
// v0.103: `from WebSocket(in: I, out: O)` binds the inbound/outbound frame
|
|
564
579
|
// types. `WebSocket`, `in`, and `out` are contextual (resolved by `word`).
|
package/package.json
CHANGED
package/queries/highlights.scm
CHANGED
package/src/grammar.json
CHANGED
|
@@ -2411,6 +2411,22 @@
|
|
|
2411
2411
|
}
|
|
2412
2412
|
]
|
|
2413
2413
|
},
|
|
2414
|
+
{
|
|
2415
|
+
"type": "CHOICE",
|
|
2416
|
+
"members": [
|
|
2417
|
+
{
|
|
2418
|
+
"type": "FIELD",
|
|
2419
|
+
"name": "security",
|
|
2420
|
+
"content": {
|
|
2421
|
+
"type": "SYMBOL",
|
|
2422
|
+
"name": "security_policy"
|
|
2423
|
+
}
|
|
2424
|
+
},
|
|
2425
|
+
{
|
|
2426
|
+
"type": "BLANK"
|
|
2427
|
+
}
|
|
2428
|
+
]
|
|
2429
|
+
},
|
|
2414
2430
|
{
|
|
2415
2431
|
"type": "REPEAT",
|
|
2416
2432
|
"content": {
|
|
@@ -2490,6 +2506,72 @@
|
|
|
2490
2506
|
}
|
|
2491
2507
|
]
|
|
2492
2508
|
},
|
|
2509
|
+
"security_policy": {
|
|
2510
|
+
"type": "SEQ",
|
|
2511
|
+
"members": [
|
|
2512
|
+
{
|
|
2513
|
+
"type": "STRING",
|
|
2514
|
+
"value": "security"
|
|
2515
|
+
},
|
|
2516
|
+
{
|
|
2517
|
+
"type": "STRING",
|
|
2518
|
+
"value": "{"
|
|
2519
|
+
},
|
|
2520
|
+
{
|
|
2521
|
+
"type": "REPEAT",
|
|
2522
|
+
"content": {
|
|
2523
|
+
"type": "SEQ",
|
|
2524
|
+
"members": [
|
|
2525
|
+
{
|
|
2526
|
+
"type": "SYMBOL",
|
|
2527
|
+
"name": "security_field"
|
|
2528
|
+
},
|
|
2529
|
+
{
|
|
2530
|
+
"type": "CHOICE",
|
|
2531
|
+
"members": [
|
|
2532
|
+
{
|
|
2533
|
+
"type": "STRING",
|
|
2534
|
+
"value": ","
|
|
2535
|
+
},
|
|
2536
|
+
{
|
|
2537
|
+
"type": "BLANK"
|
|
2538
|
+
}
|
|
2539
|
+
]
|
|
2540
|
+
}
|
|
2541
|
+
]
|
|
2542
|
+
}
|
|
2543
|
+
},
|
|
2544
|
+
{
|
|
2545
|
+
"type": "STRING",
|
|
2546
|
+
"value": "}"
|
|
2547
|
+
}
|
|
2548
|
+
]
|
|
2549
|
+
},
|
|
2550
|
+
"security_field": {
|
|
2551
|
+
"type": "SEQ",
|
|
2552
|
+
"members": [
|
|
2553
|
+
{
|
|
2554
|
+
"type": "FIELD",
|
|
2555
|
+
"name": "name",
|
|
2556
|
+
"content": {
|
|
2557
|
+
"type": "SYMBOL",
|
|
2558
|
+
"name": "identifier"
|
|
2559
|
+
}
|
|
2560
|
+
},
|
|
2561
|
+
{
|
|
2562
|
+
"type": "STRING",
|
|
2563
|
+
"value": ":"
|
|
2564
|
+
},
|
|
2565
|
+
{
|
|
2566
|
+
"type": "FIELD",
|
|
2567
|
+
"name": "value",
|
|
2568
|
+
"content": {
|
|
2569
|
+
"type": "SYMBOL",
|
|
2570
|
+
"name": "_expression"
|
|
2571
|
+
}
|
|
2572
|
+
}
|
|
2573
|
+
]
|
|
2574
|
+
},
|
|
2493
2575
|
"service_protocol": {
|
|
2494
2576
|
"type": "SEQ",
|
|
2495
2577
|
"members": [
|
package/src/node-types.json
CHANGED
|
@@ -7128,6 +7128,163 @@
|
|
|
7128
7128
|
]
|
|
7129
7129
|
}
|
|
7130
7130
|
},
|
|
7131
|
+
{
|
|
7132
|
+
"type": "security_field",
|
|
7133
|
+
"named": true,
|
|
7134
|
+
"fields": {
|
|
7135
|
+
"name": {
|
|
7136
|
+
"multiple": false,
|
|
7137
|
+
"required": true,
|
|
7138
|
+
"types": [
|
|
7139
|
+
{
|
|
7140
|
+
"type": "identifier",
|
|
7141
|
+
"named": true
|
|
7142
|
+
}
|
|
7143
|
+
]
|
|
7144
|
+
},
|
|
7145
|
+
"value": {
|
|
7146
|
+
"multiple": false,
|
|
7147
|
+
"required": true,
|
|
7148
|
+
"types": [
|
|
7149
|
+
{
|
|
7150
|
+
"type": "binary_expr",
|
|
7151
|
+
"named": true
|
|
7152
|
+
},
|
|
7153
|
+
{
|
|
7154
|
+
"type": "block",
|
|
7155
|
+
"named": true
|
|
7156
|
+
},
|
|
7157
|
+
{
|
|
7158
|
+
"type": "boolean_literal",
|
|
7159
|
+
"named": true
|
|
7160
|
+
},
|
|
7161
|
+
{
|
|
7162
|
+
"type": "call",
|
|
7163
|
+
"named": true
|
|
7164
|
+
},
|
|
7165
|
+
{
|
|
7166
|
+
"type": "effect_pure_expr",
|
|
7167
|
+
"named": true
|
|
7168
|
+
},
|
|
7169
|
+
{
|
|
7170
|
+
"type": "err_expr",
|
|
7171
|
+
"named": true
|
|
7172
|
+
},
|
|
7173
|
+
{
|
|
7174
|
+
"type": "expect_expr",
|
|
7175
|
+
"named": true
|
|
7176
|
+
},
|
|
7177
|
+
{
|
|
7178
|
+
"type": "field_access",
|
|
7179
|
+
"named": true
|
|
7180
|
+
},
|
|
7181
|
+
{
|
|
7182
|
+
"type": "float_literal",
|
|
7183
|
+
"named": true
|
|
7184
|
+
},
|
|
7185
|
+
{
|
|
7186
|
+
"type": "identifier",
|
|
7187
|
+
"named": true
|
|
7188
|
+
},
|
|
7189
|
+
{
|
|
7190
|
+
"type": "if_expr",
|
|
7191
|
+
"named": true
|
|
7192
|
+
},
|
|
7193
|
+
{
|
|
7194
|
+
"type": "is_expr",
|
|
7195
|
+
"named": true
|
|
7196
|
+
},
|
|
7197
|
+
{
|
|
7198
|
+
"type": "lambda_expr",
|
|
7199
|
+
"named": true
|
|
7200
|
+
},
|
|
7201
|
+
{
|
|
7202
|
+
"type": "list_literal",
|
|
7203
|
+
"named": true
|
|
7204
|
+
},
|
|
7205
|
+
{
|
|
7206
|
+
"type": "match_expr",
|
|
7207
|
+
"named": true
|
|
7208
|
+
},
|
|
7209
|
+
{
|
|
7210
|
+
"type": "method_call",
|
|
7211
|
+
"named": true
|
|
7212
|
+
},
|
|
7213
|
+
{
|
|
7214
|
+
"type": "none_expr",
|
|
7215
|
+
"named": true
|
|
7216
|
+
},
|
|
7217
|
+
{
|
|
7218
|
+
"type": "number_literal",
|
|
7219
|
+
"named": true
|
|
7220
|
+
},
|
|
7221
|
+
{
|
|
7222
|
+
"type": "ok_expr",
|
|
7223
|
+
"named": true
|
|
7224
|
+
},
|
|
7225
|
+
{
|
|
7226
|
+
"type": "paren_expr",
|
|
7227
|
+
"named": true
|
|
7228
|
+
},
|
|
7229
|
+
{
|
|
7230
|
+
"type": "question_expr",
|
|
7231
|
+
"named": true
|
|
7232
|
+
},
|
|
7233
|
+
{
|
|
7234
|
+
"type": "record_construction",
|
|
7235
|
+
"named": true
|
|
7236
|
+
},
|
|
7237
|
+
{
|
|
7238
|
+
"type": "record_spread",
|
|
7239
|
+
"named": true
|
|
7240
|
+
},
|
|
7241
|
+
{
|
|
7242
|
+
"type": "self_expr",
|
|
7243
|
+
"named": true
|
|
7244
|
+
},
|
|
7245
|
+
{
|
|
7246
|
+
"type": "some_expr",
|
|
7247
|
+
"named": true
|
|
7248
|
+
},
|
|
7249
|
+
{
|
|
7250
|
+
"type": "string_literal",
|
|
7251
|
+
"named": true
|
|
7252
|
+
},
|
|
7253
|
+
{
|
|
7254
|
+
"type": "trace_expr",
|
|
7255
|
+
"named": true
|
|
7256
|
+
},
|
|
7257
|
+
{
|
|
7258
|
+
"type": "unary_expr",
|
|
7259
|
+
"named": true
|
|
7260
|
+
},
|
|
7261
|
+
{
|
|
7262
|
+
"type": "unit_literal",
|
|
7263
|
+
"named": true
|
|
7264
|
+
},
|
|
7265
|
+
{
|
|
7266
|
+
"type": "val_expr",
|
|
7267
|
+
"named": true
|
|
7268
|
+
}
|
|
7269
|
+
]
|
|
7270
|
+
}
|
|
7271
|
+
}
|
|
7272
|
+
},
|
|
7273
|
+
{
|
|
7274
|
+
"type": "security_policy",
|
|
7275
|
+
"named": true,
|
|
7276
|
+
"fields": {},
|
|
7277
|
+
"children": {
|
|
7278
|
+
"multiple": true,
|
|
7279
|
+
"required": false,
|
|
7280
|
+
"types": [
|
|
7281
|
+
{
|
|
7282
|
+
"type": "security_field",
|
|
7283
|
+
"named": true
|
|
7284
|
+
}
|
|
7285
|
+
]
|
|
7286
|
+
}
|
|
7287
|
+
},
|
|
7131
7288
|
{
|
|
7132
7289
|
"type": "self_expr",
|
|
7133
7290
|
"named": true,
|
|
@@ -7171,6 +7328,16 @@
|
|
|
7171
7328
|
"named": true
|
|
7172
7329
|
}
|
|
7173
7330
|
]
|
|
7331
|
+
},
|
|
7332
|
+
"security": {
|
|
7333
|
+
"multiple": false,
|
|
7334
|
+
"required": false,
|
|
7335
|
+
"types": [
|
|
7336
|
+
{
|
|
7337
|
+
"type": "security_policy",
|
|
7338
|
+
"named": true
|
|
7339
|
+
}
|
|
7340
|
+
]
|
|
7174
7341
|
}
|
|
7175
7342
|
},
|
|
7176
7343
|
"children": {
|
|
@@ -9391,6 +9558,10 @@
|
|
|
9391
9558
|
"type": "schedule",
|
|
9392
9559
|
"named": false
|
|
9393
9560
|
},
|
|
9561
|
+
{
|
|
9562
|
+
"type": "security",
|
|
9563
|
+
"named": false
|
|
9564
|
+
},
|
|
9394
9565
|
{
|
|
9395
9566
|
"type": "self",
|
|
9396
9567
|
"named": false
|