From 29eb2a7cd86887c18982d5ce62912c2d6742fe07 Mon Sep 17 00:00:00 2001 From: TheRealLorenz Date: Wed, 10 Jan 2024 20:11:09 +0100 Subject: [PATCH] Update char rule --- rq-core/src/grammar.pest | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rq-core/src/grammar.pest b/rq-core/src/grammar.pest index 5b7349e..31d9649 100644 --- a/rq-core/src/grammar.pest +++ b/rq-core/src/grammar.pest @@ -3,7 +3,7 @@ file = { SOI ~ (request ~ (DELIM ~ request)*)? ~ EOI} DELIM = _{ "###" } WHITESPACE = _{ " " } -char = { ASCII_ALPHANUMERIC | "." | "_" | "/" } +char = { !(" " | "\n" | "\t") ~ ANY } request = { NEWLINE* ~ @@ -16,7 +16,7 @@ request = { method = { "GET" | "DELETE" | "POST" | "PUT" } -url = @{ (!("?") ~ char)+ } +url = @{ (!"?" ~ char)+ } query = @{ PUSH(NEWLINE ~ " "* | "") ~ @@ -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)+ }