src/Pure/General/position.ML
changeset 68172 0f14cf9c632f
parent 67280 dfc5a1503916
child 68177 6e40f5d43936
equal deleted inserted replaced
68171:13162bb3a677 68172:0f14cf9c632f
    30   val get_id: T -> string option
    30   val get_id: T -> string option
    31   val put_id: string -> T -> T
    31   val put_id: string -> T -> T
    32   val parse_id: T -> int option
    32   val parse_id: T -> int option
    33   val of_properties: Properties.T -> T
    33   val of_properties: Properties.T -> T
    34   val properties_of: T -> Properties.T
    34   val properties_of: T -> Properties.T
       
    35   val offset_properties_of: T -> Properties.T
    35   val def_properties_of: T -> Properties.T
    36   val def_properties_of: T -> Properties.T
    36   val entity_properties_of: bool -> serial -> T -> Properties.T
    37   val entity_properties_of: bool -> serial -> T -> Properties.T
    37   val default_properties: T -> Properties.T -> Properties.T
    38   val default_properties: T -> Properties.T -> Properties.T
    38   val markup: T -> Markup.T -> Markup.T
    39   val markup: T -> Markup.T -> Markup.T
    39   val is_reported: T -> bool
    40   val is_reported: T -> bool
   159 fun value k i = if valid i then [(k, Value.print_int i)] else [];
   160 fun value k i = if valid i then [(k, Value.print_int i)] else [];
   160 
   161 
   161 fun properties_of (Pos ((i, j, k), props)) =
   162 fun properties_of (Pos ((i, j, k), props)) =
   162   value Markup.lineN i @ value Markup.offsetN j @ value Markup.end_offsetN k @ props;
   163   value Markup.lineN i @ value Markup.offsetN j @ value Markup.end_offsetN k @ props;
   163 
   164 
       
   165 fun offset_properties_of (Pos ((_, j, k), _)) =
       
   166   value Markup.offsetN j @ value Markup.end_offsetN k;
       
   167 
   164 val def_properties_of = properties_of #> map (fn (x, y) => ("def_" ^ x, y));
   168 val def_properties_of = properties_of #> map (fn (x, y) => ("def_" ^ x, y));
   165 
   169 
   166 fun entity_properties_of def serial pos =
   170 fun entity_properties_of def serial pos =
   167   if def then (Markup.defN, Value.print_int serial) :: properties_of pos
   171   if def then (Markup.defN, Value.print_int serial) :: properties_of pos
   168   else (Markup.refN, Value.print_int serial) :: def_properties_of pos;
   172   else (Markup.refN, Value.print_int serial) :: def_properties_of pos;