diff options
author | Melody Horn <melody@boringcactus.com> | 2020-11-02 13:37:32 -0700 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2020-11-02 13:37:32 -0700 |
commit | 8868b5fa2e8b9f40a31035c51519cce40e73f079 (patch) | |
tree | 4a91e7d5437f91a7f95358753097a99e2c84cf2e /language/type-definition.rst | |
parent | 83e23b6b449112f4a85d09c57e5601faa87856ca (diff) | |
download | spec-8868b5fa2e8b9f40a31035c51519cce40e73f079.tar.gz spec-8868b5fa2e8b9f40a31035c51519cce40e73f079.zip |
define compile-time vs runtime behavior
Diffstat (limited to 'language/type-definition.rst')
-rw-r--r-- | language/type-definition.rst | 12 |
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:: |