Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5124241

Browse files
committed
Some keyword sorting. Fixed comment parsing
1 parent 498512f commit 5124241

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/coderay/scanners/vhdl.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class VHDL < Scanner
1414

1515
# From IEEE Std 1076-2002: Section 13.9 Reserved Words
1616
KEYWORDS = [
17-
'abs', 'access', 'after', 'alias', 'all', 'and', 'architecture', 'array', 'assert', 'attribute', 'begin', 'block', 'body', 'buffer', 'bus', 'case', 'component', 'configuration', 'constant', 'disconnect', 'downto', 'else', 'elsif', 'end', 'entity', 'exit', 'file', 'for', 'function', 'generate', 'generic', 'group', 'guarded', 'if', 'impure', 'in', 'inertial', 'inout', 'is', 'label', 'library', 'linkage', 'literal', 'loop', 'map', 'mod', 'nand', 'new', 'next', 'nor', 'not', 'null', 'of', 'on', 'open', 'or', 'others', 'out', 'package', 'port', 'postponed', 'procedural', 'procedure', 'process', 'protected', 'pure', 'range', 'record', 'reference', 'register', 'reject', 'rem', 'report', 'return', 'rol', 'ror', 'select', 'severity', 'shared', 'signal', 'sla', 'sll', 'sra', 'srl', 'subtype', 'then', 'to', 'transport', 'type', 'unaffected', 'units', 'until', 'use', 'variable', 'wait', 'when', 'while', 'with', 'xnor', 'xor' ] # :nodoc:
17+
'abs', 'access', 'after', 'alias', 'all', 'and', 'architecture', 'array', 'assert', 'attribute', 'begin', 'block', 'body', 'case', 'component', 'configuration', 'disconnect', 'downto', 'else', 'elsif', 'end', 'entity', 'exit', 'file', 'for', 'function', 'generate', 'generic', 'group', 'guarded', 'if', 'inertial', 'is', 'label', 'library', 'literal', 'loop', 'map', 'mod', 'nand', 'new', 'next', 'nor', 'not', 'null', 'of', 'on', 'open', 'or', 'others', 'package', 'port', 'postponed', 'procedural', 'procedure', 'process', 'protected', 'range', 'record', 'reference', 'reject', 'rem', 'report', 'return', 'rol', 'ror', 'select', 'severity', 'signal', 'sla', 'sll', 'sra', 'srl', 'subtype', 'then', 'to', 'transport', 'type', 'unaffected', 'units', 'until', 'use', 'wait', 'when', 'while', 'with', 'xnor', 'xor' ] # :nodoc:
1818

1919
PREDEFINED_TYPES = [
2020
] # :nodoc:
@@ -23,6 +23,7 @@ class VHDL < Scanner
2323
PREDEFINED_VARIABLES = [
2424
] # :nodoc:
2525
DIRECTIVES = [
26+
'buffer', 'bus', 'constant', 'impure', 'in', 'inout', 'linkage', 'out', 'pure', 'register', 'shared', 'variable'
2627
] # :nodoc:
2728

2829
IDENT_KIND = WordList.new(:ident).
@@ -58,7 +59,7 @@ def scan_tokens encoder, options
5859
end
5960
encoder.text_token match, :space
6061

61-
elsif match = scan(%r! // [^\n\\]* (?: \\. [^\n\\]* )* | /\* (?: .*? \*/ | .* ) !mx)
62+
elsif match = scan(%r! -- [^\n\\]* (?: \\. [^\n\\]* )* !mx)
6263
encoder.text_token match, :comment
6364

6465
elsif match = scan(/ \# \s* if \s* 0 /x)

0 commit comments

Comments
 (0)