Ex Contract v0.1.0 ExContract.CompileState View Source
Holds compilation state for JdContracts storing each condition and optional message in corresponding requires or ensures lists.
Link to this section Summary
Types
Defines fields that store JdContracts
compile state.
:requires
- list ofExContract.ConditionMsg
that define a single method pre-conditions.:ensures
- list ofExContract.ConditionMsg
that define a single method post-conditions
Functions
Adds a ensures condition of type ExContract.ConditionMsg
to the ensures
list. The condition
is associated with nil
message
Adds a ensures condition of type ExContract.ConditionMsg
to the ensures
list. The condition
is associated with nil
message
Adds a require condition of type ExContract.ConditionMsg
to the requires
list. The condition
is associated with nil
message
Adds a require condition of type ExContract.ConditionMsg
to the requires
list. The condition
is associated with provided message
Returns an empty state where both :requires
and :ensures
list are empty
Link to this section Types
t() :: %ExContract.CompileState{ensures: [ExContract.ConditionMsg.t], requires: [ExContract.ConditionMsg.t]}
Defines fields that store JdContracts
compile state.
:requires
- list ofExContract.ConditionMsg
that define a single method pre-conditions.:ensures
- list ofExContract.ConditionMsg
that define a single method post-conditions.
Link to this section Functions
add_ensure(state :: ExContract.CompileState.t, condition :: tuple) :: ExContract.CompileState.t
Adds a ensures condition of type ExContract.ConditionMsg
to the ensures
list. The condition
is associated with nil
message.
add_ensure(state :: ExContract.CompileState.t, condition :: tuple, msg :: String.t) :: ExContract.CompileState.t
Adds a ensures condition of type ExContract.ConditionMsg
to the ensures
list. The condition
is associated with nil
message.
add_require(state :: ExContract.CompileState.t, condition :: tuple) :: ExContract.CompileState.t
Adds a require condition of type ExContract.ConditionMsg
to the requires
list. The condition
is associated with nil
message.
add_require(state :: ExContract.CompileState.t, condition :: tuple, msg :: String.t) :: ExContract.CompileState.t
Adds a require condition of type ExContract.ConditionMsg
to the requires
list. The condition
is associated with provided message.
Returns an empty state where both :requires
and :ensures
list are empty.