|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2005 - 2009 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing a Batch file lexer with some additional methods. |
|
8 """ |
|
9 |
|
10 from PyQt4.Qsci import QsciLexerBatch |
|
11 |
|
12 from Lexer import Lexer |
|
13 |
|
14 class LexerBatch(QsciLexerBatch, 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 QsciLexerBatch.__init__(self, parent) |
|
25 Lexer.__init__(self) |
|
26 |
|
27 self.commentString = "REM " |
|
28 |
|
29 def isCommentStyle(self, style): |
|
30 """ |
|
31 Public method to check, if a style is a comment style. |
|
32 |
|
33 @return flag indicating a comment style (boolean) |
|
34 """ |
|
35 return style in [QsciLexerBatch.Comment] |
|
36 |
|
37 def isStringStyle(self, style): |
|
38 """ |
|
39 Public method to check, if a style is a string style. |
|
40 |
|
41 @return flag indicating a string style (boolean) |
|
42 """ |
|
43 return False |