summaryrefslogtreecommitdiff
path: root/pygments/lexers/hdl.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/lexers/hdl.py')
-rw-r--r--pygments/lexers/hdl.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/pygments/lexers/hdl.py b/pygments/lexers/hdl.py
index 2e64b8e9..1472b5df 100644
--- a/pygments/lexers/hdl.py
+++ b/pygments/lexers/hdl.py
@@ -162,14 +162,22 @@ class SystemVerilogLexer(RegexLexer):
(r'[{}#@]', Punctuation),
(r'L?"', String, 'string'),
(r"L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", String.Char),
+
(r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?', Number.Float),
(r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
- (r'([0-9]+)|(\'h)[0-9a-fA-F]+', Number.Hex),
- (r'([0-9]+)|(\'b)[01]+', Number.Bin),
- (r'([0-9]+)|(\'d)[0-9]+', Number.Integer),
- (r'([0-9]+)|(\'o)[0-7]+', Number.Oct),
- (r'\'[01xz]', Number),
- (r'\d+[Ll]?', Number.Integer),
+
+ (r'([1-9][_0-9]*)?\s*\'[sS]?[bB]\s*[xXzZ?01][_xXzZ?01]*',
+ Number.Bin),
+ (r'([1-9][_0-9]*)?\s*\'[sS]?[oO]\s*[xXzZ?0-7][_xXzZ?0-7]*',
+ Number.Oct),
+ (r'([1-9][_0-9]*)?\s*\'[sS]?[dD]\s*[xXzZ?0-9][_xXzZ?0-9]*',
+ Number.Integer),
+ (r'([1-9][_0-9]*)?\s*\'[sS]?[hH]\s*[xXzZ?0-9a-fA-F][_xXzZ?0-9a-fA-F]*',
+ Number.Hex),
+
+ (r'\'[01xXzZ]', Number),
+ (r'[0-9][_0-9]*', Number.Integer),
+
(r'\*/', Error),
(r'[~!%^&*+=|?:<>/-]', Operator),
(r'[()\[\],.;\']', Punctuation),