src/Pure/ML/ml_antiquote.ML
changeset 27868 a28b3cd0077b
parent 27809 a1e409db516b
child 27882 eaa9fef9f4c1
equal deleted inserted replaced
27867:6e6a159671d4 27868:a28b3cd0077b
    40 
    40 
    41 
    41 
    42 (* specific antiquotations *)
    42 (* specific antiquotations *)
    43 
    43 
    44 fun macro name scan = ML_Context.add_antiq name
    44 fun macro name scan = ML_Context.add_antiq name
    45   (scan :|-- (fn ctxt => Scan.depend (fn _ => Scan.succeed
    45   (fn _ => scan :|-- (fn ctxt => Scan.depend (fn _ => Scan.succeed
    46     (Context.Proof ctxt, fn {background, ...} => (K ("", ""), background)))));
    46     (Context.Proof ctxt, fn {background, ...} => (K ("", ""), background)))));
    47 
    47 
    48 fun inline name scan = ML_Context.add_antiq name
    48 fun inline name scan = ML_Context.add_antiq name
    49   (scan >> (fn s => fn {struct_name, background} => (K ("", s), background)));
    49   (fn _ => scan >> (fn s => fn {struct_name, background} => (K ("", s), background)));
    50 
    50 
    51 fun declaration kind name scan = ML_Context.add_antiq name
    51 fun declaration kind name scan = ML_Context.add_antiq name
    52   (scan >> (fn s => fn {struct_name, background} =>
    52   (fn _ => scan >> (fn s => fn {struct_name, background} =>
    53     let
    53     let
    54       val (a, background') = variant name background;
    54       val (a, background') = variant name background;
    55       val env = kind ^ " " ^ a ^ " = " ^ s ^ ";\n";
    55       val env = kind ^ " " ^ a ^ " = " ^ s ^ ";\n";
    56       val body = struct_name ^ "." ^ a;
    56       val body = struct_name ^ "." ^ a;
    57     in (K (env, body), background') end));
    57     in (K (env, body), background') end));