src/Tools/Code/code_thingol.ML
changeset 33969 1e7ca47c6c3d
parent 33957 e9afca2118d4
child 33972 daf65be6bfe5
equal deleted inserted replaced
33968:f94fb13ecbb3 33969:1e7ca47c6c3d
   928           | NONE => thy;
   928           | NONE => thy;
   929         val cs = Symtab.fold (fn (c, (_, NONE)) => cons c | _ => I)
   929         val cs = Symtab.fold (fn (c, (_, NONE)) => cons c | _ => I)
   930           ((snd o #constants o Consts.dest o #consts o Sign.rep_sg) thy') [];
   930           ((snd o #constants o Consts.dest o #consts o Sign.rep_sg) thy') [];
   931         fun belongs_here c =
   931         fun belongs_here c =
   932           not (exists (fn thy'' => Sign.declared_const thy'' c) (Theory.parents_of thy'))
   932           not (exists (fn thy'' => Sign.declared_const thy'' c) (Theory.parents_of thy'))
   933       in case some_thyname
   933       in if is_some some_thyname then cs else filter belongs_here cs end;
   934        of NONE => cs
       
   935         | SOME thyname => filter belongs_here cs
       
   936       end;
       
   937     fun read_const_expr "*" = ([], consts_of NONE)
   934     fun read_const_expr "*" = ([], consts_of NONE)
   938       | read_const_expr s = if String.isSuffix ".*" s
   935       | read_const_expr s = if String.isSuffix ".*" s
   939           then ([], consts_of (SOME (unsuffix ".*" s)))
   936           then ([], consts_of (SOME (unsuffix ".*" s)))
   940           else ([Code.read_const thy s], []);
   937           else ([Code.read_const thy s], []);
   941   in pairself flat o split_list o map read_const_expr end;
   938   in pairself flat o split_list o map read_const_expr end;