Skip to content
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

Introducing Lib Tags for Declaring Direct Function Mapping Compilation #95

Open
Alexius-Huang opened this issue May 29, 2020 · 0 comments

Comments

@Alexius-Huang
Copy link
Owner

Alexius-Huang commented May 29, 2020

What?
Related to #83, introduce several library tags:

  • @direct-function-mapping ~ @end is the region to declare direct function mappings
  • @maps which maps to the name of the JavaScript method, default is the same name as the original function
  • @params which is the parameters of the method, default is no parameters
  • @returns is the return type of the method, default returns Void

Why?
Instead of configuring the builtin method inside parser, it is better to decouple these builtin methods and config by importing library files.

How?
Sample Wyrd Code

@direct-function-mapping
  puts @maps("console.log") @params(Str)
  warn @maps("console.warn") @params(Str)
  ...
@end

No Compiled Result, but will be builtin methods.

@Alexius-Huang Alexius-Huang added Bug Something isn't working Category: Lib and removed Bug Something isn't working labels Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant