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.
I found a bug in the
prepare_lines_subparserfunction in theparser.pymodule.When the recipe file contains a
}character inside a function, e.g. in asedcommand insidedo_configure, the scope level detection mechanism in lines 114 to 122 wrongly thinks that the}character inside thesedcommand is the closing bracket of the function (line 117). The scope_level becomes negative immediately and the while loop exits before all lines of thedo_configurefunction 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
}\nin 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.