rokucommunity / brighterscript

A superset of Roku's BrightScript language
MIT License
152 stars 47 forks source link

Conditional compilation should allow operators #59

Open JPeMu opened 4 years ago

JPeMu commented 4 years ago

Preprocessor statements such as this:

#if not production
   ? "Debug Version"
#else
   ? "Production Version"
#end if

Give a 1091 error ("#if conditionals can only be 'true', 'false', or other #const names"). This doesn't seem to be the case for vanilla BrightScript as can be seen in the example in the Roku documentation:

Conditional Compilation - Roku Documentation

Unfortunately the Roku docs don't expand on which operators are permitted. It's probably relatively safe to assume that the logical operators (AND, OR, NOT) are OK, but what about others? The code shown above works fine on a Roku device.

sjbarag commented 4 years ago

Dupe of upstream bug https://github.com/sjbarag/brs/issues/390