forked from adl-lang/adl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
774 additions
and
0 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 @@ | ||
target/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,10 @@ | ||
[package] | ||
name = "compiler" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
serde = { version = "1.0.130", features=["derive"] } | ||
serde_json = "1.0.68" |
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 @@ | ||
pub mod rust; |
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,62 @@ | ||
// @generated from adl module adlc.config.rust | ||
|
||
use serde::Deserialize; | ||
use serde::Serialize; | ||
|
||
/** | ||
* ADL module or declaration annotation to control | ||
* whether code is actually generated. | ||
*/ | ||
pub type RustGenerate = bool; | ||
|
||
/** | ||
* ADL field annotation giving explicit control over | ||
* how a field should be stored. | ||
*/ | ||
#[derive(Clone,Deserialize,Eq,Hash,PartialEq,Serialize)] | ||
pub enum RustStorageModel { | ||
/** | ||
* Standard inline storage | ||
*/ | ||
#[serde(rename="standard")] | ||
Standard, | ||
|
||
/** | ||
* Store the value in a Box<> | ||
*/ | ||
#[serde(rename="boxed")] | ||
Boxed, | ||
} | ||
|
||
/** | ||
* ADL declaration annotation to specify that a custom type | ||
* should be used | ||
*/ | ||
#[derive(Clone,Deserialize,Eq,Hash,PartialEq,Serialize)] | ||
pub struct RustCustomType { | ||
pub rustname: String, | ||
|
||
pub helpers: String, | ||
|
||
#[serde(default="RustCustomType::def_generate_orig_adl_type")] | ||
#[serde(rename="generateOrigADLType")] | ||
pub generate_orig_adl_type: String, | ||
|
||
#[serde(rename="stdTraits")] | ||
pub std_traits: Vec<String>, | ||
} | ||
|
||
impl RustCustomType { | ||
pub fn new(rustname: String, helpers: String, std_traits: Vec<String>) -> RustCustomType { | ||
RustCustomType { | ||
rustname: rustname, | ||
helpers: helpers, | ||
generate_orig_adl_type: RustCustomType::def_generate_orig_adl_type(), | ||
std_traits: std_traits, | ||
} | ||
} | ||
|
||
pub fn def_generate_orig_adl_type() -> String { | ||
"".to_string() | ||
} | ||
} |
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 @@ | ||
pub mod config; |
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,2 @@ | ||
pub mod adlc; | ||
pub mod sys; |
Oops, something went wrong.