Python highlighting #1352

git-svn-id: svn://ultimatepp.org/upp/trunk@9294 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2015-12-17 12:24:48 +00:00
parent 2e7558edcf
commit d765ba04b2
6 changed files with 275 additions and 8 deletions

View file

@ -13,16 +13,21 @@ void RegisterCSyntax(const char *id, int kind,
EditorSyntax::Register(id, callback1(CreateCSyntax, kind), exts, description);
}
void CreateTagSyntax(One<EditorSyntax>& e, bool html, bool witz)
{
e.Create<TagSyntax>().Html(html).Witz(witz);
}
void CreateDiffSyntax(One<EditorSyntax>& e)
{
e.Create<DiffSyntax>();
}
void CreatePythonSyntax(One<EditorSyntax>& e)
{
e.Create<PythonSyntax>();
}
void CreateTagSyntax(One<EditorSyntax>& e, bool html, bool witz)
{
e.Create<TagSyntax>().Html(html).Witz(witz);
}
void CreateLogSyntax(One<EditorSyntax>& e)
{
e.Create<LogSyntax>();
@ -46,12 +51,14 @@ INITBLOCK
RegisterCSyntax("calc", CSyntax::HIGHLIGHT_CALC, "", "");
RegisterCSyntax("php", CSyntax::HIGHLIGHT_PHP, "*.php", "PHP");
EditorSyntax::Register("diff", callback(CreateDiffSyntax), "*.diff *.patch", "Diff");
EditorSyntax::Register("python", callback(CreatePythonSyntax), "*.py, *.pyc, *.pyd, *.pyo, *.pyw, *.pyz", "Python");
EditorSyntax::Register("xml", callback2(CreateTagSyntax, false, false), "*.xml *.xsd", "XML (.xml)");
EditorSyntax::Register("html", callback2(CreateTagSyntax, true, false), "*.html *.htm", "HTML (.html)");
EditorSyntax::Register("witz", callback2(CreateTagSyntax, true, true), "*.witz", "Skylark templates (.witz)");
EditorSyntax::Register("diff", callback(CreateDiffSyntax), "*.diff *.patch", "Diff");
EditorSyntax::Register("log", callback(CreateLogSyntax), "*.log", "Log (*.log)");
}