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

Preprocessor #167

Open
3 tasks
rbrich opened this issue Apr 10, 2023 · 0 comments
Open
3 tasks

Preprocessor #167

rbrich opened this issue Apr 10, 2023 · 0 comments
Labels
enhancement New feature or request xci-script

Comments

@rbrich
Copy link
Owner

rbrich commented Apr 10, 2023

Doesn't need to be really a separate preprocessor, can be part of parser. A "preprocess-only" option will emit source code with conditionals and includes applied, #syntax can be either kept untouched or removed.

To avoid emitting special markers for compiler (real/logical line numbers etc.), the directives can be consumed directly by compiler, inclusion will create new file context but keep same AST, conditional will skip part of source, etc.

  • #syntax fire 1.0 (<lang> <major>[.<minor>]) - optional declaration of language version, checked by compiler ( part only informative, <lang> <major> must be known to the compiler, otherwise it emits error or warning)
  • #include
  • #if

New idea: still textual preprocessor, but the language will be the xci-script, i.e. you can define compile-time function that can be called to generate code.

@rbrich rbrich added enhancement New feature or request xci-script labels Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request xci-script
Projects
None yet
Development

No branches or pull requests

1 participant