Closed
Description
Describe the bug
When using some of ...
with symbols, a non-capturing group is added unconditionally. This is unnecessary for most individual symbols (e.g. <word>
).
To Reproduce
Steps to reproduce the behavior:
- Open the Melody Playground
- Write a program which only uses
some of ...
with a single symbol, e.g.:some of <word>;
- Review the output
Expected behavior
RegEx output should only add wrap things with non-capturing groups if necessary or if implicitly required (via match {}
).
Examples
any of <word>;
// Outputs /(?:\w)*/
any of "a";
// Outputs /a*/
some of <word>;
// Outputs /(?:\w)+/
some of "a";
// Outputs /a+/
option of <word>;
// Outputs /(?:\w)?/
option of "a";
// Outputs /a?/