simultaneous modification of statements: statement names
authorhaftmann
Wed Sep 01 17:21:50 2010 +0200 (2010-09-01)
changeset 3902430d5dd2f30b6
parent 39023 3f70c03e8282
child 39025 582546cc49a1
simultaneous modification of statements: statement names
src/Tools/Code/code_namespace.ML
src/Tools/Code/code_scala.ML
     1.1 --- a/src/Tools/Code/code_namespace.ML	Wed Sep 01 17:14:42 2010 +0200
     1.2 +++ b/src/Tools/Code/code_namespace.ML	Wed Sep 01 17:21:50 2010 +0200
     1.3 @@ -14,7 +14,7 @@
     1.4      reserved: Name.context, empty_nsp: 'c, namify_module: string -> 'c -> string * 'c,
     1.5      namify_stmt: Code_Thingol.stmt -> string -> 'c -> string * 'c,
     1.6      cyclic_modules: bool, empty_data: 'b, memorize_data: string -> 'b -> 'b,
     1.7 -    modify_stmts: Code_Thingol.stmt list -> 'a option list }
     1.8 +    modify_stmts: (string * Code_Thingol.stmt) list -> 'a option list }
     1.9        -> Code_Thingol.program
    1.10        -> { deresolver: string list -> string -> string,
    1.11             hierarchical_program: (string * ('a, 'b) node) Graph.T }
    1.12 @@ -109,8 +109,7 @@
    1.13            #> AList.make (snd o Graph.get_node nodes)
    1.14            #> split_list
    1.15            ##> map (fn Stmt stmt => stmt)
    1.16 -          ##> modify_stmts
    1.17 -          #> op ~~;
    1.18 +          #> (fn (names, stmts) => names ~~ modify_stmts (names ~~ stmts));
    1.19          val stmtss' = maps modify_stmts' (Graph.strong_conn nodes);
    1.20          val nodes'' = Graph.map (fn name => apsnd (fn Module content => Module (make_declarations nsps' content)
    1.21              | _ => case AList.lookup (op =) stmtss' name of SOME (SOME stmt) => Stmt stmt | _ => Dummy)) nodes';
     2.1 --- a/src/Tools/Code/code_scala.ML	Wed Sep 01 17:14:42 2010 +0200
     2.2 +++ b/src/Tools/Code/code_scala.ML	Wed Sep 01 17:21:50 2010 +0200
     2.3 @@ -317,10 +317,10 @@
     2.4          val implicits = filter (is_classinst o Graph.get_node program)
     2.5            (Graph.imm_succs program name);
     2.6        in union (op =) implicits end;
     2.7 -    fun modify_stmt (Code_Thingol.Datatypecons _) = NONE
     2.8 -      | modify_stmt (Code_Thingol.Classrel _) = NONE
     2.9 -      | modify_stmt (Code_Thingol.Classparam _) = NONE
    2.10 -      | modify_stmt stmt = SOME stmt;
    2.11 +    fun modify_stmt (_, Code_Thingol.Datatypecons _) = NONE
    2.12 +      | modify_stmt (_, Code_Thingol.Classrel _) = NONE
    2.13 +      | modify_stmt (_, Code_Thingol.Classparam _) = NONE
    2.14 +      | modify_stmt (_, stmt) = SOME stmt;
    2.15    in
    2.16      Code_Namespace.hierarchical_program labelled_name { module_alias = module_alias, reserved = reserved,
    2.17        empty_nsp = ((reserved, reserved), reserved), namify_module = namify_module, namify_stmt = namify_stmt,