Skip to content

Pragmas #218

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Pragmas #218

wants to merge 3 commits into from

Conversation

esb
Copy link

@esb esb commented May 21, 2024

Add support for Pragmas. A pragma can be added by the addition of a comment at the end of a line. The comment has the format "# Pragma: xxxxx" where xxxxx is the name of a specific supported pragma. Each pragma, when enabled changes the way in which the line is translated in some way.

Initial support is included for a nullish coalescing pragma which changes all '||' operators to '??' within a line. It is enabled with a '??' pragma.

For example:

a ||= b # Pragma: ??

This results in the translation:

a ??= b;

@jaredcwhite
Copy link
Member

@esb Apologies for the delay in reviews…I was rather out of commission last month for personal reasons, but trying to get caught up now. Will look at this and other outstanding issues. TY!

@jaredcwhite jaredcwhite self-requested a review July 3, 2024 00:03
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

Successfully merging this pull request may close these issues.

3 participants