toujours plus
This commit is contained in:
parent
66718968a4
commit
67b763f20f
15
README.md
15
README.md
|
@ -22,6 +22,8 @@ convenience.
|
||||||
|
|
||||||
Here's an example of what can be achieved with Rouille:
|
Here's an example of what can be achieved with Rouille:
|
||||||
|
|
||||||
|
### struct and impl (aka convention et réalisation)
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
rouille::rouille! {
|
rouille::rouille! {
|
||||||
utilisons std::collections::Dictionnaire comme Dico;
|
utilisons std::collections::Dictionnaire comme Dico;
|
||||||
|
@ -53,6 +55,19 @@ rouille::rouille! {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Support for regional languages
|
||||||
|
|
||||||
|
```rust
|
||||||
|
#[légal(code_inaccessible)]
|
||||||
|
fonction secondaire() {
|
||||||
|
merde!("oh non"); // for the true French experience
|
||||||
|
calisse!("tabernacle"); // for friends speaking fr-ca
|
||||||
|
oups!("fetchez la vache"); // in SFW contexts
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Other examples
|
||||||
|
|
||||||
See the [examples](./examples/src/main.rs) to get a rough sense of the whole
|
See the [examples](./examples/src/main.rs) to get a rough sense of the whole
|
||||||
syntax. Voilà, that's it.
|
syntax. Voilà, that's it.
|
||||||
|
|
||||||
|
|
|
@ -72,5 +72,14 @@ rouille::rouille! {
|
||||||
12
|
12
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
secondaire();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[légal(code_inaccessible)]
|
||||||
|
fonction secondaire() {
|
||||||
|
merde!("oh non"); // for the true French experience
|
||||||
|
calisse!("tabernacle"); // for friends speaking fr-ca
|
||||||
|
oups!("fetchez la vache"); // in SFW contexts
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,6 @@ fn replace_ident(ident: Ident) -> Option<TokenTree> {
|
||||||
let ident_str = ident.to_string();
|
let ident_str = ident.to_string();
|
||||||
|
|
||||||
let new_str = match ident_str.as_str() {
|
let new_str = match ident_str.as_str() {
|
||||||
"vers" => "into",
|
|
||||||
"réf" => "ref",
|
|
||||||
"en_réf" => "as_ref",
|
|
||||||
"Arf" => "Err",
|
"Arf" => "Err",
|
||||||
"Bien" => "Ok",
|
"Bien" => "Ok",
|
||||||
"Chaine" => "String",
|
"Chaine" => "String",
|
||||||
|
@ -25,6 +22,7 @@ fn replace_ident(ident: Ident) -> Option<TokenTree> {
|
||||||
"boucle" => "loop",
|
"boucle" => "loop",
|
||||||
"bouge" => "move",
|
"bouge" => "move",
|
||||||
"cagette" => "crate",
|
"cagette" => "crate",
|
||||||
|
"code_inaccessible" => "unreachable_code",
|
||||||
"comme" => "as",
|
"comme" => "as",
|
||||||
"constant" => "const",
|
"constant" => "const",
|
||||||
"convention" => "trait",
|
"convention" => "trait",
|
||||||
|
@ -34,6 +32,7 @@ fn replace_ident(ident: Ident) -> Option<TokenTree> {
|
||||||
"dynamique" => "dyn",
|
"dynamique" => "dyn",
|
||||||
"déballer" => "unwrap",
|
"déballer" => "unwrap",
|
||||||
"défaut" => "default",
|
"défaut" => "default",
|
||||||
|
"en_réf" => "as_ref",
|
||||||
"es" => "io",
|
"es" => "io",
|
||||||
"externe" => "extern",
|
"externe" => "extern",
|
||||||
"faux" => "false",
|
"faux" => "false",
|
||||||
|
@ -41,6 +40,7 @@ fn replace_ident(ident: Ident) -> Option<TokenTree> {
|
||||||
"génial" => "super",
|
"génial" => "super",
|
||||||
"insérer" => "insert",
|
"insérer" => "insert",
|
||||||
"lire" => "get",
|
"lire" => "get",
|
||||||
|
"légal" => "allow",
|
||||||
"merde" | "calisse" | "oups" => "panic",
|
"merde" | "calisse" | "oups" => "panic",
|
||||||
"module" => "mod",
|
"module" => "mod",
|
||||||
"mutable" => "mut",
|
"mutable" => "mut",
|
||||||
|
@ -53,6 +53,7 @@ fn replace_ident(ident: Ident) -> Option<TokenTree> {
|
||||||
"que" => None?,
|
"que" => None?,
|
||||||
"renvoie" => "return",
|
"renvoie" => "return",
|
||||||
"réalisation" => "impl",
|
"réalisation" => "impl",
|
||||||
|
"réf" => "ref",
|
||||||
"selon" => "match",
|
"selon" => "match",
|
||||||
"si" => "if",
|
"si" => "if",
|
||||||
"sinon" => "else",
|
"sinon" => "else",
|
||||||
|
@ -63,6 +64,7 @@ fn replace_ident(ident: Ident) -> Option<TokenTree> {
|
||||||
"suppose" => "expect",
|
"suppose" => "expect",
|
||||||
"tant" => "while",
|
"tant" => "while",
|
||||||
"utilisons" => "use",
|
"utilisons" => "use",
|
||||||
|
"vers" => "into",
|
||||||
"vrai" => "true",
|
"vrai" => "true",
|
||||||
"énumération" => "enum",
|
"énumération" => "enum",
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue