@@ -1963,15 +1963,15 @@ relation get_componentitems_annotation: Absyn.ComponentItem list => string =
19631963 string_append(s3,str) => res
19641964 ----------------------------
19651965 get_componentitems_annotation (Absyn.COMPONENTITEM(_,SOME(Absyn.COMMENT(SOME(
1966- Absyn.ANNOTATION(Absyn.MODIFICATION(_,_,Absyn.CREF_IDENT("Diagram ",_),Absyn.CLASSMOD(mod,_) ,_)::_)
1966+ Absyn.ANNOTATION(mod as Absyn.MODIFICATION(_,_,Absyn.CREF_IDENT("Placement ",_),_ ,_)::_)
19671967 ),_)))::(rest as (_::_))) => res
19681968
19691969 rule get_annotation_string(Placement_records, Absyn.ANNOTATION(mod)) => s1 &
19701970 string_append("{",s1) => s2 &
19711971 string_append(s2,"}") => res
19721972 ----------------------------
19731973 get_componentitems_annotation ([Absyn.COMPONENTITEM(_,SOME(Absyn.COMMENT(SOME(
1974- Absyn.ANNOTATION(Absyn.MODIFICATION(_,_,Absyn.CREF_IDENT("Diagram ",_),Absyn.CLASSMOD(mod,_) ,_)::_)
1974+ Absyn.ANNOTATION(mod as Absyn.MODIFICATION(_,_, Absyn.CREF_IDENT("Placement ",_),_ ,_)::_)
19751975 ),_)))]) => res
19761976
19771977 rule get_componentitems_annotation(rest) => str &
@@ -2585,14 +2585,26 @@ end
25852585 **)
25862586relation record_constructor_to_modification: (Absyn.Exp ) => Absyn.ElementArg =
25872587
2588- rule Util.list_map(nargs,namedarg_to_modification) => eltarglst &
2588+ rule (* Covers the case annotate=Diagram(x=1,y=2) *)
2589+ Util.list_map(nargs,namedarg_to_modification) => eltarglst &
25892590 let res = Absyn.MODIFICATION(false,Absyn.NON_EACH,cr,Absyn.CLASSMOD(eltarglst,NONE),NONE)
25902591 -----------------------------------
25912592 record_constructor_to_modification(Absyn.CALL(cr,Absyn.FUNCTIONARGS([],nargs))) => res
2593+
2594+ rule (* Covers the case annotate=Diagram(SOMETHING(x=1,y=2)) *)
2595+ Util.list_map(nargs,namedarg_to_modification) => eltarglst &
2596+ record_constructor_to_modification(e) => emod &
2597+ let res = Absyn.MODIFICATION(false, Absyn.NON_EACH,
2598+ cr, Absyn.CLASSMOD(emod::eltarglst, NONE), NONE)
2599+ -----------------------------------
2600+ record_constructor_to_modification(Absyn.CALL(cr,
2601+ Absyn.FUNCTIONARGS([e as Absyn.CALL(_,_)],nargs))) => res
25922602
2593- rule Print.print_buf "record_constructor_to_modification failed\n"
2603+
2604+ rule Print.print_buf "record_constructor_to_modification failed, exp=" &
2605+ Absyn.print_absyn_exp e & Print.print_buf "\n"
25942606 -------------------------
2595- record_constructor_to_modification(_ ) => fail
2607+ record_constructor_to_modification(e ) => fail
25962608end
25972609
25982610(** relation: namedarg_to_modification
@@ -2609,4 +2621,8 @@ relation namedarg_to_modification: (Absyn.NamedArg) => Absyn.ElementArg =
26092621 rule let res = Absyn.MODIFICATION(false,Absyn.NON_EACH,Absyn.CREF_IDENT(id,[]),Absyn.CLASSMOD([],SOME(e)),NONE)
26102622 ----------------------------------------------------------------
26112623 namedarg_to_modification( Absyn.NAMEDARG(id,e)) => res
2624+
2625+ rule Print.print_buf "- namedarg_to_modification failed\n"
2626+ ----------------
2627+ namedarg_to_modification(_) => fail
26122628end
0 commit comments