sjbarag / brs

An interpreter for the BrightScript language that runs on non-Roku platforms.
MIT License
113 stars 43 forks source link

Caret assignment operator not valid #176

Closed TwitchBronBron closed 5 years ago

TwitchBronBron commented 5 years ago

The caret equals (^=) operator was added to brs in this commit.

This does not appear to be valid brightscript. I can't find any reference in the docs, and it also produces a syntax error when compiling on a Roku device. I believe the ^= assignment operator should be removed?

Here's a test file you can run on a Roku device which proves the code does not compile.

function Main()
   age = 10
   age ^= 2
   print age
end function
sjbarag commented 5 years ago

Oh dang I must have mentally added it to the list from sdkdocs: https://sdkdocs.roku.com/display/sdkdoc/Expressions%2C+Variables%2C+and+Types#Expressions,Variables,andTypes-MathematicalandBitshiftAssignmentOperators

Great catch!

On Mon, Feb 25, 2019 at 12:01 PM Bronley Plumb notifications@github.com wrote:

The caret equals (^=) operator was added to brs in this commit https://github.com/sjbarag/brs/commit/9cff49fd1387ca22bd4d34e022295777c8f1124d#diff-a13a274bb5ce98d0a99b2a3c4243ba46R192 .

This does not appear to be valid brightscript. I can't find any reference in the docs, and it also produces a syntax error when compiling on a Roku device. I believe the ^= assignment operator should be removed?

Here's a test file you can run on a Roku device which proves the code does not compile.

function Main() age = 10 age ^= 2 print ageend function

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sjbarag/brs/issues/176, or mute the thread https://github.com/notifications/unsubscribe-auth/AAoorxq-R8vpfQ6WouoBcAiugms35Uj_ks5vREEjgaJpZM4bQq_v .