anchor.diff:  open ExtCore.Control
   
   module FSharpSyntaxModeInternals =
  -    let contains predicate sequence =
  -        sequence |> Seq.exists predicate
  -
  -    [<Literal>]
  -    let tripleString = "\"\"\""
  -    [<Literal>]
  -    let verbatimString = "@\""
  -    [<Literal>]
  -    let normalString = "\""
  -    [<Literal>]
  -    let escapeString = "\\\""
  -    [<Literal>]
  -    let openBlockComment = "(*"
  -    [<Literal>]
  -    let closeBlockComment = "*)"
  -
  -    type AbstractStringSpan() =
  -        inherit Span()
  -        do 
  -            base.Color <- "String"
  -            base.Rule <- "String"
  -
  -    type StringSpan() =
  -        inherit AbstractStringSpan()
  -
  -    type CommentSpan() =
  -        inherit Span()
  -        do
  -            base.Color <- "Comment"
  -            base.Rule <- "Comment"
  -
  -    type LineCommentSpan() =
  -        inherit CommentSpan()
  -        do
  -            base.StopAtEol <- true
   
       type PreprocessorSpan() =
           inherit Span()
  
positive.code:                         false
                      elif currentText.Substring(textOffset).StartsWith("#endif") then
                          let span = EndIfBlockSpan()
                          if this.CurSpan <> null && typeof<AbstractBlockSpan>.IsAssignableFrom(this.CurSpan.GetType()) then
                              this.FoundSpanEnd.Invoke(this.CurSpan, i, 0)
                          this.FoundSpanBegin.Invoke(span, i, 6)
                          this.FoundSpanEnd.Invoke(span, i + 6, 0)
                          true
                      elif (this.CurSpan = null || (this.CurSpan <> null && this.CurSpan.Color <> "Excluded Code")) then
                          let spanLength = 
                              match currentText.Substring(textOffset).IndexOf(Environment.NewLine) with
                              | -1 -> currentText.Substring(textOffset).Length
                              | value -> value
                          this.FoundSpanBegin.Invoke(PreprocessorSpan(), i + textOffset, spanLength)
                          i <- i + spanLength
                          base.ScanSpan(&i)
                      else
                          false
                  elif (this.CurSpan <> null && this.CurSpan.Color <> "Excluded Code") then
  
negative.code:         if ts.TokenInfo.ColorClass = FSharpTokenColorKind.InactiveCode then Some UnusedCode
          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 =
  