diff --git a/muppet/puppet/format/parser.py b/muppet/puppet/format/parser.py index c942ee8236820695e39953a0998b15232d6839dd..1a960b8ec52e241d4aebde3959f00bac3c07a1cb 100644 --- a/muppet/puppet/format/parser.py +++ b/muppet/puppet/format/parser.py @@ -370,16 +370,8 @@ class ParserFormatter(Serializer[ParseDirective]): & optional(s('}'))) parser &= f case PuppetString(st): - # TODO what am I doing here? ParseError should - # never be throw, since we aren't running the - # parser, simply building it. And why is the - # except block the exact same as the try block? - try: - for c in st: - parser &= rich_char(c) - except ParseError: - for c in st: - parser &= rich_char(c) + for c in st: + parser &= rich_char(c) case _: parser &= many(space) & "${" & ws & self.s(fragment) & ws & "}" parser &= s('"') & ws diff --git a/tests/test_parse_elsif.py b/tests/test_parse_elsif.py index db9264063f3b6fcd31001bdbf76b8534232d9f2b..cc02476ec57691f8ab196f42a799450c32bdb89d 100644 --- a/tests/test_parse_elsif.py +++ b/tests/test_parse_elsif.py @@ -322,6 +322,10 @@ def test_string_interpolation_call_access(): block=None)])) +def test_concat_with_actual_string(): + parse_string('"Hello ${name}"') + + def test_collect(): parse_string(""" Exec <| title=='apt_update' |> {