src/Pure/Isar/named_target.ML
changeset 57074 9a631586e3e5
parent 57073 9c990475d44f
child 57109 84c1e0453bda
equal deleted inserted replaced
57073:9c990475d44f 57074:9a631586e3e5
    48   Option.map #target (peek lthy) = SOME "" andalso Local_Theory.level lthy = 1;
    48   Option.map #target (peek lthy) = SOME "" andalso Local_Theory.level lthy = 1;
    49 
    49 
    50 
    50 
    51 (* define *)
    51 (* define *)
    52 
    52 
    53 fun locale_foundation target (((b, U), mx), (b_def, rhs)) params =
    53 fun locale_foundation locale (((b, U), mx), (b_def, rhs)) params =
    54   Generic_Target.background_foundation (((b, U), NoSyn), (b_def, rhs)) params
    54   Generic_Target.background_foundation (((b, U), NoSyn), (b_def, rhs)) params
    55   #-> (fn (lhs, def) => Generic_Target.locale_const_declaration target Syntax.mode_default ((b, mx), lhs)
    55   #-> (fn (lhs, def) => Generic_Target.locale_const locale Syntax.mode_default ((b, mx), lhs)
    56     #> pair (lhs, def));
    56     #> pair (lhs, def));
    57 
    57 
    58 fun class_foundation target (((b, U), mx), (b_def, rhs)) params =
    58 fun class_foundation class (((b, U), mx), (b_def, rhs)) params =
    59   Generic_Target.background_foundation (((b, U), NoSyn), (b_def, rhs)) params
    59   Generic_Target.background_foundation (((b, U), NoSyn), (b_def, rhs)) params
    60   #-> (fn (lhs, def) => Class.const target ((b, mx), lhs) params
    60   #-> (fn (lhs, def) => Class.const class ((b, mx), lhs) params
    61     #> pair (lhs, def));
    61     #> pair (lhs, def));
    62 
    62 
    63 fun target_foundation (ta as Target {target, is_locale, is_class, ...}) =
    63 fun target_foundation (ta as Target {target, is_locale, is_class, ...}) =
    64   if is_class then class_foundation target
    64   if is_class then class_foundation target
    65   else if is_locale then locale_foundation target
    65   else if is_locale then locale_foundation target
    73   else Generic_Target.theory_notes;
    73   else Generic_Target.theory_notes;
    74 
    74 
    75 
    75 
    76 (* abbrev *)
    76 (* abbrev *)
    77 
    77 
    78 fun locale_abbrev target prmode (b, mx) (t, _) xs =
    78 fun locale_abbrev locale prmode (b, mx) (t, _) xs =
    79   Generic_Target.background_abbrev (b, t) xs
    79   Generic_Target.background_abbrev (b, t) xs
    80   #-> (fn (lhs, _) => Generic_Target.locale_const_declaration target prmode ((b, mx), lhs));
    80   #-> (fn (lhs, _) => Generic_Target.locale_const locale prmode ((b, mx), lhs));
    81 
    81 
    82 fun class_abbrev target prmode (b, mx) (t, t') xs =
    82 fun class_abbrev class prmode (b, mx) (t, t') xs =
    83   Generic_Target.background_abbrev (b, t) xs
    83   Generic_Target.background_abbrev (b, t) xs
    84   #-> (fn (lhs, _) => Class.abbrev target prmode ((b, mx), lhs) t');
    84   #-> (fn (lhs, _) => Class.abbrev class prmode ((b, mx), lhs) t');
    85 
    85 
    86 fun target_abbrev (ta as Target {target, is_locale, is_class, ...}) =
    86 fun target_abbrev (ta as Target {target, is_locale, is_class, ...}) =
    87   if is_class then class_abbrev target
    87   if is_class then class_abbrev target
    88   else if is_locale then locale_abbrev target
    88   else if is_locale then locale_abbrev target
    89   else Generic_Target.theory_abbrev;
    89   else Generic_Target.theory_abbrev;