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:
parent
bbf5e85999
commit
f9b88a27b8
|
@ -12,6 +12,21 @@ open Compiler_utils
|
||||||
|
|
||||||
let pp p = if !verbose then Mls_printer.print stdout p
|
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 =
|
let compile pp p =
|
||||||
(* Clocking *)
|
(* Clocking *)
|
||||||
let p = do_pass Clocking.program "Clocking" p pp true in
|
let p = do_pass Clocking.program "Clocking" p pp true in
|
||||||
|
|
|
@ -12,20 +12,6 @@ open Location
|
||||||
open Compiler_utils
|
open Compiler_utils
|
||||||
open Mls2seq
|
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 =
|
let compile_impl modname filename =
|
||||||
(* input and output files *)
|
(* input and output files *)
|
||||||
|
|
Loading…
Reference in a new issue