xspp: gram.ml, lex.ml - fix compilation

malekith malekith at pld-linux.org
Sat Sep 3 22:03:09 CEST 2005


Author: malekith                     Date: Sat Sep  3 20:03:09 2005 GMT
Module: xspp                          Tag: HEAD
---- Log message:
- fix compilation

---- Files affected:
xspp:
   gram.ml (1.6 -> 1.7) , lex.ml (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: xspp/gram.ml
diff -u xspp/gram.ml:1.6 xspp/gram.ml:1.7
--- xspp/gram.ml:1.6	Sun Mar 30 14:08:48 2003
+++ xspp/gram.ml	Sat Sep  3 22:03:03 2005
@@ -143,6 +143,8 @@
 END
 
 let err_msg (x, y, err, file, str) =
+  let x = x.Lexing.pos_cnum in
+  let y = y.Lexing.pos_cnum in
   let b = Buffer.create 80 in
   let s = Stream.of_string str in
   let rec find_line ln x =

================================================================
Index: xspp/lex.ml
diff -u xspp/lex.ml:1.2 xspp/lex.ml:1.3
--- xspp/lex.ml:1.2	Tue May 14 15:02:46 2002
+++ xspp/lex.ml	Sat Sep  3 22:03:04 2005
@@ -71,7 +71,7 @@
     let start_ch = ctx.ctx_pos in
     let _ = fnc ctx s in
     let stop_ch = ctx.ctx_pos in
-    ((cons, Buffer.contents ctx.ctx_buffer), (start_ch, stop_ch)) in
+    ((cons, Buffer.contents ctx.ctx_buffer), Token.make_loc (start_ch, stop_ch)) in
 
   try
     let c = getc ctx s in
@@ -97,7 +97,7 @@
     | '=' | '%' | ':' | '{' | '}' | '(' | ')' | ',' | '/' | '<' | '>' 
     | ';'
     ->
-      (("", String.make 1 c), (ctx.ctx_pos - 1, ctx.ctx_pos))
+      (("", String.make 1 c), Token.make_loc (ctx.ctx_pos - 1, ctx.ctx_pos))
     | _ -> 
       if is_id_beg c then
         let ((_, s), loc) = sublex (Some c) ident "" in
@@ -110,7 +110,7 @@
       else
         raise (Token.Error "illegal character")
    with Stream.Failure ->
-    (("EOF", ""), (ctx.ctx_pos, ctx.ctx_pos))
+    (("EOF", ""), Token.make_loc (ctx.ctx_pos, ctx.ctx_pos))
         
 
 let rec printer lex s =
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/xspp/gram.ml?r1=1.6&r2=1.7&f=u
    http://cvs.pld-linux.org/xspp/lex.ml?r1=1.2&r2=1.3&f=u




More information about the pld-cvs-commit mailing list