Skip to content

Unterminated Brace Panic

Michael Aaron Murphy requested to merge emturner:707_brace_panic into master

Created by: emturner

Problem: Unterminated brace panic on echo [{ }]

Caused by ArgumentSplitter - [{ }] gets parsed to Array('{', '}'), resulting in the brace_expander panicking when it recieves only '{'.

Solution: Change the behaviour of ArgumentSplitter to only split by space when not in the middle of a pair of braces (as already happens with arrays).

Changes introduced by this pull request:

  • Adds b'{' and b'}' arms to ArgumentSplitter::next which increment and decrement blevel respectively. As with arrays, ArgumentSplitter only splits on space when blevel = 0.
  • Adds integration test arrays_with_braces.ion

Fixes: fixes #707 (closed)

State: Ready

Merge request reports