objectionary / eo

EOLANG, an Experimental Pure Object-Oriented Programming Language Based on 𝜑-calculus
https://www.eolang.org
MIT License
1.02k stars 128 forks source link

No viable alternative at input after `eo:0.43.0:xmir-to-phi` #3535

Open volodya-lombrozo opened 1 day ago

volodya-lombrozo commented 1 day ago

I tried to upgrade eo-maven-plugin up to the 0.43.0 version and got a bunch of errors, the main is:

org/eolang/hone/App.phi:
    [9:27] no viable alternative at input 'j$org↦⟦j$eolang↦⟦j$hone↦⟦j$App↦⟦version↦Φ.jeo.int(α0↦Φ.org.eolang.bytes(α0↦⟦Δ⤍0': "EOF"
    [9:27] no viable alternative at input 'α0↦Φ.org.eolang.bytes(α0↦⟦Δ⤍0': "EOF"
    [9:27] no viable alternative at input 'α0↦⟦Δ⤍0': "EOF"
    [11:12] mismatched input ')' expecting {'}', '(', '.'}: "EOF"

How to reproduce:

  1. I disassemble java bytecode by using jeo-maven-plugin:disassemble into xmir
  2. Convert this xmir to phi by using eo-maven-plugin:0.43.0:xmir-to-phi
  3. Convert the phi back to xmir by using eo-maven-plugin:0.43.0:phi-to-xmir

On the (3) step I get the exception.

Expected behaviour: all the transformation work without errors. Moreover, xmir-to-phi and phi-to-xmir shouldn't alter the original xmir.

Also I attach all the files that might be helpful: App.xmir.disassemble.txt App.phi.txt App.xmir.unphi.txt

volodya-lombrozo commented 1 day ago

@yegor256 Could you take a look please?

yegor256 commented 1 day ago

@volodya-lombrozo I believe, it's a duplicate of https://github.com/objectionary/eo/issues/3534

volodya-lombrozo commented 1 day ago

@yegor256 I don't know. It's impossible to say anything from the error output. But I would suggest to keep both issues, at least for now.

yegor256 commented 1 day ago

@volodya-lombrozo the problem is that you are generating bytes in XMIR in 00 01 02 format, but it should be 00-01-02, starting from 0.43.0.

yegor256 commented 1 day ago

@volodya-lombrozo try to format bytes differently, with a dash between them, not space. This is what 0.43.0 expects

maxonfjvipon commented 1 day ago

@volodya-lombrozo empty bytes must look like -- and one byte must end with dash: 00-, the same as in EO original grammar

volodya-lombrozo commented 21 hours ago

@yegor256 @maxonfjvipon Please note that the exception was thrown after the xmir-to-phi phase, specifically during the phi-to-xmir phase. This means that xmir-to-phi accepts the XMIR and produces incorrect phi. If xmir-to-phi had given me an error message about dashes and bytes formatting, it would indicate a bug in jeo-maven-plugin, but that is not the case now. Please add some sort of checking or specification that I can rely on. Otherwise, I have no way of knowing how many else inconsistencies jeo-maven-plugin might produce.

volodya-lombrozo commented 21 hours ago

It's kinda blocker.

yegor256 commented 21 hours ago

@volodya-lombrozo we are planning to make XSD stronger, in https://github.com/objectionary/eo/issues/3534

volodya-lombrozo commented 21 hours ago

@yegor256 It would be awesome, I'm waiting for it