src/Pure/ML/ml_parse.ML
changeset 48992 0518bf89c777
parent 48911 5debc3e4fa81
child 58864 505a8150368a
equal deleted inserted replaced
48991:0350245dec1c 48992:0518bf89c777
    16 (** error handling **)
    16 (** error handling **)
    17 
    17 
    18 fun !!! scan =
    18 fun !!! scan =
    19   let
    19   let
    20     fun get_pos [] = " (end-of-input)"
    20     fun get_pos [] = " (end-of-input)"
    21       | get_pos (tok :: _) = Position.str_of (ML_Lex.pos_of tok);
    21       | get_pos (tok :: _) = Position.here (ML_Lex.pos_of tok);
    22 
    22 
    23     fun err (toks, NONE) = (fn () => "SML syntax error" ^ get_pos toks)
    23     fun err (toks, NONE) = (fn () => "SML syntax error" ^ get_pos toks)
    24       | err (toks, SOME msg) = (fn () => "SML syntax error" ^ get_pos toks ^ ": " ^ msg ());
    24       | err (toks, SOME msg) = (fn () => "SML syntax error" ^ get_pos toks ^ ": " ^ msg ());
    25   in Scan.!! err scan end;
    25   in Scan.!! err scan end;
    26 
    26 
    65 (* global use_context *)
    65 (* global use_context *)
    66 
    66 
    67 val global_context: use_context =
    67 val global_context: use_context =
    68  {tune_source = fix_ints,
    68  {tune_source = fix_ints,
    69   name_space = ML_Name_Space.global,
    69   name_space = ML_Name_Space.global,
    70   str_of_pos = Position.str_of oo Position.line_file,
    70   str_of_pos = Position.here oo Position.line_file,
    71   print = writeln,
    71   print = writeln,
    72   error = error};
    72   error = error};
    73 
    73 
    74 end;
    74 end;