[sldev] Verified the lexxing bug in indra.l
Jesse Malthus
JesseMalthus at gmail.com
Tue Jan 23 14:34:56 PST 2007
By all means, please file a bug in JIRA (http:\\jira.secondlife.com\)
On 1/23/07, Argent Stonecutter <secret.argent at gmail.com> wrote:
> This script parses successfuly in LSL and produces an obviously
> incorrect result.
>
> default
> {
> state_entry()
> {
> llSay(0, (string)(3.-4));
> }
> }
>
> [14:09] Object: 3.000000
>
> This is what I suggested would happen in my previous article with the
> constant folding patched for indra.l and indra.y.
>
> What's happening is that floating point numbers match an expression
> that begins with {D}+"."{D}*, and {D} expands to [-]?[0-9], which -4
> matches...
>
> This could be fixed in indra.l, but really folding '-' FP_CONSTANT
> into FP_CONSTANT should be done in indra.y, because it keeps "a-1"
> from matching this rule:
>
> expression : expression '-' expression ;
>
> Since "a-1" lexes to IDENTIFIER INTEGER_CONSTANT, not IDENTIFIER '-'
> INTEGER_CONSTANT.
>
> See my previous post for the patch.
> _______________________________________________
> Click here to unsubscribe or manage your list subscription:
> /index.html
>
--
--Jesse
More information about the SLDev
mailing list