129 ], |
129 ], |
130 'import': [ |
130 'import': [ |
131 (r'[\w:]+\*?', Name.Namespace, '#pop') |
131 (r'[\w:]+\*?', Name.Namespace, '#pop') |
132 ] |
132 ] |
133 } |
133 } |
|
134 |
|
135 def analyse_text(text): |
|
136 """Verilog code will use one of reg/wire/assign for sure, and that |
|
137 is not common elsewhere.""" |
|
138 result = 0 |
|
139 if 'reg' in text: |
|
140 result += 0.1 |
|
141 if 'wire' in text: |
|
142 result += 0.1 |
|
143 if 'assign' in text: |
|
144 result += 0.1 |
|
145 |
|
146 return result |
134 |
147 |
135 |
148 |
136 class SystemVerilogLexer(RegexLexer): |
149 class SystemVerilogLexer(RegexLexer): |
137 """ |
150 """ |
138 Extends verilog lexer to recognise all SystemVerilog keywords from IEEE |
151 Extends verilog lexer to recognise all SystemVerilog keywords from IEEE |