https://bz.apache.org/bugzilla/show_bug.cgi?id=60848

--- Comment #11 from mewa...@gmail.com ---
Looking at the syntax in
https://msdn.microsoft.com/en-us/library/dd906358(v=office.12).aspx, then,
assuming that "Unary Minus" is equivalent in the POI grammer as "sign" in the
MSFT site's grammar, it seems possible that the grammar in POI should not be
classifying the leading "-" as "Unary Minus", and instead should be classifying
it as whatever in the POI grammar is equivalent to "prefix-operator".

See in particular the line that reads:

  nospace-argument-expression = "("  expression  ")" / constant /
prefix-operator argument-expression ...


in other words, "--(xx)" should be parsed as


  prefix-operator argument-expression
                    |
                  prefix-operator argument-expression
                                    |
                                  "("  expression  ")"


(note that I've ignored the difference between nospace-argument-expression and
argument-expression and treated them as equivalent for brevity)

Would you agree that the expression should parsed differently, as shown above?
I'm not familiar enough with how POI implemented the grammar to know whether
there is some other way to deal with this which is different from how the MSFT
site's grammar works... but I would think that the formula parsing is hairy
enough that it would be optimal to use the exact same grammar as specified in
the MSFT site. It might be a fundamental change to make, but there are a number
of other formula-parsing bugs in POI that would likely be more easily addressed
taking that approach.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to