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

How is possible to implement C-like pre-processor macros ? #66

Open
dooxe opened this issue Feb 22, 2022 · 0 comments
Open

How is possible to implement C-like pre-processor macros ? #66

dooxe opened this issue Feb 22, 2022 · 0 comments

Comments

@dooxe
Copy link

dooxe commented Feb 22, 2022

Hello !

For my script language I want to implement a simple way to separate scripts into multiple file.
In order to do so, I imagine using C-like preprocessor to include script files into another like:

@import "script1"
@import "script2"

# ... remaining of the script 

The idea would be to load the file content of "script1" and "script2" before parsing the whole content.
The macros "@import ..." should be at the start of the script.

Is that possible to implement it with jison ?

For now, I'm using a dedicated parser that only parse comments and imports before parsing the script content, dou you think it's a good idea ?

Thanks a lot

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

No branches or pull requests

1 participant