discontinued legacy antiquotations and styles
authorhaftmann
Tue Dec 18 21:59:44 2012 +0100 (2012-12-18)
changeset 50592a39250169636
parent 50591 c5e0073558f3
child 50593 8372c8b59cea
discontinued legacy antiquotations and styles
NEWS
src/Pure/Thy/term_style.ML
src/Pure/Thy/thy_output.ML
     1.1 --- a/NEWS	Tue Dec 18 02:19:14 2012 +0100
     1.2 +++ b/NEWS	Tue Dec 18 21:59:44 2012 +0100
     1.3 @@ -102,6 +102,10 @@
     1.4  
     1.5  *** Pure ***
     1.6  
     1.7 +* Dropped legacy antiquotations "term_style" and "thm_style", since
     1.8 +styles may be given as arguments to "term" and "thm" already.  Dropped
     1.9 +legacy styles "prem1" .. "prem19".  INCOMPATIBILITY.
    1.10 +
    1.11  * Code generation for Haskell: restrict unqualified imports from
    1.12  Haskell Prelude to a small set of fundamental operations.
    1.13  
     2.1 --- a/src/Pure/Thy/term_style.ML	Tue Dec 18 02:19:14 2012 +0100
     2.2 +++ b/src/Pure/Thy/term_style.ML	Tue Dec 18 21:59:44 2012 +0100
     2.3 @@ -8,7 +8,6 @@
     2.4  sig
     2.5    val setup: string -> (Proof.context -> term -> term) parser -> theory -> theory
     2.6    val parse: (term -> term) context_parser
     2.7 -  val parse_bare: (term -> term) context_parser
     2.8  end;
     2.9  
    2.10  structure Term_Style: TERM_STYLE =
    2.11 @@ -53,12 +52,6 @@
    2.12        >> fold I
    2.13    || Scan.succeed I));
    2.14  
    2.15 -val parse_bare = Args.context :|-- (fn ctxt => (legacy_feature "Old-style antiquotation style.";
    2.16 -  Scan.lift Args.liberal_name
    2.17 -  >> (fn name => fst (Args.context_syntax "style"
    2.18 -       (Scan.lift (the_style (Proof_Context.theory_of ctxt) name))
    2.19 -          (Args.src (("style", []), Position.none)) ctxt |>> (fn f => f ctxt)))));
    2.20 -
    2.21  
    2.22  (* predefined styles *)
    2.23  
    2.24 @@ -81,19 +74,6 @@
    2.25        " in propositon: " ^ Syntax.string_of_term ctxt t)
    2.26    end);
    2.27  
    2.28 -fun style_parm_premise i = Scan.succeed (fn ctxt => fn t =>
    2.29 -  let
    2.30 -    val i_str = string_of_int i;
    2.31 -    val _ = legacy_feature (quote ("prem" ^ i_str)
    2.32 -      ^ " term style encountered; use explicit argument syntax "
    2.33 -      ^ quote ("prem " ^ i_str) ^ " instead.");
    2.34 -    val prems = Logic.strip_imp_prems t;
    2.35 -  in
    2.36 -    if i <= length prems then nth prems (i - 1)
    2.37 -    else error ("Not enough premises for prem" ^ i_str ^
    2.38 -      " in propositon: " ^ Syntax.string_of_term ctxt t)
    2.39 -  end);
    2.40 -
    2.41  fun isub_symbols (d :: s :: ss) =
    2.42        if Symbol.is_ascii_digit d andalso not (String.isPrefix ("\\<^") s)
    2.43        then d :: "\\<^isub>" :: isub_symbols (s :: ss)
    2.44 @@ -115,25 +95,6 @@
    2.45    setup "rhs" (style_lhs_rhs snd) #>
    2.46    setup "prem" style_prem #>
    2.47    setup "concl" (Scan.succeed (K Logic.strip_imp_concl)) #>
    2.48 -  setup "isub" (Scan.succeed (K isub_term)) #>
    2.49 -  setup "prem1" (style_parm_premise 1) #>
    2.50 -  setup "prem2" (style_parm_premise 2) #>
    2.51 -  setup "prem3" (style_parm_premise 3) #>
    2.52 -  setup "prem4" (style_parm_premise 4) #>
    2.53 -  setup "prem5" (style_parm_premise 5) #>
    2.54 -  setup "prem6" (style_parm_premise 6) #>
    2.55 -  setup "prem7" (style_parm_premise 7) #>
    2.56 -  setup "prem8" (style_parm_premise 8) #>
    2.57 -  setup "prem9" (style_parm_premise 9) #>
    2.58 -  setup "prem10" (style_parm_premise 10) #>
    2.59 -  setup "prem11" (style_parm_premise 11) #>
    2.60 -  setup "prem12" (style_parm_premise 12) #>
    2.61 -  setup "prem13" (style_parm_premise 13) #>
    2.62 -  setup "prem14" (style_parm_premise 14) #>
    2.63 -  setup "prem15" (style_parm_premise 15) #>
    2.64 -  setup "prem16" (style_parm_premise 16) #>
    2.65 -  setup "prem17" (style_parm_premise 17) #>
    2.66 -  setup "prem18" (style_parm_premise 18) #>
    2.67 -  setup "prem19" (style_parm_premise 19)));
    2.68 +  setup "isub" (Scan.succeed (K isub_term))));
    2.69  
    2.70  end;
     3.1 --- a/src/Pure/Thy/thy_output.ML	Tue Dec 18 02:19:14 2012 +0100
     3.2 +++ b/src/Pure/Thy/thy_output.ML	Tue Dec 18 21:59:44 2012 +0100
     3.3 @@ -595,11 +595,7 @@
     3.4      basic_entity (Binding.name "text") (Scan.lift Args.name) pretty_text #>
     3.5      basic_entities (Binding.name "prf") Attrib.thms (pretty_prf false) #>
     3.6      basic_entities (Binding.name "full_prf") Attrib.thms (pretty_prf true) #>
     3.7 -    basic_entity (Binding.name "theory") (Scan.lift (Parse.position Args.name)) pretty_theory #>
     3.8 -    basic_entities_style (Binding.name "thm_style")
     3.9 -      (Term_Style.parse_bare -- Attrib.thms) pretty_thm_style #>
    3.10 -    basic_entity (Binding.name "term_style")
    3.11 -      (Term_Style.parse_bare -- Args.term) pretty_term_style));
    3.12 +    basic_entity (Binding.name "theory") (Scan.lift (Parse.position Args.name)) pretty_theory));
    3.13  
    3.14  end;
    3.15