QScintilla/Lexers/LexerCPP.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 3011
18292228c724
child 3145
a9de05d4a22f
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
22 def __init__(self, parent=None, caseInsensitiveKeywords=False): 22 def __init__(self, parent=None, caseInsensitiveKeywords=False):
23 """ 23 """
24 Constructor 24 Constructor
25 25
26 @param parent parent widget of this lexer 26 @param parent parent widget of this lexer
27 @param caseInsensitiveKeywords flag indicating keywords are case
28 insensitive (boolean)
27 """ 29 """
28 super(LexerCPP, self).__init__(parent, caseInsensitiveKeywords) 30 super(LexerCPP, self).__init__(parent, caseInsensitiveKeywords)
29 Lexer.__init__(self) 31 Lexer.__init__(self)
30 32
31 self.commentString = "//" 33 self.commentString = "//"
56 try: 58 try:
57 self.setDollarsAllowed(Preferences.getEditor("CppDollarsAllowed")) 59 self.setDollarsAllowed(Preferences.getEditor("CppDollarsAllowed"))
58 except AttributeError: 60 except AttributeError:
59 pass 61 pass
60 try: 62 try:
61 self.setStylePreprocessor(Preferences.getEditor("CppStylePreprocessor")) 63 self.setStylePreprocessor(
64 Preferences.getEditor("CppStylePreprocessor"))
62 except AttributeError: 65 except AttributeError:
63 pass 66 pass
64 try: 67 try:
65 self.setHighlightTripleQuotedStrings( 68 self.setHighlightTripleQuotedStrings(
66 Preferences.getEditor("CppHighlightTripleQuotedStrings")) 69 Preferences.getEditor("CppHighlightTripleQuotedStrings"))
82 85
83 def isCommentStyle(self, style): 86 def isCommentStyle(self, style):
84 """ 87 """
85 Public method to check, if a style is a comment style. 88 Public method to check, if a style is a comment style.
86 89
90 @param style style to check (integer)
87 @return flag indicating a comment style (boolean) 91 @return flag indicating a comment style (boolean)
88 """ 92 """
89 return style in [QsciLexerCPP.Comment, 93 return style in [QsciLexerCPP.Comment,
90 QsciLexerCPP.CommentDoc, 94 QsciLexerCPP.CommentDoc,
91 QsciLexerCPP.CommentLine, 95 QsciLexerCPP.CommentLine,
93 97
94 def isStringStyle(self, style): 98 def isStringStyle(self, style):
95 """ 99 """
96 Public method to check, if a style is a string style. 100 Public method to check, if a style is a string style.
97 101
102 @param style style to check (integer)
98 @return flag indicating a string style (boolean) 103 @return flag indicating a string style (boolean)
99 """ 104 """
100 return style in [QsciLexerCPP.DoubleQuotedString, 105 return style in [QsciLexerCPP.DoubleQuotedString,
101 QsciLexerCPP.SingleQuotedString, 106 QsciLexerCPP.SingleQuotedString,
102 QsciLexerCPP.UnclosedString, 107 QsciLexerCPP.UnclosedString,

eric ide

mercurial