Last modified: 2009-03-25 11:48:56 UTC
Created attachment 5959 [details] Patch and bugfix to extend short circuiting. The attached patch extends the short circuit handling to more efficiently bypass unnecessary sub-expressions. At the same time the patch fixes check syntax errors related to short circuiting. Based on benchmarking with function evaluation and variable lookup hacked off, the extended short circuiting results in a ~20% improvement in parser speed for typical cases. Regarding the syntax check bug: Currently short circuiting allows some expressions to pass syntax validation even though they contain unknown keywords. An example of such an expression is "added_lines & applesauce", which validates as okay even though "applesauce" is meaningless. This patch includes logic that fixes this short circuiting bug.
true && someBool is a useless no-op. Otherwise seems to be okay. Will have a closer look soon.
Yes, = true && Bool could be reduced to just = Bool. I left it like that without really thinking, since the original value was (and the typical mode of execution is) = true.
Applied with minor changes in r48808.