src/Pure/System/scala_compiler.ML
changeset 73761 ef1a18e20ace
parent 72294 25c6423ec538
child 73780 466fae6bf22e
equal deleted inserted replaced
73760:f4be1b0d7a51 73761:ef1a18e20ace
    63 
    63 
    64 in
    64 in
    65 
    65 
    66 val _ =
    66 val _ =
    67   Theory.setup
    67   Theory.setup
    68     (Thy_Output.antiquotation_verbatim_embedded \<^binding>\<open>scala\<close>
    68     (Document_Output.antiquotation_verbatim_embedded \<^binding>\<open>scala\<close>
    69       (Scan.lift Args.embedded_position)
    69       (Scan.lift Args.embedded_position)
    70       (fn _ => fn (s, pos) => (static_check (s, pos); s)) #>
    70       (fn _ => fn (s, pos) => (static_check (s, pos); s)) #>
    71 
    71 
    72     Thy_Output.antiquotation_raw_embedded \<^binding>\<open>scala_type\<close>
    72     Document_Output.antiquotation_raw_embedded \<^binding>\<open>scala_type\<close>
    73       (Scan.lift (Args.embedded_position -- (types >> print_types)))
    73       (Scan.lift (Args.embedded_position -- (types >> print_types)))
    74       (fn _ => fn ((t, pos), type_args) =>
    74       (fn _ => fn ((t, pos), type_args) =>
    75         (static_check ("type _Test_" ^ type_args ^ " = " ^ t ^ type_args, pos);
    75         (static_check ("type _Test_" ^ type_args ^ " = " ^ t ^ type_args, pos);
    76           scala_name (t ^ type_args))) #>
    76           scala_name (t ^ type_args))) #>
    77 
    77 
    78     Thy_Output.antiquotation_raw_embedded \<^binding>\<open>scala_object\<close>
    78     Document_Output.antiquotation_raw_embedded \<^binding>\<open>scala_object\<close>
    79       (Scan.lift Args.embedded_position)
    79       (Scan.lift Args.embedded_position)
    80       (fn _ => fn (x, pos) => (static_check ("val _test_ = " ^ x, pos); scala_name x)) #>
    80       (fn _ => fn (x, pos) => (static_check ("val _test_ = " ^ x, pos); scala_name x)) #>
    81 
    81 
    82     Thy_Output.antiquotation_raw_embedded \<^binding>\<open>scala_method\<close>
    82     Document_Output.antiquotation_raw_embedded \<^binding>\<open>scala_method\<close>
    83       (Scan.lift (class -- Args.embedded_position -- types -- args))
    83       (Scan.lift (class -- Args.embedded_position -- types -- args))
    84       (fn _ => fn (((class_context, (method, pos)), method_types), method_args) =>
    84       (fn _ => fn (((class_context, (method, pos)), method_types), method_args) =>
    85         let
    85         let
    86           val class_types = (case class_context of SOME (_, Ts) => Ts | NONE => []);
    86           val class_types = (case class_context of SOME (_, Ts) => Ts | NONE => []);
    87           val def = "def _test_" ^ print_types (merge (op =) (method_types, class_types));
    87           val def = "def _test_" ^ print_types (merge (op =) (method_types, class_types));