Fix more iri issues
turtle/parser.scm
105 | 105 | (define-peg-pattern pn-prefix body | |
106 | 106 | (and pn-chars-base (* (and (* ".") pn-chars)))) | |
107 | 107 | ;; [168s] PN_LOCAL ::= (PN_CHARS_U | ':' | [0-9] | PLX) ((PN_CHARS | '.' | ':' | PLX)* (PN_CHARS | ':' | PLX))? | |
108 | - | (define-peg-pattern pn-local body | |
108 | + | (define-peg-pattern pn-local all | |
109 | 109 | (and (or pn-chars-u ":" (range #\0 #\9) plx) | |
110 | 110 | (* (and (* ".") (or pn-chars ":" plx))))) | |
111 | 111 | ;; [169s] PLX ::= PERCENT | PN_LOCAL_ESC |
turtle/tordf.scm
84 | 84 | (() ""))) | |
85 | 85 | ||
86 | 86 | (define (parse-iri iri state) | |
87 | + | (pk 'iri iri) | |
87 | 88 | (match iri | |
88 | - | (('iri ('prefixed-name ('pname-ln ('pname-ns ns) suffix))) | |
89 | + | (('iri ('prefixed-name ('pname-ln ('pname-ns ns) ('pn-local suffix)))) | |
89 | 90 | `(("iri" . ,(string-append (assoc-ref (parser-state-namespaces state) ns) | |
90 | - | suffix)) | |
91 | - | ("state" . ,state))) | |
92 | - | (('iri ('prefixed-name ('pname-ln ('pname-ns suffix)))) | |
93 | - | `(("iri" . ,(string-append (assoc-ref (parser-state-namespaces state) "") | |
94 | 91 | suffix)) | |
95 | 92 | ("state" . ,state))) | |
96 | - | (('iri ('prefixed-name ('pname-ns suffix))) | |
93 | + | (('iri ('prefixed-name ('pname-ln ('pname-ns ('pn-local suffix))))) | |
97 | 94 | `(("iri" . ,(string-append (assoc-ref (parser-state-namespaces state) "") | |
98 | 95 | suffix)) | |
99 | 96 | ("state" . ,state))) | |
97 | + | (('iri ('prefixed-name ('pname-ns ns))) | |
98 | + | `(("iri" . ,(assoc-ref (parser-state-namespaces state) ns)) | |
99 | + | ("state" . ,state))) | |
100 | 100 | (('iri ('prefixed-name 'pname-ns)) | |
101 | 101 | `(("iri" . ,(assoc-ref (parser-state-namespaces state) "")) | |
102 | 102 | ("state" . ,state))) |