13 val ambiguity_warning_raw: Config.raw |
13 val ambiguity_warning_raw: Config.raw |
14 val ambiguity_warning: bool Config.T |
14 val ambiguity_warning: bool Config.T |
15 val ambiguity_limit_raw: Config.raw |
15 val ambiguity_limit_raw: Config.raw |
16 val ambiguity_limit: int Config.T |
16 val ambiguity_limit: int Config.T |
17 val read_token: string -> Symbol_Pos.T list * Position.T |
17 val read_token: string -> Symbol_Pos.T list * Position.T |
|
18 val read_token_pos: string -> Position.T |
18 val parse_token: Proof.context -> (XML.tree list -> 'a) -> |
19 val parse_token: Proof.context -> (XML.tree list -> 'a) -> |
19 Markup.T -> (Symbol_Pos.T list * Position.T -> 'a) -> string -> 'a |
20 Markup.T -> (Symbol_Pos.T list * Position.T -> 'a) -> string -> 'a |
20 val parse_sort: Proof.context -> string -> sort |
21 val parse_sort: Proof.context -> string -> sort |
21 val parse_typ: Proof.context -> string -> typ |
22 val parse_typ: Proof.context -> string -> typ |
22 val parse_term: Proof.context -> string -> term |
23 val parse_term: Proof.context -> string -> term |
162 val ambiguity_limit = Config.int ambiguity_limit_raw; |
163 val ambiguity_limit = Config.int ambiguity_limit_raw; |
163 |
164 |
164 |
165 |
165 (* outer syntax token -- with optional YXML content *) |
166 (* outer syntax token -- with optional YXML content *) |
166 |
167 |
|
168 fun token_position (XML.Elem ((name, props), _)) = |
|
169 if name = Isabelle_Markup.tokenN then Position.of_properties props |
|
170 else Position.none |
|
171 | token_position (XML.Text _) = Position.none; |
|
172 |
167 fun explode_token tree = |
173 fun explode_token tree = |
168 let |
174 let |
169 val text = XML.content_of [tree]; |
175 val text = XML.content_of [tree]; |
170 val pos = |
176 val pos = token_position tree; |
171 (case tree of |
|
172 XML.Elem ((name, props), _) => |
|
173 if name = Isabelle_Markup.tokenN then Position.of_properties props |
|
174 else Position.none |
|
175 | XML.Text _ => Position.none); |
|
176 in (Symbol_Pos.explode (text, pos), pos) end; |
177 in (Symbol_Pos.explode (text, pos), pos) end; |
177 |
178 |
178 fun read_token str = explode_token (YXML.parse str handle Fail msg => error msg); |
179 fun read_token str = explode_token (YXML.parse str handle Fail msg => error msg); |
|
180 fun read_token_pos str = token_position (YXML.parse str handle Fail msg => error msg); |
179 |
181 |
180 fun parse_token ctxt decode markup parse str = |
182 fun parse_token ctxt decode markup parse str = |
181 let |
183 let |
182 fun parse_tree tree = |
184 fun parse_tree tree = |
183 let |
185 let |