Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 23rd, 2012  |  syntax: None  |  size: 0.91 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. {-
  2. Wed Apr 11 16:26:27 BST 2012  Eric Kow <eric.kow@gmail.com>
  3.   * Quote GeniVals that begin with +/-
  4.   This fixes a bug spotted by a NLP.GenI.Parser QC testing if we
  5.   can round-trip lexical items (modulo semantic polarities).
  6.  
  7.   But lexical semantics can have semantic polarities, and if for
  8.   some bizarre reason you have values that start with +/-, you
  9.   can have this parse/display cycle gone awry:
  10.     foo(++x -y) => foo(+x y) with polarities +1 for x -1 for y
  11.                 => foo(x y)  with polarities +1 for x
  12.  
  13.   To avoid this, we need to quote GeniValues with plusses or
  14.   minuses in them.
  15.     foo(++x -y) => foo("+x" y) with polarities +1 for "+x" and -1 for y
  16.                 => foo("+x" y)
  17. -}
  18.     hunk ./src/NLP/GenI/GeniVal/Internal.hs 93
  19.     +                     | "-" `T.isPrefixOf` x = quoteText x -- could be interpreted as
  20.     +                     | "+" `T.isPrefixOf` x = quoteText x -- semantic polarities