aboutsummaryrefslogtreecommitdiff
path: root/language/type-definition.rst
diff options
context:
space:
mode:
Diffstat (limited to 'language/type-definition.rst')
-rw-r--r--language/type-definition.rst12
1 files changed, 10 insertions, 2 deletions
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::