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

Bug in phi-calculus parser #2930

Closed
maxonfjvipon opened this issue Mar 8, 2024 · 9 comments
Closed

Bug in phi-calculus parser #2930

maxonfjvipon opened this issue Mar 8, 2024 · 9 comments
Labels

Comments

@maxonfjvipon
Copy link
Member

This comment shows that there's a bug in phi-calculus parser.

@maxonfjvipon
Copy link
Member Author

After parsing this phi:

{
  ⟦
    test ↦ ⟦
      α1 ↦ ⟦⟧.plus(
        α0 ↦ Φ.org.eolang.int
      )
    ⟧
  ⟧
}

we get the next XMIR:

<program dob="2023-03-19T00:00:00"
         name="main"
         revision="1234567"
         time="2024-03-08T08:51:26.339569Z"
         version="0.0-SNAPSHOT"><!--This is XMIR - a dialect of XML, which is used to present a parsed EO program. For more information please visit https://news.eolang.org/2022-11-25-xmir-guide.html-->
   <listing>{
  ⟦
    test ↦ ⟦
      α1 ↦ ⟦⟧.plus(
        α0 ↦ Φ.org.eolang.int
      )
    ⟧
  ⟧
}</listing>
   <errors/>
   <sheets/>
   <license/>
   <metas/>
   <objects ms="4">
      <o line="3" pos="4">
         <o abstract="" line="4" name="1" pos="6">
            <o base=".plus" line="4" method="" name="test" pos="13">
               <o base="Q" line="5" pos="8"/>
               <o base=".org" line="5" method="" pos="14"/>
               <o base=".eolang" line="5" method="" pos="18"/>
               <o as="0" base=".int" line="5" method="" pos="25"/>
            </o>
         </o>
      </o>
   </objects>
</program>

It's definitely wrong.

I guess the main problem here is in parsing dispatch after formation.

@maxonfjvipon
Copy link
Member Author

@yegor256 let's make a new release with tag 0.35.9

@yegor256
Copy link
Member

@rultor release, tag is 0.35.9

@rultor
Copy link
Contributor

rultor commented Mar 13, 2024

@rultor release, tag is 0.35.9

@yegor256 OK, I will release it now. Please check the progress here

@rultor
Copy link
Contributor

rultor commented Mar 13, 2024

@rultor release, tag is 0.35.9

@yegor256 Done! FYI, the full log is here (took me 17min)

@maxonfjvipon
Copy link
Member Author

@deemp I think the bug is fixed. Please use --parser=0.35.9 in your pipeline

@deemp
Copy link
Member

deemp commented Mar 13, 2024

@maxonfjvipon, bool-tests still fail. Have you tested the fixes on eo-runtime tests? Are you going to test your fixes on eo-runtime tests?

I made #2929 that allows to test phi -> unphi on a subset of eo-runtime tests. Do you need my assistance in configuring the tests?

Error:

Test EO without normalization

Warning: JAVA_HOME environment variable is not set.
EO objects registered in .eoc/eo-foreign.json
Assembling into .eoc
Warning: JAVA_HOME environment variable is not set.
[ERROR] Failed to parse '/home/eyjafjallajokull/Desktop/gh/normalizer/pipeline/eo-not-normalized/bool-tests.eo:1207': [1207:10] no viable alternative at input '# This is the default 64+ symbols comment in front of named abstract object.\n[] > iterating-tuple-with-while-without-body-multiple\n  INTQ\n  .org\n  .eolang\n  .tuple > arr\n    INTQ\n    .org\n    .eolang\n    .tuple:0\n      INTQ\n      .org\n      .eolang\n      .tuple:0\n        INTQ\n        .org\n        .eolang\n        .tuple:0\n          INTQ\n          .org\n          .eolang\n          .tuple\n          .empty:0\n          Q\n          .org\n          .eolang\n          .int:1\n            INTQ\n            .org\n            .eolang\n            .bytes:0\n              INT00-00-00-00-00-00-00-01\n        EXPONENTEXPONENTEXPONENTQ\n        .org\n        .eolang\n        .int:1\n          INTQ\n          .org\n          .eolang\n          .bytes:0\n            INT00-00-00-00-00-00-00-01\n      EXPONENTEXPONENTEXPONENTQ\n      .org\n      .eolang\n      .int:1\n        INTQ\n        .org\n        .eolang\n        .bytes:0\n          INT00-00-00-00-00-00-00-01\n    EXPONENTEXPONENTEXPONENTQ\n    .org\n    .eolang\n    .int:1\n      INTQ\n      .org\n      .eolang\n      .bytes:0\n        INT00-00-00-00-00-00-00-01\n  EXPONENTEXPONENTEXPONENTQ\n  .org\n  .eolang\n  .memory > iter\n    INTQ\n    .org\n    .eolang\n    .int:0\n      INTQ\n      .org\n      .eolang\n      .bytes:0\n        INT00-00-00-00-00-00-00-00\n  EXPONENTEXPONENTEXPONENTQ\n  .org\n  .eolang\n  .memory > acc\n    INTQ\n    .org\n    .eolang\n    .int:0\n      INTQ\n      .org\n      .eolang\n      .bytes:0\n        INT00-00-00-00-00-00-00-00\n  EXPONENTEXPONENTEXPONENT$\n  .arr\n  .length > max\n  Q\n  .org\n  .eolang\n  .seq > @\n    INTQ\n    .org\n    .eolang\n    .tuple:0\n      INTQ\n      .org\n      .eolang\n      .tuple:0\n        INTQ\n        .org\n        .eolang\n        .tuple\n        .empty:0\n        []\n          ': "        []"
[ERROR] net.sf.saxon.style.XSLMessage@46c8a1b9: This transformation must be applied only after you remove @method attributes from objects, using 'wrap-method-calls.xsl'
[ERROR] #fatalError(): Processing terminated by xsl:message at line 82 in set-locators.xsl; SystemID: file:///org/eolang/parser/set-locators.xsl; Line#: 82; Column#: 36
[ERROR] Processing terminated by xsl:message at line 82 in set-locators.xsl
[ERROR] 'org.eolang.maven.ShakeMojo@c25cc5a' execution failed
[ERROR] Processing terminated by xsl:message at line 82 in set-locators.xsl
[ERROR] Failed to execute goal org.eolang:eo-maven-plugin:0.35.9:assemble (default-cli) on project eoc: 'org.eolang.maven.AssembleMojo@43aeb5e0' execution failed: java.lang.IllegalStateException: org.apache.maven.plugin.MojoFailureException: 'org.eolang.maven.ShakeMojo@c25cc5a' execution failed: java.io.UncheckedIOException: java.io.IOException: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Failed to transform by net.sf.saxon.jaxp.TransformerImpl: Processing terminated by xsl:message at line 82 in set-locators.xsl; SystemID: file:///org/eolang/parser/set-locators.xsl; Line#: 82; Column#: 36 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
The command "/home/eyjafjallajokull/Desktop/gh/normalizer/node_modules/eolang/mvnw/mvnw eo:assemble -Deo.version=0.35.9 -Deo.hash=130afdd1456a0cbafd52aee8d7bc612e1faac547 --quiet -Deo.sourcesDir=/home/eyjafjallajokull/Desktop/gh/normalizer/pipeline/eo-not-normalized -Deo.targetDir=/home/eyjafjallajokull/Desktop/gh/normalizer/pipeline/eo-not-normalized/.eoc -Deo.outputDir=/home/eyjafjallajokull/Desktop/gh/normalizer/pipeline/eo-not-normalized/.eoc/classes -Deo.generatedDir=/home/eyjafjallajokull/Desktop/gh/normalizer/pipeline/eo-not-normalized/.eoc/generated-sources -Deo.placed=/home/eyjafjallajokull/Desktop/gh/normalizer/pipeline/eo-not-normalized/.eoc/eo-placed.csv -Deo.placedFormat=csv --batch-mode --color=never --update-snapshots --fail-fast --strict-checksums" exited with #1 code

@maxonfjvipon
Copy link
Member Author

phi and unphi goals work fine. But EO grammar does not support the one specific case - vertical method after formation:

[]
.method

It seems we should allow such syntax, because there's no other way we can print XMIR to EO in straight notation

@maxonfjvipon
Copy link
Member Author

maxonfjvipon commented Mar 14, 2024

@deemp I'm closing this one, because there's no bug anymore. Follow one: #2943

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants