Pogues
Pogues copied to clipboard
VTL editor is not correctly handling simple quotes use
In VTL, strings start and end with a double quote (→ "
). Thus, using simple quotes (→ '
) should raise a syntax error or at least a warning.
The misuse of simple quotes leads to subtle bugs, consider this case:
- we want to check the content of a text response fied,
- for that i use the editor and write the following control :
$MY_VAR$ = 'bad text'
- when generating the web questionnaire[0], it will trigger the control for any text,
- correcting the control code to
$MY_VAR$ = "bad text"
, - the behaviour is now the good one, only triggering the error message when typing
bad text
The existing VTL in Pogues documentation (for now in french only 🇫🇷 ) highlight the exclusive use of double quotes, but it would be nice that the editor helps here.
[0] remember, the generating target is a web form using both Lunatic and Trevas-JS