git.annexia.org
/
ocaml-bitstring.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix documentation for how to compile using camlp4 directly.
[ocaml-bitstring.git]
/
pa_bitmatch.ml
diff --git
a/pa_bitmatch.ml
b/pa_bitmatch.ml
index
ef4d8eb
..
98151a3
100644
(file)
--- a/
pa_bitmatch.ml
+++ b/
pa_bitmatch.ml
@@
-791,7
+791,10
@@
let load_patterns_from_file _loc filename =
let names = List.rev !names in
List.iter (
function
let names = List.rev !names in
List.iter (
function
- | name, P.Pattern patt -> add_named_pattern _loc name patt
+ | name, P.Pattern patt ->
+ if patt = [] then
+ locfail _loc (sprintf "pattern %s: no fields" name);
+ add_named_pattern _loc name patt
| _, P.Constructor _ -> () (* just ignore these for now *)
) names
| _, P.Constructor _ -> () (* just ignore these for now *)
) names