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

simple rule of resetting delta doesn't work #504

Open
yegor256 opened this issue Oct 7, 2024 · 8 comments
Open

simple rule of resetting delta doesn't work #504

yegor256 opened this issue Oct 7, 2024 · 8 comments
Assignees

Comments

@yegor256
Copy link
Member

yegor256 commented Oct 7, 2024

My YAML file:

title: "simple"
rules:
  - name: simple
    description: 'change 33 double to 42 double'
    pattern: |
      Δ ⤍ 40-40-80-00-00-00-00-00
    result: |
      Δ ⤍ 40-45-00-00-00-00-00-00
    when: [ ]
    tests: [ ]

I'm getting:

$ normalizer transform --rules /hone/simple.yml /target/generated-sources/phi/Hello.phi --single -o /target/generated-sources/phi-optimized/Hello.phi
>> normalizer: syntax error at line 1, column 1 before `Δ'
>> on input
>> Δ ⤍ 40-40-80-00-00-00-00-00

What's wrong?

PS. I tried this, same result (added brackets):

title: "simple"
rules:
  - name: simple
    description: 'change 33 double to 42 double'
    pattern: |
      (Δ ⤍ 40-40-80-00-00-00-00-00)
    result: |
      (Δ ⤍ 40-45-00-00-00-00-00-00)
    when: [ ]
    tests: [ ]
@yegor256
Copy link
Member Author

yegor256 commented Oct 7, 2024

@deemp please, help

@yegor256
Copy link
Member Author

yegor256 commented Oct 7, 2024

@deemp I also tried this, same result:

title: "simple"
rules:
  - name: simple
    description: test
    pattern: |
      a ↦ ⟦⟧.b
    result: |
      a ↦ b
    when: [ ]
    tests: [ ]

What am I doing wrong?

@yegor256
Copy link
Member Author

yegor256 commented Oct 7, 2024

@deemp if we would have documentation, maybe I would solve it by myself: #506

@deemp
Copy link
Member

deemp commented Oct 7, 2024

@yegor256, the pattern must be an object.

This information will be specified in the documentation when #427 is closed.

@yegor256
Copy link
Member Author

yegor256 commented Oct 7, 2024

@deemp it should be possible to specify any expression as a pattern, not only a formation. A binding, for example. Otherwise, we will have a very limited ability of the normalizer.

@deemp
Copy link
Member

deemp commented Oct 8, 2024

@yegor256, which syntactic constructs apart from Object and Binding should be supported?

The names of these constructs are written just before ::= in Syntax.cf

@deemp
Copy link
Member

deemp commented Oct 8, 2024

@fizruk, will you take this issue?

@yegor256
Copy link
Member Author

yegor256 commented Oct 8, 2024

@deemp @fizruk any phi expression should be supported in the pattern, I believe. Even this should be possible:

pattern: |
  00-2A
result: |
  00-2B

@fizruk fizruk self-assigned this Oct 9, 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

No branches or pull requests

3 participants