equal
deleted
inserted
replaced
125 (* parsetree_to_ast *) |
125 (* parsetree_to_ast *) |
126 |
126 |
127 fun parsetree_to_ast ctxt constrain_pos trf parsetree = |
127 fun parsetree_to_ast ctxt constrain_pos trf parsetree = |
128 let |
128 let |
129 val reports = Unsynchronized.ref ([]: Position.reports); |
129 val reports = Unsynchronized.ref ([]: Position.reports); |
130 fun report pos = Position.reports reports [pos]; |
130 fun report pos = Position.store_reports reports [pos]; |
131 |
131 |
132 fun trans a args = |
132 fun trans a args = |
133 (case trf a of |
133 (case trf a of |
134 NONE => Ast.mk_appl (Ast.Constant a) args |
134 NONE => Ast.mk_appl (Ast.Constant a) args |
135 | SOME f => f ctxt args); |
135 | SOME f => f ctxt args); |
205 val get_free = Proof_Context.intern_skolem ctxt; |
205 val get_free = Proof_Context.intern_skolem ctxt; |
206 |
206 |
207 val decodeT = typ_of_term (Proof_Context.get_sort ctxt (term_sorts tm)); |
207 val decodeT = typ_of_term (Proof_Context.get_sort ctxt (term_sorts tm)); |
208 |
208 |
209 val reports = Unsynchronized.ref reports0; |
209 val reports = Unsynchronized.ref reports0; |
210 fun report ps = Position.reports reports ps; |
210 fun report ps = Position.store_reports reports ps; |
211 |
211 |
212 fun decode ps qs bs (Const ("_constrain", _) $ t $ typ) = |
212 fun decode ps qs bs (Const ("_constrain", _) $ t $ typ) = |
213 (case Term_Position.decode_position typ of |
213 (case Term_Position.decode_position typ of |
214 SOME p => decode (p :: ps) qs bs t |
214 SOME p => decode (p :: ps) qs bs t |
215 | NONE => Type.constraint (decodeT typ) (decode ps qs bs t)) |
215 | NONE => Type.constraint (decodeT typ) (decode ps qs bs t)) |