Diff of /lexers/LexHTML.cxx [643a62] .. [b042cc] Maximize Restore

  Switch to unified view

a/lexers/LexHTML.cxx b/lexers/LexHTML.cxx
...
...
477
477
478
static bool isLineEnd(int ch) {
478
static bool isLineEnd(int ch) {
479
    return ch == '\r' || ch == '\n';
479
    return ch == '\r' || ch == '\n';
480
}
480
}
481
481
482
static bool isOKBeforeRE(int ch) {
483
  return (ch == '(') || (ch == '=') || (ch == ',');
484
}
485
486
static bool isMakoBlockEnd(const int ch, const int chNext, const char *blockType) {
482
static bool isMakoBlockEnd(const int ch, const int chNext, const char *blockType) {
487
    if (strlen(blockType) == 0) {
483
    if (strlen(blockType) == 0) {
488
        return ((ch == '%') && (chNext == '>'));
484
        return ((ch == '%') && (chNext == '>'));
489
    } else if ((0 == strcmp(blockType, "inherit")) ||
485
    } else if ((0 == strcmp(blockType, "inherit")) ||
490
               (0 == strcmp(blockType, "namespace")) ||
486
               (0 == strcmp(blockType, "namespace")) ||
...
...
684
    const bool isDjango = styler.GetPropertyInt("lexer.html.django", 0) != 0;
680
    const bool isDjango = styler.GetPropertyInt("lexer.html.django", 0) != 0;
685
681
686
    const CharacterSet setHTMLWord(CharacterSet::setAlphaNum, ".-_:!#", 0x80, true);
682
    const CharacterSet setHTMLWord(CharacterSet::setAlphaNum, ".-_:!#", 0x80, true);
687
    const CharacterSet setTagContinue(CharacterSet::setAlphaNum, ".-_:!#[", 0x80, true);
683
    const CharacterSet setTagContinue(CharacterSet::setAlphaNum, ".-_:!#[", 0x80, true);
688
    const CharacterSet setAttributeContinue(CharacterSet::setAlphaNum, ".-_:!#/", 0x80, true);
684
    const CharacterSet setAttributeContinue(CharacterSet::setAlphaNum, ".-_:!#/", 0x80, true);
685
  // TODO: also handle + and - (except if they're part of ++ or --) and return keywords
686
  const CharacterSet setOKBeforeJSRE(CharacterSet::setNone, "([{=,:;!%^&*|?~");
689
687
690
    int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
688
    int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
691
    int levelCurrent = levelPrev;
689
    int levelCurrent = levelPrev;
692
    int visibleChars = 0;
690
    int visibleChars = 0;
693
    int lineStartVisibleChars = 0;
691
    int lineStartVisibleChars = 0;
...
...
1585
                    i++;
1583
                    i++;
1586
                }
1584
                }
1587
            } else if (ch == '/' && chNext == '/') {
1585
            } else if (ch == '/' && chNext == '/') {
1588
                styler.ColourTo(i - 1, StateToPrint);
1586
                styler.ColourTo(i - 1, StateToPrint);
1589
                state = SCE_HJ_COMMENTLINE;
1587
                state = SCE_HJ_COMMENTLINE;
1590
            } else if (ch == '/' && isOKBeforeRE(chPrevNonWhite)) {
1588
            } else if (ch == '/' && setOKBeforeJSRE.Contains(chPrevNonWhite)) {
1591
                styler.ColourTo(i - 1, StateToPrint);
1589
                styler.ColourTo(i - 1, StateToPrint);
1592
                state = SCE_HJ_REGEX;
1590
                state = SCE_HJ_REGEX;
1593
            } else if (ch == '\"') {
1591
            } else if (ch == '\"') {
1594
                styler.ColourTo(i - 1, StateToPrint);
1592
                styler.ColourTo(i - 1, StateToPrint);
1595
                state = SCE_HJ_DOUBLESTRING;
1593
                state = SCE_HJ_DOUBLESTRING;