Comments (6)
Okay, I can confirm that, replacing the (range => '0')
in my production code with a constant defined as zeroes upscope, causes the issue to go away.
My code is not as pretty, so a full fix is still desirable, but I at least have a workaround to lint this one file and carry on
from vhdl-style-guide.
vhdl-style-guide/vsg/vhdlFile/vhdlFile.py
Line 717 in a972c42
Is the line that is throwing the IndexError exception. But I don't know why :(
from vhdl-style-guide.
Morning @SittingDuc ,
I suspect (proc0(b,c)) = (1 downto 0 => '0')
is being treated as an aggregate.
The line
func0(a, (proc0(b,c)) = (1 downto 0 => '0'), d, e);
is parsed into the following tokens:
1 <vsg.parser.whitespace object at 0x7fe5b0a04d60>
2 <vsg.token.procedure_call.procedure_name object at 0x7fe5b0a046a0>
3 <vsg.token.procedure_call.open_parenthesis object at 0x7fe5b0a04610>
4 <vsg.token.association_element.actual_part object at 0x7fe5b0a04520>
5 <vsg.token.association_list.comma object at 0x7fe5b0a04940>
6 <vsg.parser.whitespace object at 0x7fe5b0a041c0>
7 <vsg.token.association_element.formal_part object at 0x7fe5b0a04160>
8 <vsg.token.todo.name object at 0x7fe5b0a05510>
9 <vsg.token.todo.open_parenthesis object at 0x7fe5b0a054e0>
10 <vsg.parser.todo object at 0x7fe5b0a04730>
11 <vsg.parser.comma object at 0x7fe5b0a04820>
12 <vsg.parser.todo object at 0x7fe5b0a04ac0>
13 <vsg.token.todo.close_parenthesis object at 0x7fe5b0a053f0>
14 <vsg.parser.close_parenthesis object at 0x7fe5b0a04970>
15 <vsg.parser.whitespace object at 0x7fe5b0a04850>
16 <vsg.token.relational_operator.equal object at 0x7fe5b0a048e0>
17 <vsg.parser.whitespace object at 0x7fe5b0a04be0>
18 <vsg.parser.open_parenthesis object at 0x7fe5b0a049d0>
19 <vsg.parser.todo object at 0x7fe5b0a043a0>
20 <vsg.parser.whitespace object at 0x7fe5b0a04a00>
21 <vsg.token.direction.downto object at 0x7fe5b0a04bb0>
22 <vsg.parser.whitespace object at 0x7fe5b0a04b50>
23 <vsg.parser.todo object at 0x7fe5b0a048b0>
24 <vsg.parser.whitespace object at 0x7fe5b0a04760>
25 <vsg.token.association_element.assignment object at 0x7fe5b0a04b20>
26 <vsg.parser.whitespace object at 0x7fe5b0a04c40>
27 <vsg.token.association_element.actual_part object at 0x7fe5b0a04a90>
28 <vsg.token.association_element.actual_part object at 0x7fe5b0a04d30>
29 <vsg.token.association_list.comma object at 0x7fe5b0a04a60>
30 <vsg.parser.whitespace object at 0x7fe5b0a04d00>
31 <vsg.token.association_element.actual_part object at 0x7fe5b0a04910>
32 <vsg.token.association_list.comma object at 0x7fe5b0a04c10>
33 <vsg.parser.whitespace object at 0x7fe5b0a04dc0>
34 <vsg.token.association_element.actual_part object at 0x7fe5b0a04df0>
35 <vsg.token.procedure_call.close_parenthesis object at 0x7fe5b0a04ca0>
36 <vsg.token.procedure_call_statement.semicolon object at 0x7fe5b0a04e50>
37 <vsg.parser.carriage_return object at 0x7fe5b0a047f0>
Line 7 corresponds with the open parenthesis before proc0
and is not being classified as a parenthesis. So the number of open and close parenthesis are not equal and it will error out when attempting to match open and close parenthesis.
If you remove the =>
from the line:
func0(a, (proc0(b,c)) = (1 downto 0), d, e);
it will not error out.
I believe line 41 in vsg/vhdlFile/classify/association_element.py
:
38 def classify(iStart, iEnd, lObjects, sEnd):
39 iCurrent = iStart
40 # Classify formal part if it exists
41 if utils.find_in_index_range("=>", iStart, iEnd, lObjects):
42 iCurrent = formal_part.classify(token.formal_part, iCurrent, lObjects)
43 iCurrent = utils.assign_next_token_required("=>", token.assignment, iCurrent, lObjects)
should be updated to understand the assignment operator must exist at the correct parenthesis depth.
--Jeremy
from vhdl-style-guide.
Morning @SittingDuc ,
I pushed an update for this to the issue-1168
branch. When you get a chance could you check it out on your end and validate it is working and let me know?
Thanks,
--Jeremy
from vhdl-style-guide.
Hello. I can confirm on my production file the branch fixes the issue: no more python stack dump. Thank you
from vhdl-style-guide.
Awesome, I will merge this into master.
from vhdl-style-guide.
Related Issues (20)
- Extended configurability HOT 16
- Rule for "space around operators" (?) HOT 8
- Local Rule Creation Documentation HOT 5
- Multiple local_rule Directories HOT 5
- Rule for new lines between end of generic map and port map HOT 5
- Prefix/suffix exceptions not exempted from case checking in instantiation_008 HOT 6
- Rule concerning label presence after end keyword on component declaration HOT 4
- PascalCase/camelCase and acronyms HOT 9
- Options for merging config files HOT 1
- Forcing single space when disabling alignment rules HOT 6
- record element is incorrectly recognized as type element HOT 3
- Comment tricks vsg into incorrect parsing state HOT 3
- Better diagnostics when local indent rules don't match default config HOT 4
- Whitespace rules should allow <= operator HOT 8
- Ignore Components for port rules HOT 4
- Function/Procedure name as optional in end statement HOT 6
- Regex case rule fails on port_map_002 HOT 3
- Unable to have a series of port, port map declarations, signal declarations all be aligned even across comments or white space HOT 9
- Add Pascal_Snake_Case to case checking rules HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vhdl-style-guide.