Skip to content

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

@dooxe

Description

@dooxe

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions