anchor.diff:      override x.GetColoredSegments (segment) =
           let line = editor.GetLineByOffset segment.Offset
           match segments with
  -        | [||] -> Seq.empty
  -        | xs when xs.Length >= line.LineNumber-1 -> segments.[line.LineNumber-1] |> List.toSeq+        | xs when xs.Length >= line.LineNumber-1 -> segments.[line.LineNumber-1] |> List.toSeq
  +        | _ -> Seq.empty
positive.code:             | _ -> None
          else None
  
  
      let isPreprocessor (s:string) =
          s.StartsWith "#if" || s.StartsWith "#else" || s.StartsWith "#endif" 
  
  //    let (|StartsWithAbstractBlockSpan|ContainsAbstractBlockSpan|Other|) (spans: CloneableStack<Span>) =
  //        if spans = null || spans.Count = 0 then Other else
  //        match spans.Peek () with
  //        | :? FSharpSyntaxModeInternals.AbstractBlockSpan as abs -> StartsWithAbstractBlockSpan abs
  //        | _ -> spans.Clone()
  //               |> Seq.tryFind (fun s -> s :? FSharpSyntaxModeInternals.AbstractBlockSpan)
  //               |> function
  //                  | Some bs -> ContainsAbstractBlockSpan (bs :?> FSharpSyntaxModeInternals.AbstractBlockSpan)
  //                  | None -> Other
  
  //    let (|ExcludedCode|StringCode|CommentCode|OtherCode|PreProcessor|) (document: TextDocument, line: DocumentLine, offset, length, style: Highlighting.ColorScheme) =
  //        let docText = document.GetTextAt(offset, length)
  //
  //        let isPreProcessor = docText.Trim() |> isPreprocessor
  //
  //        if line.StartSpan <> null && line.StartSpan.Count > 0 then
  //            match line.StartSpan with
  //            | StartsWithAbstractBlockSpan abs ->
  //                if isPreProcessor then
  //                    PreProcessor docText
  //                else
  //                    if abs.Disabled then
  //                        ExcludedCode style.ExcludedCode.Name
  //                    else
  //                        OtherCode (style.PlainText.Name, docText)
  //
  //            | ContainsAbstractBlockSpan bs-> 
  //                if bs.Disabled then
  //                    ExcludedCode style.ExcludedCode.Name
  //                else
  //                    OtherCode (style.PlainText.Name, docText)
  //
  //            | Other ->
  //                match line.StartSpan.Peek() with
  //                | span when span.Rule = "String" || span.Rule = "VerbatimString" || span.Rule = "TripleQuotedString" ->
  //                    StringCode span.Color
  //                | span when span.Rule = "Comment" || span.Rule = "MultiComment" ->
  //                    CommentCode span.Color
  //                | _span -> OtherCode (style.PlainText.Name, docText)
  //
  //        else
  //            if docText.StartsWith ("#") then
  //                PreProcessor docText
  //            else
  //                OtherCode (style.PlainText.Name, docText)
  
  module internal Rules =
      let baseMode =
          let assembly = Reflection.Assembly.GetExecutingAssembly ()
  
negative.code:                         let rec parseLine() =
                              [ match tokenizer.ScanToken(!state) with
                                | Some(tok), nstate ->
                                    yield tok
                                    state := nstate
                                    yield! parseLine()
                                | None, nstate -> state := nstate ]
                          yield line, parseLine() |]
                                          
                  let processedTokens =
                      let style = getColourScheme ()
                      tokens
                      |> Array.map
                          (fun (line, chunks) ->
                              chunks
                              |> Tokens.CollapseInactiveTokens
                              |> List.map (makeChunk symbolsInFile colourisations line style))
                  segments <- processedTokens
                  Gtk.Application.Invoke (fun _ _ -> x.NotifySemanticHighlightingUpdate())
              | None -> ()
  