10 from PyQt4.Qsci import QsciLexerSQL |
10 from PyQt4.Qsci import QsciLexerSQL |
11 |
11 |
12 from .Lexer import Lexer |
12 from .Lexer import Lexer |
13 import Preferences |
13 import Preferences |
14 |
14 |
|
15 |
15 class LexerSQL(QsciLexerSQL, Lexer): |
16 class LexerSQL(QsciLexerSQL, Lexer): |
16 """ |
17 """ |
17 Subclass to implement some additional lexer dependant methods. |
18 Subclass to implement some additional lexer dependant methods. |
18 """ |
19 """ |
19 def __init__(self, parent=None): |
20 def __init__(self, parent=None): |
20 """ |
21 """ |
21 Constructor |
22 Constructor |
39 """ |
40 """ |
40 Public method to check, if a style is a comment style. |
41 Public method to check, if a style is a comment style. |
41 |
42 |
42 @return flag indicating a comment style (boolean) |
43 @return flag indicating a comment style (boolean) |
43 """ |
44 """ |
44 return style in [QsciLexerSQL.Comment, |
45 return style in [QsciLexerSQL.Comment, |
45 QsciLexerSQL.CommentDoc, |
46 QsciLexerSQL.CommentDoc, |
46 QsciLexerSQL.CommentLine, |
47 QsciLexerSQL.CommentLine, |
47 QsciLexerSQL.CommentLineHash] |
48 QsciLexerSQL.CommentLineHash] |
48 |
49 |
49 def isStringStyle(self, style): |
50 def isStringStyle(self, style): |
50 """ |
51 """ |
51 Public method to check, if a style is a string style. |
52 Public method to check, if a style is a string style. |
52 |
53 |
53 @return flag indicating a string style (boolean) |
54 @return flag indicating a string style (boolean) |
54 """ |
55 """ |
55 return style in [QsciLexerSQL.DoubleQuotedString, |
56 return style in [QsciLexerSQL.DoubleQuotedString, |
56 QsciLexerSQL.SingleQuotedString] |
57 QsciLexerSQL.SingleQuotedString] |
57 |
58 |
58 def defaultKeywords(self, kwSet): |
59 def defaultKeywords(self, kwSet): |
59 """ |
60 """ |
60 Public method to get the default keywords. |
61 Public method to get the default keywords. |
61 |
62 |
62 @param kwSet number of the keyword set (integer) |
63 @param kwSet number of the keyword set (integer) |
63 @return string giving the keywords (string) or None |
64 @return string giving the keywords (string) or None |
64 """ |
65 """ |
65 return QsciLexerSQL.keywords(self, kwSet) |
66 return QsciLexerSQL.keywords(self, kwSet) |