sjbarag / brs

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

feat(execution): create function to execute with scope #603

Closed lkipke closed 3 years ago

lkipke commented 3 years ago

Change Summary

This creates a function that generates an "execution scope" by executing a given set of files. Then, it returns a function that will execute other files in that execution scope.

This is similar to the existing runInScope extension in that it allows us to lex/parse a set of files once, then use those results for future executions. The benefit of this, though, is that we can use this capability in JS, whereas runInScope is called from Brightscript files.

We can use this in roca to run through our test suite in JS, which will allow us more flexibility in reporting, CLI options, and better error handling.