elkowar / eww

ElKowars wacky widgets
https://elkowar.github.io/eww
MIT License
9.11k stars 377 forks source link

[BUG] Bad error message on empty string interpolation `${}` #515

Open ankrisac opened 2 years ago

ankrisac commented 2 years ago

Checklist before submitting an issue

Description of the bug

When using an empty string interpolation expression ${}, eww reports Input ended unexpectedly at the beginning of the file.

Reproducing the issue

Minimum config to reproduce the bug

eww.yuck

; Comment

(defvar var "${}")

Running eww daemon

$ eww daemon
...

error: Input ended unexpectedly. Check if you have any unclosed delimiters
  ┌─ /home/ankrisac/.config/eww/eww.yuck:1:1
  │
1 │ ; Comment
  │ ─

Expected behaviour

Ideally ${} should be a valid expression resulting in an empty string

Additional context

No response

elkowar commented 2 years ago

The errror message here is definitely bad, that needs to be improved! However, I don't think it should result in an empty string, as the empty string interpolation is just an invalid expression that cannot be evaluated, and thus should still result in an error - just a more readable one!