src/Pure/General/symbol.ML
changeset 16002 e0557c452138
parent 15979 c81578ac2d31
child 16138 727c5e32930e
equal deleted inserted replaced
16001:554836ed1f1b 16002:e0557c452138
   340     if is_ascii_letter s then Letter
   340     if is_ascii_letter s then Letter
   341     else if is_ascii_digit s then Digit
   341     else if is_ascii_digit s then Digit
   342     else if is_ascii_quasi s then Quasi
   342     else if is_ascii_quasi s then Quasi
   343     else if is_ascii_blank s then Blank
   343     else if is_ascii_blank s then Blank
   344     else if is_char s then Other
   344     else if is_char s then Other
   345     else getOpt (Symtab.lookup (symbol_kinds, s), Other);
   345     else if_none (Symtab.lookup (symbol_kinds, s)) Other;
   346 end;
   346 end;
   347 
   347 
   348 fun is_letter s = kind s = Letter;
   348 fun is_letter s = kind s = Letter;
   349 fun is_digit s = kind s = Digit;
   349 fun is_digit s = kind s = Digit;
   350 fun is_quasi s = kind s = Quasi;
   350 fun is_quasi s = kind s = Quasi;
   415   | no_explode (_ :: cs) = no_explode cs;
   415   | no_explode (_ :: cs) = no_explode cs;
   416 
   416 
   417 fun sym_explode str =
   417 fun sym_explode str =
   418   let val chs = explode str in
   418   let val chs = explode str in
   419     if no_explode chs then chs
   419     if no_explode chs then chs
   420     else valOf (Scan.read stopper (Scan.repeat scan) chs)
   420     else the (Scan.read stopper (Scan.repeat scan) chs)
   421   end;
   421   end;
   422 
   422 
   423 val chars_only = not o exists_string (equal "\\");
   423 val chars_only = not o exists_string (equal "\\");
   424 
   424 
   425 
   425