From: SourceForge.net <no...@so...> - 2006-01-27 17:50:40
|
Patches item #1412982, was opened at 2006-01-23 17:29 Message generated for change (Comment added) made by czi You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=373087&aid=1412982&group_id=22049 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: NSIS Group: Unstable Status: Open Resolution: None Priority: 5 Submitted By: David Weiss (czi) Assigned to: Amir Szekely (kichik) Summary: "!if" - enhanced compile time flow control Initial Comment: it's not finished yet, includes no test and no documentation files. but it works. i just want to collect some feedback if its useful and should be expanded somehow, or even has a chance to make it into the stable NSIS. it currently supports the following operations: !if[n] val1 [= < > & | val2] !else !endif where !if val1 = val2 returns !stricmp(val1,val2) !ifn val1 > val2 returns !(val1>val2) which is the same as val1<=val2 its not yet possible to do !if !else if !endif attached is a cvs patch file for: tokens.h tokens.cpp script.cpp ---------------------------------------------------------------------- >Comment By: David Weiss (czi) Date: 2006-01-27 18:50 Message: Logged In: YES user_id=970495 updated patch. - removed !ifn - new syntax: !if [!] value [op value2] works like normal "if()" statement, if optional ! is set, works like "if (!())". op can be: == and != for string comparision <=, <, >, >= for float comparision && and || for boolean comparision patch file has been updated to work with latest cvs changes (script.cpp changes for ICON errors) ---------------------------------------------------------------------- Comment By: Amir Szekely (kichik) Date: 2006-01-27 18:00 Message: Logged In: YES user_id=584402 #if false is invalid in CPP. It only accepts numbers or boolean expressions. If you give it a string, you'll get an error. ---------------------------------------------------------------------- Comment By: David Weiss (czi) Date: 2006-01-27 17:45 Message: Logged In: YES user_id=970495 1)you're right. but as we already have ifndef (its a standard, i know) and ifmacrondef, i thought !ifn would be nice. i'll change this one, but it will make things more complex. 2)what to you mean? "false" should not be handled as boolean on boolean comparision? 3)i'll do so :) its just i prefer tabs ... ---------------------------------------------------------------------- Comment By: Amir Szekely (kichik) Date: 2006-01-27 17:08 Message: Logged In: YES user_id=584402 The idea seems nice, I'd apply it once it's done. Some comments: 1) !ifn is not a standard command. If already adding a standard-ish command, I'd prefer it to act like in CPP - #if !(something). 2) Same goes to !if false and strings in there at all. 3) Please use spaces instead of tabs in the source code. Thanks ---------------------------------------------------------------------- Comment By: David Weiss (czi) Date: 2006-01-23 20:45 Message: Logged In: YES user_id=970495 forgot to mention that the patch now also includes a first try of documentation :) ---------------------------------------------------------------------- Comment By: David Weiss (czi) Date: 2006-01-23 20:44 Message: Logged In: YES user_id=970495 updated the patch. !if !else if !endif should now work. of course also a combination is possible: !ifmacrondef !else if !else ifdef !else !endif ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=373087&aid=1412982&group_id=22049 |