wist icon indicating copy to clipboard operation
wist copied to clipboard

Parse error on dangling dot operator

Open cdthompson opened this issue 6 years ago • 0 comments

Dangling dot operators are valid syntax and the roku interpreter ends up ignoring the final dot. I dislike the language behavior here but it does run as valid syntax. Would be nice to have wist successfully parse this but also have a rule to warn against it since it almost surely was not intended by the developer.

Example behavior from the console

Brightscript Debugger> print m
<Component: roAssociativeArray> =
{
}

Brightscript Debugger> m.foo. = "hi"

Brightscript Debugger> print m
<Component: roAssociativeArray> =
{
    foo: "hi"
}

Brightscript Debugger> m.bar = "bye"

Brightscript Debugger> a = m.bar.

Brightscript Debugger> print a
bye

Brightscript Debugger> 

cdthompson avatar May 29 '18 15:05 cdthompson