src/Pure/Thy/thy_syntax.ML
changeset 55744 4a4e5686e091
parent 55708 f4b114070675
child 55828 42ac3cfb89f6
     1.1 --- a/src/Pure/Thy/thy_syntax.ML	Tue Feb 25 14:56:58 2014 +0100
     1.2 +++ b/src/Pure/Thy/thy_syntax.ML	Tue Feb 25 17:03:55 2014 +0100
     1.3 @@ -42,41 +42,6 @@
     1.4  
     1.5  local
     1.6  
     1.7 -val token_kind_markup =
     1.8 - fn Token.Command       => (Markup.command, "")
     1.9 -  | Token.Keyword       => (Markup.keyword, "")
    1.10 -  | Token.Ident         => (Markup.empty, "")
    1.11 -  | Token.LongIdent     => (Markup.empty, "")
    1.12 -  | Token.SymIdent      => (Markup.empty, "")
    1.13 -  | Token.Var           => (Markup.var, "")
    1.14 -  | Token.TypeIdent     => (Markup.tfree, "")
    1.15 -  | Token.TypeVar       => (Markup.tvar, "")
    1.16 -  | Token.Nat           => (Markup.empty, "")
    1.17 -  | Token.Float         => (Markup.empty, "")
    1.18 -  | Token.String        => (Markup.string, "")
    1.19 -  | Token.AltString     => (Markup.altstring, "")
    1.20 -  | Token.Verbatim      => (Markup.verbatim, "")
    1.21 -  | Token.Cartouche     => (Markup.cartouche, "")
    1.22 -  | Token.Space         => (Markup.empty, "")
    1.23 -  | Token.Comment       => (Markup.comment, "")
    1.24 -  | Token.InternalValue => (Markup.empty, "")
    1.25 -  | Token.Error msg     => (Markup.bad, msg)
    1.26 -  | Token.Sync          => (Markup.control, "")
    1.27 -  | Token.EOF           => (Markup.control, "");
    1.28 -
    1.29 -fun token_markup tok =
    1.30 -  if Token.keyword_with (not o Symbol.is_ascii_identifier) tok
    1.31 -  then (Markup.operator, "")
    1.32 -  else
    1.33 -    let
    1.34 -      val kind = Token.kind_of tok;
    1.35 -      val props =
    1.36 -        if kind = Token.Command
    1.37 -        then Markup.properties [(Markup.nameN, Token.content_of tok)]
    1.38 -        else I;
    1.39 -      val (markup, txt) = token_kind_markup kind;
    1.40 -    in (props markup, txt) end;
    1.41 -
    1.42  fun reports_of_token tok =
    1.43    let
    1.44      val malformed_symbols =
    1.45 @@ -85,7 +50,7 @@
    1.46            if Symbol.is_malformed sym
    1.47            then SOME ((pos, Markup.bad), "Malformed symbolic character") else NONE);
    1.48      val is_malformed = Token.is_error tok orelse not (null malformed_symbols);
    1.49 -    val (markup, txt) = token_markup tok;
    1.50 +    val (markup, txt) = Token.markup tok;
    1.51      val reports = ((Token.pos_of tok, markup), txt) :: malformed_symbols;
    1.52    in (is_malformed, reports) end;
    1.53  
    1.54 @@ -96,7 +61,7 @@
    1.55    in (exists fst results, maps snd results) end;
    1.56  
    1.57  fun present_token tok =
    1.58 -  Markup.enclose (fst (token_markup tok)) (Output.output (Token.unparse tok));
    1.59 +  Markup.enclose (fst (Token.markup tok)) (Output.output (Token.unparse tok));
    1.60  
    1.61  end;
    1.62