Changeset 33648 in project


Ignore:
Timestamp:
09/12/16 11:51:09 (5 years ago)
Author:
sjamaan
Message:

uri-generic: update prcc alternative with a few bugfixes

Still doesn't pass the tests 100%, but it's better than before.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/uri-generic/trunk/alternatives/uri-generic.prcc.scm

    r33637 r33648  
    311311           ,(and-let* ((fragment (uri-fragment uri))) (list  "#" fragment))))))))
    312312
    313 
    314 ;; RFC3986, section 2.2
    315 ;;
    316 ;; Percent encoding
    317 ;;
    318 
    319 (define hex-char (one-of (char-set->string char-set:hex-digit)))
    320 (define pct-encoded (seq (char #\%) hex-char hex-char))
    321 
    322 (define (preceded-by ignore-parser use-parser)
    323   (ind (seq ignore-parser use-parser) 1))
    324 
    325313(define (as-string parser)
    326314  (act parser (lambda (x)
     
    328316                    (string-concatenate (map ->string x))
    329317                    (->string x)))))
     318
     319;; RFC3986, section 2.2
     320;;
     321;; Percent encoding
     322;;
     323
     324(define hex-char (one-of (char-set->string char-set:hex-digit)))
     325(define pct-encoded (as-string (seq (char #\%) hex-char hex-char)))
     326
     327(define (preceded-by ignore-parser use-parser)
     328  (ind (seq ignore-parser use-parser) 1))
    330329
    331330(define (repeated parser n)
     
    613612(define segment-nz-nc (as-path-segment (rep+ pchar-nc)))
    614613
    615 (define path-empty (str "")) ;; Always succeeds. "0<pchar>" in the ABNF
     614;; Always succeeds. "0<pchar>" in the ABNF
     615(define path-empty (act (str "") (constantly '())))
    616616
    617617(define path-noscheme
Note: See TracChangeset for help on using the changeset viewer.