src/Pure/Isar/outer_syntax.scala
changeset 64616 dc3ec40fe41b
parent 63867 fb46c031c841
child 65383 089f2edefb77
equal deleted inserted replaced
64615:fd0d6de380c6 64616:dc3ec40fe41b
   152             case None => Command_Span.Malformed_Span
   152             case None => Command_Span.Malformed_Span
   153             case Some(cmd) =>
   153             case Some(cmd) =>
   154               val name = cmd.source
   154               val name = cmd.source
   155               val offset =
   155               val offset =
   156                 (0 /: span.takeWhile(_ != cmd)) {
   156                 (0 /: span.takeWhile(_ != cmd)) {
   157                   case (i, tok) => i + Symbol.iterator(tok.source).length }
   157                   case (i, tok) => i + Symbol.length(tok.source) }
   158               val end_offset = offset + Symbol.iterator(name).length
   158               val end_offset = offset + Symbol.length(name)
   159               val pos = Position.Range(Text.Range(offset, end_offset) + 1)
   159               val pos = Position.Range(Text.Range(offset, end_offset) + 1)
   160               Command_Span.Command_Span(name, pos)
   160               Command_Span.Command_Span(name, pos)
   161           }
   161           }
   162       result += Command_Span.Span(kind, span)
   162       result += Command_Span.Span(kind, span)
   163     }
   163     }