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

"guards" of Rules should be in their patterns, not outputs #26

Open
EasyArray opened this issue Mar 2, 2022 · 0 comments
Open

"guards" of Rules should be in their patterns, not outputs #26

EasyArray opened this issue Mar 2, 2022 · 0 comments

Comments

@EasyArray
Copy link
Owner

Now when a Rule is parsed, the portion after || becomes part of the output of the rule:

(r'rule +([^ :]+):? +⟦?([^⟧]+)⟧? *(?:=>?|->) *(.+) \|\| +(.+)(?=\n)', r"Rule(\1, \2, '\3 if \4 else None')"),

class Rule(object):
def __init__(self, name, pattern, output):

I wonder if it should instead be part of the pattern? But that is not possible given that patterns are simply PhiVals as things stand. This ties in to the larger issue of expanding the pattern matching machinery.

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