Commits

Igor Kalnitsky committed b8a84c2

Fix some bugs in VHDL Lexer.

  • Participants
  • Parent commits 3bf9bdb

Comments (0)

Files changed (1)

File pygments/lexers/hdl.py

     aliases = ['vhdl']
     filenames = ['*.vhdl', '*.vhd']
     mimetypes = ['text/x-vhdl']
+    flags = re.MULTILINE | re.IGNORECASE
 
     tokens = {
         'root': [
             (r'"[^\n\\]*"', String),
 
             (r'(library)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)', bygroups(Keyword, Text, Name.Namespace)),
+            (r'(use)(\s+)(entity)', bygroups(Keyword, Text, Keyword)),
             (r'(use)(\s+)([a-zA-Z_][\.a-zA-Z0-9_]*)', bygroups(Keyword, Text, Name.Namespace)),
             (r'(entity|component)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)', bygroups(Keyword, Text, Name.Class)),
             (r'(architecture|configuration)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)(\s+)(of)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)(\s+)(is)',
             (r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
         ],
         'endblock': [
-            (r'\s+$', Text),
-            (r'[()\[\],.;\']', Punctuation),
-
             include('keywords'),
             (r'[a-zA-Z_][a-zA-Z0-9_]*', Name.Class),
+            (r'(\s+)', Text),
+            (r';', Punctuation, '#pop'),
         ],
         'types': [
             (r'(boolean|bit|character|severity_level|integer|time|delay_length|'