diff options
Diffstat (limited to 'otherlibs/labltk')
-rw-r--r-- | otherlibs/labltk/browser/lexical.ml | 2 | ||||
-rw-r--r-- | otherlibs/labltk/browser/typecheck.ml | 10 | ||||
-rw-r--r-- | otherlibs/labltk/examples_camltk/Makefile.nt | 2 | ||||
-rw-r--r-- | otherlibs/labltk/examples_labltk/Makefile.nt | 2 |
4 files changed, 12 insertions, 4 deletions
diff --git a/otherlibs/labltk/browser/lexical.ml b/otherlibs/labltk/browser/lexical.ml index a2573ef7c..72f1957ec 100644 --- a/otherlibs/labltk/browser/lexical.ml +++ b/otherlibs/labltk/browser/lexical.ml @@ -39,6 +39,8 @@ let tag ?(start=tstart) ?(stop=tend) tw = let tpos c = (Text.index tw ~index:start, [`Char c]) in let text = Text.get tw ~start ~stop in let buffer = Lexing.from_string text in + Location.init buffer ""; + Location.input_name := ""; List.iter tags ~f:(fun tag -> Text.tag_remove tw ~start ~stop ~tag); let last = ref (EOF, 0, 0) in diff --git a/otherlibs/labltk/browser/typecheck.ml b/otherlibs/labltk/browser/typecheck.ml index 890fd195b..d5347ef53 100644 --- a/otherlibs/labltk/browser/typecheck.ml +++ b/otherlibs/labltk/browser/typecheck.ml @@ -46,8 +46,12 @@ let preprocess ~pp ~ext text = exception Outdated_version let parse_pp ~parse ~wrap ~ext text = + Location.input_name := ""; match !Clflags.preprocessor with - None -> parse (Lexing.from_string text) + None -> + let buffer = Lexing.from_string text in + Location.init buffer ""; + parse buffer | Some pp -> let tmpfile = preprocess ~pp ~ext text in let ast_magic = @@ -72,7 +76,9 @@ let parse_pp ~parse ~wrap ~ext text = failwith "Ocaml and preprocessor have incompatible versions" | _ -> seek_in ic 0; - parse (Lexing.from_channel ic) + let buffer = Lexing.from_channel ic in + Location.init buffer ""; + parse buffer in close_in ic; Sys.remove tmpfile; diff --git a/otherlibs/labltk/examples_camltk/Makefile.nt b/otherlibs/labltk/examples_camltk/Makefile.nt index 13f27a01d..d07471bc0 100644 --- a/otherlibs/labltk/examples_camltk/Makefile.nt +++ b/otherlibs/labltk/examples_camltk/Makefile.nt @@ -1,4 +1,4 @@ -include ../support/Makefile.common.nt +include ../support/Makefile.common # We are using the non-installed library ! COMPFLAGS= -I ../lib -I ../camltk -I ../support diff --git a/otherlibs/labltk/examples_labltk/Makefile.nt b/otherlibs/labltk/examples_labltk/Makefile.nt index 825d9e42b..261bf7543 100644 --- a/otherlibs/labltk/examples_labltk/Makefile.nt +++ b/otherlibs/labltk/examples_labltk/Makefile.nt @@ -1,4 +1,4 @@ -include ../support/Makefile.common.nt +include ../support/Makefile.common # We are using the non-installed library ! COMPFLAGS= -I ../lib -I ../labltk -I ../support |