src/Pure/Isar/outer_parse.ML
changeset 7418 87c12d352bab
parent 7352 d98001b492b3
child 7477 c7caea1ce78c
equal deleted inserted replaced
7417:70c1d3eac214 7418:87c12d352bab
   231 (* patterns *)
   231 (* patterns *)
   232 
   232 
   233 val is_terms = Scan.repeat1 ($$$ "is" |-- term);
   233 val is_terms = Scan.repeat1 ($$$ "is" |-- term);
   234 val is_props = Scan.repeat1 ($$$ "is" |-- prop);
   234 val is_props = Scan.repeat1 ($$$ "is" |-- prop);
   235 val concl_props = $$$ "concl" |-- !!! is_props;
   235 val concl_props = $$$ "concl" |-- !!! is_props;
   236 val any_props = is_props -- Scan.optional concl_props [] || concl_props >> pair [];
   236 val any_props = concl_props >> pair [] || is_props -- Scan.optional concl_props [];
   237 
   237 
   238 val propp = prop -- Scan.optional ($$$ "(" |-- !!! (any_props --| $$$ ")")) ([], []);
   238 val propp = prop -- Scan.optional ($$$ "(" |-- !!! (any_props --| $$$ ")")) ([], []);
   239 val termp = term -- Scan.optional ($$$ "(" |-- !!! (is_terms --| $$$ ")")) [];
   239 val termp = term -- Scan.optional ($$$ "(" |-- !!! (is_terms --| $$$ ")")) [];
   240 
   240 
   241 
   241 
   281 
   281 
   282 
   282 
   283 (* proof methods *)
   283 (* proof methods *)
   284 
   284 
   285 fun is_symid_meth s =
   285 fun is_symid_meth s =
   286   s <> "|" andalso s <> "?" andalso s <> "*" andalso s <> "+" andalso OuterLex.is_sid s;
   286   s <> "|" andalso s <> "?" andalso s <> "+" andalso OuterLex.is_sid s;
   287 
   287 
   288 fun meth4 x =
   288 fun meth4 x =
   289  (position (xname >> rpair []) >> (Method.Source o Args.src) ||
   289  (position (xname >> rpair []) >> (Method.Source o Args.src) ||
   290   $$$ "(" |-- !!! (meth0 --| $$$ ")")) x
   290   $$$ "(" |-- !!! (meth0 --| $$$ ")")) x
   291 and meth3 x =
   291 and meth3 x =
   292  (meth4 --| $$$ "?" >> Method.Try ||
   292  (meth4 --| $$$ "?" >> Method.Try ||
   293   meth4 --| $$$ "*" >> Method.Repeat ||
       
   294   meth4 --| $$$ "+" >> Method.Repeat1 ||
   293   meth4 --| $$$ "+" >> Method.Repeat1 ||
   295   meth4) x
   294   meth4) x
   296 and meth2 x =
   295 and meth2 x =
   297  (position (xname -- args1 is_symid_meth false) >> (Method.Source o Args.src) ||
   296  (position (xname -- args1 is_symid_meth false) >> (Method.Source o Args.src) ||
   298   meth3) x
   297   meth3) x