Code coverage for boolean.li

///////////////////////////////////////////////////////////////////////////////
//                             Lisaac Library                                //
//                                                                           //
//                   LSIIT - ULP - CNRS - INRIA - FRANCE                     //
//                                                                           //
//   This program is free software: you can redistribute it and/or modify    //
//   it under the terms of the GNU General Public License as published by    //
//   the Free Software Foundation, either version 3 of the License, or       //
//   (at your option) any later version.                                     //
//                                                                           //
//   This program is distributed in the hope that it will be useful,         //
//   but WITHOUT ANY WARRANTY; without even the implied warranty of          //
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           //
//   GNU General Public License for more details.                            //
//                                                                           //
//   You should have received a copy of the GNU General Public License       //
//   along with this program.  If not, see <http://www.gnu.org/licenses/>.   //
//                                                                           //
//                     http://isaacproject.u-strasbg.fr/                     //
///////////////////////////////////////////////////////////////////////////////
Section Header

  + name    := Expanded BOOLEAN;


  - copyright   := "2003-2005 Jérome Boutet, 2003-2007 Benoit Sonntag";

  - comment := "Boolean library (self is mapping on int C).";

  - type    := `char`;
  - default := FALSE;

Section Insert

  - parent_object:OBJECT := OBJECT;

Section Private

  - deferred_boolean:BOOLEAN <-
  ( + result:BOOLEAN;

    deferred;
    result
  );

Section Public

  //
  // Conditional :
  //

  - if_true block:{}  <- deferred;

  - if_false block:{} <- deferred;

  - if true_block:{} else false_block:{} <- `ERROR`; //deferred;

  - if_true true_block:{} else false_block:{} <- deferred;

  - if_false true_block:{} else false_block:{} <- deferred;

  - if true_block:{} :BOOLEAN <- deferred_boolean;

  - elseif cond:{BOOLEAN} then block:{} :BOOLEAN <- deferred_boolean;

  - elseif cond:{BOOLEAN} then block:{} else block_else:{} <- deferred;

  - else_if cond:{BOOLEAN} then block:{} :BOOLEAN <-
  // Alias.
  elseif cond then block;

  - else_if cond:{BOOLEAN} then block:{} else block_else:{} <-
  // Alias.
  elseif cond then block else block_else;

  //
  // Binary operator :
  //

  - Self:SELF '=='  Right 60 other:SELF :BOOLEAN <- Self = other;

  - Self:SELF '!==' Right 60 other:SELF :BOOLEAN <- Self != other;

  - Self:SELF '||' Left 10  other:{BOOLEAN}   :BOOLEAN <- deferred_boolean;

  - Self:SELF '  ' Left 20  other:{BOOLEAN}   :BOOLEAN <- deferred_boolean;

  - Self:SELF '|'  Left 10  other:BOOLEAN :BOOLEAN <- deferred_boolean;

  - Self:SELF ' '  Left 20  other:BOOLEAN :BOOLEAN <- deferred_boolean;

  - Self:SELF '^' Left 10  other:BOOLEAN :BOOLEAN  <- deferred_boolean;

  - Self:SELF '->' Right 25 other:BOOLEAN :BOOLEAN <- deferred_boolean;

  - Self:SELF '->>' Right 25 other:{BOOLEAN}  :BOOLEAN <- deferred_boolean;

  - Self:SELF '=>' s:ABSTRACT_STRING <- deferred;

  //
  // Prefix operator
  //

  - '!' Self:SELF :BOOLEAN <- deferred;

  //
  // Convertion
  //

  - to_string:STRING <-
  ( + result:STRING;

    deferred;
    result
  );

  - to_abstract_string:ABSTRACT_STRING <- "BOOLEAN";

  - to_integer:INTEGER <-
  ( + result:INTEGER;

    deferred;
    result
  );

  - to_character:CHARACTER <-
  ( + result:CHARACTER;

    deferred;
    result
  );

  - append_in str:STRING <- str.append to_abstract_string;