eliminated non-canonical alias structure T = ML_Lex;
authorwenzelm
Tue Mar 24 11:39:25 2009 +0100 (2009-03-24 ago)
changeset 30682dcb233670c98
parent 30681 27ee3f4ea99c
child 30683 e8ac1f9d9469
eliminated non-canonical alias structure T = ML_Lex;
src/Pure/ML/ml_parse.ML
     1.1 --- a/src/Pure/ML/ml_parse.ML	Tue Mar 24 00:36:32 2009 +0100
     1.2 +++ b/src/Pure/ML/ml_parse.ML	Tue Mar 24 11:39:25 2009 +0100
     1.3 @@ -13,33 +13,32 @@
     1.4  structure ML_Parse: ML_PARSE =
     1.5  struct
     1.6  
     1.7 -structure T = ML_Lex;
     1.8 -
     1.9 -
    1.10  (** error handling **)
    1.11  
    1.12  fun !!! scan =
    1.13    let
    1.14      fun get_pos [] = " (past end-of-file!)"
    1.15 -      | get_pos (tok :: _) = Position.str_of (T.pos_of tok);
    1.16 +      | get_pos (tok :: _) = Position.str_of (ML_Lex.pos_of tok);
    1.17  
    1.18      fun err (toks, NONE) = "SML syntax error" ^ get_pos toks
    1.19        | err (toks, SOME msg) = "SML syntax error" ^ get_pos toks ^ ": " ^ msg;
    1.20    in Scan.!! err scan end;
    1.21  
    1.22  fun bad_input x =
    1.23 -  (Scan.some (fn tok => (case T.kind_of tok of T.Error msg => SOME msg | _ => NONE)) :|--
    1.24 +  (Scan.some (fn tok => (case ML_Lex.kind_of tok of ML_Lex.Error msg => SOME msg | _ => NONE)) :|--
    1.25      (fn msg => Scan.fail_with (K msg))) x;
    1.26  
    1.27  
    1.28  (** basic parsers **)
    1.29  
    1.30  fun $$$ x =
    1.31 -  Scan.one (fn tok => T.kind_of tok = T.Keyword andalso T.content_of tok = x) >> T.content_of;
    1.32 -val int = Scan.one (fn tok => T.kind_of tok = T.Int) >> T.content_of;
    1.33 +  Scan.one (fn tok => ML_Lex.kind_of tok = ML_Lex.Keyword andalso ML_Lex.content_of tok = x)
    1.34 +    >> ML_Lex.content_of;
    1.35  
    1.36 -val regular = Scan.one T.is_regular >> T.content_of;
    1.37 -val improper = Scan.one T.is_improper >> T.content_of;
    1.38 +val int = Scan.one (fn tok => ML_Lex.kind_of tok = ML_Lex.Int) >> ML_Lex.content_of;
    1.39 +
    1.40 +val regular = Scan.one ML_Lex.is_regular >> ML_Lex.content_of;
    1.41 +val improper = Scan.one ML_Lex.is_improper >> ML_Lex.content_of;
    1.42  
    1.43  val blanks = Scan.repeat improper >> implode;
    1.44  
    1.45 @@ -56,8 +55,8 @@
    1.46  
    1.47  fun do_fix_ints s =
    1.48    Source.of_string s
    1.49 -  |> T.source
    1.50 -  |> Source.source T.stopper (Scan.bulk (!!! fix_int)) NONE
    1.51 +  |> ML_Lex.source
    1.52 +  |> Source.source ML_Lex.stopper (Scan.bulk (!!! fix_int)) NONE
    1.53    |> Source.exhaust
    1.54    |> implode;
    1.55