sjbarag / brs

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

Plus Equals is results in parse error #155

Closed TwitchBronBron closed 5 years ago

TwitchBronBron commented 5 years ago

The += operator is valid brightscript, but this library results in a parse error. Take the following code example to show this issue.

var brs = require('brs');
let lexResult = brs.lexer.Lexer.scan(`
    sub Main()
        num = 1
        num += 2    
    end sub
`)
let parseResult = brs.parser.Parser.parse(lexResult.tokens);
if (parseResult.errors.length > 0) {
    throw new Error('There should not be parse errors');
}
sjbarag commented 5 years ago

Thanks for opening this — I’ve meaning to do it! This is going to be a pretty high priority once I get location tracking finished off.

On Tue, Feb 5, 2019 at 6:58 PM Bronley Plumb notifications@github.com wrote:

The += operator is valid brightscript, but this library results in a parse error. Take the following code example to show this issue.

var brs = require('brs');let lexResult = brs.lexer.Lexer.scan(sub Main() num = 1 num += 2 end sub)let parseResult = brs.parser.Parser.parse(lexResult.tokens);if (parseResult.errors.length > 0) { throw new Error('There should not be parse errors'); }

— 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/155, or mute the thread https://github.com/notifications/unsubscribe-auth/AAoor6yT91VJXoSxsiKVljwBLGRc9Lznks5vKkTKgaJpZM4akeCR .