Skip to content

Prepare Lines Subparser does not detect function correctly #340

Description

@stwalser

I found a bug in the prepare_lines_subparser function in the parser.py module.
When the recipe file contains a } character inside a function, e.g. in a sed command inside do_configure, the scope level detection mechanism in lines 114 to 122 wrongly thinks that the } character inside the sed command is the closing bracket of the function (line 117). The scope_level becomes negative immediately and the while loop exits before all lines of the do_configure function have been parsed.

Would it be possible to enhance this check somehow with a more robust mechanism that doesn't lead to false positives?
I was thinking about checking for }\n in line 117, but I don't know if it's a valid assumption that on a closing bracket of a function always follows a newline.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    communityCan be taken by the community

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions