~masmullin/scintilla-cocoa/updates

« back to all changes in this revision

Viewing changes to lexers/LexHTML.cxx

  • Committer: Michael Mullin
  • Date: 2011-05-10 01:10:01 UTC
  • Revision ID: masmullin@gmail.com-20110510011001-oqg4et6521j2gidj
synced to CS 3648

Show diffs side-by-side

added added

removed removed

Lines of Context:
755
755
                                                        levelCurrent--;
756
756
                                                }
757
757
                                        } else if ((ch == '{') || (ch == '}') || (foldComment && (ch == '/') && (chNext == '*')) ) {
758
 
                                                levelCurrent += ((ch == '{') || (ch == '/') ) ? 1 : -1;
 
758
                                                levelCurrent += (((ch == '{') || (ch == '/') ) ? 1 : -1);
759
759
                                        }
760
760
                                } else if (((state == SCE_HPHP_COMMENT) || (state == SCE_HJ_COMMENT)) && foldComment && (ch == '*') && (chNext == '/')) {
761
761
                                        levelCurrent--;
883
883
                         (ch == '<') &&
884
884
                         (chNext == '?') &&
885
885
                                 !IsScriptCommentState(state) ) {
 
886
                        beforeLanguage = scriptLanguage;
886
887
                        scriptLanguage = segIsScriptingIndicator(styler, i + 2, i + 6, eScriptPHP);
887
888
                        if (scriptLanguage != eScriptPHP && isStringState(state)) continue;
888
889
                        styler.ColourTo(i - 1, StateToPrint);
954
955
                        continue;
955
956
                }
956
957
 
 
958
                // handle the start/end of Django comment
 
959
                else if (isDjango && state != SCE_H_COMMENT && (ch == '{' && chNext == '#')) {
 
960
                        styler.ColourTo(i - 1, StateToPrint);
 
961
                        beforePreProc = state;
 
962
                        beforeLanguage = scriptLanguage;
 
963
                        if (inScriptType == eNonHtmlScript)
 
964
                                inScriptType = eNonHtmlScriptPreProc;
 
965
                        else
 
966
                                inScriptType = eNonHtmlPreProc;
 
967
                        i += 1;
 
968
                        visibleChars += 1;
 
969
                        scriptLanguage = eScriptComment;
 
970
                        state = SCE_H_COMMENT;
 
971
                        styler.ColourTo(i, SCE_H_ASP);
 
972
                        ch = static_cast<unsigned char>(styler.SafeGetCharAt(i));
 
973
                        continue;
 
974
                }
 
975
                else if (isDjango && state == SCE_H_COMMENT && (ch == '#' && chNext == '}')) {
 
976
                        styler.ColourTo(i - 1, StateToPrint);
 
977
                        i += 1;
 
978
                        visibleChars += 1;
 
979
                        styler.ColourTo(i, SCE_H_ASP);
 
980
                        state = beforePreProc;
 
981
                        if (inScriptType == eNonHtmlScriptPreProc)
 
982
                                inScriptType = eNonHtmlScript;
 
983
                        else
 
984
                                inScriptType = eHtml;
 
985
                        scriptLanguage = beforeLanguage;
 
986
                        continue;
 
987
                }
 
988
 
957
989
                // handle the start Django template code
958
990
                else if (isDjango && scriptLanguage != eScriptPython && (ch == '{' && (chNext == '%' ||  chNext == '{'))) {
959
991
                        if (chNext == '%')
1154
1186
                        if (foldHTMLPreprocessor && (scriptLanguage != eScriptXML)) {
1155
1187
                                levelCurrent--;
1156
1188
                        }
1157
 
                        scriptLanguage = eScriptNone;
 
1189
                        scriptLanguage = beforeLanguage;
1158
1190
                        continue;
1159
1191
                }
1160
1192
                /////////////////////////////////////