src/HOL/Tools/string_code.ML
changeset 67620 3817a93a3e5e
parent 62597 b3f2b8c906a6
equal deleted inserted replaced
67619:37ba3d234fbf 67620:3817a93a3e5e
    19 fun decode_char_nonzero t =
    19 fun decode_char_nonzero t =
    20   case Numeral.dest_num t of
    20   case Numeral.dest_num t of
    21     SOME n => if 0 < n andalso n < 256 then SOME n else NONE
    21     SOME n => if 0 < n andalso n < 256 then SOME n else NONE
    22   | _ => NONE;
    22   | _ => NONE;
    23 
    23 
    24 fun decode_char (IConst { sym = Code_Symbol.Constant @{const_name Groups.zero}, ... }) =
    24 fun decode_char (IConst { sym = Code_Symbol.Constant @{const_name String.zero_char_inst.zero_char}, ... }) =
    25      SOME 0
    25      SOME 0
    26   | decode_char (IConst { sym = Code_Symbol.Constant @{const_name Char}, ... } `$ t) =
    26   | decode_char (IConst { sym = Code_Symbol.Constant @{const_name Char}, ... } `$ t) =
    27       decode_char_nonzero t
    27       decode_char_nonzero t
    28   | decode_char _ = NONE
    28   | decode_char _ = NONE
    29 
    29