diff options
-rw-r--r-- | camlp4/CHANGES | 4 | ||||
-rw-r--r-- | camlp4/lib/token.ml | 4 | ||||
-rw-r--r-- | camlp4/ocaml_src/camlp4/.depend | 1 | ||||
-rw-r--r-- | camlp4/ocaml_src/lib/Makefile | 4 | ||||
-rw-r--r-- | camlp4/ocaml_src/lib/token.ml | 3 | ||||
-rw-r--r-- | camlp4/ocaml_src/meta/pa_ifdef.ml | 2 |
6 files changed, 9 insertions, 9 deletions
diff --git a/camlp4/CHANGES b/camlp4/CHANGES index 4edfabb84..d27b1bf64 100644 --- a/camlp4/CHANGES +++ b/camlp4/CHANGES @@ -1,10 +1,12 @@ -Camlp4 Version 3.04+1 +Camlp4 Version 3.04+5 --------------------- - [01 Fev 02] Fixed bug in token.ml: the location function provided by lexer_func_of_parser, lexer_func_of_ocamllex and make_stream_and_location could raise Invalid_argument "Array.make" for big files if the number of read tokens overflows the maximum arrays size (Sys.max_array_length). + The bug is not really fixed: in case of this overflow, the returned + location is (0, 0) (but the program does not fail). - [28 Jan 02] Fixed bug in pa_o when parsing class_types. A horrible hack had to be programmed to be able to treat them correctly. - [28 Jan 02] Fixed bug in OCaml toplevel when loading camlp4: the directives diff --git a/camlp4/lib/token.ml b/camlp4/lib/token.ml index 4db2b9d92..e84d43542 100644 --- a/camlp4/lib/token.ml +++ b/camlp4/lib/token.ml @@ -40,9 +40,7 @@ value loct_create () = (ref (Array.create 1024 None), ref False); value loct_func (loct, ov) i = match if i < 0 || i >= Array.length loct.val then - if ov.val then - Array.unsafe_get loct.val (Array.length loct.val - 1) - else None + if ov.val then Some (0, 0) else None else Array.unsafe_get loct.val i with [ Some loc -> loc diff --git a/camlp4/ocaml_src/camlp4/.depend b/camlp4/ocaml_src/camlp4/.depend index aa6eb1b8e..3f2d833e5 100644 --- a/camlp4/ocaml_src/camlp4/.depend +++ b/camlp4/ocaml_src/camlp4/.depend @@ -1,3 +1,4 @@ +ast2pt.cmi: mLast.cmi pcaml.cmi: mLast.cmi spretty.cmi quotation.cmi: mLast.cmi reloc.cmi: mLast.cmi diff --git a/camlp4/ocaml_src/lib/Makefile b/camlp4/ocaml_src/lib/Makefile index dc7aca28c..1d589b1bb 100644 --- a/camlp4/ocaml_src/lib/Makefile +++ b/camlp4/ocaml_src/lib/Makefile @@ -44,9 +44,9 @@ install: installopt: cp $(TARGET:.cma=.cmxa) *.cmx $(LIBDIR)/camlp4/. if test -f $(TARGET:.cma=.lib); then \ - cp $(TARGET:.cma=.lib) $(LIBDIR)/camlp4/.; \ + cp $(TARGET:.cma=.lib) $(LIBDIR)/camlp4/.; \ else \ - tar cf - $(TARGET:.cma=.a) | (cd $(LIBDIR)/camlp4/.; tar xf -); \ + tar cf - $(TARGET:.cma=.a) | (cd $(LIBDIR)/camlp4/.; tar xf -); \ fi include .depend diff --git a/camlp4/ocaml_src/lib/token.ml b/camlp4/ocaml_src/lib/token.ml index 379fdd0ce..4aec652a0 100644 --- a/camlp4/ocaml_src/lib/token.ml +++ b/camlp4/ocaml_src/lib/token.ml @@ -39,8 +39,7 @@ let locerr () = invalid_arg "Lexer: location function";; let loct_create () = ref (Array.create 1024 None), ref false;; let loct_func (loct, ov) i = match - if i < 0 || i >= Array.length !loct then - if !ov then Array.unsafe_get !loct (Array.length !loct - 1) else None + if i < 0 || i >= Array.length !loct then if !ov then Some (0, 0) else None else Array.unsafe_get !loct i with Some loc -> loc diff --git a/camlp4/ocaml_src/meta/pa_ifdef.ml b/camlp4/ocaml_src/meta/pa_ifdef.ml index 73451ac2e..c0b4ad6c3 100644 --- a/camlp4/ocaml_src/meta/pa_ifdef.ml +++ b/camlp4/ocaml_src/meta/pa_ifdef.ml @@ -8,7 +8,7 @@ let list_remove x l = List.fold_right (fun e l -> if e = x then l else e :: l) l [] ;; -let defined = ref ["CAMLP4_300"; "NEWSEQ"];; +let defined = ref ["OCAML_305"; "NEWSEQ"];; let define x = defined := x :: !defined;; let undef x = defined := list_remove x !defined;; |