ultimatepp/uppsrc/CodeEditor/PythonSyntax.h
cxl 1769d782d3 ide: Python syntax highlighting refactored
git-svn-id: svn://ultimatepp.org/upp/trunk@14555 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2020-06-05 11:47:35 +00:00

21 lines
705 B
C++

class PythonSyntax : public EditorSyntax {
public:
virtual void Highlight(const wchar *start, const wchar *end, HighlightOutput& hls,
CodeEditor *editor, int line, int64 pos);
virtual void IndentInsert(CodeEditor& e, int chr, int count);
private:
struct Identation {
enum Type {
Tab = 0,
Space,
Unknown
};
};
bool LineHasColon(const WString& line);
int CalculateLineIndetations(const WString& line, Identation::Type type);
int CalculateSpaceIndetationSize(CodeEditor& editor);
Identation::Type FindIdentationType(CodeEditor& editor, const WString& line);
char GetIdentationByType(Identation::Type type);
};