# HG changeset patch # User haftmann # Date 1283354510 -7200 # Node ID 30d5dd2f30b650a0a273b53e0d82b9ce85db2187 # Parent 3f70c03e828247fb8924791e0d37eb2bd21b1001 simultaneous modification of statements: statement names diff -r 3f70c03e8282 -r 30d5dd2f30b6 src/Tools/Code/code_namespace.ML --- a/src/Tools/Code/code_namespace.ML Wed Sep 01 17:14:42 2010 +0200 +++ b/src/Tools/Code/code_namespace.ML Wed Sep 01 17:21:50 2010 +0200 @@ -14,7 +14,7 @@ reserved: Name.context, empty_nsp: 'c, namify_module: string -> 'c -> string * 'c, namify_stmt: Code_Thingol.stmt -> string -> 'c -> string * 'c, cyclic_modules: bool, empty_data: 'b, memorize_data: string -> 'b -> 'b, - modify_stmts: Code_Thingol.stmt list -> 'a option list } + modify_stmts: (string * Code_Thingol.stmt) list -> 'a option list } -> Code_Thingol.program -> { deresolver: string list -> string -> string, hierarchical_program: (string * ('a, 'b) node) Graph.T } @@ -109,8 +109,7 @@ #> AList.make (snd o Graph.get_node nodes) #> split_list ##> map (fn Stmt stmt => stmt) - ##> modify_stmts - #> op ~~; + #> (fn (names, stmts) => names ~~ modify_stmts (names ~~ stmts)); val stmtss' = maps modify_stmts' (Graph.strong_conn nodes); val nodes'' = Graph.map (fn name => apsnd (fn Module content => Module (make_declarations nsps' content) | _ => case AList.lookup (op =) stmtss' name of SOME (SOME stmt) => Stmt stmt | _ => Dummy)) nodes'; diff -r 3f70c03e8282 -r 30d5dd2f30b6 src/Tools/Code/code_scala.ML --- a/src/Tools/Code/code_scala.ML Wed Sep 01 17:14:42 2010 +0200 +++ b/src/Tools/Code/code_scala.ML Wed Sep 01 17:21:50 2010 +0200 @@ -317,10 +317,10 @@ val implicits = filter (is_classinst o Graph.get_node program) (Graph.imm_succs program name); in union (op =) implicits end; - fun modify_stmt (Code_Thingol.Datatypecons _) = NONE - | modify_stmt (Code_Thingol.Classrel _) = NONE - | modify_stmt (Code_Thingol.Classparam _) = NONE - | modify_stmt stmt = SOME stmt; + fun modify_stmt (_, Code_Thingol.Datatypecons _) = NONE + | modify_stmt (_, Code_Thingol.Classrel _) = NONE + | modify_stmt (_, Code_Thingol.Classparam _) = NONE + | modify_stmt (_, stmt) = SOME stmt; in Code_Namespace.hierarchical_program labelled_name { module_alias = module_alias, reserved = reserved, empty_nsp = ((reserved, reserved), reserved), namify_module = namify_module, namify_stmt = namify_stmt,