Skip to content

Correctly parse statements with multiple escaped characters

Michael Aaron Murphy requested to merge huntergoldstein:master into master

Created by: huntergoldstein

Problem: Statements such as foo\(\) were not being correctly parsed, see #291 (closed).

Solution: Whenever a character is read by a WordIterator when the BACKSL flag is set, the flag gets unset.

Changes introduced by this pull request:

  • Backslash flag now reset upon reading the escaped character
  • Add regression test for multiple backslashes

Drawbacks:

  • It could use some more tests for these sorts of use cases
  • It is unclear if this affects the other uses of the WordIterator beyond parsing command line statements.

Fixes: Resolves #291 (closed). State: Ready with the caveat of adding more unit / regression tests, also formatting and such.

Merge request reports