Commit ff176a7f authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2003-09-17 21:52:42 by cvscast] Lexing changed handling of location... need to adapt wlex at some

point

Original author: cvscast
Date: 2003-09-17 21:52:42+00:00
parent 67c0f771
......@@ -409,6 +409,12 @@ and parse_hexa_char engine lexbuf =
let lexbuf = ref None
let last_tok = ref ("","")
let lexeme_start lexbuf =
lexbuf.Lexing.lex_abs_pos + lexbuf.Lexing.lex_start_pos
let lexeme_end lexbuf =
lexbuf.Lexing.lex_abs_pos + lexbuf.Lexing.lex_curr_pos
let lexer_func_of_wlex lexfun lexengine cs =
let dl = !delta_loc in
delta_loc := 0;
......@@ -421,8 +427,7 @@ and parse_hexa_char engine lexbuf =
lexbuf := Some lb;
let next () =
let tok = lexfun lexengine lb in
let loc = (Lexing.lexeme_start lb + dl,
Lexing.lexeme_end lb + dl) in
let loc = (lexeme_start lb + dl, lexeme_end lb + dl) in
last_tok := tok;
(tok, loc)
in
......@@ -588,4 +593,4 @@ and parse_hexa_char engine lexbuf =
let latin1_engine = Lex_engines.engine_tiny_8bit table
# 592 "parser/wlexer.ml"
# 597 "parser/wlexer.ml"
......@@ -195,6 +195,12 @@ and parse_hexa_char = parse
let lexbuf = ref None
let last_tok = ref ("","")
let lexeme_start lexbuf =
lexbuf.Lexing.lex_abs_pos + lexbuf.Lexing.lex_start_pos
let lexeme_end lexbuf =
lexbuf.Lexing.lex_abs_pos + lexbuf.Lexing.lex_curr_pos
let lexer_func_of_wlex lexfun lexengine cs =
let dl = !delta_loc in
delta_loc := 0;
......@@ -207,8 +213,7 @@ and parse_hexa_char = parse
lexbuf := Some lb;
let next () =
let tok = lexfun lexengine lb in
let loc = (Lexing.lexeme_start lb + dl,
Lexing.lexeme_end lb + dl) in
let loc = (lexeme_start lb + dl, lexeme_end lb + dl) in
last_tok := tok;
(tok, loc)
in
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment