You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am writing the parser for first-order conditions. I am using Scala and the scala-parser-combinators library. It works well, but I discovered this issue.
Here, I report the clause for negation (example: not predicate(p1)). It uses recursion, calling fol_condition, i.e. the root level rule for fol conditions:
So, a string like "not predicate(p1)" produces the correct result Negation(Predicate("predicate",...)) However, when I parse a string like "note(p2)", it should produce a Predicate("note",...); instead, it returns Negation(Predicate(a,...)). In other words, the parser ignores whether there is a space between "not" and the following fol_condition.
This is not the desired behaviour. I would inform the parser that "not a" is different from "nota" because there is a space in between.
This discussion was converted from issue #540 on March 28, 2024 16:43.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am writing the parser for first-order conditions. I am using Scala and the scala-parser-combinators library. It works well, but I discovered this issue.
Here, I report the clause for negation (example: not predicate(p1)). It uses recursion, calling fol_condition, i.e. the root level rule for fol conditions:
So, a string like "not predicate(p1)" produces the correct result Negation(Predicate("predicate",...)) However, when I parse a string like "note(p2)", it should produce a Predicate("note",...); instead, it returns Negation(Predicate(a,...)). In other words, the parser ignores whether there is a space between "not" and the following fol_condition.
This is not the desired behaviour. I would inform the parser that "not a" is different from "nota" because there is a space in between.
Beta Was this translation helpful? Give feedback.
All reactions