Closed abousta closed 2 years ago
Hi there, thanks for the bug report! I've reproduced the error with the steps you've provided (thank you for those steps too!), and was able to track the problem down to the 'string literals' rule:
Looks like I'm attempting to do some regex trick which won't work with empty strings. I'll have to figure out what I'm trying to do there and see how to make it work with empty strings 🤔
Maybe you could try '^$|.*?(?!\\').'
That would mean something like
Sorry... I wrote too soon. My previous regex doesn't fail if you miss the first or last quote (I hate regex :)) )
But I think this one should work: ''|'.*?(?!\\').'
, don't you ?
I tried a few other things, but the fix ended up being pretty much what you've suggested, so thank you for that 👍 I'll push a release out with this fix in it soon.
Hi,
As it is my first report, I would like to thank you first for this very well coded and helpful project.
The expression processor seems to fail parsing a ternary condition that could output an empty string.
Steps to reproduce this bug :
${condition} ? 'Hello!' : 'Goodbye :('
to${condition} ? '' : 'Goodbye :('
--> Error: Failed to parse "${condition} ? '' : 'Goodbye :('"${condition} ? 'Hello!' : 'Goodbye :('
to${condition} ? 'Hello!' : ''
--> Error: Failed to parse "${condition} ? 'Hello!' : ''"