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

Imports (file imports) #66

Closed
5 tasks done
pouya-eghbali opened this issue Dec 24, 2019 · 2 comments · Fixed by #118
Closed
5 tasks done

Imports (file imports) #66

pouya-eghbali opened this issue Dec 24, 2019 · 2 comments · Fixed by #118

Comments

@pouya-eghbali
Copy link
Member

pouya-eghbali commented Dec 24, 2019

An import pattern should be added to the lexer, rules should be written for parser and generator, and the necessary runtime (if needed) should be created.

  • Add import pattern in core/patterns.js
  • Add from pattern in core/patterns.js
  • Add parser rules in core/clio.beef
  • Add generator rules in core/generator.js
  • Add required builtins and runtime in core/internals

Import statement should work with below patterns:

import * from path
import name1 name2 name3 from path
import path
import name1 as name2 from path
import path as name

For beef files, there's a vscode addon hosted here:
https://github.com/pouya-eghbali/bean/tree/master/vscode-beef

@garritfra garritfra changed the title New compiler: Imports (file imports) Imports (file imports) Dec 24, 2019
@pouya-eghbali
Copy link
Member Author

import name from path
import name1 name2 from path

works, others are not implemented.

@pouya-eghbali
Copy link
Member Author

import * from path
import path

should work now (haven't pushed yet)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants