Commit 443cdcd1 authored by Rehan MALAK's avatar Rehan MALAK

adapt microc and python plugin to Ptree constructors (3d86e1c5)

parent f9228fac
...@@ -319,9 +319,9 @@ let read_channel env path file c = ...@@ -319,9 +319,9 @@ let read_channel env path file c =
Typing.open_module (mk_id ~loc name); Typing.open_module (mk_id ~loc name);
let use_import (f, m) = let use_import (f, m) =
let m = mk_id ~loc m in let m = mk_id ~loc m in
Typing.open_scope loc m; let qid = Qdot (Qident (mk_id ~loc f), m) in
Typing.add_decl loc (Ptree.Duse (Qdot (Qident (mk_id ~loc f), m))); let decl = Ptree.Duseimport(loc,false,[(qid,None)]) in
Typing.close_scope loc ~import:true in Typing.add_decl loc decl in
List.iter use_import List.iter use_import
["int", "Int"; "ref", "Refint"; "microc", "MicroC"]; ["int", "Int"; "ref", "Refint"; "microc", "MicroC"];
translate f; translate f;
......
...@@ -339,10 +339,9 @@ let read_channel env path file c = ...@@ -339,10 +339,9 @@ let read_channel env path file c =
Typing.open_module (mk_id ~loc name); Typing.open_module (mk_id ~loc name);
let use_import (f, m) = let use_import (f, m) =
let m = mk_id ~loc m in let m = mk_id ~loc m in
Typing.open_scope loc m; let qid = Qdot (Qident (mk_id ~loc f), m) in
let decl = Ptree.Duseimport(loc,false,[((Qdot (Qident (mk_id ~loc f), m)),None)]) in let decl = Ptree.Duseimport(loc,false,[(qid,None)]) in
Typing.add_decl loc decl ; Typing.add_decl loc decl in
Typing.close_scope loc ~import:true in
List.iter use_import List.iter use_import
["int", "Int"; "ref", "Refint"; "python", "Python"]; ["int", "Int"; "ref", "Refint"; "python", "Python"];
translate ~loc f; translate ~loc f;
......
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