Skip to content

Commit

Permalink
Update char rule
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealLorenz committed Jan 10, 2024
1 parent ab5a4b4 commit 29eb2a7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rq-core/src/grammar.pest
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ file = { SOI ~ (request ~ (DELIM ~ request)*)? ~ EOI}
DELIM = _{ "###" }
WHITESPACE = _{ " " }

char = { ASCII_ALPHANUMERIC | "." | "_" | "/" }
char = { !(" " | "\n" | "\t") ~ ANY }

request = {
NEWLINE* ~
Expand All @@ -16,7 +16,7 @@ request = {

method = { "GET" | "DELETE" | "POST" | "PUT" }

url = @{ (!("?") ~ char)+ }
url = @{ (!"?" ~ char)+ }

query = @{
PUSH(NEWLINE ~ " "* | "") ~
Expand All @@ -25,21 +25,21 @@ query = @{
DROP
}
query_item = ${ query_name ~ "=" ~ query_value }
query_name = @{ char+ }
query_name = @{ (!"=" ~ char)+ }
query_value = @{
(
PUSH("\"" | "'") ~
(!PEEK ~ ANY)+ ~
POP
) |
char+
(!"&" ~ char)+
}

version = { "HTTP/" ~ ("0.9" | "1.0" | "1.1" | "2.0" | "3.0") }

headers = { (header ~ NEWLINE)+ }
header = { header_name ~ ": " ~ header_value }
header_name = @{ char+ }
header_name = @{ (!":" ~ char)+ }
header_value = @{ (" " | char)+ }

body = { (!DELIM ~ ANY)+ }
Expand Down

0 comments on commit 29eb2a7

Please sign in to comment.