Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

Commit

Permalink
(language) Nil is the type name for nil
Browse files Browse the repository at this point in the history
Signed-off-by: Jerome Simeon <[email protected]>
  • Loading branch information
jeromesimeon committed Aug 9, 2018
1 parent 4a00d24 commit edc2b06
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion examples/helloworldstate/logic.ergo
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ contract HelloWorldState over TemplateModel {
}
}

clause init(request : MyRequest) : Nothing {
clause init(request : MyRequest) {
set state State{
counter: 0.0
};
Expand Down
4 changes: 2 additions & 2 deletions extraction/src/ErgoParser.mly
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ clause:

outtype:
|
{ ErgoCompiler.ergo_type_nothing (mk_provenance $startpos $endpos) }
{ ErgoCompiler.ergo_type_nil (mk_provenance $startpos $endpos) }
| COLON out = paramtype
{ out }

Expand Down Expand Up @@ -531,7 +531,7 @@ tname:
| "Long" -> ErgoCompiler.ergo_type_long (mk_provenance $startpos $endpos)
| "Integer" -> ErgoCompiler.ergo_type_integer (mk_provenance $startpos $endpos)
| "DateTime" -> ErgoCompiler.ergo_type_dateTime (mk_provenance $startpos $endpos)
| "Nothing" -> ErgoCompiler.ergo_type_nothing (mk_provenance $startpos $endpos)
| "Nil" -> ErgoCompiler.ergo_type_nil (mk_provenance $startpos $endpos)
| "Any" -> ErgoCompiler.ergo_type_any (mk_provenance $startpos $endpos)
| _ ->
ErgoCompiler.ergo_type_class_ref
Expand Down
4 changes: 2 additions & 2 deletions mechanization/Common/Types/ErgoType.v
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Section ErgoType.

Inductive ergo_type :=
| ErgoTypeAny : A -> ergo_type (**r any type *)
| ErgoTypeNothing : A -> ergo_type (**r nothing type *)
| ErgoTypeNil : A -> ergo_type (**r unit type *)
| ErgoTypeBoolean : A -> ergo_type (**r bool atomic type *)
| ErgoTypeString : A -> ergo_type (**r string atomic type *)
| ErgoTypeDouble : A -> ergo_type (**r double atomic type *)
Expand All @@ -46,7 +46,7 @@ Section ErgoType.
Definition type_annot (et:ergo_type) : A :=
match et with
| ErgoTypeAny a => a
| ErgoTypeNothing a => a
| ErgoTypeNil a => a
| ErgoTypeBoolean a => a
| ErgoTypeString a => a
| ErgoTypeDouble a => a
Expand Down
2 changes: 1 addition & 1 deletion mechanization/Common/Types/ErgoTypetoErgoCType.v
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Section ErgoTypetoErgoCType.
Fixpoint ergo_type_to_ergoc_type (t:laergo_type) : ergoc_type :=
match t with
| ErgoTypeAny _ => ttop
| ErgoTypeNothing _ => tunit
| ErgoTypeNil _ => tunit
| ErgoTypeBoolean _ => tbool
| ErgoTypeString _ => tstring
| ErgoTypeDouble _ => tfloat
Expand Down
2 changes: 1 addition & 1 deletion mechanization/Common/Utils/DataTypes.v
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Section DataTypes.
match t with
| Bottom₀ => "Nothing"%string
| Top₀ => "Any"%string
| Unit₀ => "Unit"%string
| Unit₀ => "Nil"%string
| Nat₀ => "Integer"%string
| Float₀ => "Double"%string
| Bool₀ => "Boolean"%string
Expand Down
4 changes: 2 additions & 2 deletions mechanization/Compiler/ErgoCompiler.v
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ Module ErgoCompiler.

Definition ergo_type_any prov : ergo_type
:= ErgoType.ErgoTypeAny prov.
Definition ergo_type_nothing prov : ergo_type
:= ErgoType.ErgoTypeNothing prov.
Definition ergo_type_nil prov : ergo_type
:= ErgoType.ErgoTypeNil prov.
Definition ergo_type_boolean prov : ergo_type
:= ErgoType.ErgoTypeBoolean prov.
Definition ergo_type_string prov : ergo_type
Expand Down
2 changes: 1 addition & 1 deletion mechanization/Ergo/Lang/ErgoExpand.v
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Section ErgoExpand.
(mkErgoTypeSignature
prov
(("request"%string, ErgoTypeClassRef prov default_request_absolute_name)::nil)
(ErgoTypeNothing prov)
(ErgoTypeNil prov)
None
(Some (ErgoTypeClassRef prov default_emits_absolute_name)))
(Some init_body).
Expand Down
2 changes: 1 addition & 1 deletion mechanization/ErgoC/Lang/ErgoCStdlib.v
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Section ErgoCStdlib.
Definition empty_sigc prov (params:list string) :=
mkSigC
(List.map (fun x => (x,ErgoTypeAny prov)) params)
(ErgoTypeNothing prov).
(ErgoTypeNil prov).

Definition mk_naked_closure prov (params:list string) (body:ergoc_expr) : ergoc_function :=
mkFuncC
Expand Down
2 changes: 1 addition & 1 deletion mechanization/Translation/ErgoNameResolve.v
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Section ErgoNameResolution.
(t:lrergo_type) : eresult laergo_type :=
match t with
| ErgoTypeAny prov => esuccess (ErgoTypeAny prov)
| ErgoTypeNothing prov => esuccess (ErgoTypeNothing prov)
| ErgoTypeNil prov => esuccess (ErgoTypeNil prov)
| ErgoTypeBoolean prov => esuccess (ErgoTypeBoolean prov)
| ErgoTypeString prov => esuccess (ErgoTypeString prov)
| ErgoTypeDouble prov => esuccess (ErgoTypeDouble prov)
Expand Down
2 changes: 1 addition & 1 deletion mechanization/Translation/ErgotoErgoC.v
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ Section ErgotoErgoC.
then
((current_time, (ErgoTypeDateTime prov))
::(this_contract, tem)
::(this_state, ErgoTypeNothing prov)
::(this_state, ErgoTypeNil prov)
::(this_emit, ErgoTypeArray prov emit_type)
::c.(clause_sig).(type_signature_params))
else
Expand Down
2 changes: 1 addition & 1 deletion packages/ergo-cli/lib/ergoc-lib.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/ergo-cli/lib/ergotop.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/ergo-compiler/lib/ergo-core.js

Large diffs are not rendered by default.

0 comments on commit edc2b06

Please sign in to comment.