style(treewide): Reformat
This commit is contained in:
parent
5a7bb00548
commit
03f8eda241
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
//! This module is responsible for the config passed to trixy.
|
||||
//! It works using the popular builder syntax:
|
||||
//! ```no_run
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
//! This module generates the c header
|
||||
//! It works by firstly listing the functions and then by grouping them into structures, effectively
|
||||
//! simulating namespaces in c.
|
||||
|
|
|
@ -21,10 +21,10 @@
|
|||
|
||||
use proc_macro2::TokenStream as TokenStream2;
|
||||
use quote::format_ident;
|
||||
use trixy_parser::command_spec::{CommandSpec, Namespace, Identifier, Function};
|
||||
use quote::quote;
|
||||
use trixy_parser::command_spec::{CommandSpec, Function, Identifier, Namespace};
|
||||
|
||||
use crate::generate::{identifier_to_rust, c_api::mangle_c_function_ident};
|
||||
use crate::generate::{c_api::mangle_c_function_ident, identifier_to_rust};
|
||||
|
||||
pub fn generate(trixy: &CommandSpec) -> String {
|
||||
let struct_initializer: TokenStream2 = trixy
|
||||
|
@ -83,4 +83,3 @@ fn namespace_to_struct_init(namespace: &Namespace) -> TokenStream2 {
|
|||
. #ident = #ident ,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
use convert_case::{Case, Casing};
|
||||
use proc_macro2::TokenStream as TokenStream2;
|
||||
use quote::{format_ident, quote};
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
use convert_case::{Case, Casing};
|
||||
use proc_macro2::{Ident, TokenStream as TokenStream2};
|
||||
use quote::{format_ident, quote};
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
//! This module is responsible for generating the rust code used to interface with the api.
|
||||
//! That includes the structs and enums declared in the trixy file and the enum used to describe the
|
||||
//! command being executed.
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
use proc_macro2::TokenStream as TokenStream2;
|
||||
use quote::{format_ident, quote};
|
||||
use trixy_parser::command_spec::{CommandSpec, Function, Identifier, NamedType, Type};
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
use std::{
|
||||
env,
|
||||
fs::{self, File},
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
use std::{fs, path::PathBuf, process::exit};
|
||||
|
||||
use clap::{Parser, Subcommand};
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
//! This module contains the already type checked types.
|
||||
|
||||
use std::fmt::{Display, Write};
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
//! This module provides the type definitions for the parser.
|
||||
//! These types are split into type-checked ones [`checked`] and the raw types [`unchecked`]
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
//! This module contains the not type checked types.
|
||||
//! These are generated on the first pass of the parser, to be later converted into the checked
|
||||
//! ones.
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
use core::fmt;
|
||||
|
||||
use thiserror::Error;
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
use std::{error::Error, fmt::Display};
|
||||
use thiserror::Error;
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
use std::fmt::Display;
|
||||
|
||||
use self::{error::SpannedLexingError, tokenizer::Tokenizer};
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
use crate::lexing::{Keyword, Token, TokenKind, TokenSpan};
|
||||
|
||||
use super::TokenStream;
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
// This code is heavily inspired by: https://michael-f-bryan.github.io/static-analyser-in-rust/book/lex.html
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
use error::TrixyError;
|
||||
|
||||
use crate::lexing::TokenStream;
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
use thiserror::Error;
|
||||
|
||||
use std::{error::Error, fmt::Display};
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
use std::mem;
|
||||
|
||||
use convert_case::{Case, Casing};
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
use crate::command_spec::checked::{
|
||||
Attribute, CommandSpec, DocIdentifier, DocNamedType, Enumeration, Function, Identifier,
|
||||
NamedType, Namespace, Structure, Type,
|
||||
|
|
|
@ -19,6 +19,5 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
pub mod checked;
|
||||
pub mod unchecked;
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
use std::{error::Error, fmt::Display};
|
||||
use thiserror::Error;
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
use std::mem;
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
use std::ffi::c_char;
|
||||
|
||||
use thiserror::Error;
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
//! Trixy contains the types used by the [`trixy-macros`] crate to provide ffi safe types
|
||||
pub mod error;
|
||||
pub mod traits;
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
use core::slice;
|
||||
use std::{
|
||||
cell::RefCell,
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
pub mod convert_trait;
|
||||
pub mod errno;
|
||||
mod try_from_impl;
|
||||
|
|
Reference in New Issue