summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Pouillard <np@nicolaspouillard.fr>2007-11-21 20:48:37 +0000
committerNicolas Pouillard <np@nicolaspouillard.fr>2007-11-21 20:48:37 +0000
commit1526de337ecf03415df8be80fcea5956fa255cf6 (patch)
tree952d676fb07c3de585cfa4c0282c36d1092d2679
parent3107465c71ec6e390f04b1941915397a911b3fd2 (diff)
[ocamlbuild] [FIXED] Globbing wildcard '?' cannot match slash (update doc too)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8568 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--ocamlbuild/glob_lexer.mll2
-rw-r--r--ocamlbuild/manual/manual.tex2
-rw-r--r--ocamlbuild/signatures.mli7
3 files changed, 7 insertions, 4 deletions
diff --git a/ocamlbuild/glob_lexer.mll b/ocamlbuild/glob_lexer.mll
index 8bf49900d..e03d57816 100644
--- a/ocamlbuild/glob_lexer.mll
+++ b/ocamlbuild/glob_lexer.mll
@@ -94,7 +94,7 @@ and parse_pattern eof_chars p = parse
| "**" { raise (Parse_error("Ambiguous ** pattern not allowed unless surrounded by one or more slashes")) }
| '*' { parse_pattern eof_chars (concat_patterns p (Star not_slash)) lexbuf }
| '/' { parse_pattern eof_chars (concat_patterns p slash) lexbuf }
-| '?' { parse_pattern eof_chars (concat_patterns p (Class True)) lexbuf }
+| '?' { parse_pattern eof_chars (concat_patterns p not_slash) lexbuf }
| _ as c
{ if List.mem c eof_chars then
(p,c)
diff --git a/ocamlbuild/manual/manual.tex b/ocamlbuild/manual/manual.tex
index 6cb325364..7da1b5cb6 100644
--- a/ocamlbuild/manual/manual.tex
+++ b/ocamlbuild/manual/manual.tex
@@ -414,7 +414,7 @@ $\texttt{-}$ and $\texttt{.}$. This is called the pathname alphabet $P$.
\texttt{foo/**}&
\texttt{foo}, \texttt{foo/bar} &
\texttt{bar/foo} &
- Any string starting with a slash, or the empty string.
+ Any string starting with a slash, or the empty string
($\varepsilon \cup \mathtt{/}P^*$) \\
\hline
%%
diff --git a/ocamlbuild/signatures.mli b/ocamlbuild/signatures.mli
index 0cc06cbbe..a4ab1bfb1 100644
--- a/ocamlbuild/signatures.mli
+++ b/ocamlbuild/signatures.mli
@@ -249,8 +249,11 @@ module type GLOB = sig
matching {i glob2}.
- [a] matches the string consisting of the single letter [a].
- [{]{i glob1},{i glob2}[}] matches strings matching {i glob1} or {i glob2}.
- - [*] matches all strings, including the empty one.
- - [?] matches strings of length 1.
+ - [?] any one-letter string, excluding the slash.
+ - [*] matches all strings not containing a slash, including the empty one.
+ - [**/] the empty string, or any string ending with a slash.
+ - [/**] any string starting with a slash, or the empty string.
+ - [/**/] any string starting and ending with a slash.
- [\[]{i c1}-{i c2}{i c3}-{i c4}...[\]] matches characters in the range {i c1} to {i c2} inclusive,
or in the range {i c3} to {i c4} inclusive. For instance [\[a-fA-F0-9\]] matches hexadecimal digits.
To match the dash, put it at the end.