src/Pure/Syntax/syntax_phases.ML
changeset 81250 08e0d3f248f9
parent 81238 a8502d492dde
child 81251 89ea66c2045b
equal deleted inserted replaced
81249:389f315f8c24 81250:08e0d3f248f9
   171     fun report_pos tok =
   171     fun report_pos tok =
   172       if Lexicon.is_literal tok andalso null (Lexicon.literal_markup (Lexicon.str_of_token tok))
   172       if Lexicon.is_literal tok andalso null (Lexicon.literal_markup (Lexicon.str_of_token tok))
   173       then Position.none else Lexicon.pos_of_token tok;
   173       then Position.none else Lexicon.pos_of_token tok;
   174 
   174 
   175     val markup_cache = markup_entity_cache ctxt;
   175     val markup_cache = markup_entity_cache ctxt;
   176 
       
   177     fun report_literals a ts = List.app (report_literal a) ts
       
   178     and report_literal a t =
       
   179       (case t of
       
   180         Parser.Markup (_, ts) => report_literals a ts
       
   181       | Parser.Node _ => ()
       
   182       | Parser.Tip tok =>
       
   183           if Lexicon.is_literal tok then report (report_pos tok) markup_cache a else ());
       
   184 
   176 
   185     val ast_of_pos = Ast.Variable o Term_Position.encode;
   177     val ast_of_pos = Ast.Variable o Term_Position.encode;
   186     val ast_of_position = ast_of_pos o single o report_pos;
   178     val ast_of_position = ast_of_pos o single o report_pos;
   187     fun ast_of_position' a = Ast.constrain (Ast.Constant a) o ast_of_position;
   179     fun ast_of_position' a = Ast.constrain (Ast.Constant a) o ast_of_position;
   188 
   180