Back to no exceptions in test, still two test failures which need to be investigated.

This commit is contained in:
simon 2016-08-13 23:20:34 +01:00
parent 3168c1b2fb
commit ca9553fe83
2 changed files with 5 additions and 20 deletions

View file

@ -112,13 +112,3 @@
([rule-text] ([rule-text]
(compile-rule rule-text false))) (compile-rule rule-text false)))
(ps/simplify
(parse-rule
"if more than 2 neighbours have altitude equal to 11 then state should be beach"))
(pg/generate
(ps/simplify
(parse-rule
"if more than 2 neighbours have altitude equal to 11 then state should be beach")))

View file

@ -59,23 +59,18 @@
(if (if
(coll? tree) (coll? tree)
(case (first tree) (case (first tree)
;; 'all' isn't actually the same as 'eight', because cells at the edges of the world have
;; fewer than eight neighbours; but it's a simplifying (ha!) assumption for now."
;; TODO: fix this so it actually works.
:ALL [:COMPARATIVE '= 8]
:ACTION (simplify-second-of-two tree) :ACTION (simplify-second-of-two tree)
:ACTIONS (simplify-second-of-two tree) :ACTIONS (cons (first tree) (simplify (rest tree)))
:CHANCE-IN nil
:COMPARATIVE (simplify-second-of-two tree) :COMPARATIVE (simplify-second-of-two tree)
:CONDITION (simplify-second-of-two tree) :CONDITION (simplify-second-of-two tree)
:CONDITIONS (simplify-second-of-two tree) :CONDITIONS (simplify-second-of-two tree)
:EXPRESSION (simplify-second-of-two tree) :EXPRESSION (simplify-second-of-two tree)
:NONE [:COMPARATIVE '= 0]
:NUMBER tree
:PROPERTY (simplify-second-of-two tree) :PROPERTY (simplify-second-of-two tree)
:QUALIFIER (simplify-qualifier tree) :PROPERTY-CONDITION-OR-EXPRESSION (simplify-second-of-two tree)
:QUANTIFIER (simplify-quantifier tree)
:SOME [:COMPARATIVE '> 0]
:SPACE nil :SPACE nil
:THEN nil
:AND nil
:VALUE (simplify-second-of-two tree) :VALUE (simplify-second-of-two tree)
(remove nil? (map simplify tree))) (remove nil? (map simplify tree)))
tree)) tree))