draperlaboratory / hope-policy-tool

Policy language tools
Other
0 stars 0 forks source link

remove use of `pass` variable and correct documentation #28

Closed ccasin closed 5 years ago

ccasin commented 5 years ago

The comment above translatePolicy in GenRuleC.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 in translateRuleResult, 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 to translatePolicy should also be fixed.

ccasin commented 5 years ago

This ticket may be bogus - I was looking at generated code on a branch, and it may have been wrong.

amstrnad commented 5 years ago

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