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

Add --dependency-file option to support dependency files #265

Merged
merged 9 commits into from Apr 12, 2024

Conversation

fizruk
Copy link
Collaborator

@fizruk fizruk commented Apr 12, 2024

Closes #242.

  • Support --dependency-file options
  • Add documentation
  • Add org.eolang.* dependencies as .phi files (generated by EO compiler, extracted from the pipeline artifacts from pipeline/phi/.eoc/phi/org/eolang directory)
  • Figure out why dataization loops indefinitely if bytes.phi is not specified.
  • Figure out why dataization loops indefinitely when the actual bool.phi and bytes.phi are specified (ones generated by EO compiler).

The problem with non-termination was due to $\Phi.\mathsf{org}$ expanding into a package, which then was recursively dataized. Temporarily added a flag to avoid dataization of fields in Packages unless we are in a subformation of the program.

Also, bytes.phi generated by EO compiler lacks the empty delta binding, fixed that manually here.

Example

stack run -- dataize --recursive --rules eo-phi-normalizer/test/eo/phi/rules/yegor.yaml --dependency-file bool.phi --dependency-file bytes.phi test.phi
{ ⟦ org ↦ ⟦ eolang ↦ ⟦ x ↦ ⟦ Δ ⤍ 01- ⟧, z ↦ ⟦ Δ ⤍ 01- ⟧, λ ⤍ Package ⟧, λ ⤍ Package ⟧, λ ⤍ Package ⟧ }

Input files:

bool.phi:

{
  ⟦
    org ↦ ⟦
      eolang ↦ ⟦
        bool ↦ ⟦ α0 ↦ ∅, φ ↦ ξ.α0 ⟧,
        λ ⤍ Package
      ⟧,
      λ ⤍ Package
    ⟧,
    λ ⤍ Package
  ⟧
}

bytes.phi:

{
  ⟦
    org ↦ ⟦
      eolang ↦ ⟦
        bytes ↦ ⟦ Δ ⤍ ∅ ⟧,
        λ ⤍ Package
      ⟧,
      λ ⤍ Package
    ⟧,
    λ ⤍ Package
  ⟧
}

test.phi:

{
  ⟦
    org ↦ ⟦
      eolang ↦ ⟦
        x ↦ ⟦
          φ ↦ Φ.org.eolang.bool(
            α0 ↦ Φ.org.eolang.bytes(
              Δ ⤍ 01-
            )
          )
        ⟧,
        z ↦ ⟦
          y ↦ ⟦
            x ↦ ∅,
            φ ↦ ξ.x
          ⟧,
          φ ↦ Φ.org.eolang.bool(
            α0 ↦ Φ.org.eolang.bytes(
              Δ ⤍ 01-
            )
          )
        ⟧,
        λ ⤍ Package
      ⟧,
      λ ⤍ Package
    ⟧,
    λ ⤍ Package
  ⟧
}

PR-Codex overview

This PR introduces new normalization rules and file injection options to the eo-phi-normalizer tool.

Detailed summary

  • Added new normalization rules for various objects
  • Introduced --rules FILE argument for specifying rule files
  • Added --output-file FILE option for redirecting output
  • Included --dependency-file FILE to inject package dependencies
  • Modified the Context struct in Common.hs to include a flag for dataizing Package attributes

The following files were skipped due to too many changes: eo-phi-normalizer/test/eo/phi/org/eolang/tuple.phi, eo-phi-normalizer/test/eo/phi/org/eolang/heap.phi, eo-phi-normalizer/test/eo/phi/org/eolang/float.phi, eo-phi-normalizer/src/Language/EO/Phi/Dataize.hs, eo-phi-normalizer/test/eo/phi/org/eolang/negative-infinity.phi, eo-phi-normalizer/test/eo/phi/org/eolang/positive-infinity.phi, eo-phi-normalizer/app/Main.hs

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

@fizruk fizruk merged commit 6a54fc0 into master Apr 12, 2024
4 checks passed
@fizruk fizruk deleted the add-dependencies-option branch April 12, 2024 11:48
@fizruk fizruk mentioned this pull request Apr 12, 2024
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.

Support EO dependencies
1 participant