mirror of
https://github.com/kristoferssolo/tree-sitter-bruno.git
synced 2025-10-21 20:10:34 +00:00
feat: add params
This commit is contained in:
parent
4c8da45da6
commit
5f35d5970b
@ -94,7 +94,7 @@ module.exports = grammar({
|
||||
seq(alias("body:multipart-form", $.keyword), $.dictionary),
|
||||
|
||||
varsandassert: ($) =>
|
||||
choice($.vars, $.vars_secret, $.varsreq, $.varsres, $.assert),
|
||||
choice($.vars, $.vars_secret, $.varsreq, $.varsres, $.assert, $.params),
|
||||
vars: ($) => seq(alias("vars", $.keyword), $.dictionary),
|
||||
vars_secret: ($) => seq(alias("vars:secret", $.keyword), $.array),
|
||||
varsreq: ($) => seq(alias("vars:pre-request", $.keyword), $.dictionary),
|
||||
@ -107,6 +107,10 @@ module.exports = grammar({
|
||||
scriptres: ($) =>
|
||||
seq(alias("script:post-response", $.keyword), $.textblock),
|
||||
|
||||
params: ($) => choice($.params_path, $.params_query),
|
||||
params_query: ($) => seq(alias("params:query", $.keyword), $.dictionary),
|
||||
params_path: ($) => seq(alias("params:path", $.keyword), $.dictionary),
|
||||
|
||||
tests: ($) => seq(alias("tests", $.keyword), $.textblock),
|
||||
|
||||
docs: ($) => seq(alias("docs", $.keyword), $.textblock),
|
||||
|
||||
53
src/grammar.json
generated
53
src/grammar.json
generated
@ -516,6 +516,10 @@
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "assert"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "params"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -658,6 +662,55 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "params_path"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "params_query"
|
||||
}
|
||||
]
|
||||
},
|
||||
"params_query": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "ALIAS",
|
||||
"content": {
|
||||
"type": "STRING",
|
||||
"value": "params:query"
|
||||
},
|
||||
"named": true,
|
||||
"value": "keyword"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "dictionary"
|
||||
}
|
||||
]
|
||||
},
|
||||
"params_path": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "ALIAS",
|
||||
"content": {
|
||||
"type": "STRING",
|
||||
"value": "params:path"
|
||||
},
|
||||
"named": true,
|
||||
"value": "keyword"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "dictionary"
|
||||
}
|
||||
]
|
||||
},
|
||||
"tests": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
|
||||
61
src/node-types.json
generated
61
src/node-types.json
generated
@ -541,6 +541,63 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "params",
|
||||
"named": true,
|
||||
"fields": {},
|
||||
"children": {
|
||||
"multiple": false,
|
||||
"required": true,
|
||||
"types": [
|
||||
{
|
||||
"type": "params_path",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "params_query",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "params_path",
|
||||
"named": true,
|
||||
"fields": {},
|
||||
"children": {
|
||||
"multiple": true,
|
||||
"required": true,
|
||||
"types": [
|
||||
{
|
||||
"type": "dictionary",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "keyword",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "params_query",
|
||||
"named": true,
|
||||
"fields": {},
|
||||
"children": {
|
||||
"multiple": true,
|
||||
"required": true,
|
||||
"types": [
|
||||
{
|
||||
"type": "dictionary",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "keyword",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "query",
|
||||
"named": true,
|
||||
@ -754,6 +811,10 @@
|
||||
"type": "assert",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "params",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "vars",
|
||||
"named": true
|
||||
|
||||
3154
src/parser.c
generated
3154
src/parser.c
generated
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user