|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2005 - 2009 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing a Diff lexer with some additional methods. |
|
8 """ |
|
9 |
|
10 from PyQt4.Qsci import QsciLexerDiff |
|
11 |
|
12 from Lexer import Lexer |
|
13 |
|
14 class LexerDiff(QsciLexerDiff, Lexer): |
|
15 """ |
|
16 Subclass to implement some additional lexer dependant methods. |
|
17 """ |
|
18 def __init__(self, parent=None): |
|
19 """ |
|
20 Constructor |
|
21 |
|
22 @param parent parent widget of this lexer |
|
23 """ |
|
24 QsciLexerDiff.__init__(self, parent) |
|
25 Lexer.__init__(self) |
|
26 |
|
27 def isCommentStyle(self, style): |
|
28 """ |
|
29 Public method to check, if a style is a comment style. |
|
30 |
|
31 @return flag indicating a comment style (boolean) |
|
32 """ |
|
33 return style in [LexerDiff.Comment] |
|
34 |
|
35 def isStringStyle(self, style): |
|
36 """ |
|
37 Public method to check, if a style is a string style. |
|
38 |
|
39 @return flag indicating a string style (boolean) |
|
40 """ |
|
41 return False |