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

Implement a preprocessor #1

Open
RealKC opened this issue Mar 26, 2020 · 1 comment · May be fixed by #7
Open

Implement a preprocessor #1

RealKC opened this issue Mar 26, 2020 · 1 comment · May be fixed by #7
Assignees
Labels
bug Something isn't working enhancement New feature or request high priority Something should be worked on ASAP

Comments

@RealKC
Copy link
Owner

RealKC commented Mar 26, 2020

In commit 8b189c2 I gave up on working on the assembler. This is something I still need to write and this issue stands to remind me of that.

@RealKC RealKC added bug Something isn't working enhancement New feature or request labels Mar 26, 2020
@RealKC RealKC self-assigned this Mar 27, 2020
@RealKC RealKC added the high priority Something should be worked on ASAP label Mar 28, 2020
@RealKC
Copy link
Owner Author

RealKC commented Apr 1, 2020

Commit 4a506f0 removed all traces of the initial preprocessor, this is a good thing (code quality was low + wasn't half finished + it was commented out anyway).

Implementation notes:

  • if, and elif should share the expression parses, which should likely be implemented using the shunting-yard algorithm [1]

Specification notes:

  • the operators supported in (el)if should be specified
  • specify what happens when the preprocessor has to expand an empty macro in (1) (el)if expressions (should we follow CPP's example and expand them to 0?) and (2) in usual usages of the macros

Possible features that might be worth adding:

  • defining macros from the command line
  • textual inclusion of files for macros that appear in multiple files? (Although currently you can't link files... It would be nice for macros used across projects, I guess? Also could allow a model where despite working in different files they all get included by a single one.)

There are still bugs regarding codegen however, so this issue can wait for a bit longer.

[1] Shunting-yard algorithm on Wikipedia

@RealKC RealKC modified the milestone: 0.5.0 Apr 11, 2020
@RealKC RealKC linked a pull request Jun 1, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request high priority Something should be worked on ASAP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant