src/Tools/Code/code_scala.ML
changeset 38782 3865cbe5d2be
parent 38780 910cedb62327
child 38809 7dc73a208722
equal deleted inserted replaced
38781:6b356e3687d2 38782:3865cbe5d2be
   432     val print_stmt = print_scala_stmt labelled_name syntax_tyco syntax_const
   432     val print_stmt = print_scala_stmt labelled_name syntax_tyco syntax_const
   433       (make_vars reserved) args_num is_singleton_constr
   433       (make_vars reserved) args_num is_singleton_constr
   434       (deresolve, Long_Name.implode o fst o split_last o Long_Name.explode (*FIXME full*));
   434       (deresolve, Long_Name.implode o fst o split_last o Long_Name.explode (*FIXME full*));
   435 
   435 
   436     (* print nodes *)
   436     (* print nodes *)
   437     fun print_implicits [] = NONE
   437     fun print_implicit implicit =
   438       | print_implicits implicits = (SOME o Pretty.block)
   438       let
   439           (str "import /*implicits*/" :: Pretty.brk 1 :: commas (map (str o deresolve) implicits));
   439         val s = deresolve implicit;
       
   440       in if length (Long_Name.explode s) = 1 then NONE else SOME (str s) end;
       
   441     fun print_implicits implicits = case map_filter print_implicit implicits
       
   442      of [] => NONE
       
   443       | ps => (SOME o Pretty.block)
       
   444           (str "import /*implicits*/" :: Pretty.brk 1 :: commas ps);
   440     fun print_module base implicits p = Pretty.chunks2
   445     fun print_module base implicits p = Pretty.chunks2
   441       ([str ("object " ^ base ^ " {")] @ the_list (print_implicits implicits)
   446       ([str ("object " ^ base ^ " {")] @ the_list (print_implicits implicits)
   442         @ [p, str ("} /* object " ^ base ^ " */")]);
   447         @ [p, str ("} /* object " ^ base ^ " */")]);
   443     fun print_node (_, Dummy) = NONE
   448     fun print_node (_, Dummy) = NONE
   444       | print_node (name, Stmt stmt) = if null presentation_stmt_names
   449       | print_node (name, Stmt stmt) = if null presentation_stmt_names