
Untitled
By: a guest on
Aug 23rd, 2012 | syntax:
None | size: 0.91 KB | hits: 9 | expires: Never
{-
Wed Apr 11 16:26:27 BST 2012 Eric Kow <eric.kow@gmail.com>
* Quote GeniVals that begin with +/-
This fixes a bug spotted by a NLP.GenI.Parser QC testing if we
can round-trip lexical items (modulo semantic polarities).
But lexical semantics can have semantic polarities, and if for
some bizarre reason you have values that start with +/-, you
can have this parse/display cycle gone awry:
foo(++x -y) => foo(+x y) with polarities +1 for x -1 for y
=> foo(x y) with polarities +1 for x
To avoid this, we need to quote GeniValues with plusses or
minuses in them.
foo(++x -y) => foo("+x" y) with polarities +1 for "+x" and -1 for y
=> foo("+x" y)
-}
hunk ./src/NLP/GenI/GeniVal/Internal.hs 93
+ | "-" `T.isPrefixOf` x = quoteText x -- could be interpreted as
+ | "+" `T.isPrefixOf` x = quoteText x -- semantic polarities