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

Global object matching #99

Merged
merged 6 commits into from
Feb 7, 2024
Merged

Global object matching #99

merged 6 commits into from
Feb 7, 2024

Conversation

aabounegm
Copy link
Collaborator

@aabounegm aabounegm commented Feb 6, 2024

Adds context to a rule that specifies if global object (Φ) or current object (ξ) should be matched and substituted immediately in pattern and result.

Closes #57


PR-Codex overview

Focus of this PR:

This PR introduces new rules and updates existing code in the EO Phi Normalizer.

Detailed summary:

  • Added a new rule named "Rule 4" with a Φ-dispatch pattern and result.
  • Updated the description and context of "Rule 4".
  • Removed "Rule 5" and its description.
  • Updated the context and pattern of "Rule 5".
  • Added a new rule context type named "RuleContext".
  • Updated the convertRule function to handle rule contexts.
  • Added a new function matchContext to match rule contexts.
  • Added a new function extendContextWith to extend the context with an object.
  • Updated the withSubObject function to include the context.
  • Updated the withSubObjectBindings function to include the context.
  • Updated the withSubObjectBinding function to include the context.
  • Added a new function progToObj to convert a program to an object.
  • Updated the convertRule function to use progToObj.
  • Added imports and language extensions as needed.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@fizruk
Copy link
Collaborator

fizruk commented Feb 6, 2024

Please, fix CI and address comments (here or create TODOs).

@aabounegm
Copy link
Collaborator Author

Actually, there is another mistake other than the unused variable, but I couldn't track it down last night. If you run stack test, you will see that head outerFormations fails because outerFormations is empty. I thought it should already be filled by the time this function is called, but seems like not. Any ideas what I'm doing wrong?

aabounegm and others added 3 commits February 7, 2024 16:13
Co-authored-by: Nikolai Kudasov <fizruk@users.noreply.github.com>
Co-authored-by: Nikolai Kudasov <fizruk@users.noreply.github.com>
Co-authored-by: Nikolai Kudasov <fizruk@users.noreply.github.com>
@aabounegm aabounegm merged commit 496546c into master Feb 7, 2024
5 checks passed
@aabounegm aabounegm deleted the rule-context-matching branch February 7, 2024 13:42
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.

Add rule feature: reference to global object bindings
2 participants