QScintilla/Lexers/LexerCSharp.py

changeset 945
8cd4d08fa9f6
parent 791
9ec2ac20e54e
child 1131
7781e396c903
equal deleted inserted replaced
944:1b59c4ba121e 945:8cd4d08fa9f6
10 from PyQt4.Qsci import QsciLexerCSharp, QsciScintilla 10 from PyQt4.Qsci import QsciLexerCSharp, QsciScintilla
11 11
12 from .Lexer import Lexer 12 from .Lexer import Lexer
13 import Preferences 13 import Preferences
14 14
15
15 class LexerCSharp(QsciLexerCSharp, Lexer): 16 class LexerCSharp(QsciLexerCSharp, 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
25 QsciLexerCSharp.__init__(self, parent) 26 QsciLexerCSharp.__init__(self, parent)
26 Lexer.__init__(self) 27 Lexer.__init__(self)
27 28
28 self.commentString = "//" 29 self.commentString = "//"
29 self.streamCommentString = { 30 self.streamCommentString = {
30 'start' : '/* ', 31 'start': '/* ',
31 'end' : ' */' 32 'end': ' */'
32 } 33 }
33 self.boxCommentString = { 34 self.boxCommentString = {
34 'start' : '/* ', 35 'start': '/* ',
35 'middle' : ' * ', 36 'middle': ' * ',
36 'end' : ' */' 37 'end': ' */'
37 } 38 }
38 39
39 def initProperties(self): 40 def initProperties(self):
40 """ 41 """
41 Public slot to initialize the properties. 42 Public slot to initialize the properties.
55 """ 56 """
56 Public method to check, if a style is a comment style. 57 Public method to check, if a style is a comment style.
57 58
58 @return flag indicating a comment style (boolean) 59 @return flag indicating a comment style (boolean)
59 """ 60 """
60 return style in [QsciLexerCSharp.Comment, 61 return style in [QsciLexerCSharp.Comment,
61 QsciLexerCSharp.CommentDoc, 62 QsciLexerCSharp.CommentDoc,
62 QsciLexerCSharp.CommentLine, 63 QsciLexerCSharp.CommentLine,
63 QsciLexerCSharp.CommentLineDoc] 64 QsciLexerCSharp.CommentLineDoc]
64 65
65 def isStringStyle(self, style): 66 def isStringStyle(self, style):
66 """ 67 """
67 Public method to check, if a style is a string style. 68 Public method to check, if a style is a string style.
68 69
69 @return flag indicating a string style (boolean) 70 @return flag indicating a string style (boolean)
70 """ 71 """
71 return style in [QsciLexerCSharp.DoubleQuotedString, 72 return style in [QsciLexerCSharp.DoubleQuotedString,
72 QsciLexerCSharp.SingleQuotedString, 73 QsciLexerCSharp.SingleQuotedString,
73 QsciLexerCSharp.UnclosedString, 74 QsciLexerCSharp.UnclosedString,
74 QsciLexerCSharp.VerbatimString] 75 QsciLexerCSharp.VerbatimString]
75 76
76 def defaultKeywords(self, kwSet): 77 def defaultKeywords(self, kwSet):
77 """ 78 """
78 Public method to get the default keywords. 79 Public method to get the default keywords.
79 80
80 @param kwSet number of the keyword set (integer) 81 @param kwSet number of the keyword set (integer)
81 @return string giving the keywords (string) or None 82 @return string giving the keywords (string) or None
82 """ 83 """
83 return QsciLexerCSharp.keywords(self, kwSet) 84 return QsciLexerCSharp.keywords(self, kwSet)

eric ide

mercurial