ljleb / prompt-fusion-extension

auto1111 webui extension for all sorts of prompt interpolations!
MIT License
264 stars 16 forks source link

Parser is way too restrictive #16

Closed ljleb closed 1 year ago

ljleb commented 1 year ago

The parser should either be nerfed so that it accepts a lot of inputs, or it should generate more precise and useful error messages.

In particular, the parsing for interpolation expressions could be simplified to accept any list of strings separated by :s. This would make it easier to support floating point values 0 < x < 1 (representing a ratio of total processing steps). Also it would fix some weird edge cases we're getting when trying to use numbers separated by commas in prompt interpolation text fields.

We additionally may want to allow unbalanced parentheses since the webui is now visually reporting them. The way I see it, it shouldn't be our responsibility to make sure parentheses are balanced, it should be webui's.

ljleb commented 1 year ago

The value of variable declarations $symbol = ... is greedy and spans multiple lines at the moment. This is also something that should be addressed. We should either break variable assignments on new lines or using something like a : to indicate end of expression.