author | wenzelm |
Sun, 28 Aug 2005 16:04:49 +0200 | |
changeset 17165 | 9b498019723f |
parent 17070 | 3b29a01417f8 |
child 17358 | 5746c9bd4356 |
permissions | -rw-r--r-- |
5826 | 1 |
(* Title: Pure/Isar/outer_parse.ML |
2 |
ID: $Id$ |
|
3 |
Author: Markus Wenzel, TU Muenchen |
|
4 |
||
5 |
Generic parsers for Isabelle/Isar outer syntax. |
|
6 |
*) |
|
7 |
||
8 |
signature OUTER_PARSE = |
|
9 |
sig |
|
10 |
type token |
|
11 |
val group: string -> (token list -> 'a) -> token list -> 'a |
|
12 |
val !!! : (token list -> 'a) -> token list -> 'a |
|
8581
5c7ed2af8bfb
!!!! = cut "Corrupted outer syntax in presentation";
wenzelm
parents:
8350
diff
changeset
|
13 |
val !!!! : (token list -> 'a) -> token list -> 'a |
12047 | 14 |
val triple1: ('a * 'b) * 'c -> 'a * 'b * 'c |
15 |
val triple2: 'a * ('b * 'c) -> 'a * 'b * 'c |
|
16 |
val triple_swap: ('a * 'b) * 'c -> ('a * 'c) * 'b |
|
15703 | 17 |
val not_eof: token list -> token * token list |
5826 | 18 |
val position: (token list -> 'a * 'b) -> token list -> ('a * Position.T) * 'b |
7026 | 19 |
val command: token list -> string * token list |
5826 | 20 |
val keyword: token list -> string * token list |
21 |
val short_ident: token list -> string * token list |
|
22 |
val long_ident: token list -> string * token list |
|
23 |
val sym_ident: token list -> string * token list |
|
15963 | 24 |
val minus: token list -> string * token list |
5826 | 25 |
val term_var: token list -> string * token list |
26 |
val type_ident: token list -> string * token list |
|
27 |
val type_var: token list -> string * token list |
|
28 |
val number: token list -> string * token list |
|
29 |
val string: token list -> string * token list |
|
30 |
val verbatim: token list -> string * token list |
|
6860 | 31 |
val sync: token list -> string * token list |
5826 | 32 |
val eof: token list -> string * token list |
15703 | 33 |
val $$$ : string -> token list -> string * token list |
16030 | 34 |
val reserved : string -> token list -> string * token list |
15703 | 35 |
val semicolon: token list -> string * token list |
36 |
val underscore: token list -> string * token list |
|
37 |
val maybe: (token list -> 'a * token list) -> token list -> 'a option * token list |
|
17070 | 38 |
val tag_name: token list -> string * token list |
39 |
val tags: token list -> string list * token list |
|
7930 | 40 |
val opt_unit: token list -> unit * token list |
14646 | 41 |
val opt_keyword: string -> token list -> bool * token list |
5826 | 42 |
val nat: token list -> int * token list |
43 |
val enum: string -> (token list -> 'a * token list) -> token list -> 'a list * token list |
|
44 |
val enum1: string -> (token list -> 'a * token list) -> token list -> 'a list * token list |
|
45 |
val list: (token list -> 'a * token list) -> token list -> 'a list * token list |
|
46 |
val list1: (token list -> 'a * token list) -> token list -> 'a list * token list |
|
6013 | 47 |
val and_list: (token list -> 'a * token list) -> token list -> 'a list * token list |
48 |
val and_list1: (token list -> 'a * token list) -> token list -> 'a list * token list |
|
5826 | 49 |
val name: token list -> bstring * token list |
50 |
val xname: token list -> xstring * token list |
|
51 |
val text: token list -> string * token list |
|
14949 | 52 |
val path: token list -> Path.T * token list |
8897 | 53 |
val sort: token list -> string * token list |
54 |
val arity: token list -> (string list * string) * token list |
|
5826 | 55 |
val type_args: token list -> string list * token list |
56 |
val typ: token list -> string * token list |
|
57 |
val opt_infix: token list -> Syntax.mixfix * token list |
|
58 |
val opt_mixfix: token list -> Syntax.mixfix * token list |
|
9037 | 59 |
val opt_infix': token list -> Syntax.mixfix * token list |
60 |
val opt_mixfix': token list -> Syntax.mixfix * token list |
|
14646 | 61 |
val mixfix': token list -> Syntax.mixfix * token list |
5826 | 62 |
val const: token list -> (bstring * string * Syntax.mixfix) * token list |
63 |
val term: token list -> string * token list |
|
64 |
val prop: token list -> string * token list |
|
6935 | 65 |
val propp: token list -> (string * (string list * string list)) * token list |
6949 | 66 |
val termp: token list -> (string * string list) * token list |
9131 | 67 |
val arguments: token list -> Args.T list * token list |
15703 | 68 |
val attribs: token list -> Attrib.src list * token list |
69 |
val opt_attribs: token list -> Attrib.src list * token list |
|
70 |
val thm_name: string -> token list -> (bstring * Attrib.src list) * token list |
|
71 |
val opt_thm_name: string -> token list -> (bstring * Attrib.src list) * token list |
|
72 |
val spec_name: token list -> ((bstring * string) * Attrib.src list) * token list |
|
73 |
val spec_opt_name: token list -> ((bstring * string) * Attrib.src list) * token list |
|
74 |
val xthm: token list -> (thmref * Attrib.src list) * token list |
|
75 |
val xthms1: token list -> (thmref * Attrib.src list) list * token list |
|
16736
1e792b32abef
Preparations for interpretation of locales in locales.
ballarin
parents:
16498
diff
changeset
|
76 |
val locale_target: token list -> xstring * token list |
1e792b32abef
Preparations for interpretation of locales in locales.
ballarin
parents:
16498
diff
changeset
|
77 |
val opt_locale_target: token list -> xstring option * token list |
12272 | 78 |
val locale_expr: token list -> Locale.expr * token list |
12942 | 79 |
val locale_keyword: token list -> string * token list |
15703 | 80 |
val locale_element: token list -> Locale.element * token list |
81 |
val locale_elem_or_expr: token list -> Locale.element Locale.elem_expr * token list |
|
5826 | 82 |
val method: token list -> Method.text * token list |
83 |
end; |
|
84 |
||
85 |
structure OuterParse: OUTER_PARSE = |
|
86 |
struct |
|
87 |
||
9131 | 88 |
structure T = OuterLex; |
89 |
type token = T.token; |
|
5826 | 90 |
|
91 |
||
92 |
(** error handling **) |
|
93 |
||
94 |
(* group atomic parsers (no cuts!) *) |
|
95 |
||
96 |
fun fail_with s = Scan.fail_with |
|
97 |
(fn [] => s ^ " expected (past end-of-file!)" |
|
9155 | 98 |
| (tok :: _) => s ^ " expected,\nbut " ^ T.name_of tok ^ T.pos_of tok ^ " was found"); |
5826 | 99 |
|
100 |
fun group s scan = scan || fail_with s; |
|
101 |
||
102 |
||
5877 | 103 |
(* cut *) |
5826 | 104 |
|
8581
5c7ed2af8bfb
!!!! = cut "Corrupted outer syntax in presentation";
wenzelm
parents:
8350
diff
changeset
|
105 |
fun cut kind scan = |
5826 | 106 |
let |
107 |
fun get_pos [] = " (past end-of-file!)" |
|
9131 | 108 |
| get_pos (tok :: _) = T.pos_of tok; |
5826 | 109 |
|
15531 | 110 |
fun err (toks, NONE) = kind ^ get_pos toks |
111 |
| err (toks, SOME msg) = kind ^ get_pos toks ^ ": " ^ msg; |
|
5826 | 112 |
in Scan.!! err scan end; |
113 |
||
8586 | 114 |
fun !!! scan = cut "Outer syntax error" scan; |
115 |
fun !!!! scan = cut "Corrupted outer syntax in presentation" scan; |
|
8581
5c7ed2af8bfb
!!!! = cut "Corrupted outer syntax in presentation";
wenzelm
parents:
8350
diff
changeset
|
116 |
|
5826 | 117 |
|
118 |
||
119 |
(** basic parsers **) |
|
120 |
||
121 |
(* utils *) |
|
122 |
||
123 |
fun triple1 ((x, y), z) = (x, y, z); |
|
124 |
fun triple2 (x, (y, z)) = (x, y, z); |
|
6430 | 125 |
fun triple_swap ((x, y), z) = ((x, z), y); |
5826 | 126 |
|
127 |
||
128 |
(* tokens *) |
|
129 |
||
15703 | 130 |
val not_eof = Scan.one T.not_eof; |
131 |
||
132 |
fun position scan = (Scan.ahead not_eof >> T.position_of) -- scan >> Library.swap; |
|
5826 | 133 |
|
134 |
fun kind k = |
|
9131 | 135 |
group (T.str_of_kind k) (Scan.one (T.is_kind k) >> T.val_of); |
5826 | 136 |
|
9131 | 137 |
val command = kind T.Command; |
138 |
val keyword = kind T.Keyword; |
|
139 |
val short_ident = kind T.Ident; |
|
140 |
val long_ident = kind T.LongIdent; |
|
141 |
val sym_ident = kind T.SymIdent; |
|
142 |
val term_var = kind T.Var; |
|
143 |
val type_ident = kind T.TypeIdent; |
|
144 |
val type_var = kind T.TypeVar; |
|
145 |
val number = kind T.Nat; |
|
146 |
val string = kind T.String; |
|
17165 | 147 |
val alt_string = kind T.AltString; |
9131 | 148 |
val verbatim = kind T.Verbatim; |
149 |
val sync = kind T.Sync; |
|
150 |
val eof = kind T.EOF; |
|
5826 | 151 |
|
152 |
fun $$$ x = |
|
9131 | 153 |
group (T.str_of_kind T.Keyword ^ " " ^ quote x) |
154 |
(Scan.one (T.keyword_with (equal x)) >> T.val_of); |
|
155 |
||
16030 | 156 |
fun reserved x = |
157 |
group ("Reserved identifier " ^ quote x) |
|
158 |
(Scan.one (T.ident_with (equal x)) >> T.val_of); |
|
159 |
||
9131 | 160 |
val semicolon = $$$ ";"; |
5826 | 161 |
|
15703 | 162 |
val minus = sym_ident :-- (fn "-" => Scan.succeed () | _ => Scan.fail) >> #1; |
11792
311eee3d63b6
parser for underscore (actually a symbolic identifier!);
wenzelm
parents:
11651
diff
changeset
|
163 |
val underscore = sym_ident :-- (fn "_" => Scan.succeed () | _ => Scan.fail) >> #1; |
15703 | 164 |
fun maybe scan = underscore >> K NONE || scan >> SOME; |
11792
311eee3d63b6
parser for underscore (actually a symbolic identifier!);
wenzelm
parents:
11651
diff
changeset
|
165 |
|
14835 | 166 |
val nat = number >> (#1 o Library.read_int o Symbol.explode); |
5826 | 167 |
|
17070 | 168 |
val tag_name = group "tag name" (short_ident || string); |
169 |
val tags = Scan.repeat ($$$ "%" |-- !!! tag_name); |
|
170 |
||
7930 | 171 |
val opt_unit = Scan.optional ($$$ "(" -- $$$ ")" >> (K ())) (); |
14646 | 172 |
fun opt_keyword s = Scan.optional ($$$ "(" |-- !!! (($$$ s >> K true) --| $$$ ")")) false; |
173 |
||
5826 | 174 |
|
175 |
(* enumerations *) |
|
176 |
||
6003 | 177 |
fun enum1 sep scan = scan -- Scan.repeat ($$$ sep |-- !!! scan) >> op ::; |
5826 | 178 |
fun enum sep scan = enum1 sep scan || Scan.succeed []; |
179 |
||
180 |
fun list1 scan = enum1 "," scan; |
|
181 |
fun list scan = enum "," scan; |
|
182 |
||
6013 | 183 |
fun and_list1 scan = enum1 "and" scan; |
184 |
fun and_list scan = enum "and" scan; |
|
185 |
||
5826 | 186 |
|
5960 | 187 |
(* names and text *) |
5826 | 188 |
|
8146 | 189 |
val name = group "name declaration" (short_ident || sym_ident || string || number); |
190 |
val xname = group "name reference" (short_ident || long_ident || sym_ident || string || number); |
|
191 |
val text = group "text" (short_ident || long_ident || sym_ident || string || number || verbatim); |
|
14949 | 192 |
val path = group "file name/path specification" name >> Path.unpack; |
6553 | 193 |
|
194 |
||
6372 | 195 |
(* sorts and arities *) |
5826 | 196 |
|
8897 | 197 |
val sort = group "sort" xname; |
5826 | 198 |
|
6372 | 199 |
fun gen_arity cod = |
7352 | 200 |
Scan.optional ($$$ "(" |-- !!! (list1 sort --| $$$ ")")) [] -- cod; |
6372 | 201 |
|
202 |
val arity = gen_arity sort; |
|
5826 | 203 |
|
204 |
||
205 |
(* types *) |
|
206 |
||
8146 | 207 |
val typ = group "type" |
208 |
(short_ident || long_ident || sym_ident || type_ident || type_var || string || number); |
|
5826 | 209 |
|
210 |
val type_args = |
|
211 |
type_ident >> single || |
|
212 |
$$$ "(" |-- !!! (list1 type_ident --| $$$ ")") || |
|
213 |
Scan.succeed []; |
|
214 |
||
215 |
||
216 |
(* mixfix annotations *) |
|
217 |
||
11651 | 218 |
val infx = $$$ "infix" |-- !!! (nat >> Syntax.Infix || string -- nat >> Syntax.InfixName); |
5826 | 219 |
val infxl = $$$ "infixl" |-- !!! (nat >> Syntax.Infixl || string -- nat >> Syntax.InfixlName); |
220 |
val infxr = $$$ "infixr" |-- !!! (nat >> Syntax.Infixr || string -- nat >> Syntax.InfixrName); |
|
221 |
||
222 |
val binder = |
|
223 |
$$$ "binder" |-- |
|
224 |
!!! (string -- ($$$ "[" |-- nat --| $$$ "]" -- nat || nat >> (fn n => (n, n)))) |
|
225 |
>> (Syntax.Binder o triple2); |
|
226 |
||
227 |
||
228 |
val opt_pris = Scan.optional ($$$ "[" |-- !!! (list nat --| $$$ "]")) []; |
|
229 |
||
230 |
val mixfix = |
|
8648 | 231 |
(string -- !!! (opt_pris -- Scan.optional nat Syntax.max_pri)) |
232 |
>> (Syntax.Mixfix o triple2); |
|
5826 | 233 |
|
14646 | 234 |
fun fix_decl guard fix = $$$ "(" |-- guard (fix --| $$$ ")"); |
235 |
fun opt_fix guard fix = Scan.optional (fix_decl guard fix) Syntax.NoSyn; |
|
5826 | 236 |
|
11651 | 237 |
val opt_infix = opt_fix !!! (infxl || infxr || infx); |
238 |
val opt_mixfix = opt_fix !!! (mixfix || binder || infxl || infxr || infx); |
|
239 |
val opt_infix' = opt_fix I (infxl || infxr || infx); |
|
240 |
val opt_mixfix' = opt_fix I (mixfix || binder || infxl || infxr || infx); |
|
14646 | 241 |
val mixfix' = fix_decl !!! (mixfix || binder || infxl || infxr || infx); |
5826 | 242 |
|
243 |
||
244 |
(* consts *) |
|
245 |
||
246 |
val const = |
|
247 |
name -- ($$$ "::" |-- !!! (typ -- opt_mixfix)) >> triple2; |
|
248 |
||
249 |
||
250 |
(* terms *) |
|
251 |
||
7477 | 252 |
val trm = short_ident || long_ident || sym_ident || term_var || number || string; |
5826 | 253 |
|
254 |
val term = group "term" trm; |
|
255 |
val prop = group "proposition" trm; |
|
256 |
||
257 |
||
6949 | 258 |
(* patterns *) |
6935 | 259 |
|
6949 | 260 |
val is_terms = Scan.repeat1 ($$$ "is" |-- term); |
6935 | 261 |
val is_props = Scan.repeat1 ($$$ "is" |-- prop); |
262 |
val concl_props = $$$ "concl" |-- !!! is_props; |
|
7418 | 263 |
val any_props = concl_props >> pair [] || is_props -- Scan.optional concl_props []; |
6935 | 264 |
|
265 |
val propp = prop -- Scan.optional ($$$ "(" |-- !!! (any_props --| $$$ ")")) ([], []); |
|
12047 | 266 |
val propp' = prop -- Scan.optional ($$$ "(" |-- !!! (is_props --| $$$ ")")) []; |
6949 | 267 |
val termp = term -- Scan.optional ($$$ "(" |-- !!! (is_terms --| $$$ ")")) []; |
6935 | 268 |
|
269 |
||
5826 | 270 |
(* arguments *) |
271 |
||
9131 | 272 |
fun keyword_symid is_symid = Scan.one (T.keyword_with is_symid) >> T.val_of; |
273 |
val keyword_sid = keyword_symid T.is_sid; |
|
5826 | 274 |
|
6983 | 275 |
fun atom_arg is_symid blk = |
5826 | 276 |
group "argument" |
7477 | 277 |
(position (short_ident || long_ident || sym_ident || term_var || |
15703 | 278 |
type_ident || type_var || number) >> Args.mk_ident || |
279 |
position (keyword_symid is_symid) >> Args.mk_keyword || |
|
280 |
position (string || verbatim) >> Args.mk_string || |
|
281 |
position (if blk then $$$ "," else Scan.fail) >> Args.mk_keyword); |
|
5826 | 282 |
|
5877 | 283 |
fun paren_args l r scan = position ($$$ l) -- !!! (scan true -- position ($$$ r)) |
15703 | 284 |
>> (fn (x, (ys, z)) => Args.mk_keyword x :: ys @ [Args.mk_keyword z]); |
5826 | 285 |
|
6983 | 286 |
fun args is_symid blk x = Scan.optional (args1 is_symid blk) [] x |
287 |
and args1 is_symid blk x = |
|
5826 | 288 |
((Scan.repeat1 |
6983 | 289 |
(Scan.repeat1 (atom_arg is_symid blk) || |
290 |
paren_args "(" ")" (args is_symid) || |
|
15570 | 291 |
paren_args "[" "]" (args is_symid))) >> List.concat) x; |
5826 | 292 |
|
9131 | 293 |
val arguments = args T.is_sid false; |
294 |
||
5826 | 295 |
|
6372 | 296 |
(* theorem specifications *) |
5826 | 297 |
|
9131 | 298 |
val attrib = position ((keyword_sid || xname) -- !!! arguments) >> Args.src; |
5826 | 299 |
val attribs = $$$ "[" |-- !!! (list attrib --| $$$ "]"); |
300 |
val opt_attribs = Scan.optional attribs []; |
|
301 |
||
6398 | 302 |
fun thm_name s = name -- opt_attribs --| $$$ s; |
6511 | 303 |
fun opt_thm_name s = |
304 |
Scan.optional ((name -- opt_attribs || (attribs >> pair "")) --| $$$ s) ("", []);; |
|
5917 | 305 |
|
6372 | 306 |
val spec_name = thm_name ":" -- prop >> (fn ((x, y), z) => ((x, z), y)); |
307 |
val spec_opt_name = opt_thm_name ":" -- prop >> (fn ((x, y), z) => ((x, z), y)); |
|
308 |
||
15456
956d6acacf89
Specific theorems in a named list of theorems can now be referred to
berghofe
parents:
15206
diff
changeset
|
309 |
val thm_sel = $$$ "(" |-- list1 |
15703 | 310 |
(nat --| minus -- nat >> PureThy.FromTo || |
311 |
nat --| minus >> PureThy.From || |
|
312 |
nat >> PureThy.Single) --| $$$ ")"; |
|
15456
956d6acacf89
Specific theorems in a named list of theorems can now be referred to
berghofe
parents:
15206
diff
changeset
|
313 |
|
16498 | 314 |
val xthm = (xname -- thm_sel >> NameSelection || xname >> Name) -- opt_attribs; |
6372 | 315 |
val xthms1 = Scan.repeat1 xthm; |
5826 | 316 |
|
317 |
||
12047 | 318 |
(* locale elements *) |
319 |
||
12272 | 320 |
local |
321 |
||
15531 | 322 |
val loc_mixfix = $$$ "(" -- $$$ "structure" -- !!! ($$$ ")") >> K NONE || opt_mixfix >> SOME; |
16169
b59202511b8a
Locales: new element constrains, parameter renaming with syntax,
ballarin
parents:
16102
diff
changeset
|
323 |
val loc_keyword = $$$ "fixes" || $$$ "constrains" || $$$ "assumes" || |
b59202511b8a
Locales: new element constrains, parameter renaming with syntax,
ballarin
parents:
16102
diff
changeset
|
324 |
$$$ "defines" || $$$ "notes" || $$$ "includes"; |
12272 | 325 |
|
15127 | 326 |
val loc_element = |
327 |
$$$ "fixes" |-- !!! (and_list1 (name -- Scan.option ($$$ "::" |-- typ) -- loc_mixfix |
|
328 |
>> triple1)) >> Locale.Fixes || |
|
16169
b59202511b8a
Locales: new element constrains, parameter renaming with syntax,
ballarin
parents:
16102
diff
changeset
|
329 |
$$$ "constrains" |-- !!! (and_list1 (name -- ($$$ "::" |-- typ))) |
b59202511b8a
Locales: new element constrains, parameter renaming with syntax,
ballarin
parents:
16102
diff
changeset
|
330 |
>> Locale.Constrains || |
15127 | 331 |
$$$ "assumes" |-- !!! (and_list1 (opt_thm_name ":" -- Scan.repeat1 propp)) |
332 |
>> Locale.Assumes || |
|
333 |
$$$ "defines" |-- !!! (and_list1 (opt_thm_name ":" -- propp')) |
|
334 |
>> Locale.Defines || |
|
335 |
$$$ "notes" |-- !!! (and_list1 (opt_thm_name "=" -- xthms1)) |
|
336 |
>> Locale.Notes; |
|
337 |
||
12272 | 338 |
fun plus1 scan = |
339 |
scan -- Scan.repeat ($$$ "+" |-- Scan.unless loc_keyword (!!! scan)) >> op ::; |
|
340 |
||
16102
c5f6726d9bb1
Locale expressions: rename with optional mixfix syntax.
ballarin
parents:
16030
diff
changeset
|
341 |
val rename = name -- Scan.option mixfix'; |
c5f6726d9bb1
Locale expressions: rename with optional mixfix syntax.
ballarin
parents:
16030
diff
changeset
|
342 |
|
12268 | 343 |
fun expr2 x = (xname >> Locale.Locale || $$$ "(" |-- !!! (expr0 --| $$$ ")")) x |
16102
c5f6726d9bb1
Locale expressions: rename with optional mixfix syntax.
ballarin
parents:
16030
diff
changeset
|
344 |
and expr1 x = (expr2 -- Scan.repeat1 (maybe rename) >> Locale.Rename || expr2) x |
12272 | 345 |
and expr0 x = (plus1 expr1 >> (fn [e] => e | es => Locale.Merge es)) x; |
12268 | 346 |
|
12272 | 347 |
in |
348 |
||
16736
1e792b32abef
Preparations for interpretation of locales in locales.
ballarin
parents:
16498
diff
changeset
|
349 |
val locale_target = ($$$ "(" -- $$$ "in") |-- !!! (xname --| $$$ ")"); |
1e792b32abef
Preparations for interpretation of locales in locales.
ballarin
parents:
16498
diff
changeset
|
350 |
val opt_locale_target = Scan.option locale_target; |
12272 | 351 |
val locale_expr = expr0; |
12942 | 352 |
val locale_keyword = loc_keyword; |
12047 | 353 |
|
15127 | 354 |
val locale_element = group "locale element" loc_element; |
355 |
||
356 |
val locale_elem_or_expr = group "locale element or includes" |
|
357 |
(loc_element >> Locale.Elem || |
|
12955 | 358 |
$$$ "includes" |-- !!! locale_expr >> Locale.Expr); |
12272 | 359 |
|
360 |
end; |
|
12047 | 361 |
|
362 |
||
5826 | 363 |
(* proof methods *) |
364 |
||
6983 | 365 |
fun is_symid_meth s = |
9131 | 366 |
s <> "|" andalso s <> "?" andalso s <> "+" andalso T.is_sid s; |
6983 | 367 |
|
5826 | 368 |
fun meth4 x = |
5877 | 369 |
(position (xname >> rpair []) >> (Method.Source o Args.src) || |
6983 | 370 |
$$$ "(" |-- !!! (meth0 --| $$$ ")")) x |
5826 | 371 |
and meth3 x = |
372 |
(meth4 --| $$$ "?" >> Method.Try || |
|
373 |
meth4 --| $$$ "+" >> Method.Repeat1 || |
|
5940 | 374 |
meth4) x |
375 |
and meth2 x = |
|
6983 | 376 |
(position (xname -- args1 is_symid_meth false) >> (Method.Source o Args.src) || |
5826 | 377 |
meth3) x |
378 |
and meth1 x = (enum1 "," meth2 >> (fn [m] => m | ms => Method.Then ms)) x |
|
379 |
and meth0 x = (enum1 "|" meth1 >> (fn [m] => m | ms => Method.Orelse ms)) x; |
|
380 |
||
6558 | 381 |
val method = meth3; |
5826 | 382 |
|
383 |
||
384 |
end; |