Skip to content

Commit 7df535d

Browse files
committed
Issue#1449: Updated tests to ensure that classification works with bit string literals.
1 parent 89faef7 commit 7df535d

File tree

4 files changed

+85
-20
lines changed

4 files changed

+85
-20
lines changed

tests/vhdlFile/case_statement/classification_results.txt

Lines changed: 54 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
38 |
221221
<class 'vsg.parser.blank_line'>
222222
--------------------------------------------------------------------------------
223-
39 | -- Check others
223+
39 | -- Check bit string literal as choice
224224
<class 'vsg.parser.comment'>
225225
--------------------------------------------------------------------------------
226226
40 |
@@ -235,9 +235,10 @@
235235
<class 'vsg.parser.todo'>
236236
<class 'vsg.token.case_statement.is_keyword'>
237237
--------------------------------------------------------------------------------
238-
43 | when others => Out_1 <= 0;
238+
43 | when x"1" => Out_1 <= 0;
239239
<class 'vsg.token.case_statement_alternative.when_keyword'>
240-
<class 'vsg.token.choice.others_keyword'>
240+
<class 'vsg.token.bit_string_literal.base_specifier'>
241+
<class 'vsg.token.bit_string_literal.bit_value_string'>
241242
<class 'vsg.token.case_statement_alternative.assignment'>
242243
<class 'vsg.token.simple_waveform_assignment.target'>
243244
<class 'vsg.token.simple_waveform_assignment.assignment'>
@@ -257,60 +258,97 @@
257258
46 |
258259
<class 'vsg.parser.blank_line'>
259260
--------------------------------------------------------------------------------
260-
47 | process begin
261+
47 | -- Check others
262+
<class 'vsg.parser.comment'>
263+
--------------------------------------------------------------------------------
264+
48 |
265+
<class 'vsg.parser.blank_line'>
266+
--------------------------------------------------------------------------------
267+
49 | process begin
268+
<class 'vsg.token.process_statement.process_keyword'>
269+
<class 'vsg.token.process_statement.begin_keyword'>
270+
--------------------------------------------------------------------------------
271+
50 | case x is
272+
<class 'vsg.token.case_statement.case_keyword'>
273+
<class 'vsg.parser.todo'>
274+
<class 'vsg.token.case_statement.is_keyword'>
275+
--------------------------------------------------------------------------------
276+
51 | when others => Out_1 <= 0;
277+
<class 'vsg.token.case_statement_alternative.when_keyword'>
278+
<class 'vsg.token.choice.others_keyword'>
279+
<class 'vsg.token.case_statement_alternative.assignment'>
280+
<class 'vsg.token.simple_waveform_assignment.target'>
281+
<class 'vsg.token.simple_waveform_assignment.assignment'>
282+
<class 'vsg.parser.todo'>
283+
<class 'vsg.token.simple_waveform_assignment.semicolon'>
284+
--------------------------------------------------------------------------------
285+
52 | end case;
286+
<class 'vsg.token.case_statement.end_keyword'>
287+
<class 'vsg.token.case_statement.end_case_keyword'>
288+
<class 'vsg.token.case_statement.semicolon'>
289+
--------------------------------------------------------------------------------
290+
53 | end process;
291+
<class 'vsg.token.process_statement.end_keyword'>
292+
<class 'vsg.token.process_statement.end_process_keyword'>
293+
<class 'vsg.token.process_statement.semicolon'>
294+
--------------------------------------------------------------------------------
295+
54 |
296+
<class 'vsg.parser.blank_line'>
297+
--------------------------------------------------------------------------------
298+
55 | process begin
261299
<class 'vsg.token.process_statement.process_keyword'>
262300
<class 'vsg.token.process_statement.begin_keyword'>
263301
--------------------------------------------------------------------------------
264-
48 | case foo(i) is
302+
56 | case foo(i) is
265303
<class 'vsg.token.case_statement.case_keyword'>
266304
<class 'vsg.token.todo.name'>
267305
<class 'vsg.token.todo.open_parenthesis'>
268306
<class 'vsg.parser.todo'>
269307
<class 'vsg.token.todo.close_parenthesis'>
270308
<class 'vsg.token.case_statement.is_keyword'>
271309
--------------------------------------------------------------------------------
272-
49 | end case;
310+
57 | end case;
273311
<class 'vsg.token.case_statement.end_keyword'>
274312
<class 'vsg.token.case_statement.end_case_keyword'>
275313
<class 'vsg.token.case_statement.semicolon'>
276314
--------------------------------------------------------------------------------
277-
50 | end process;
315+
58 | end process;
278316
<class 'vsg.token.process_statement.end_keyword'>
279317
<class 'vsg.token.process_statement.end_process_keyword'>
280318
<class 'vsg.token.process_statement.semicolon'>
281319
--------------------------------------------------------------------------------
282-
51 |
320+
59 |
283321
<class 'vsg.parser.blank_line'>
284322
--------------------------------------------------------------------------------
285-
52 | -- Testing combined case and ?
323+
60 | -- Testing combined case and ?
286324
<class 'vsg.parser.comment'>
287325
--------------------------------------------------------------------------------
288-
53 |
326+
61 |
289327
<class 'vsg.parser.blank_line'>
290328
--------------------------------------------------------------------------------
291-
54 | process begin
329+
62 | process begin
292330
<class 'vsg.token.process_statement.process_keyword'>
293331
<class 'vsg.token.process_statement.begin_keyword'>
294332
--------------------------------------------------------------------------------
295-
55 | case? is
333+
63 | case? is
296334
<class 'vsg.token.case_statement.case_keyword'>
297335
<class 'vsg.token.case_statement.question_mark'>
298336
<class 'vsg.token.case_statement.is_keyword'>
299337
--------------------------------------------------------------------------------
300-
56 | end case;
338+
64 | end case;
301339
<class 'vsg.token.case_statement.end_keyword'>
302340
<class 'vsg.token.case_statement.end_case_keyword'>
303341
<class 'vsg.token.case_statement.semicolon'>
304342
--------------------------------------------------------------------------------
305-
57 | end process;
343+
65 | end process;
306344
<class 'vsg.token.process_statement.end_keyword'>
307345
<class 'vsg.token.process_statement.end_process_keyword'>
308346
<class 'vsg.token.process_statement.semicolon'>
309347
--------------------------------------------------------------------------------
310-
58 |
348+
66 |
311349
<class 'vsg.parser.blank_line'>
312350
--------------------------------------------------------------------------------
313-
59 | end architecture RTL;
351+
67 | end architecture RTL;
314352
<class 'vsg.token.architecture_body.end_keyword'>
315353
<class 'vsg.token.architecture_body.end_architecture_keyword'>
316354
<class 'vsg.token.architecture_body.architecture_simple_name'>

tests/vhdlFile/case_statement/classification_test_input.vhd

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ begin
3636

3737
end process;
3838

39+
-- Check bit string literal as choice
40+
41+
process begin
42+
case x is
43+
when x"1" => Out_1 <= 0;
44+
end case;
45+
end process;
46+
3947
-- Check others
4048

4149
process begin

tests/vhdlFile/procedure_call_statement/classification_results.txt

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,39 @@
6868
14 |
6969
<class 'vsg.parser.blank_line'>
7070
--------------------------------------------------------------------------------
71-
15 | proc;
71+
15 | proc(x"1", d"5", o"X");
7272
<class 'vsg.token.procedure_call.procedure_name'>
73+
<class 'vsg.token.procedure_call.open_parenthesis'>
74+
<class 'vsg.token.bit_string_literal.base_specifier'>
75+
<class 'vsg.token.bit_string_literal.bit_value_string'>
76+
<class 'vsg.token.association_list.comma'>
77+
<class 'vsg.token.bit_string_literal.base_specifier'>
78+
<class 'vsg.token.bit_string_literal.bit_value_string'>
79+
<class 'vsg.token.association_list.comma'>
80+
<class 'vsg.token.bit_string_literal.base_specifier'>
81+
<class 'vsg.token.bit_string_literal.bit_value_string'>
82+
<class 'vsg.token.procedure_call.close_parenthesis'>
7383
<class 'vsg.token.procedure_call_statement.semicolon'>
7484
--------------------------------------------------------------------------------
7585
16 |
7686
<class 'vsg.parser.blank_line'>
7787
--------------------------------------------------------------------------------
78-
17 | end process;
88+
17 | proc;
89+
<class 'vsg.token.procedure_call.procedure_name'>
90+
<class 'vsg.token.procedure_call_statement.semicolon'>
91+
--------------------------------------------------------------------------------
92+
18 |
93+
<class 'vsg.parser.blank_line'>
94+
--------------------------------------------------------------------------------
95+
19 | end process;
7996
<class 'vsg.token.process_statement.end_keyword'>
8097
<class 'vsg.token.process_statement.end_process_keyword'>
8198
<class 'vsg.token.process_statement.semicolon'>
8299
--------------------------------------------------------------------------------
83-
18 |
100+
20 |
84101
<class 'vsg.parser.blank_line'>
85102
--------------------------------------------------------------------------------
86-
19 | end architecture RTL;
103+
21 | end architecture RTL;
87104
<class 'vsg.token.architecture_body.end_keyword'>
88105
<class 'vsg.token.architecture_body.end_architecture_keyword'>
89106
<class 'vsg.token.architecture_body.architecture_simple_name'>

tests/vhdlFile/procedure_call_statement/classification_test_input.vhd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ begin
1212

1313
proc(a, b, c);
1414

15+
proc(x"1", d"5", o"X");
16+
1517
proc;
1618

1719
end process;

0 commit comments

Comments
 (0)