From 8868b5fa2e8b9f40a31035c51519cce40e73f079 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Mon, 2 Nov 2020 13:37:32 -0700 Subject: define compile-time vs runtime behavior --- language/type-definition.rst | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'language/type-definition.rst') diff --git a/language/type-definition.rst b/language/type-definition.rst index b596d0a..9e3d7c4 100644 --- a/language/type-definition.rst +++ b/language/type-definition.rst @@ -5,6 +5,14 @@ Defining Types Crowbar has three different kinds of user-defined types. + Compile-time Behavior: + + When a type is defined, the compiler must then allow that type to be used. + + Runtime Behavior: + + The definition of a type has no runtime behavior. + .. crowbar:element:: StructDefinition <- NormalStructDefinition / OpaqueStructDefinition NormalStructDefinition <- 'struct' identifier '{' VariableDeclaration+ '}' @@ -25,7 +33,7 @@ Defining Types An ``enum`` defines a type which can take one of several specified values. .. todo:: - + define enum value assignment, type-related behavior .. crowbar:element:: UnionDefinition <- RobustUnionDefinition / FragileUnionDefinition @@ -65,7 +73,7 @@ Defining Types case Whitespace: ; } } - + defines a ``union Token`` type, where the ``type`` field controls which of the other fields in the union is valid. .. todo:: -- cgit v1.2.3