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

Unary operator precedence ignored by ASTNode parser. #249

Open
danv61 opened this issue Jun 15, 2022 · 6 comments
Open

Unary operator precedence ignored by ASTNode parser. #249

danv61 opened this issue Jun 15, 2022 · 6 comments

Comments

@danv61
Copy link

danv61 commented Jun 15, 2022

Given this expression (konm * (h ^ - 1.0) / koffm), parsing it with the ASTNode parser will result in an error for the unary operator.
The following equivalent expression will parse correctly: (konm * (h ^ (0.0 - 1.0)) / koffm)

@fbergmann
Copy link
Member

When i try this, it works as intended:

formulaToL3String(parseL3Formula(' (konm * (h ^ - 1.0) / koffm)'))

yields: konm * h^-1 / koffm

Can you let me know what functions you used?

<?xml version="1.0" encoding="UTF-8"?>
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <apply>
    <divide/>
    <apply>
      <times/>
      <ci> konm </ci>
      <apply>
        <power/>
        <ci> h </ci>
        <apply>
          <minus/>
          <cn> 1 </cn>
        </apply>
      </apply>
    </apply>
    <ci> koffm </ci>
  </apply>
</math>

@danv61
Copy link
Author

danv61 commented Jun 20, 2022 via email

@fbergmann
Copy link
Member

Hello Dan, this makes it apparent, that this is an issue with the jsbml project, so there is not much i can help with here. I'll try and transfer the issue to the other project and hope that @draeger or @niko-rodrigue will be able to look at this soon.

@fbergmann fbergmann transferred this issue from sbmlteam/libsbml Jun 21, 2022
@luciansmith
Copy link
Member

Are you sure this was completed? It's been moved to the jsbml project, and I don't see a duplicate in the issues list.

@skeating
Copy link
Member

Sorry assumed if it had been moved it could be closed here

@skeating skeating reopened this Jun 25, 2022
@TlexCypher
Copy link

TlexCypher commented Dec 3, 2023

I had the same error with jsbml-1.6.1-with-dependencies.jar.
Is this still not fixed?

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

5 participants