changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/lib/obj/uri/pkg.lisp

changeset 698: 96958d3eb5b0
parent: 78ef6145e272
author: Richard Westhaver <ellis@rwest.io>
date: Fri, 04 Oct 2024 22:04:59 -0400
permissions: -rw-r--r--
description: fixes
1 ;;; obj/uri.lisp --- Univeral Resource Identifiers
2 
3 ;; Where convenient, this is a straight-forward copy of Franz's
4 ;; NET.URI. the source is available here:
5 ;; https://github.com/franzinc/uri/blob/master/uri.cl
6 
7 ;; For general URI information see RFC 3986.
8 
9 ;; For general IRI information see RFC 3987.
10 
11 ;; For general URN information see RFC 8141.
12 
13 ;; For IPv6 changes see RFC 6874.
14 
15 ;; examples of URIs:
16 #|
17 ftp://ftp.is.co.za/rfc/rfc1808.txt
18 https://www.ietf.org/rfc/rfc2396.txt
19 ldap://[2001:db8::7]/c=GB?objectClass?one
20 mailto:John.Doe@example.com
21 news:comp.infosystems.www.servers.unix
22 tel:+1-816-555-1212
23 telnet://192.0.2.16:80/
24 urn:oasis:names:specification:docbook:dtd:xml:4.1.2
25 |#
26 
27 ;;
28 
29 ;;; Code:
30 (in-package :obj/uri)
31 
32 ;; (parse-uri-string-rfc3986 "https://test.com")
33 
34 ;; TODO
35 ;; (defmacro do-all-uris ((var &optional uri-space result-form)
36 ;; &rest forms
37 ;; &environment env)
38 ;; "do-all-uris (var [[uri-space] result-form])
39 ;; {declaration}* {tag | statement}*
40 ;; Executes the forms once for each uri with var bound to the current uri"
41 ;; (let ((f (gensym))
42 ;; (g-ignore (gensym))
43 ;; (g-uri-space (gensym))
44 ;; (body (third (excl::parse-body forms env))))
45 ;; `(let ((,g-uri-space (or ,uri-space *uris*)))
46 ;; (prog nil
47 ;; (flet ((,f (,var &optional ,g-ignore)
48 ;; (declare (ignorable ,var ,g-ignore))
49 ;; (tagbody ,@body)))
50 ;; (maphash #',f ,g-uri-space))
51 ;; (return ,result-form)))))
52 
53 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
54 (pushnew :rfc3986 *features*)
55 (pushnew :rfc6874 *features*)
56 (pushnew :rfc8141 *features*)
57 
58 #+ignore ;; debugging only
59 (progn
60  (trace parse-uri-string-rfc3986)
61  #+ignore (trace xsubseq)
62  #+ignore (trace val)
63  (trace looking-at)
64  (trace scan-forward)
65 
66  (trace state-uri)
67  (trace state-uri-reference)
68  (trace state-absolute-uri)
69  (trace state-hier-part)
70  (trace state-relative-ref)
71  (trace state-relative-part)
72  (trace state-scheme)
73  (trace state-authority)
74  (trace state-userinfo)
75  (trace state-port)
76  (trace state-host)
77  (trace state-ip-literal)
78  (trace state-ipv6addrz)
79  (trace scan-zone-id)
80  (trace state-ipvfuture)
81  (trace scan-ipv6address)
82  (trace scan-ipv6address-part4)
83  (trace scan-ipv6address-part5)
84  (trace scan-ipv6address-part6)
85  (trace scan-ipv6address-part7)
86  (trace scan-ipv6address-part8)
87  (trace scan-h16-colon-pairs)
88  (trace scan-h16)
89  (trace scan-ls32)
90  (trace state-ipv4address)
91  (trace scan-dec-octet)
92  (trace state-reg-name)
93  (trace state-path-abempty)
94  (trace state-path-absolute)
95  (trace state-path-noscheme)
96  (trace state-path-rootless)
97  (trace state-path-empty)
98  (trace scan-segment-nz-nc)
99  (trace scan-pchar)
100  (trace state-query)
101  (trace state-fragment)
102  (trace scan-pct-encoded)
103 
104  (trace state-uri-file)
105 
106  (trace state-urn-namestring)
107  (trace state-urn-assigned-name)
108  (trace state-urn-nid)
109  (trace state-urn-nss)
110  (trace state-urn-rq-components)
111  (trace state-urn-r-component)
112  (trace state-urn-q-component)
113  )