src/Pure/Isar/outer_lex.ML
changeset 8580 e79ee31d3936
parent 8231 fa93309ff27e
child 8651 f095f3b8181a
equal deleted inserted replaced
8579:81ef0fc80822 8580:e79ee31d3936
    19   val pos_of: token -> string
    19   val pos_of: token -> string
    20   val is_kind: token_kind -> token -> bool
    20   val is_kind: token_kind -> token -> bool
    21   val keyword_with: (string -> bool) -> token -> bool
    21   val keyword_with: (string -> bool) -> token -> bool
    22   val name_of: token -> string
    22   val name_of: token -> string
    23   val is_proper: token -> bool
    23   val is_proper: token -> bool
       
    24   val is_begin_ignore: token -> bool
       
    25   val is_end_ignore: token -> bool
    24   val is_indent: token -> bool
    26   val is_indent: token -> bool
    25   val val_of: token -> string
    27   val val_of: token -> string
    26   val is_sid: string -> bool
    28   val is_sid: string -> bool
    27   val scan: (Scan.lexicon * Scan.lexicon) ->
    29   val scan: (Scan.lexicon * Scan.lexicon) ->
    28     Position.T * Symbol.symbol list -> token * (Position.T * Symbol.symbol list)
    30     Position.T * Symbol.symbol list -> token * (Position.T * Symbol.symbol list)
    96 fun name_of (Token (_, (k, _))) = str_of_kind k;
    98 fun name_of (Token (_, (k, _))) = str_of_kind k;
    97 
    99 
    98 fun is_proper (Token (_, (Space, _))) = false
   100 fun is_proper (Token (_, (Space, _))) = false
    99   | is_proper (Token (_, (Comment, _))) = false
   101   | is_proper (Token (_, (Comment, _))) = false
   100   | is_proper _ = true;
   102   | is_proper _ = true;
       
   103 
       
   104 fun is_begin_ignore (Token (_, (Comment, "<"))) = true
       
   105   | is_begin_ignore _ = false;
       
   106 
       
   107 fun is_end_ignore (Token (_, (Comment, ">"))) = true
       
   108   | is_end_ignore _ = false;
   101 
   109 
   102 (*indentations; note that space tokens obey lines*)
   110 (*indentations; note that space tokens obey lines*)
   103 fun is_indent (Token (_, (Space, s))) =
   111 fun is_indent (Token (_, (Space, s))) =
   104       let val n = size s in n > 0 andalso String.substring (s, n - 1, 1) <> "\n" end
   112       let val n = size s in n > 0 andalso String.substring (s, n - 1, 1) <> "\n" end
   105   | is_indent _ = false;
   113   | is_indent _ = false;