-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(parse,interp,e2e): Add basic global native functions #35
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sjbarag
added
enhancement
Any addition to this project's existing capabilities
parser
Affects this project's token parser
interpreter
Affects this project's tree-walking interpreter
e2e
Affects this project's end-to-end test cases (the BrightScript sample files executed during testing)
labels
Apr 4, 2018
Oh right, I forgot to mention: The same |
It's part of the BrightScript standard library, so at least it's something
This also provides a good function name in errors instead of just "[Function]". So that's neat.
This includes a move twoards greater compile-time safety in the implementation of "native" functions.
These are only here right now to help work out the native function implementation.
It's just UCase and LCase for now, but I want to get a pattern set up for whenever we add more global functions.
This adds parser tests for function calls as well! *Ho0r@Y*
Still only for global functions, but these tests should be easyish to extend for user-defined functions
Right now it's only `LCase` and `UCase` but it's something! At least we've got a pattern set up.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
e2e
Affects this project's end-to-end test cases (the BrightScript sample files executed during testing)
enhancement
Any addition to this project's existing capabilities
interpreter
Affects this project's tree-walking interpreter
parser
Affects this project's token parser
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This gets the groundwork set up for the rapid implementation of global functions — including the ability to call them at runtime. There's a few caveats there for now though:
LCase
,UCase
, (string lowercase and string uppercase) andRebootSystem
(which does nothing in this implementation [1]) are implemented so far.LCase(185)
is called.[1] I guess I could shell out to
shutdown -r
but that seems particularly mean and useless.