src/HOL/HOLCF/Tools/fixrec.ML
changeset 47089 29e92b644d6c
parent 46961 5c6955f487e5
child 47432 e1576d13e933
equal deleted inserted replaced
47088:eba1cea4eef6 47089:29e92b644d6c
   397 val spec' : (bool * (Attrib.binding * string)) parser =
   397 val spec' : (bool * (Attrib.binding * string)) parser =
   398   opt_thm_name' -- Parse.prop >> (fn ((a, b), c) => (a, (b, c)))
   398   opt_thm_name' -- Parse.prop >> (fn ((a, b), c) => (a, (b, c)))
   399 
   399 
   400 val alt_specs' : (bool * (Attrib.binding * string)) list parser =
   400 val alt_specs' : (bool * (Attrib.binding * string)) list parser =
   401   let val unexpected = Scan.ahead (Parse.name || @{keyword "["} || @{keyword "("})
   401   let val unexpected = Scan.ahead (Parse.name || @{keyword "["} || @{keyword "("})
   402   in Parse.enum1 "|" (spec' --| Scan.option (unexpected -- Parse.!!! (@{keyword "|"}))) end
   402   in Parse.enum1 "|" (spec' --| Scan.option (unexpected -- Parse.!!! @{keyword "|"})) end
   403 
   403 
   404 val _ =
   404 val _ =
   405   Outer_Syntax.local_theory @{command_spec "fixrec"} "define recursive functions (HOLCF)"
   405   Outer_Syntax.local_theory @{command_spec "fixrec"} "define recursive functions (HOLCF)"
   406     (Parse.fixes -- (Parse.where_ |-- Parse.!!! alt_specs')
   406     (Parse.fixes -- (Parse.where_ |-- Parse.!!! alt_specs')
   407       >> (fn (fixes, specs) => add_fixrec_cmd fixes specs))
   407       >> (fn (fixes, specs) => add_fixrec_cmd fixes specs))