500 lines
10 KiB
JSON
500 lines
10 KiB
JSON
{
|
|
"name": "hurl",
|
|
"word": "identifier",
|
|
"rules": {
|
|
"source_file": {
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_statement"
|
|
}
|
|
},
|
|
"_statement": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_declaration_statement"
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "[\\r\\n]+"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"_declaration_statement": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "request_declaration"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "header_declaration"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "http_response_declaration"
|
|
},
|
|
"named": true,
|
|
"value": "response"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "assert_declaration"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "request_body_declaration"
|
|
},
|
|
"named": true,
|
|
"value": "body"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 7,
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_whitespace"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"request_declaration": {
|
|
"type": "PREC_LEFT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_literal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_whitespace"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "url",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "url"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"request_body_declaration": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "json_request_declaration"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "text_body_declaration"
|
|
}
|
|
]
|
|
},
|
|
"json_request_declaration": {
|
|
"type": "PREC_LEFT",
|
|
"value": 5,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\{"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\n"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_line"
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "[\\r\\n]+"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\}\\n\\n"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"text_body_declaration": {
|
|
"type": "PREC_LEFT",
|
|
"value": 5,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "```"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\n"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_line"
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "[\\r\\n]+"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "```\\n\\n"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"header_declaration": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "header_name",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "header_name"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ":"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_whitespace"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "header_value",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "header_value"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"http_response_declaration": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "scheme_literal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_whitespace"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "status_code_pattern"
|
|
}
|
|
]
|
|
},
|
|
"assert_declaration": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "["
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "assert_literal"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "]"
|
|
}
|
|
]
|
|
},
|
|
"_literal": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "request_literal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "assert_literal"
|
|
}
|
|
]
|
|
},
|
|
"request_literal": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "GET"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "POST"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "PUT"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "DELETE"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "CONNECT"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "OPTIONS"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "TRACE"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "PATCH"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "LINK"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "UNLINK"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "PURGE"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "LOCK"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "UNLOCK"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "PROPFIND"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "VIEW"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "const_pattern"
|
|
}
|
|
]
|
|
},
|
|
"assert_literal": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "QueryStringParams"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "FormParams"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "MultipartFormData"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "Cookies"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "Captures"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "Asserts"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "Options"
|
|
}
|
|
]
|
|
},
|
|
"scheme_literal": {
|
|
"type": "STRING",
|
|
"value": "HTTP"
|
|
},
|
|
"const_pattern": {
|
|
"type": "PATTERN",
|
|
"value": "[A-Z_0-9\\/\\\\\\d]+"
|
|
},
|
|
"comment": {
|
|
"type": "PREC_LEFT",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "#"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": ".*"
|
|
},
|
|
{
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "[\\r\\n]+"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"status_code_pattern": {
|
|
"type": "PATTERN",
|
|
"value": "[\\d]{3}"
|
|
},
|
|
"header_name": {
|
|
"type": "PATTERN",
|
|
"value": "[a-zA-Z-_0-9]+"
|
|
},
|
|
"header_value": {
|
|
"type": "PATTERN",
|
|
"value": "[a-zA-Z\\-_0-9\\/\\\\]+"
|
|
},
|
|
"url": {
|
|
"type": "PATTERN",
|
|
"value": "\\S+"
|
|
},
|
|
"_line": {
|
|
"type": "PATTERN",
|
|
"value": "[^\\n]+"
|
|
},
|
|
"identifier": {
|
|
"type": "PATTERN",
|
|
"value": "[A-Za-z_.\\d\\u00A1-\\uFFFF-]+"
|
|
},
|
|
"_whitespace": {
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "[\\t\\v ]"
|
|
}
|
|
}
|
|
},
|
|
"extras": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "comment"
|
|
}
|
|
],
|
|
"conflicts": [],
|
|
"precedences": [],
|
|
"externals": [],
|
|
"inline": [],
|
|
"supertypes": []
|
|
}
|
|
|