-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for function and module attributes
- Loading branch information
1 parent
84dc25b
commit d266710
Showing
40 changed files
with
514 additions
and
213 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
title: Attributes | ||
--- | ||
|
||
Spice offers the option to annotate single function or whole modules via attributes. | ||
|
||
## Module attributes | ||
|
||
```spice | ||
// Attribute for the whole module | ||
#![core.linker.flags = "-pthread"] | ||
// ... | ||
``` | ||
|
||
### Available attributes | ||
|
||
- `core.linker.flag: string` | ||
|
||
## Function attributes | ||
|
||
```spice | ||
#[core.compiler.mangleName = false] | ||
f<int> test(long input) { | ||
return input == 0 ? 123 : 456; | ||
} | ||
``` | ||
|
||
### Available attributes | ||
|
||
- `core.compiler.mangleName: bool` | ||
- `core.linker.dll: bool` |
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
Oops, something went wrong.