mirror of
https://github.com/kristoferssolo/tree-sitter-bruno.git
synced 2026-03-22 00:36:24 +00:00
1005 lines
19 KiB
JSON
Generated
1005 lines
19 KiB
JSON
Generated
{
|
|
"$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json",
|
|
"name": "bruno",
|
|
"rules": {
|
|
"source_file": {
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "section"
|
|
}
|
|
},
|
|
"section": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "meta"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "http"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "query"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "headers"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "auth"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "body"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "vars"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "assert"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "params"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "script"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "tests"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "docs"
|
|
}
|
|
]
|
|
},
|
|
"meta": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "meta"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "object_block"
|
|
}
|
|
]
|
|
},
|
|
"http": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "http_verb"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "object_block"
|
|
}
|
|
]
|
|
},
|
|
"http_verb": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "get"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "post"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "put"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "delete"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "patch"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "options"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "head"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "connect"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "trace"
|
|
}
|
|
]
|
|
},
|
|
"query": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "query"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "object_block"
|
|
}
|
|
]
|
|
},
|
|
"headers": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "headers"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "object_block"
|
|
}
|
|
]
|
|
},
|
|
"auth": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "authawsv4"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "authbasic"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "authbearer"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "authdigest"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "authoauth2"
|
|
}
|
|
]
|
|
},
|
|
"authawsv4": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "auth:awsv4"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "object_block"
|
|
}
|
|
]
|
|
},
|
|
"authbasic": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "auth:basic"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "object_block"
|
|
}
|
|
]
|
|
},
|
|
"authbearer": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "auth:bearer"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "object_block"
|
|
}
|
|
]
|
|
},
|
|
"authdigest": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "auth:digest"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "object_block"
|
|
}
|
|
]
|
|
},
|
|
"authoauth2": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "auth:oauth2"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "object_block"
|
|
}
|
|
]
|
|
},
|
|
"body": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "bodyjson"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "bodytext"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "bodyxml"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "bodysparql"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "bodygraphql"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "bodygraphqlvars"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "bodyformurlencoded"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "bodyformmultipart"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "bodyraw"
|
|
}
|
|
]
|
|
},
|
|
"bodyraw": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "body"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "textblock"
|
|
}
|
|
]
|
|
},
|
|
"bodyjson": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "body:json"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "textblock"
|
|
}
|
|
]
|
|
},
|
|
"bodytext": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "body:text"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "textblock"
|
|
}
|
|
]
|
|
},
|
|
"bodyxml": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "body:xml"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "textblock"
|
|
}
|
|
]
|
|
},
|
|
"bodysparql": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "body:sparql"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "textblock"
|
|
}
|
|
]
|
|
},
|
|
"bodygraphql": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "body:graphql"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "textblock"
|
|
}
|
|
]
|
|
},
|
|
"bodygraphqlvars": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "body:graphql:vars"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "textblock"
|
|
}
|
|
]
|
|
},
|
|
"bodyformurlencoded": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "body:form-urlencoded"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "object_block"
|
|
}
|
|
]
|
|
},
|
|
"bodyformmultipart": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "body:multipart-form"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "object_block"
|
|
}
|
|
]
|
|
},
|
|
"vars": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "vars_plain"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "vars_secret"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "varsreq"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "varsres"
|
|
}
|
|
]
|
|
},
|
|
"vars_plain": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "vars"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "object_block"
|
|
}
|
|
]
|
|
},
|
|
"vars_secret": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "vars:secret"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "array_block"
|
|
}
|
|
]
|
|
},
|
|
"varsreq": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "vars:pre-request"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "object_block"
|
|
}
|
|
]
|
|
},
|
|
"varsres": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "vars:post-response"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "object_block"
|
|
}
|
|
]
|
|
},
|
|
"assert": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "assert"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "assert_block"
|
|
}
|
|
]
|
|
},
|
|
"script": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "scriptreq"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "scriptres"
|
|
}
|
|
]
|
|
},
|
|
"scriptreq": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "script:pre-request"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "textblock"
|
|
}
|
|
]
|
|
},
|
|
"scriptres": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "script:post-response"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "textblock"
|
|
}
|
|
]
|
|
},
|
|
"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": "object_block"
|
|
}
|
|
]
|
|
},
|
|
"params_path": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "params:path"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "object_block"
|
|
}
|
|
]
|
|
},
|
|
"tests": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "tests"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "textblock"
|
|
}
|
|
]
|
|
},
|
|
"docs": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "docs"
|
|
},
|
|
"named": true,
|
|
"value": "keyword"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "textblock"
|
|
}
|
|
]
|
|
},
|
|
"object_block": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "{"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "dictionary_pair"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "}"
|
|
}
|
|
]
|
|
},
|
|
"dictionary_pair": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "key"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ":"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "dictionary_value"
|
|
}
|
|
]
|
|
},
|
|
"dictionary_value": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "template_value"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "quoted_value"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "bare_value"
|
|
}
|
|
]
|
|
},
|
|
"assert_block": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "{"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "assert_dictionary_pair"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "}"
|
|
}
|
|
]
|
|
},
|
|
"assert_dictionary_pair": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "assert_key"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ":"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "dictionary_value"
|
|
}
|
|
]
|
|
},
|
|
"array_block": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "["
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "array_value"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "]"
|
|
}
|
|
]
|
|
},
|
|
"array_value": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "template_value"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "quoted_value"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "bare_value"
|
|
}
|
|
]
|
|
},
|
|
"textblock": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "{"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "rawtext"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "}"
|
|
}
|
|
]
|
|
},
|
|
"assert_key": {
|
|
"type": "PATTERN",
|
|
"value": "[^\\r\\n:]+"
|
|
},
|
|
"key": {
|
|
"type": "PATTERN",
|
|
"value": "[^\\s\\r\\n:]+"
|
|
},
|
|
"bare_value": {
|
|
"type": "PATTERN",
|
|
"value": "[^\\s\\r\\n\",\\]}][^\\r\\n]*"
|
|
},
|
|
"quoted_value": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "\""
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "[^\"\\\\]+"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\\\."
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "\""
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"template_value": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "{{"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "[^}]+"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "}[^}]"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "}}"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"extras": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\s"
|
|
}
|
|
],
|
|
"conflicts": [],
|
|
"precedences": [],
|
|
"externals": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "rawtext"
|
|
}
|
|
],
|
|
"inline": [],
|
|
"supertypes": [],
|
|
"reserved": {}
|
|
} |