126 | init_context (Class class) = Class.init class; |
126 | init_context (Class class) = Class.init class; |
127 |
127 |
128 fun init' {setup, conclude} ident thy = |
128 fun init' {setup, conclude} ident thy = |
129 let |
129 let |
130 val target = make_target thy ident; |
130 val target = make_target thy ident; |
131 val background_naming = |
|
132 Sign.naming_of thy |> Name_Space.mandatory_path (Long_Name.base_name ident); |
|
133 in |
131 in |
134 thy |
132 thy |
135 |> Sign.change_begin |
133 |> Sign.change_begin |
136 |> init_context target |
134 |> init_context target |
137 |> setup |
135 |> setup |
138 |> Local_Theory.init background_naming |
136 |> Local_Theory.init |
|
137 {background_naming = Sign.naming_of thy |> Name_Space.mandatory_path (Long_Name.base_name ident), |
|
138 exit = conclude #> Local_Theory.target_of #> Sign.change_end_local} |
139 {define = Generic_Target.define (foundation target), |
139 {define = Generic_Target.define (foundation target), |
140 notes = Generic_Target.notes (notes target), |
140 notes = Generic_Target.notes (notes target), |
141 abbrev = abbrev target, |
141 abbrev = abbrev target, |
142 declaration = declaration target, |
142 declaration = declaration target, |
143 theory_registration = theory_registration target, |
143 theory_registration = theory_registration target, |
144 locale_dependency = locale_dependency target, |
144 locale_dependency = locale_dependency target, |
145 pretty = pretty target, |
145 pretty = pretty target} |
146 exit = conclude #> Local_Theory.target_of #> Sign.change_end_local} |
|
147 end; |
146 end; |
148 |
147 |
149 fun init ident thy = |
148 fun init ident thy = |
150 init' {setup = Data.put (SOME (make_target thy ident)), conclude = I} ident thy; |
149 init' {setup = Data.put (SOME (make_target thy ident)), conclude = I} ident thy; |
151 |
150 |