Commit c6997a74 authored by Julien Lopez's avatar Julien Lopez
Browse files

Bug fix in lexer: Now we can write type variables inside parentheses, so in

cases like this:

	type t = ['b '@' 'a]

We have a syntax error because CDuce thinks 'b ' as a string, to fix that,
implicitly write:

	type t = [('b) '@' 'a]
parent ea94368d
......@@ -289,6 +289,10 @@ and token2 = lexer
let s = get_stored_string () in
return_loc start (L.lexeme_end lexbuf) (STRING2 s)
| _ -> assert false) () lexbuf
| "('" ncname ")" ->
let s = L.utf8_lexeme lexbuf in
let s = String.sub s 1 (String.length s - 1) in
return lexbuf (PTYPE s)
| "'" ncname ->
let s = L.utf8_lexeme lexbuf in
let s = String.sub s 1 (String.length s - 1) in
......@@ -344,6 +348,10 @@ and token2toplevel = lexer
let s = get_stored_string () in
return_loc start (L.lexeme_end lexbuf) (STRING2 s)
| _ -> assert false) () lexbuf
| "('" ncname ")" ->
let s = L.utf8_lexeme lexbuf in
let s = String.sub s 1 (String.length s - 1) in
return lexbuf (PTYPE s)
| "'" ncname ->
let s = L.utf8_lexeme lexbuf in
let s = String.sub s 1 (String.length s - 1) 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