sjbarag / brs

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

Make Statement.Block include surrounding whitespace #159

Closed sjbarag closed 5 years ago

sjbarag commented 5 years ago

A Block currently doesn't get parsed to include the whitespace immediately preceding it or trailing it. For example, consider this bit of BrightScript:

sub Main()

    age = 1

end sub

The parsed Block attached to the Main function will have a starting and ending line of 2, but it actually starts at the end of line 1 and beginning of line 5!

Reported by @TwitchBronBron.

sjbarag commented 5 years ago

Related to #134, but probably won't make it into 0.13.0 at the current rate. There's some further AST improvements necessary anyway, so this might get packaged up with that.

TwitchBronBron commented 5 years ago

@sjbarag I'm working on this.