102 (* markup *) |
102 (* markup *) |
103 |
103 |
104 local |
104 local |
105 |
105 |
106 val token_kind_markup = |
106 val token_kind_markup = |
107 fn Keyword => Markup.ML_keyword |
107 fn Keyword => Isabelle_Markup.ML_keyword |
108 | Ident => Markup.empty |
108 | Ident => Markup.empty |
109 | LongIdent => Markup.empty |
109 | LongIdent => Markup.empty |
110 | TypeVar => Markup.ML_tvar |
110 | TypeVar => Isabelle_Markup.ML_tvar |
111 | Word => Markup.ML_numeral |
111 | Word => Isabelle_Markup.ML_numeral |
112 | Int => Markup.ML_numeral |
112 | Int => Isabelle_Markup.ML_numeral |
113 | Real => Markup.ML_numeral |
113 | Real => Isabelle_Markup.ML_numeral |
114 | Char => Markup.ML_char |
114 | Char => Isabelle_Markup.ML_char |
115 | String => Markup.ML_string |
115 | String => Isabelle_Markup.ML_string |
116 | Space => Markup.empty |
116 | Space => Markup.empty |
117 | Comment => Markup.ML_comment |
117 | Comment => Isabelle_Markup.ML_comment |
118 | Error _ => Markup.ML_malformed |
118 | Error _ => Isabelle_Markup.ML_malformed |
119 | EOF => Markup.empty; |
119 | EOF => Markup.empty; |
120 |
120 |
121 fun token_markup kind x = |
121 fun token_markup kind x = |
122 if kind = Keyword andalso exists_string (not o Symbol.is_ascii_letter) x |
122 if kind = Keyword andalso exists_string (not o Symbol.is_ascii_letter) x |
123 then Markup.ML_delimiter |
123 then Isabelle_Markup.ML_delimiter |
124 else token_kind_markup kind; |
124 else token_kind_markup kind; |
125 |
125 |
126 in |
126 in |
127 |
127 |
128 fun report_of_token (Token ((pos, _), (kind, x))) = (pos, token_markup kind x); |
128 fun report_of_token (Token ((pos, _), (kind, x))) = (pos, token_markup kind x); |