Closed ccasin closed 5 years ago
This ticket may be bogus - I was looking at generated code on a branch, and it may have been wrong.
While there were some errors in the generated code, the pass
variable wasn't helpful. I think #9 was still relevant, but because the pass variable was doing double duty as both checking if the rule matched and sometimes the result value, it wasn't obvious to me.
Done on pr-remove-pass-variable
The comment above
translatePolicy
inGenRuleC.hs
says that it generates a list of statements that "will set [evalResult] to one of policySuccessName, policyIFailName, or policyEFailName". The generated code doesn't actually do this - it just returns the relevant result, as seen intranslateRuleResult
, whose documentation is accurate.I think therefore that both the Haskell and the generaed C can be simplified by removing the
pass
variable completely. The documentation totranslatePolicy
should also be fixed.