sjbarag / brs

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

Implement global `Type` function #80

Closed sjbarag closed 5 years ago

sjbarag commented 5 years ago

BrightScript values including uninitialized variables are all valid parameters to the global Type function that returns a string describing the variable's type. Note that there's an optional second parameter, but it's not super clear how that affects the output. It seems like type(foo, 3) returns a BrightScript Component name, and type(foo, 2) doesn't? I'm not entirely sure yet, but this will likely require a change to the BrsValue interface to ensure all values are capable of handling this on their own.

Reference Implementation docs

depends on #79

sjbarag commented 5 years ago

This wasn't supposed to be closed with #95; #79 was. Whooooooooops