Git Product home page Git Product logo

Comments (6)

SittingDuc avatar SittingDuc commented on July 22, 2024 1

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.

SittingDuc avatar SittingDuc commented on July 22, 2024

iIndex = lOpenParens.pop()

Is the line that is throwing the IndexError exception. But I don't know why :(

from vhdl-style-guide.

jeremiah-c-leary avatar jeremiah-c-leary commented on July 22, 2024

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.

jeremiah-c-leary avatar jeremiah-c-leary commented on July 22, 2024

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.

SittingDuc avatar SittingDuc commented on July 22, 2024

Hello. I can confirm on my production file the branch fixes the issue: no more python stack dump. Thank you

from vhdl-style-guide.

jeremiah-c-leary avatar jeremiah-c-leary commented on July 22, 2024

Awesome, I will merge this into master.

from vhdl-style-guide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.