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

Bugfix in lexer: we no longer need to enter twice in toplevel when writing type

variables in brackets. However, we can't write ';;' in strings in brackets in
toplevel now:

	# type t = ['a];;
	# type t = ['a'];;
	# type t = ['a 'a'];;
	# type t = [';;'];;
	Characters 10-11:
	Illegal character

We still have to print a better error message.
parent abbf084d
......@@ -336,7 +336,7 @@ and token2toplevel = lexer
let s = get_stored_string () in
return_loc start (L.lexeme_end lexbuf) (STRING s)
| "'" "\\"? _ "'--'" "\\"? _ "'"
| "'" [^ "\n'"]+ "'" not_xml_letter ->
| "'" ((";"[^ ";'"]) | [^ ";'"])* ";"? "'" not_xml_letter ->
L.rollback lexbuf;
(fun _ -> lexer
| "'" -> let start = L.lexeme_start lexbuf in
......
......@@ -32,7 +32,8 @@ let tests_poly_abstr = [
"fun ('A -> (Int -> Int)) | _ -> (fun ('B -> 'B) y -> y)";
"Test CDuce.lambda.appl_partial",
"Abstraction([('B,'B)],Id)",
"Abstraction([('B,'B)],Sel(1,[('B -> 'B)],{{'B = Int
}}))",
"(fun ('A -> (Int -> Int)) | _ -> (fun ('B -> 'B) y -> y)) 3";
];;
......
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