space-parser ,
] seq* [ "1.0" suffix! ] action ;
-PEG: parse-request-line ( string -- triple )
+PARTIAL-PEG: parse-request-line ( string -- triple )
! Triple is { method url version }
full-request-parser simple-request-parser 2array choice ;
: response-message-parser ( -- parser )
text-parser repeat0 case-sensitive ;
-PEG: parse-response-line ( string -- triple )
+PARTIAL-PEG: parse-response-line ( string -- triple )
! Triple is { version code message }
[
space-parser ,
text-parser repeat0 case-sensitive
2choice ;
-PEG: parse-header-line ( string -- pair )
+PARTIAL-PEG: parse-header-line ( string -- pair )
! Pair is either { name value } or { f value }. If f, its a
! continuation of the previous header line.
[
: av-pairs-parser ( -- parser )
av-pair-parser ";" token list-of optional ;
-PEG: (parse-set-cookie) ( string -- alist )
+PARTIAL-PEG: (parse-set-cookie) ( string -- alist )
av-pairs-parser just [ sift ] action ;
: cookie-value-parser ( -- parser )
[ ";,=" member? not ] satisfy repeat0 [ drop f ] action
2choice ;
-PEG: (parse-cookie) ( string -- alist )
+PARTIAL-PEG: (parse-cookie) ( string -- alist )
cookie-value-parser [ ";," member? ] satisfy list-of
optional just [ sift ] action ;