Skip to content

Commit

Permalink
Store expname with modulename
Browse files Browse the repository at this point in the history
  • Loading branch information
ushitora-anqou committed Feb 3, 2019
1 parent 2ea640e commit e8d0a2e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions analyzer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ let analyze asts =
entries ;
Nope
| ExpDef (expname, components) ->
let expname = with_modulename expname in
Hashtbl.add toplevel.exps expname expname ;
toplevel.exps_list <- expname :: toplevel.exps_list ;
Nope
Expand Down
8 changes: 4 additions & 4 deletions generator.ml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ let rec generate (letfuncs, strings, typedefs, exps) =
appfmt buf "%s:" exp_label ;
(* TODO: arguments of Match_failure *)
appstr buf "mov rax, 1" ;
appstr buf @@ gen_raise_exp_of "Match_failure" true ;
appstr buf @@ gen_raise_exp_of "Stdlib.Match_failure" true ;
appfmt buf "%s:" exit_label ;
Buffer.contents buf
and gen_raise () =
Expand Down Expand Up @@ -802,7 +802,7 @@ let rec generate (letfuncs, strings, typedefs, exps) =
(let buf = Buffer.create 128 in
appstr buf "mov rax, 1" ;
(* TODO: arguments for Match_failure *)
appstr buf @@ gen_raise_exp_of "Match_failure" true ;
appstr buf @@ gen_raise_exp_of "Stdlib.Match_failure" true ;
Buffer.contents buf) ;
appstr buf "/* MatchWith END */" ;
Buffer.contents buf
Expand Down Expand Up @@ -993,7 +993,7 @@ let rec generate (letfuncs, strings, typedefs, exps) =
appstr buf "call aqaml_input_char_detail@PLT" ;
appstr buf "cmp rax, -1" ;
appfmt buf "jne %s" exit_label ;
appstr buf @@ gen_raise_exp_of "End_of_file" false ;
appstr buf @@ gen_raise_exp_of "Stdlib.End_of_file" false ;
appfmt buf "%s:" exit_label ;
appstr buf "ret" ;
appstr buf "" ;
Expand All @@ -1005,7 +1005,7 @@ let rec generate (letfuncs, strings, typedefs, exps) =
appfmt buf "jne %s" exit_label ;
(* TODO: raise 'No such file or directory *)
appstr buf "mov rax, 0" ;
appstr buf @@ gen_raise_exp_of "Sys_error" true ;
appstr buf @@ gen_raise_exp_of "Stdlib.Sys_error" true ;
appfmt buf "%s:" exit_label ;
appstr buf "ret" ;
appstr buf "" ;
Expand Down

0 comments on commit e8d0a2e

Please sign in to comment.