Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHeaderParser hangs forever if a line has both "{" and "}" #219

Open
colbychaskell opened this issue Aug 15, 2022 · 0 comments
Open

CHeaderParser hangs forever if a line has both "{" and "}" #219

colbychaskell opened this issue Aug 15, 2022 · 0 comments

Comments

@colbychaskell
Copy link

Describe the bug
The CHeaderParser script will hang forever searching for command parameters if a line has both a "{" and a "}". This includes commented lines since there is nothing in the script to ignore comment lines.

To Reproduce

  1. Add a comment such as /* {TEST_PARSER} */ to a header file
  2. Add that header file to CHeaderParser-hdr-paths.txt

Expected behavior
For one, the parser should ignore structs that are commented out so this line could be ignored entirely, but otherwise it should be adding that line to the list of command structs and continuing

Code snips
From CHeaderParser.py:
`
while inside_struct:
# Check for the end of the structure
# We will still want to know what line this is
if '}' in file_lines[line_num]:
# Clear the flag, we found the end.
inside_struct = False

    # Add line number to list, even if it has a '}'
    lines_of_struct.append(line_num)

    # Now that we know the struct is over, add list of lines
    # to the sets of command structures
    list_cmd_structs.append(lines_of_struct)
    line_num += 1
    break

System observed on:

  • OS: Ubuntu 20.0.4
  • Versions: v3.3.0-rc4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant