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

650 fix new.yaml #651

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

650 fix new.yaml #651

wants to merge 50 commits into from

Conversation

deemp
Copy link
Member

@deemp deemp commented Dec 28, 2024

@deemp deemp linked an issue Dec 28, 2024 that may be closed by this pull request
deemp added 25 commits December 31, 2024 13:29
- use a more specific function name
- improve error message
…-binding with this formation so that rho-attribute isn't used in the binding sugar
deemp and others added 23 commits January 30, 2025 23:46
- number some tests
- add a test with application with an empty list of bindings
- update problematic test
- check value, no sugar, and sugar equalities
- sugar before printing in the "sugar" test
- temporarily disable test that hangs after this change
- remove immediate formation dispatch
- move attributes into a formation and run dispatch because no rules specify what to do with a formation with neither a dispatch, nor an application
- avoid immediate dispatches
- wrap expressions into formations with a dispatch to evaluate them
- format
- remove unnecessary parenthses
@deemp
Copy link
Member Author

deemp commented Feb 13, 2025

@yegor256

Currently, dataization with built-in rules (different from new.yaml) works for the celsius example if I desugar literals. So, it may be OK to desugar literals right after parsing (#680 (comment)).

Input

desugared.phi

{
  ⟦
    y ↦ ⟦
      c ↦ Φ.org.eolang.number(
        as-bytes ↦ Φ.org.eolang.bytes(
            α0 ↦ ⟦
              Δ ⤍ 40-39-00-00-00-00-00-00,
              ρ ↦ ∅
            ⟧
        )
      ).times(
        x ↦ Φ.org.eolang.number(
          as-bytes ↦ Φ.org.eolang.bytes(
              α0 ↦ ⟦
                Δ ⤍ 40-39-00-00-00-00-00-00,
                ρ ↦ ∅
              ⟧
          )
        )
      ).plus (
        x ↦ Φ.org.eolang.number(
          as-bytes ↦ Φ.org.eolang.bytes(
              α0 ↦ ⟦
                Δ ⤍ 40-39-00-00-00-00-00-00,
                ρ ↦ ∅
              ⟧
          )
        )
      )
    ⟧.c,
    λ ⤍ Package
  ⟧
}

I use these dependencies

bytes.phi

{⟦
  org() ↦ ⟦
    eolang() ↦ ⟦
      bytes(data) ↦ ⟦
        φ ↦ ξ.data,
      ⟧,
      λ ⤍ Package
    ⟧,
    λ ⤍ Package
  ⟧
⟧}

number.phi

{⟦
  org() ↦ ⟦
    eolang() ↦ ⟦
      number(as-bytes) ↦ ⟦
        φ ↦ ξ.as-bytes,
        times(x) ↦ ⟦
          λ ⤍ Lorg_eolang_number_times
        ⟧,
        plus(x) ↦ ⟦
          λ ⤍ Lorg_eolang_number_plus
        ⟧,
      ⟧,
      λ ⤍ Package
    ⟧,
    λ ⤍ Package
  ⟧
⟧}

Built-in rules

eo-phi-normalizer dataize --recursive -d bytes.phi -d number.phi --no-sugar --chain  desugared.phi

Chain

built-in-desugared.log

New rules

Command

eo-phi-normalizer dataize --recursive -d bytes.phi -d number.phi --no-sugar --chain -r eo-phi-normalizer/test/eo/phi/rules/new.yaml desugared.phi

Chain

new-rules-desugared.log

@yegor256
Copy link
Member

@deemp my input is required here or this message is just FYI?

@deemp
Copy link
Member Author

deemp commented Feb 13, 2025

@yegor256, just FYI

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.

Fix new.yaml
2 participants