I think expression parsing is a big topic since every more complex part
of protocol requires it. I found that quite often builds emit warnings
about "invalid expression", yet whole thing goes just fine. I once tried
to narrow a cause, but didn't find any.
What is pretty painful is that we don't have a clear picture of what is
available for expressions in given context since some things are visible
during serialization while some are not. I guess this might and probably
will vary between languages and the only way to find it is by making
compilation.
Reason why I bring this up now is basic, maybe with this cycle of mspec
updates we could introduce reserved words for expressions (or mspec)?
Best,
Łukasz
On 11.05.2021 10:22, Christofer Dutz wrote:
> Hi all,
>
> I'm currently trying to resolve some issues with the string parsing in
> mspec. Right now the generated output is technically not correct as for
> dynamic length string fields the "sizeInBits" is set to "-1". We need to
> address this.
>
> Here I noticed that if the expression references another field, the
> parser automatically makes this a "stringLiteral", which is also not
> really correct.
>
> I thin we should probably invest some time ("we" probably being "me") to
> make sure there is a difference between a "stringLiteral" and something
> else (maybe "variableLiteral") ... StringLiterals should always be quoted.
>
> So a:
>
> '"hurz"' would be a StringLiteral, but a 'hurz' would be a VariableLiteral.
>
> Just wanted to let you know that we will be having some minor updated
> with respect to this.
>
> Chris
>