summaryrefslogtreecommitdiff
path: root/pygments/lexers/hdl.py
diff options
context:
space:
mode:
authorTim Hatch <tim@timhatch.com>2012-03-09 12:06:35 -0800
committerTim Hatch <tim@timhatch.com>2012-03-09 12:06:35 -0800
commit057392c8f40d6ecfc0307c6c862a7ed3e060fe87 (patch)
treeb06ba62a658c18dde1b6490627dc3e426db7a749 /pygments/lexers/hdl.py
parent652451c0fc435d8719e5e13e5a3a2712b8488fb4 (diff)
downloadpygments-057392c8f40d6ecfc0307c6c862a7ed3e060fe87.tar.gz
Move verilog package/import up in match order
Lines that have leading whitespace should now match correctly. --- pygments/lexers/hdl.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
Diffstat (limited to 'pygments/lexers/hdl.py')
-rw-r--r--pygments/lexers/hdl.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/pygments/lexers/hdl.py b/pygments/lexers/hdl.py
index f1e9f26d..0db35e74 100644
--- a/pygments/lexers/hdl.py
+++ b/pygments/lexers/hdl.py
@@ -147,6 +147,9 @@ class SystemVerilogLexer(RegexLexer):
tokens = {
'root': [
(r'^\s*`define', Comment.Preproc, 'macro'),
+ (r'^(\s*)(package)(\s+)', bygroups(Text, Keyword.Namespace, Text)),
+ (r'^(\s*)(import)(\s+)', bygroups(Text, Keyword.Namespace, Text), 'import'),
+
(r'\n', Text),
(r'\s+', Text),
(r'\\\n', Text), # line continuation
@@ -168,11 +171,6 @@ class SystemVerilogLexer(RegexLexer):
(r'[()\[\],.;\']', Punctuation),
(r'`[a-zA-Z_][a-zA-Z0-9_]*', Name.Constant),
- (r'^\s*(package)(\s+)', bygroups(Keyword.Namespace, Text)),
- (r'^\s*(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'),
-
-
-
(r'(accept_on|alias|always|always_comb|always_ff|always_latch|'
r'and|assert|assign|assume|automatic|before|begin|bind|bins|'
r'binsof|bit|break|buf|bufif0|bufif1|byte|case|casex|casez|'