Skip to content

Primi 0.2.2

Compare
Choose a tag to compare
@smuuf smuuf released this 21 Oct 12:56
· 339 commits to master since this release
959e548
  • NEW: Logical operators.
    • Implemented and, or and proper ! negation operators.
      • Added helper Common::isTruthy() for having a single point of
        truth for value's truthyness.
    • Precedence of operators is defined as follows (high to low):
      • (...)
      • !
      • *, /
      • +, -
      • ==, !=, >=, <=, >, <
      • and
      • or
  • FIX: Fixed error in array_shuffle() function. …
    • It did not operate on copy of the array. It does now.
  • FIX: Fixed error when getting argument count for error message.
  • Pretty major refactoring.
    • Introduced left-to-right evaluation helpers.
      • Supports short-circuiting.
    • Introduced left-to-right comparion evaluation helper.
      • Uses short-circuiting.
    • Many places where we relied on PHP's internal boolean-evaluation logic
      were now refactored to use our Common::isTruthy() helper.
    • There was an attempt to normalize number-bool comparison.
  • Tests now support pragma comments, eg. // pragma:one_liners
    • This pragma (compilator/interpreter directive) forces the test runner to evaluate each line of the test as if it were standalone script.
      • That enables us to test exceptions better (thrown Primi's error exception no longer terminates the whole test suite.)
    • This leads to improved test coverage.