From 03f24503b72a6598b9da014bc657429dfb00695e Mon Sep 17 00:00:00 2001 From: Soispha Date: Sat, 23 Dec 2023 18:57:10 +0100 Subject: [PATCH] chore(treewide): Add license headers --- .envrc | 19 +++++++++++++++++ Cargo.toml | 19 +++++++++++++++++ cog.toml | 19 +++++++++++++++++ flake.nix | 19 +++++++++++++++++ src/config/mod.rs | 21 +++++++++++++++++++ src/generate/command_enum/mod.rs | 21 +++++++++++++++++++ .../lua_functions_to_globals/mod.rs | 21 +++++++++++++++++++ src/generate/lua_wrapper/mod.rs | 21 +++++++++++++++++++ .../lua_wrapper/rust_wrapper_functions/mod.rs | 21 +++++++++++++++++++ src/generate/mod.rs | 21 +++++++++++++++++++ src/lib.rs | 21 +++++++++++++++++++ trixy-lang_parser/Cargo.toml | 19 +++++++++++++++++ trixy-lang_parser/docs/grammar.ebnf | 21 +++++++++++++++++++ trixy-lang_parser/example/comments.tri | 21 +++++++++++++++++++ trixy-lang_parser/example/empty.tri | 21 +++++++++++++++++++ trixy-lang_parser/example/failing.tri | 21 +++++++++++++++++++ .../example/failing_comments.tri | 21 +++++++++++++++++++ trixy-lang_parser/example/failing_types.tri | 21 +++++++++++++++++++ trixy-lang_parser/example/full.tri | 21 +++++++++++++++++++ trixy-lang_parser/example/multiple.tri | 21 +++++++++++++++++++ trixy-lang_parser/example/simple.tri | 21 +++++++++++++++++++ trixy-lang_parser/example/types.tri | 21 +++++++++++++++++++ trixy-lang_parser/generate_docs | 19 +++++++++++++++++ trixy-lang_parser/src/command_spec/checked.rs | 21 +++++++++++++++++++ trixy-lang_parser/src/command_spec/mod.rs | 21 +++++++++++++++++++ .../src/command_spec/unchecked.rs | 21 +++++++++++++++++++ trixy-lang_parser/src/error.rs | 21 +++++++++++++++++++ trixy-lang_parser/src/lexing/error.rs | 21 +++++++++++++++++++ trixy-lang_parser/src/lexing/mod.rs | 21 +++++++++++++++++++ trixy-lang_parser/src/lexing/test.rs | 21 +++++++++++++++++++ trixy-lang_parser/src/lexing/tokenizer.rs | 21 +++++++++++++++++++ trixy-lang_parser/src/lib.rs | 21 +++++++++++++++++++ trixy-lang_parser/src/main.rs | 21 +++++++++++++++++++ .../src/parsing/checked/error.rs | 21 +++++++++++++++++++ trixy-lang_parser/src/parsing/checked/mod.rs | 21 +++++++++++++++++++ trixy-lang_parser/src/parsing/checked/test.rs | 21 +++++++++++++++++++ trixy-lang_parser/src/parsing/mod.rs | 21 +++++++++++++++++++ .../src/parsing/unchecked/error.rs | 21 +++++++++++++++++++ .../src/parsing/unchecked/mod.rs | 21 +++++++++++++++++++ .../src/parsing/unchecked/test.rs | 21 +++++++++++++++++++ 40 files changed, 828 insertions(+) diff --git a/.envrc b/.envrc index 96eca6b..1261dec 100644 --- a/.envrc +++ b/.envrc @@ -1,3 +1,22 @@ +# Copyright (C) 2023 The Trinitrix Project +# +# This file is part of the Trixy crate for Trinitrix. +# +# Trixy is free software: you can redistribute it and/or modify +# it under the terms of the Lesser GNU General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# and the Lesser GNU General Public License along with this program. +# If not, see . + + use flake || use nix watch_file flake.nix diff --git a/Cargo.toml b/Cargo.toml index af5db2d..210b17b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,22 @@ +# Copyright (C) 2023 The Trinitrix Project +# +# This file is part of the Trixy crate for Trinitrix. +# +# Trixy is free software: you can redistribute it and/or modify +# it under the terms of the Lesser GNU General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# and the Lesser GNU General Public License along with this program. +# If not, see . + + [package] name = "trixy" version = "0.1.0" diff --git a/cog.toml b/cog.toml index 6dd14ec..78b431c 100644 --- a/cog.toml +++ b/cog.toml @@ -1,3 +1,22 @@ +# Copyright (C) 2023 The Trinitrix Project +# +# This file is part of the Trixy crate for Trinitrix. +# +# Trixy is free software: you can redistribute it and/or modify +# it under the terms of the Lesser GNU General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# and the Lesser GNU General Public License along with this program. +# If not, see . + + tag_prefix = "v" branch_whitelist = [ "main" ] ignore_merge_commits = false diff --git a/flake.nix b/flake.nix index b90587f..1ca9c2d 100644 --- a/flake.nix +++ b/flake.nix @@ -1,3 +1,22 @@ +# Copyright (C) 2023 The Trinitrix Project +# +# This file is part of the Trixy crate for Trinitrix. +# +# Trixy is free software: you can redistribute it and/or modify +# it under the terms of the Lesser GNU General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# and the Lesser GNU General Public License along with this program. +# If not, see . + + { description = "A rust crate used to generate multi-language apis for your application"; diff --git a/src/config/mod.rs b/src/config/mod.rs index 5899d6e..2fb6dd7 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + //! This module is responsible for parsing the config passed to the macro call: //! For example: //! ```no_run diff --git a/src/generate/command_enum/mod.rs b/src/generate/command_enum/mod.rs index 61f0b7b..796e24e 100644 --- a/src/generate/command_enum/mod.rs +++ b/src/generate/command_enum/mod.rs @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + use convert_case::{Case, Casing}; use proc_macro2::TokenStream as TokenStream2; use quote::{format_ident, quote, ToTokens}; diff --git a/src/generate/lua_wrapper/lua_functions_to_globals/mod.rs b/src/generate/lua_wrapper/lua_functions_to_globals/mod.rs index 124817a..9183740 100644 --- a/src/generate/lua_wrapper/lua_functions_to_globals/mod.rs +++ b/src/generate/lua_wrapper/lua_functions_to_globals/mod.rs @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + use proc_macro2::TokenStream as TokenStream2; use quote::{format_ident, quote}; use syn::{punctuated::Punctuated, Token}; diff --git a/src/generate/lua_wrapper/mod.rs b/src/generate/lua_wrapper/mod.rs index ddbb235..1f374c2 100644 --- a/src/generate/lua_wrapper/mod.rs +++ b/src/generate/lua_wrapper/mod.rs @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + use proc_macro2::TokenStream as TokenStream2; use quote::quote; diff --git a/src/generate/lua_wrapper/rust_wrapper_functions/mod.rs b/src/generate/lua_wrapper/rust_wrapper_functions/mod.rs index c0dc052..0d20ce0 100644 --- a/src/generate/lua_wrapper/rust_wrapper_functions/mod.rs +++ b/src/generate/lua_wrapper/rust_wrapper_functions/mod.rs @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + use convert_case::{Case, Casing}; use proc_macro2::TokenStream as TokenStream2; use quote::quote; diff --git a/src/generate/mod.rs b/src/generate/mod.rs index 103b3f1..9504ad6 100644 --- a/src/generate/mod.rs +++ b/src/generate/mod.rs @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + mod command_enum; mod lua_wrapper; diff --git a/src/lib.rs b/src/lib.rs index 21aa639..6fe5257 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + use command_enum_parsing::DataCommandEnum; use config::TrixyConfig; use proc_macro::TokenStream; diff --git a/trixy-lang_parser/Cargo.toml b/trixy-lang_parser/Cargo.toml index 500ee94..cb22f6b 100644 --- a/trixy-lang_parser/Cargo.toml +++ b/trixy-lang_parser/Cargo.toml @@ -1,3 +1,22 @@ +# Copyright (C) 2023 The Trinitrix Project +# +# This file is part of the Trixy crate for Trinitrix. +# +# Trixy is free software: you can redistribute it and/or modify +# it under the terms of the Lesser GNU General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# and the Lesser GNU General Public License along with this program. +# If not, see . + + [package] name = "trixy-lang_parser" version = "0.1.0" diff --git a/trixy-lang_parser/docs/grammar.ebnf b/trixy-lang_parser/docs/grammar.ebnf index d495fc3..dc1ee47 100644 --- a/trixy-lang_parser/docs/grammar.ebnf +++ b/trixy-lang_parser/docs/grammar.ebnf @@ -1,3 +1,24 @@ +#(* +# Copyright (C) 2023 The Trinitrix Project +# +# This file is part of the Trixy crate for Trinitrix. +# +# Trixy is free software: you can redistribute it and/or modify +# it under the terms of the Lesser GNU General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# and the Lesser GNU General Public License along with this program. +# If not, see . +#*) + + # (* # Trixy is fully whitespace independent, this means that you can # interleave whitespace in the definitions. diff --git a/trixy-lang_parser/example/comments.tri b/trixy-lang_parser/example/comments.tri index 597996a..1471e6b 100644 --- a/trixy-lang_parser/example/comments.tri +++ b/trixy-lang_parser/example/comments.tri @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + fn print(message: String); /// First doc comment diff --git a/trixy-lang_parser/example/empty.tri b/trixy-lang_parser/example/empty.tri index e69de29..0da6daa 100644 --- a/trixy-lang_parser/example/empty.tri +++ b/trixy-lang_parser/example/empty.tri @@ -0,0 +1,21 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + diff --git a/trixy-lang_parser/example/failing.tri b/trixy-lang_parser/example/failing.tri index 7227248..5edbc63 100644 --- a/trixy-lang_parser/example/failing.tri +++ b/trixy-lang_parser/example/failing.tri @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + fn print(message: CommandTransferValue); nasp trinitrix { {} diff --git a/trixy-lang_parser/example/failing_comments.tri b/trixy-lang_parser/example/failing_comments.tri index 7aa985b..83f6aed 100644 --- a/trixy-lang_parser/example/failing_comments.tri +++ b/trixy-lang_parser/example/failing_comments.tri @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + fn print(message: CommandTransferValue); /// Some doc comment diff --git a/trixy-lang_parser/example/failing_types.tri b/trixy-lang_parser/example/failing_types.tri index 8e5ed74..1763f1d 100644 --- a/trixy-lang_parser/example/failing_types.tri +++ b/trixy-lang_parser/example/failing_types.tri @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + struct Callback { func: Function, timeout: Integer, diff --git a/trixy-lang_parser/example/full.tri b/trixy-lang_parser/example/full.tri index 9b2f065..1467c1e 100644 --- a/trixy-lang_parser/example/full.tri +++ b/trixy-lang_parser/example/full.tri @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + /// Prints to the output, with a newline. // HACK(@soispha): The stdlib Lua `print()` function has stdout as output hardcoded, // redirecting stdout seems too much like a hack thus we are just redefining the print function diff --git a/trixy-lang_parser/example/multiple.tri b/trixy-lang_parser/example/multiple.tri index 0fca007..bf9b2fd 100644 --- a/trixy-lang_parser/example/multiple.tri +++ b/trixy-lang_parser/example/multiple.tri @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + fn print(message: CommandTransferValue); nasp trinitrix { diff --git a/trixy-lang_parser/example/simple.tri b/trixy-lang_parser/example/simple.tri index c9b5c9a..504c8c6 100644 --- a/trixy-lang_parser/example/simple.tri +++ b/trixy-lang_parser/example/simple.tri @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + fn print(message: CommandTransferValue); nasp trinitrix { diff --git a/trixy-lang_parser/example/types.tri b/trixy-lang_parser/example/types.tri index b599445..83379e1 100644 --- a/trixy-lang_parser/example/types.tri +++ b/trixy-lang_parser/example/types.tri @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + nasp trinitrix { struct Callback { func: Function, diff --git a/trixy-lang_parser/generate_docs b/trixy-lang_parser/generate_docs index f84a636..ff45b82 100755 --- a/trixy-lang_parser/generate_docs +++ b/trixy-lang_parser/generate_docs @@ -1,3 +1,22 @@ +# Copyright (C) 2023 The Trinitrix Project +# +# This file is part of the Trixy crate for Trinitrix. +# +# Trixy is free software: you can redistribute it and/or modify +# it under the terms of the Lesser GNU General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# and the Lesser GNU General Public License along with this program. +# If not, see . + + #!/usr/bin/env sh diff --git a/trixy-lang_parser/src/command_spec/checked.rs b/trixy-lang_parser/src/command_spec/checked.rs index 30d0eda..92f1f45 100644 --- a/trixy-lang_parser/src/command_spec/checked.rs +++ b/trixy-lang_parser/src/command_spec/checked.rs @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + //! This module contains the already type checked types. use std::fmt::Display; diff --git a/trixy-lang_parser/src/command_spec/mod.rs b/trixy-lang_parser/src/command_spec/mod.rs index 1bf868c..efec3b6 100644 --- a/trixy-lang_parser/src/command_spec/mod.rs +++ b/trixy-lang_parser/src/command_spec/mod.rs @@ -1,2 +1,23 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + pub mod checked; pub mod unchecked; diff --git a/trixy-lang_parser/src/command_spec/unchecked.rs b/trixy-lang_parser/src/command_spec/unchecked.rs index 5757ee0..5cb7783 100644 --- a/trixy-lang_parser/src/command_spec/unchecked.rs +++ b/trixy-lang_parser/src/command_spec/unchecked.rs @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + //! 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. diff --git a/trixy-lang_parser/src/error.rs b/trixy-lang_parser/src/error.rs index a98f518..92bbb7a 100644 --- a/trixy-lang_parser/src/error.rs +++ b/trixy-lang_parser/src/error.rs @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + use core::fmt; use thiserror::Error; diff --git a/trixy-lang_parser/src/lexing/error.rs b/trixy-lang_parser/src/lexing/error.rs index ecaf92e..49536d6 100644 --- a/trixy-lang_parser/src/lexing/error.rs +++ b/trixy-lang_parser/src/lexing/error.rs @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + use std::{error::Error, fmt::Display}; use thiserror::Error; diff --git a/trixy-lang_parser/src/lexing/mod.rs b/trixy-lang_parser/src/lexing/mod.rs index 77fd918..71a653c 100644 --- a/trixy-lang_parser/src/lexing/mod.rs +++ b/trixy-lang_parser/src/lexing/mod.rs @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + use std::fmt::Display; use self::{error::SpannedLexingError, tokenizer::Tokenizer}; diff --git a/trixy-lang_parser/src/lexing/test.rs b/trixy-lang_parser/src/lexing/test.rs index 396f1cb..b80ba41 100644 --- a/trixy-lang_parser/src/lexing/test.rs +++ b/trixy-lang_parser/src/lexing/test.rs @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + use crate::lexing::{Keyword, Token, TokenKind, TokenSpan}; use super::TokenStream; diff --git a/trixy-lang_parser/src/lexing/tokenizer.rs b/trixy-lang_parser/src/lexing/tokenizer.rs index 6662f07..b847df4 100644 --- a/trixy-lang_parser/src/lexing/tokenizer.rs +++ b/trixy-lang_parser/src/lexing/tokenizer.rs @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + // This code is heavily inspired by: https://michael-f-bryan.github.io/static-analyser-in-rust/book/lex.html use crate::{ diff --git a/trixy-lang_parser/src/lib.rs b/trixy-lang_parser/src/lib.rs index 65f69b3..ef5e72f 100644 --- a/trixy-lang_parser/src/lib.rs +++ b/trixy-lang_parser/src/lib.rs @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + use error::TrixyError; use crate::lexing::TokenStream; diff --git a/trixy-lang_parser/src/main.rs b/trixy-lang_parser/src/main.rs index aefc806..d55e593 100644 --- a/trixy-lang_parser/src/main.rs +++ b/trixy-lang_parser/src/main.rs @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + use std::{fs, process::exit}; use trixy_lang_parser::lexing::TokenStream; diff --git a/trixy-lang_parser/src/parsing/checked/error.rs b/trixy-lang_parser/src/parsing/checked/error.rs index e088199..d922d63 100644 --- a/trixy-lang_parser/src/parsing/checked/error.rs +++ b/trixy-lang_parser/src/parsing/checked/error.rs @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + use thiserror::Error; use std::{error::Error, fmt::Display}; diff --git a/trixy-lang_parser/src/parsing/checked/mod.rs b/trixy-lang_parser/src/parsing/checked/mod.rs index 669fd1b..ab63d27 100644 --- a/trixy-lang_parser/src/parsing/checked/mod.rs +++ b/trixy-lang_parser/src/parsing/checked/mod.rs @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + use std::mem; use crate::{ diff --git a/trixy-lang_parser/src/parsing/checked/test.rs b/trixy-lang_parser/src/parsing/checked/test.rs index adf7a85..1eb4811 100644 --- a/trixy-lang_parser/src/parsing/checked/test.rs +++ b/trixy-lang_parser/src/parsing/checked/test.rs @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + use crate::command_spec::checked::{ Attribute, CommandSpec, DocIdentifier, DocNamedType, Enumeration, Function, Identifier, NamedType, Namespace, Structure, Type, diff --git a/trixy-lang_parser/src/parsing/mod.rs b/trixy-lang_parser/src/parsing/mod.rs index f1506dc..1db68fe 100644 --- a/trixy-lang_parser/src/parsing/mod.rs +++ b/trixy-lang_parser/src/parsing/mod.rs @@ -1,2 +1,23 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + pub mod checked; mod unchecked; diff --git a/trixy-lang_parser/src/parsing/unchecked/error.rs b/trixy-lang_parser/src/parsing/unchecked/error.rs index f15c5d5..4e3c6b4 100644 --- a/trixy-lang_parser/src/parsing/unchecked/error.rs +++ b/trixy-lang_parser/src/parsing/unchecked/error.rs @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + use std::{error::Error, fmt::Display}; use thiserror::Error; diff --git a/trixy-lang_parser/src/parsing/unchecked/mod.rs b/trixy-lang_parser/src/parsing/unchecked/mod.rs index b1175e0..136c664 100644 --- a/trixy-lang_parser/src/parsing/unchecked/mod.rs +++ b/trixy-lang_parser/src/parsing/unchecked/mod.rs @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + use std::mem; use crate::{ diff --git a/trixy-lang_parser/src/parsing/unchecked/test.rs b/trixy-lang_parser/src/parsing/unchecked/test.rs index b5568fb..51b463e 100644 --- a/trixy-lang_parser/src/parsing/unchecked/test.rs +++ b/trixy-lang_parser/src/parsing/unchecked/test.rs @@ -1,3 +1,24 @@ +/* +* Copyright (C) 2023 The Trinitrix Project +* +* This file is part of the Trixy crate for Trinitrix. +* +* Trixy is free software: you can redistribute it and/or modify +* it under the terms of the Lesser GNU General Public License as +* published by the Free Software Foundation, either version 3 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* and the Lesser GNU General Public License along with this program. +* If not, see . +*/ + + use pretty_assertions::assert_eq; use crate::{