Commit d4737ec1 authored by Kim Nguyễn's avatar Kim Nguyễn

Add a missing function to the Loc module in ulexer.ml (so that the current trunk

compiles with the patched camlp4 bundled with fedora 21)
parent 912c5b2c
......@@ -14,6 +14,7 @@ module Loc = struct
let to_tuple _ = assert false
let merge (x1, x2) (y1, y2) = (min x1 y1, max x2 y2)
let smart_merge a b = merge a b
let join (x1, _) = (x1, x1)
let move _ _ _ = assert false
let shift _ _ = assert false
......@@ -228,7 +229,7 @@ let rec token = lexer
| "[" ->
incr in_brackets;
return lexbuf (KEYWORD (L.utf8_lexeme lexbuf))
| "]" ->
| "]" ->
decr in_brackets;
return lexbuf (KEYWORD (L.utf8_lexeme lexbuf))
| '"' ->
......@@ -284,10 +285,10 @@ and token2 = lexer
| ".."
| ["?+*"] "?" | "#" ->
return lexbuf (KEYWORD (L.utf8_lexeme lexbuf))
| "[" ->
| "[" ->
incr in_brackets;
return lexbuf (KEYWORD (L.utf8_lexeme lexbuf))
| "]" ->
| "]" ->
decr in_brackets;
return lexbuf (KEYWORD (L.utf8_lexeme lexbuf))
| '"' ->
......@@ -354,10 +355,10 @@ and token2toplevel = lexer
| ".."
| ["?+*"] "?" | "#" ->
return lexbuf (KEYWORD (L.utf8_lexeme lexbuf))
| "[" ->
| "[" ->
incr in_brackets;
return lexbuf (KEYWORD (L.utf8_lexeme lexbuf))
| "]" ->
| "]" ->
decr in_brackets;
return lexbuf (KEYWORD (L.utf8_lexeme lexbuf))
| '"' ->
......@@ -442,7 +443,7 @@ and string start endchar = lexer
let token lexbuf =
if !in_brackets = 0 then token lexbuf
else if !toplevel then token2toplevel lexbuf
else if !toplevel then token2toplevel lexbuf
else token2 lexbuf
let lexbuf = ref None
......
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