src/Pure/Syntax/lexicon.ML
changeset 44736 c2a3f1c84179
parent 44706 fe319b45315c
child 45666 d83797ef0d2d
equal deleted inserted replaced
44735:66862d02678c 44736:c2a3f1c84179
    42   val varT: typ
    42   val varT: typ
    43   val tidT: typ
    43   val tidT: typ
    44   val tvarT: typ
    44   val tvarT: typ
    45   val terminals: string list
    45   val terminals: string list
    46   val is_terminal: string -> bool
    46   val is_terminal: string -> bool
    47   val report_token: Proof.context -> token -> unit
    47   val report_of_token: token -> Position.report
    48   val reported_token_range: Proof.context -> token -> string
    48   val reported_token_range: Proof.context -> token -> string
    49   val matching_tokens: token * token -> bool
    49   val matching_tokens: token * token -> bool
    50   val valued_token: token -> bool
    50   val valued_token: token -> bool
    51   val predef_term: string -> token option
    51   val predef_term: string -> token option
    52   val implode_xstr: string list -> string
    52   val implode_xstr: string list -> string
   201   | StrSy       => Markup.inner_string
   201   | StrSy       => Markup.inner_string
   202   | Space       => Markup.empty
   202   | Space       => Markup.empty
   203   | Comment     => Markup.inner_comment
   203   | Comment     => Markup.inner_comment
   204   | EOF         => Markup.empty;
   204   | EOF         => Markup.empty;
   205 
   205 
   206 fun report_token ctxt (Token (kind, s, (pos, _))) =
   206 fun report_of_token (Token (kind, s, (pos, _))) =
   207   let val markup =
   207   let val markup =
   208     if kind = Literal andalso not (is_ascii_identifier s) then Markup.delimiter
   208     if kind = Literal andalso not (is_ascii_identifier s) then Markup.delimiter
   209     else token_kind_markup kind
   209     else token_kind_markup kind
   210   in Context_Position.report ctxt pos markup end;
   210   in (pos, markup) end;
   211 
   211 
   212 fun reported_token_range ctxt tok =
   212 fun reported_token_range ctxt tok =
   213   if is_proper tok
   213   if is_proper tok
   214   then Context_Position.reported_text ctxt (pos_of_token tok) Markup.token_range ""
   214   then Context_Position.reported_text ctxt (pos_of_token tok) Markup.token_range ""
   215   else "";
   215   else "";