9 |
9 |
10 from PyQt4.Qsci import QsciLexerRuby |
10 from PyQt4.Qsci import QsciLexerRuby |
11 |
11 |
12 from .Lexer import Lexer |
12 from .Lexer import Lexer |
13 |
13 |
|
14 |
14 class LexerRuby(QsciLexerRuby, Lexer): |
15 class LexerRuby(QsciLexerRuby, Lexer): |
15 """ |
16 """ |
16 Subclass to implement some additional lexer dependant methods. |
17 Subclass to implement some additional lexer dependant methods. |
17 """ |
18 """ |
18 def __init__(self, parent=None): |
19 def __init__(self, parent=None): |
19 """ |
20 """ |
20 Constructor |
21 Constructor |
46 """ |
47 """ |
47 Public method to check, if a style is a string style. |
48 Public method to check, if a style is a string style. |
48 |
49 |
49 @return flag indicating a string style (boolean) |
50 @return flag indicating a string style (boolean) |
50 """ |
51 """ |
51 return style in [QsciLexerRuby.DoubleQuotedString, |
52 return style in [QsciLexerRuby.DoubleQuotedString, |
52 QsciLexerRuby.HereDocument, |
53 QsciLexerRuby.HereDocument, |
53 QsciLexerRuby.PercentStringQ, |
54 QsciLexerRuby.PercentStringQ, |
54 QsciLexerRuby.PercentStringq, |
55 QsciLexerRuby.PercentStringq, |
55 QsciLexerRuby.PercentStringr, |
56 QsciLexerRuby.PercentStringr, |
56 QsciLexerRuby.PercentStringw, |
57 QsciLexerRuby.PercentStringw, |
57 QsciLexerRuby.PercentStringx, |
58 QsciLexerRuby.PercentStringx, |
58 QsciLexerRuby.SingleQuotedString] |
59 QsciLexerRuby.SingleQuotedString] |
59 |
60 |
60 def defaultKeywords(self, kwSet): |
61 def defaultKeywords(self, kwSet): |
61 """ |
62 """ |
62 Public method to get the default keywords. |
63 Public method to get the default keywords. |
63 |
64 |
64 @param kwSet number of the keyword set (integer) |
65 @param kwSet number of the keyword set (integer) |
65 @return string giving the keywords (string) or None |
66 @return string giving the keywords (string) or None |
66 """ |
67 """ |
67 return QsciLexerRuby.keywords(self, kwSet) |
68 return QsciLexerRuby.keywords(self, kwSet) |