-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #583 from nasa/tumbar-type-aliases-spec
Type alias spec
- Loading branch information
Showing
9 changed files
with
473 additions
and
153 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
=== Alias Type Definitions | ||
|
||
An *alias type definition* associates a name with a type | ||
that is defined elsewhere. | ||
|
||
==== Syntax | ||
|
||
`type` <<Lexical-Elements_Identifiers,_identifier_>> = <<Type-Names,_type-name_>> | ||
|
||
==== Semantics | ||
|
||
The identifier is the name _N_ of the type. | ||
The definition associates the name _N_ with | ||
the type _T_ specified after the `=` symbol. | ||
Elsewhere in the model, the name _N_ may be used as alias of (i.e., an | ||
alternate name for) the type _T_. | ||
|
||
==== Examples | ||
|
||
[source,fpp] | ||
---- | ||
# Defines a type A that is an alias of U32 | ||
type A = U32 | ||
# Defines a struct type B whose member x has type A | ||
struct B { | ||
x: A | ||
y: F32 | ||
} default { y = 1 } | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters