Small fixes to the compilation processes.

*Locations should be pretty damn good now.
*Mlsc is close to be up-to-date, still need a scoping pass etc (to be posted soon)
This commit is contained in:
Léonard Gérard 2010-07-27 13:31:13 +02:00 committed by Léonard Gérard
parent bbf5e85999
commit f9b88a27b8
2 changed files with 15 additions and 14 deletions

View file

@ -12,6 +12,21 @@ open Compiler_utils
let pp p = if !verbose then Mls_printer.print stdout p
let parse parsing_fun lexing_fun lexbuf =
try
parsing_fun lexing_fun lexbuf
with
| Mls_lexer.Lexical_error(err, loc) ->
lexical_error err loc
| Mls_parser.Error ->
let pos1 = Lexing.lexeme_start_p lexbuf
and pos2 = Lexing.lexeme_end_p lexbuf in
let l = Loc(pos1,pos2) in
syntax_error l
let parse_implementation lexbuf =
parse Mls_parser.program Mls_lexer.token lexbuf
let compile pp p =
(* Clocking *)
let p = do_pass Clocking.program "Clocking" p pp true in

View file

@ -12,20 +12,6 @@ open Location
open Compiler_utils
open Mls2seq
let parse parsing_fun lexing_fun lexbuf =
try
parsing_fun lexing_fun lexbuf
with
| Mls_lexer.Lexical_error(err, loc) ->
lexical_error err loc
| Mls_parser.Error ->
let pos1 = Lexing.lexeme_start_p lexbuf
and pos2 = Lexing.lexeme_end_p lexbuf in
let l = Loc(pos1,pos2) in
syntax_error l
let parse_implementation lexbuf =
parse Mls_parser.program Mls_lexer.token lexbuf
let compile_impl modname filename =
(* input and output files *)