Pogues icon indicating copy to clipboard operation
Pogues copied to clipboard

Check variable name syntax

Open romaintailhurat opened this issue 2 years ago • 1 comments

🇬🇧 When a user creates a question and the related response, the variable (or the set of variables) is generated from the question name. However, instead of relying on the generated name(s), the user can provide its own variable name(s).

The problem is that the provided name is not checked when user-provided. This can lead to parsing troubles, particularly when parsing variable names for VTL.

For example $BADLY-NAMED-VAR$ contains an hyphen - that cannot be processed. One can input that name in the variable name input field, but this name will be then renammed to $BADLY$-NAMED-VAR$ (note the $ in the middle)

🇫🇷 Quand un concepteur crée une question et la réponse qui va avec, la ou les variables collectées ad hoc sont créées à partir de l'identifiant de la question. L'utilisateur peut également renommer ces variables générées.

Le problème est que ces noms entrés par l'utilisateur ne sont pas vérifiés, ce qui peut entraîner des problèmes dans l'usage des variables en VTL.

Par exemple $BADLY-NAMED-VAR$ contient un tiret - ce qui n'est pas valide et sera interprété et renommé en $BADLY$-NAMED-VAR$ (un $ mal placé au milieu).

romaintailhurat avatar Jun 24 '22 14:06 romaintailhurat

see https://github.com/InseeFr/Pogues/issues/698

romaintailhurat avatar Mar 11 '24 14:03 romaintailhurat