View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006191CMakeCMakepublic2007-12-20 17:132008-06-26 14:32
ReporterAlex Neundorf 
Assigned ToKen Martin 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in Version 
Summary0006191: Support parentheses in conditions
DescriptionIt would be nice if the following would be supported:

if((a OR b) AND (c OR d))

I guess square brackets would be also acceptable if it is easier for the parser:
if( [a OR b] AND [c OR d] )

TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0012525)
Ken Martin (developer)
2008-06-25 15:16

As you guessed

  if((a OR b) AND (c OR d))

breaks the parser. It turns out that
  
  if( [a OR b] AND [c OR d] )

is not great either since the CMake parser makes the first argument "[a" Now

  if( [ a OR b ] AND [ c OR d ] )

would work just dandy with the current architecture but just doesn't seem intuitive. So IMO
 
  if((a OR b) AND (c OR d))

is what we want and it turns out that the changes required in the parser are easy and simple (I'm pretty sure :). I'll take a stab at making the parse changes and modifications to the if logic as well.
(0012545)
Ken Martin (developer)
2008-06-26 14:32

Changes checked into CVS plus a mod to the complex test to test the feature. The following code is tested in complex and works.

if (2 GREATER 1 AND (4 LESS 3 OR 5 LESS 6) AND NOT (7 GREATER 8))
   set(CONDITIONAL_PARENTHESES 1)
endif()

the same concept should work for the while command as it uses the if command's code to parse its conditional.

 Issue History
Date Modified Username Field Change
2007-12-20 17:13 Alex Neundorf New Issue
2007-12-20 20:31 Bill Hoffman Status new => assigned
2007-12-20 20:31 Bill Hoffman Assigned To => Ken Martin
2008-06-25 15:16 Ken Martin Note Added: 0012525
2008-06-26 14:32 Ken Martin Note Added: 0012545
2008-06-26 14:32 Ken Martin Status assigned => closed
2008-06-26 14:32 Ken Martin Resolution open => fixed
2008-06-26 14:32 Ken Martin Product Version => CMake-2-6


Copyright © 2000 - 2018 MantisBT Team