src/Pure/Isar/outer_parse.ML
changeset 6511 11b07125422e
parent 6430 69400c97d3bf
child 6553 dc962d157a63
equal deleted inserted replaced
6510:b5ef6d115b45 6511:11b07125422e
   242 val attrib = position (xname -- !!! (args false)) >> Args.src;
   242 val attrib = position (xname -- !!! (args false)) >> Args.src;
   243 val attribs = $$$ "[" |-- !!! (list attrib --| $$$ "]");
   243 val attribs = $$$ "[" |-- !!! (list attrib --| $$$ "]");
   244 val opt_attribs = Scan.optional attribs [];
   244 val opt_attribs = Scan.optional attribs [];
   245 
   245 
   246 fun thm_name s = name -- opt_attribs --| $$$ s;
   246 fun thm_name s = name -- opt_attribs --| $$$ s;
   247 fun opt_thm_name s = Scan.optional (thm_name s) ("", []);
   247 fun opt_thm_name s =
       
   248   Scan.optional ((name -- opt_attribs || (attribs >> pair "")) --| $$$ s) ("", []);;
   248 
   249 
   249 val spec_name = thm_name ":" -- prop >> (fn ((x, y), z) => ((x, z), y));
   250 val spec_name = thm_name ":" -- prop >> (fn ((x, y), z) => ((x, z), y));
   250 val spec_opt_name = opt_thm_name ":" -- prop >> (fn ((x, y), z) => ((x, z), y));
   251 val spec_opt_name = opt_thm_name ":" -- prop >> (fn ((x, y), z) => ((x, z), y));
   251 
   252 
   252 val xthm = xname -- opt_attribs;
   253 val xthm = xname -- opt_attribs;