Re: XRM 51: Add static constant propagations in static definitions.

"SIGOURE" == SIGOURE Benoit <sigoure.benoit@lrde.epita.fr> writes:
collect-static-const-decl = ?ConstInt(idf, value) - ; where(!value{Type("int")} => v) ; if <ExpandStaticConsts> idf then cannot-redefine-static-const(|idf) end ; if <ExpandFormulas> idf then cannot-redefine-formula(|idf) end
Why don't you factor your checkings into a "<check-redefinitions> idf"?
+ ; where(<innermost(ExpandStaticConsts + ExpandFormulas)> value => v' + ; !v'{Type("int")} => v) ; rules(ExpandStaticConsts: idf -> v)
collect-static-const-decl = ?ConstDouble(idf, value) - ; where(!value{Type("double")} => v) ; if <ExpandStaticConsts> idf then cannot-redefine-static-const(|idf) end ; if <ExpandFormulas> idf then cannot-redefine-formula(|idf) end + ; where(<innermost(ExpandStaticConsts + ExpandFormulas)> value => v' + ; !v'{Type("double")} => v) ; rules(ExpandStaticConsts: idf -> v)
collect-static-const-decl = ?ConstBool(idf, value) - ; where(!value{Type("bool")} => v) ; if <ExpandStaticConsts> idf then cannot-redefine-static-const(|idf) end ; if <ExpandFormulas> idf then cannot-redefine-formula(|idf) end + ; where(<innermost(ExpandStaticConsts + ExpandFormulas)> value => v' + ; !v'{Type("bool")} => v) ; rules(ExpandStaticConsts: idf -> v)
Also, the truplicate where clause seems truplication of code...

On 2006-06-12, Akim Demaille <akim@lrde.epita.fr> wrote:
"SIGOURE" == SIGOURE Benoit <sigoure.benoit@lrde.epita.fr> writes:
[SNIP]
Why don't you factor your checkings into a "<check-redefinitions> idf"?
Also, the truplicate where clause seems truplication of code...
It was quite quick'n'dirty. It has been fixed in later releases. -- SIGOURE Benoit aka Tsuna _____ /EPITA\ Promo 2008.CSI Rock & tRoll
participants (2)
-
Akim Demaille
-
Tsuna