Parse URIs starting with numbers
git-svn-id: file:///srv/svn/repo/text_parse/trunk@2 cb476dc4-a1c2-9446-a177-162899b6b847
This commit is contained in:
parent
cec56ea18c
commit
9da2a4e1e4
2
bin/dune
2
bin/dune
@ -1,4 +1,4 @@
|
|||||||
(executable
|
(executable
|
||||||
(name cli)
|
(name cli)
|
||||||
(modules cli)
|
(modules cli)
|
||||||
(libraries text parsers))
|
(libraries parsers))
|
||||||
|
@ -1,13 +1,9 @@
|
|||||||
(lang dune 2.4)
|
(lang dune 2.4)
|
||||||
(name text_parse)
|
(name text_parse)
|
||||||
(version 1.02)
|
(version 1.02)
|
||||||
(homepage "https://cgit.orbitalfox.eu/text-parse-ml")
|
|
||||||
|
|
||||||
(source (uri git://orbitalfox.eu/text-parse-ml))
|
|
||||||
(license EUPL)
|
(license EUPL)
|
||||||
(authors "orbifx")
|
(maintainers "orbifx <orbifx@disroot.org>")
|
||||||
(maintainers "fox@orbitalfox.eu")
|
|
||||||
(bug_reports "mailto:fox@orbitalfox.eu?subject=Text parse ML Issue:")
|
|
||||||
|
|
||||||
(generate_opam_files true)
|
(generate_opam_files true)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ open Text_parse.Cursor
|
|||||||
|
|
||||||
module Angled (F : Fn) = struct
|
module Angled (F : Fn) = struct
|
||||||
type t = F.t
|
type t = F.t
|
||||||
let s cur = function '<' -> letter (char_at cur 1) | _ -> false
|
let s cur = function '<' -> let c = char_at cur 1 in letter c || digit c | _ -> false
|
||||||
let e _cur = function '>' -> true | _ -> false
|
let e _cur = function '>' -> true | _ -> false
|
||||||
let parse cur acc = F.angled_uri (segment_string (unwrap 1 cur)) acc
|
let parse cur acc = F.angled_uri (segment_string (unwrap 1 cur)) acc
|
||||||
end
|
end
|
||||||
|
@ -8,3 +8,4 @@ end
|
|||||||
let newline = function '\n' -> true | _ -> false
|
let newline = function '\n' -> true | _ -> false
|
||||||
let printable ch = ch >= ' ' && ch <= '~'
|
let printable ch = ch >= ' ' && ch <= '~'
|
||||||
let letter ch = (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z')
|
let letter ch = (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z')
|
||||||
|
let digit = function '0' .. '9' -> true | _ -> false
|
||||||
|
@ -2,11 +2,8 @@
|
|||||||
opam-version: "2.0"
|
opam-version: "2.0"
|
||||||
version: "1.02"
|
version: "1.02"
|
||||||
synopsis: "Applicative text parsing"
|
synopsis: "Applicative text parsing"
|
||||||
maintainer: ["fox@orbitalfox.eu"]
|
maintainer: ["orbifx <orbifx@disroot.org>"]
|
||||||
authors: ["orbifx"]
|
|
||||||
license: "EUPL"
|
license: "EUPL"
|
||||||
homepage: "https://cgit.orbitalfox.eu/text-parse-ml"
|
|
||||||
bug-reports: "mailto:fox@orbitalfox.eu?subject=Text parse ML Issue:"
|
|
||||||
depends: [
|
depends: [
|
||||||
"dune" {>= "2.4"}
|
"dune" {>= "2.4"}
|
||||||
]
|
]
|
||||||
@ -24,4 +21,3 @@ build: [
|
|||||||
"@doc" {with-doc}
|
"@doc" {with-doc}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
dev-repo: "git://orbitalfox.eu/text-parse-ml"
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user