SHARE
TWEET

CMake math() and unary operators

a guest Mar 6th, 2012 55 Never
  1. diff --git a/Source/cmExprParser.y b/Source/cmExprParser.y
  2. index 317b0ba..57820ec 100644
  3. --- a/Source/cmExprParser.y
  4. +++ b/Source/cmExprParser.y
  5. @@ -150,6 +150,16 @@ term exp_MOD factor
  6.  {$<Number>$ = $<Number>1 % $<Number>3;}
  7.  
  8.  factor:
  9. +value
  10. +{$<Number>$ = $<Number>1;}
  11. +|
  12. +exp_MINUS factor
  13. +{$<Number>$ = -$<Number>2;}
  14. +|
  15. +exp_NOT factor
  16. +{$<Number>$ = ~$<Number>2;}
  17. +
  18. +value:
  19.  exp_NUMBER
  20.  {$<Number>$ = $<Number>1;}
  21.  |
RAW Paste Data
Top