-
Notifications
You must be signed in to change notification settings - Fork 24
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
Comments
When i try this, it works as intended: formulaToL3String(parseL3Formula(' (konm * (h ^ - 1.0) / koffm)')) yields: 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> |
I am using ASTNode math = ASTNode.parseFormula(expr);
This is the exception I'm getting:
org.sbml.jsbml.text.parser.ParseException: org.sbml.jsbml.text.parser.ParseException: Encountered " "-" "- "" at line 1, column 15.
Was expecting one of:
<INTEGER> ...
<NUMBER> ...
<EXPNUMBER> ...
"(" ...
"{" ...
<STRING> ...
<STRING> ...
<STRING> ...
"{" ...
at org.sbml.jsbml.ASTNode.parseFormula(ASTNode.java:1112)
I am using jsbml 1.6.1?
…________________________________
From: Frank Bergmann ***@***.***>
Sent: Friday, June 17, 2022 3:17 AM
To: sbmlteam/libsbml
Cc: Vasilescu,Dan; Author
Subject: Re: [sbmlteam/libsbml] Unary operator precedence ignored by ASTNode parser. (Issue sbmlteam/jsbml#249)
*** Attention: This is an external email. Use caution responding, opening attachments or clicking on links. ***
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>
-
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/sbmlteam/jsbml/issues/249*issuecomment-1158570492__;Iw!!Cn_UX_p3!npF_pJpqxhOpt3-W-zsJ7XO5IbEYDR23HoYWRDrQ-mLCpdtFdzMbEsUOiWGQ0IlTexRn6IOp_UG2ek8IkUa8dz8Ddw$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AG52W2IV6QA6UK4ICLM7I3LVPQQ7LANCNFSM5Y4TMBQQ__;!!Cn_UX_p3!npF_pJpqxhOpt3-W-zsJ7XO5IbEYDR23HoYWRDrQ-mLCpdtFdzMbEsUOiWGQ0IlTexRn6IOp_UG2ek8IkUa_P7nGAg$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
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. |
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. |
Sorry assumed if it had been moved it could be closed here |
I had the same error with jsbml-1.6.1-with-dependencies.jar. |
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)
The text was updated successfully, but these errors were encountered: