IToken javaScript = new Token(IDjangoPartitions.JAVA_SCRIPT);
IToken htmlCss = new Token(IDjangoPartitions.HTML_CSS);
List<IPredicateRule> rules = new ArrayList<IPredicateRule>();
rules.add(new MultiLineRule("{% comment %}", "{% endcomment %}", djComment));
rules.add(new SingleLineRule("{#", "#}", djComment));
rules.add(new SingleLineRule("{%", "%}", djTag));
rules.add(new SingleLineRule("{{", "}}", djVariable));
rules.add(new MultiLineRule("<!--", "-->", htmlComment));
rules.add(new MultiLineRule("<%--", "--%>", htmlComment));
rules.add(new DocTypeRule(htmlDoctype));
rules.add(new MultiLineRule("<%@", "%>", htmlDirective));
rules.add(new MultiLineRule("<%", "%>", htmlScriptlet));
rules.add(new MultiLineRule("<![CDATA[", "]]>", htmlDoctype));
rules.add(new MultiLineRule("<?xml", "?>", htmlDoctype));
rules.add(new MultiLineRule("<script", "</script>", javaScript));
rules.add(new MultiLineRule("<style", "</style>", htmlCss));
rules.add(new MultiLineRule("<", ">", htmlTag));
setPredicateRules(rules.toArray(new IPredicateRule[0]));
}