Closed guitorri closed 9 years ago
As a workaround, one can test for the datatypename
of the condition and add parenthesis for number
or variable
types.
<!-- print conditional (if) expressions -->
<admst:for-each select="conditional">
<admst:value-of select="./if/tree"/>
<admst:variable name="COND" select="%s"/> <!-- store -->
<admst:value-of select="./if/tree/adms/datatypename"/>
<admst:variable name="TYPE" select="%s"/> <!-- store -->
<admst:text format=" condition: $(COND) | type: $(TYPE) \n"/>
</admst:for-each>
Clang warns about multiple parentheses on if conditionals (the compiler output is too noisy to be of any use).
The enhancement is to make the returned conditions consistent, they should return already with parentheses. The
if (condition) ...
currently returns justcondition
. It should return(condition)
instead. Test case below.This is the sort warning that repeats for each and every if condition (using Qucs XML files here).
The user's XML scripts are forced to wrap the conditional once again, because the returned condition is not consistent. See below.
For the following Verilog-A code
The conditional if/tree stack is dumped (in reverse) as:
The first/last should be wrapped in
( )
.Test case:
Run:
admsXml test_if.va -e dump_if.xml