Skip to content

Standard way to construct RewriteRules at run-time? #273

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
THinnerichs opened this issue Apr 3, 2025 · 0 comments
Open

Standard way to construct RewriteRules at run-time? #273

THinnerichs opened this issue Apr 3, 2025 · 0 comments

Comments

@THinnerichs
Copy link

THinnerichs commented Apr 3, 2025

Hey,

I really like the Julia macro solution for constructing rules with @rule in Metatheory. Now, I would like to construct RewriteRules at run-time.

However, the expanded macro (Base.remove_linenums! for better readability)

 Base.remove_linenums!(@macroexpand @rule :a --> 1)

is pretty verbose.

What would be the standard way to construct a RewriteRule at run-time, then? Preferably, I would like to have something like

a = :a
b =1
r = RewriteRule(a, -->, b)
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