anchor.diff:      return token;
   }
   
  -bool CheckHeredocEnd(string text)
  +string GetHeredocIdentifier(string text)
   {
       text = text.Trim();
       bool semi = text.Length > 0 ? text[text.Length - 1] == ';' : false;
  -    string identifier = semi ? text.Substring(0, text.Length - 1) : text;
  -    var result = string.Equals(identifier, _heredocIdentifier, System.StringComparison.Ordinal);
  -    return result;
  +    return semi ? text.Substring(0, text.Length - 1) : text;
  +}
  +
  +bool CheckHeredocEnd(string text)
  +{
  +    return string.Equals(GetHeredocIdentifier(text), _heredocIdentifier, System.StringComparison.Ordinal);
   }}
   
   SeaWhitespace:  [ \t\r\n]+ -> channel(HIDDEN);
  
positive.code:                 if (CheckHeredocEnd(token.Text))
                  {
                      PopMode();
                      if (token.Text.Trim().EndsWith(";"))
                      {
                          token.Type = SemiColon;
                      }
                      else
                      {
                          token.Channel = SkipChannel;
                      }
                  }
                  break;
  
negative.code:             PopMode(); // exit from SingleLineComment mode.
          }
          PopMode(); // exit from PHP mode.
  
          if (string.Equals(token.Text, "</script>", System.StringComparison.Ordinal))
          {
              _phpScript = false;
  