-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add support for modules #98
Comments
yes, so we need to make a kinds of "macro" like C's |
I (very) often need this feature with mlogjs ! Why not just include a file (at the parser level) ? This would just read the concatenate module.js to the rest of the file (the compiler should even not know that a module was imported). (I'm not an expert at all in javascript) |
Because mlogjs doesn't actually do the parsing by itself, it uses babel to parse the code and then traverses the AST (Abstract Syntax Tree) that babel generated. The are a few things that are in the way of implementing modules:
And while module support is within my priorities, I find it more important to implement the optimizer first, as that will eliminate many bugs in the current implementation and possibly make handling modules more straightforward in some aspects. |
Because fery few other compilers did that. Also, this requires changes on the sourcemapping format and the name handling and resolution.
The text was updated successfully, but these errors were encountered: