diff --git a/.clang-format b/.clang-format index f9f2c5e..d32a74e 100644 --- a/.clang-format +++ b/.clang-format @@ -22,8 +22,8 @@ BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: true AllowAllArgumentsOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: true -ColumnLimit: 90 -LambdaBodyIndentation: OuterScope +ColumnLimit: 120 +LambdaBodyIndentation: Signature RemoveBracesLLVM: true SeparateDefinitionBlocks: Always CommentPragmas: '^ IWYU pragma:' @@ -51,7 +51,7 @@ AllowShortBlocksOnASingleLine: Never Cpp11BracedListStyle: true DerivePointerAlignment: true DisableFormat: false -ExperimentalAutoDetectBinPacking: true +ExperimentalAutoDetectBinPacking: false ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] IncludeCategories: - Regex: '^"(llvm|llvm-c|clang|clang-c)/' @@ -68,11 +68,11 @@ MacroBlockBegin: '' MacroBlockEnd: '' MaxEmptyLinesToKeep: 1 NamespaceIndentation: All -PenaltyBreakComment: 90 -PenaltyBreakFirstLessLess: 90 -PenaltyBreakString: 90 -PenaltyExcessCharacter: 90 -PenaltyReturnTypeOnItsOwnLine: 90 +PenaltyBreakComment: 120 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 120 +PenaltyExcessCharacter: 120 +PenaltyReturnTypeOnItsOwnLine: 120 PointerAlignment: Middle ReflowComments: true SortIncludes: "Never" diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2c89d13..0a27934 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -29,7 +29,7 @@ jobs: - name: Install dependencies run: - brew install bison flex + brew install bison flex llvm - name: build run: xmake -y \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index bc68788..0bdd17a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,65 +5,118 @@ # project cmake_minimum_required(VERSION 3.15.0) cmake_policy(SET CMP0091 NEW) +set(CMAKE_C_COMPILER "/usr/bin/x86_64-w64-mingw32-gcc") +set(CMAKE_CXX_COMPILER "/usr/bin/x86_64-w64-mingw32-g++") project(swallow VERSION 0.0.1 LANGUAGES CXX) # target -set(CMAKE_C_COMPILER "/usr/bin/clang-18") -set(CMAKE_CXX_COMPILER "/usr/bin/clang++-18") -add_library(base SHARED "") -set_target_properties(base PROPERTIES OUTPUT_NAME "base") -set_target_properties(base PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/build/linux/x86_64/release") -target_compile_options(base PRIVATE +add_executable(swa "") +set_target_properties(swa PROPERTIES OUTPUT_NAME "swa") +set_target_properties(swa PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/build/linux/x86_64/release") +add_dependencies(swa swc swi) +target_include_directories(swa PRIVATE + compiler +) +target_compile_options(swa PRIVATE + $<$:-m64> + $<$:-m64> + $<$:-DNDEBUG> + $<$:-DNDEBUG> +) +set_target_properties(swa PROPERTIES CXX_EXTENSIONS OFF) +target_compile_features(swa PRIVATE cxx_std_20) +if(MSVC) + target_compile_options(swa PRIVATE $<$:-O2>) +else() + target_compile_options(swa PRIVATE -O3) +endif() +if(MSVC) +else() + target_compile_options(swa PRIVATE -fvisibility=hidden) +endif() +if(MSVC) + set_property(TARGET swa PROPERTY + MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") +endif() +target_link_libraries(swa PRIVATE + swi + swc + pthread +) +target_link_directories(swa PRIVATE + build/linux/x86_64/release +) +target_link_options(swa PRIVATE + -m64 +) +if(Clang) +target_link_options(swa PRIVATE + -lc++abi +) +endif() +target_sources(swa PRIVATE + cli/main.cpp +) + +# target +add_library(swallow_base STATIC "") +set_target_properties(swallow_base PROPERTIES OUTPUT_NAME "swallow_base") +set_target_properties(swallow_base PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/build/linux/x86_64/release") +target_compile_options(swallow_base PRIVATE $<$:-m64> $<$:-m64> $<$:-DNDEBUG> $<$:-DNDEBUG> ) -set_target_properties(base PROPERTIES CXX_EXTENSIONS OFF) -target_compile_features(base PRIVATE cxx_std_20) +set_target_properties(swallow_base PROPERTIES CXX_EXTENSIONS OFF) +target_compile_features(swallow_base PRIVATE cxx_std_20) if(MSVC) - target_compile_options(base PRIVATE $<$:-Ox -fp:fast>) + target_compile_options(swallow_base PRIVATE $<$:-O2>) else() - target_compile_options(base PRIVATE -O3) + target_compile_options(swallow_base PRIVATE -O3) endif() if(MSVC) - set_property(TARGET base PROPERTY +else() + target_compile_options(swallow_base PRIVATE -fvisibility=hidden) +endif() +if(MSVC) + set_property(TARGET swallow_base PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") endif() -target_link_options(base PRIVATE +target_link_options(swallow_base PRIVATE -m64 ) -target_sources(base PRIVATE +target_sources(swallow_base PRIVATE base/base.cpp ) # target -set(CMAKE_C_COMPILER "/usr/bin/clang-18") -set(CMAKE_CXX_COMPILER "/usr/bin/clang++-18") -add_executable(swc "") +add_library(swc STATIC "") set_target_properties(swc PROPERTIES OUTPUT_NAME "swc") -set_target_properties(swc PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/build/linux/x86_64/release") -add_dependencies(swc base) +set_target_properties(swc PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/build/linux/x86_64/release") target_include_directories(swc PRIVATE compiler - compiler/ast - compiler/type - compiler/lexer - compiler/parser - compiler/diagnostics - compiler/utils +) +target_include_directories(swc SYSTEM PRIVATE + /home/muqiu/.xmake/packages/t/tl_optional/v1.1.0/c98c96f6367f4230ab618e8e653468c7/include + /home/muqiu/.xmake/packages/t/tl_expected/v1.1.0/57774aec28a24eb8b84e9c45d2905d73/include + /home/muqiu/.xmake/packages/s/spdlog/v1.14.1/6a0109080d85439d985a75b8a212f96a/include ) target_compile_options(swc PRIVATE $<$:-m64> $<$:-m64> $<$:-DNDEBUG> $<$:-DNDEBUG> +) +if(Clang) +target_compile_options(swc PRIVATE $<$:-stdlib=libc++> ) +endif() set_target_properties(swc PROPERTIES CXX_EXTENSIONS OFF) target_compile_features(swc PRIVATE cxx_std_20) if(MSVC) - target_compile_options(swc PRIVATE $<$:-Ox -fp:fast>) + target_compile_options(swc PRIVATE $<$:-O2>) else() target_compile_options(swc PRIVATE -O3) endif() @@ -76,42 +129,45 @@ if(MSVC) MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") endif() target_link_libraries(swc PRIVATE - c++ - base -) -target_link_directories(swc PRIVATE - build/linux/x86_64/release + pthread ) target_link_options(swc PRIVATE -m64 ) +if(Clang) +target_link_options(swc PRIVATE + -lc++abi +) +endif() target_sources(swc PRIVATE compiler/compiler.cpp - compiler/parser/parser.cpp - compiler/parser/bison_parser.cpp - compiler/type/dump.cpp - compiler/type/environment.cpp - compiler/type/type.cpp - compiler/diagnostics/reporter.cpp + compiler/ast/ast.cpp + compiler/ast/dump.cpp + compiler/ast/gmachine.cpp + compiler/ast/type.cpp compiler/diagnostics/diagnostics.cpp compiler/diagnostics/utils.cpp - compiler/g-machine/instruction.cpp - compiler/g-machine/binop.cpp - compiler/g-machine/environment.cpp + compiler/diagnostics/reporter.cpp + compiler/gmachine/binop.cpp + compiler/gmachine/environment.cpp + compiler/gmachine/instruction.cpp + compiler/ir/context.cpp compiler/lexer/flex_lexer.cpp compiler/lexer/lexer.cpp - compiler/ast/ast.cpp - compiler/ast/g-machine.cpp - compiler/ast/dump.cpp - compiler/ast/type.cpp + compiler/parser/bison_parser.cpp + compiler/parser/parser.cpp + compiler/runtime/node.cpp + compiler/runtime/runtime.cpp + compiler/runtime/stack.cpp + compiler/type/dump.cpp + compiler/type/environment.cpp + compiler/type/type.cpp ) # target -set(CMAKE_C_COMPILER "/usr/bin/clang-18") -set(CMAKE_CXX_COMPILER "/usr/bin/clang++-18") -add_executable(swi "") +add_library(swi STATIC "") set_target_properties(swi PROPERTIES OUTPUT_NAME "swi") -set_target_properties(swi PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/build/linux/x86_64/release") +set_target_properties(swi PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/build/linux/x86_64/release") add_dependencies(swi swc) target_compile_options(swi PRIVATE $<$:-m64> @@ -122,7 +178,7 @@ target_compile_options(swi PRIVATE set_target_properties(swi PROPERTIES CXX_EXTENSIONS OFF) target_compile_features(swi PRIVATE cxx_std_20) if(MSVC) - target_compile_options(swi PRIVATE $<$:-Ox -fp:fast>) + target_compile_options(swi PRIVATE $<$:-O2>) else() target_compile_options(swi PRIVATE -O3) endif() @@ -135,7 +191,8 @@ if(MSVC) MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") endif() target_link_libraries(swi PRIVATE - base + swc + pthread ) target_link_directories(swi PRIVATE build/linux/x86_64/release @@ -143,6 +200,11 @@ target_link_directories(swi PRIVATE target_link_options(swi PRIVATE -m64 ) +if(Clang) +target_link_options(swi PRIVATE + -lc++abi +) +endif() target_sources(swi PRIVATE repl/main.cpp ) diff --git a/README b/README deleted file mode 100644 index 56d8c7f..0000000 --- a/README +++ /dev/null @@ -1,55 +0,0 @@ -* Swallow -* A minimalist functional programming language -* Copyright (c) 2023 Muqiu Han -* -* This project is built using xmake: https://xmake.io/ -* -* FAQ: https://github.com/muqiuhan/Swallow/blob/main/FAQ -* Issues: https://github.com/muqiuhan/Swallow/issues -* Contribution: https://github.com/muqiuhan/Swallow/pulls - - -To build and run with xmake: - - setup: Install the xmake, flex and bison - To build: xmake build - To run: xmake run - To install: xmake install - - -Features ----------- -o- Typechecking -o- Pattern Matching -o- Garbage Collection -o- Polymorphism - -LICENSE ----------- -Copyright (c) 2023 Muqiu Han - -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of Terifo nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/README.md b/README.md index c1409b1..1d6dd2b 100644 --- a/README.md +++ b/README.md @@ -26,20 +26,30 @@ - Build & Install - > This project provides makefile, CMakeLists.txt, which can be built in an environment without xmake. - > Setup: Install the [xmake](xmake.io) - - To build: xmake build + - To build: `xmake f --toolchain=gcc -m release -y && xmake build -j$(expr $(nproc) / 2)` + > or clang `xmake f --toolchain=clang -m release -y && xmake build -j$(expr $(nproc) / 2)` - To run: xmake run - To install: xmake install - + - Cross-compile to windows or other platforms on Linux + - Setup: Install the [llvm](https://apt.llvm.org/) + - Build: `xmake f --toolchain=mingw -m release -y && xmake build -j$(expr $(nproc) / 2)` + > If the LLVM header files cannot be found, you can manually run `ln -s` to the corresponding directory of mingw, for example: + ``` + ln -s /usr/include/llvm /usr/lib64/gcc/x86_64-w64-mingw32/13.2.0/include + + ln -s /usr/include/llvm-c /usr/lib64/gcc/x86_64-w64-mingw32/13.2.0/include + ``` - Tools - [XMake: A cross-platform build utility based on Lua](https://xmake.io/#/) - [GNU Bison: A general-purpose parser generator](https://github.com/akimd/bison) - [Flex: The Fast Lexical Analyzer - scanner generator for lexing in C and C++](https://github.com/westes/flex) - Library/Frameworks - - [optional: C++11/14/17 std::optional with functional-style extensions and reference support](https://github.com/TartanLlama/optional) - - [result: Result for Modern C++](https://github.com/p-ranav/result) - + - [llvm: LLVM project](https://github.com/llvm/llvm-project) + - [tl_optional: C++11/14/17 std::optional with functional-style extensions and reference support](https://github.com/TartanLlama/optional) + - [tl_expected: C++11/14/17 std::expected with functional-style extensions ](https://github.com/TartanLlama/expected/) + - [spdlog: Fast C++ logging library](https://github.com/gabime/spdlog) - REFERENCE - [Theory of computation](https://en.wikipedia.org/wiki/Theory_of_computation) diff --git a/TAGS b/TAGS deleted file mode 100644 index 9c5f348..0000000 --- a/TAGS +++ /dev/null @@ -1,2723 +0,0 @@ - -.git/hooks/applypatch-msg.sample,18 -commitmsg=13,367 - -.git/hooks/fsmonitor-watchman.sample,740 -my ($version, $last_update_token)($version, $last_update_token19,619 -my $git_work_tree git_work_tree30,902 -my $retry retry32,942 -my $json_pkg;json_pkg34,958 -sub launch_watchman 46,1105 - my $o o47,1127 -sub output_result 53,1239 - my ($clockid, @files)($clockid, @files54,1259 - local $,65,1514 -sub watchman_clock 69,1550 - my $response response70,1571 -sub watchman_query 77,1778 - my $pid pid78,1799 - my $last_update_line last_update_line89,2316 - my $query query94,2502 - my $response response108,2826 -sub is_work_tree_watched 123,3285 - my ($output)($output124,3312 - my $error error125,3332 - my $response response128,3478 - my $o o144,4158 -sub get_working_dir 163,4500 - my $working_dir;working_dir164,4522 - -.git/hooks/pre-applypatch.sample,18 -precommit=12,313 - -.git/hooks/pre-push.sample,15 -remote=22,768 - -.git/hooks/pre-rebase.sample,16 -publish=18,587 - -.git/hooks/pre-receive.sample,12 - i=22,520 - -.git/hooks/prepare-commit-msg.sample,24 -COMMIT_MSG_FILE=23,857 - -.git/hooks/push-to-checkout.sample,15 -commit=21,927 - -.git/hooks/sendemail-validate.sample,78 -validate_cover_letter 25,887 -validate_patch 31,998 -validate_series 40,1200 - -.git/hooks/update.sample,78 -refname=28,929 -allowunannotated=46,1315 -zero=63,1921 - newrev_type=65,2017 - -.git/description,24 -Unnamed repository;1,0 - -.git/objects/pack/pack-252cc42187dba9eb9e7479580c0f96d43ca20a5f.pack,1739 -�0E�Yś��4i""�ĉ+��b�mj�Pݽu N.����W^(O�Hc�S�+�c0��E���v�b��hȀAV��(�1h�l|�j䲉"O"��e��G��Z^m�����p�p�)�ܥ�܅�����h%l� ���m��W�n��.-�=��7tm�a&ȟ1�/ÇJ��x����N�0D�|�����N��t4|�X{ל9�>����'A�hfތf�*�;;h�F�{;jt&T�gG����0�8uZ%W��f���������h��ް�FzT��z*+<�����2�-;N�J����/�=(�P� Q� -n�m�k����߹{��RJ��z�Gf�1�������\����$�*U�7|����X�x��˱n� �ᝧ��j�alsQe�1S�ဣ��!ua��'}�n�>�o�$�d�M�:�f�Xȏ���x'څ(�xT7ޥ4 =��$Zr�g �B� zc���|��ޮu�s�Y;�s���/_�\N��\��k��pA�h'"��Z=Z7,1164 -��<�pD�pD6568,1671360 -��<�pD�]�\y:��/�Ϛ�N]N6568,1671360 -Om`RzAj1�Om`RzAj16570,1671681 -Om`RzAj1��X�h�,�����+�ut�4I��%!�Nݦ�%B~bR7�JbR7�6570,1671681 -Om`RzAj1��X�h�,�����+�ut�4I��%!�Nݦ�%B~bR7�J�:;Ϸ�K�U����k����i��z�� -~���~��6570,1671681 -Om`RzAj1��X�h�,�����+�ut�4I��%!�Nݦ�%B~bR7�J�:;Ϸ�K�U����k����i��z�� -~���N��u]�O� j��j�6570,1671681 -Om`RzAj1��X�h�,�����+�ut�4I��%!�Nݦ�%B~bR7�J�:;Ϸ�K�U����k����i��z�� -~���N��u]�O� j���z�Ņ;Yw��V&3�j� ���0��j�H8L4��?�g��I�����5 ����柷�U�yU�6570,1671681 -����D���t��_v�/e�(���S2i7Lس;��2�@��݊��NY�Lеb�:��e�I�t�9�0r��%ҹ�p,>{�h��j���"{" �`�6�G�G6573,1671996 -����D���t��_v�/e�(���S2i7Lس;��2�@��݊��NY�Lеb�:��e�I�t�9�0r��%ҹ�p,>{�h��j���"{" �`�6�G��˞=������h�i� ������qf�Ў"�J���W��/�B 7��?"^���Ϭ�ӽ���g�x���}MT�.w�&����C�o+� ��d5� ��D����ȓ�� -�+lvΗ��Q1B8��$u�ҟ�F!T��낊�f�CO��܃$O&��}��I�����7�Eܤ,��,%���s�s6573,1671996 -�DBmDB6580,1673827 -�DBm]e��Z w���61,j��whkE�X�v*��- -�������w���y�zBO3�+����û ��'�֞�'}���Wj#9��X��\/W��,�Tb^�ң|QQ6580,1673827 -:�����9�C�%A�J��>�y v�8Ú�����h-���4(l� �PE�3gj��-w���fM�>R�,TfNK�TfNK6584,1675618 - -.git/objects/pack/pack-252cc42187dba9eb9e7479580c0f96d43ca20a5f.idx,412 -����S巴�<�;���sd�j�� �b�e����w�5�$��g�Q�Dmّ_�����(�ة�oש� �f����+ܤ���7Q�ռ�I6��Y.�C��X��\�y0X̪������pn�.�  ��"x�x8,2161 -�3 i֮���|�PĕP�9,2370 -�3 i֮���|�PĕXȼ]�w� r�P�4r�P�9,2370 -K� -� -F#{�|}qP]qP25,3094 -����a�UV���a�UV��28,3757 -��T����p�g��~��P��o�*�}o��|�_���� �^ni3����.Ʒ�������t.�qC�]�K�:����*�!A��Ϋ����7��\�L���ޔ�1b�ޙ*���y+*�&AA34,4985 - -.git/config,30 - repositoryformatversion 2,7 - -.git/index,11 -R]R3,765 - -CMakeLists.txt,30 -cmake_minimum_required(6,128 - -LICENSE,15 -Copyright 1,0 - -README,19 -* Copyright 3,59 - -README.md,16 -
utils::Result<utils::Result59,2309 - class Pattern68,2677 - const yy::location Location;73,2750 - explicit Pattern(75,2784 - class Branch84,3112 - const yy::location Location;89,3183 - const Pattern::Ptr Patt;90,3216 - const AST::Ptr Expr;91,3245 - Branch(93,3271 - class Constructor98,3431 - const std::string Name;103,3512 - const std::vector Types;104,3540 - const yy::location Location;105,3582 - Constructodump::dumpIndent - class Definition113,3815 - const yy::location Location;118,3894 - explicit Definition(120,3928 -namespace swallow::compiler::type349,10979 - -compiler/ast/dump.cpp,365 -namespace swallow::compiler::ast34,1645 - static void printIndent(36,1680 - void Int::dump(dump42,1795 - void LID::dump(dump48,1950 - void UID::dump(dump54,2102 - void Binop::dump(dump60,2254 - void Application::dump(dump72,2524 - void Match::dump(dump83,2761 - void PatternVariable::dump(dump100,3112 - void PatternConstructor::dump(dump105,3203 - -compiler/ast/g-machine.cpp,272 -namespace swallow::compiler::ast37,1780 - void Int::compile(compile39,1815 - void LID::compile(compile45,2018 - void UID::compile(compile56,2459 - Application::compile(compile63,2669 - void Binop::compile(compile67,2831 - void Match::compile(compile79,3309 - -compiler/ast/type.cpp,539 -namespace swallow::compiler::ast42,1834 - -> Result<Result47,1999 - -> Result<Result54,2229 - -> Result<Result67,2762 - -> Result<Result79,3284 - const noexcept -> Result<Result144,5715 - -> Result<Result193,7545 - void PatternVariable::match(match256,9932 - PatternConstructor::match(match263,10147 - void Fn::scanDefinitionType(scanDefinitionType319,12281 - void Fn::typecheck(typecheck334,12822 - void Data::scanDefinitionType(scanDefinitionType375,14447 - void Data::typecheck(typecheck391,15080 - -compiler/compiler.cpp,48 -auto main(int argc, char **argv) -> int38,1727 - -compiler/compiler.h,187 -#define SWALLOW_COMPILER_COMPILER_H31,1624 - class CompileUnit39,1730 - const std::string FileValue;42,1764 - const std::string FilePath;43,1797 - explicit CompileUnit(47,1878 - -compiler/diagnostics/LICENSE,519 - TERMS AND CONDITIONS FOR USE,5,158 - TERMS AND CONDITIONS FOR USE, REPRODUCTION,5,158 - Derivative Works a copy of this License; and95,5260 - documentation, if provided along with the Derivative Works; or,113,6244 - within a display generated by the Derivative Works,114,6318 - Unless required by applicable law or agreed to in writing,197,11036 - distributed under the License is distributed on an "AS IS" BASIS,198,11107 - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,199,11176 - -compiler/diagnostics/code.hpp,720 -#define SWALLOW_COMPILER_DIAGNOSTICS_CODE_HPP31,1634 -namespace swallow::compiler::diagnostics34,1700 - enum Code 37,1744 - UNKNOWN,39,1771 - PARSING,40,1784 - LID_NOT_DECLARED,41,1797 - UID_NOT_DECLARED,42,1819 - EXPR_TYPE_CHECKING_FAILED,43,1841 - BINOP_NOT_DECLARED,44,1872 - BINOP_TYPE_MISMATCH,45,1896 - APPLICATION_TYPE_MISMATCH,46,1921 - MATCH_EXPR_TYPE_CHECKING_FAILED,47,1952 - MATCH_EXPR_BRANCHE_TYPE_CONFLICTS,48,1989 - MATCH_EXPR_CURRENT_BRANCHE_TYPE_CHECKING_FAILED,49,2028 - MATCH_NON_DATA_TYPE,50,2081 - PATTERN_CONSTRUCTOR_IS_NOT_FUNCTION,51,2106 - PATTERN_MISMATCH,52,2147 - FUNCTION_BODY_TYPE_CHECKING_FAILED,53,2169 - CONSTRUCTOR_NOT_DECLARED,54,2209 - -compiler/diagnostics/diagnostics.h,3948 -#define SWALLOW_COMPILER_DIAGNOSTICS_DIAGNOSTICS_H2,51 -#define COLOR_BY_TYPE(10,197 -#define COLOR_RGB(12,339 -#define assertm(14,419 - enum class ReportType19,516 - ERROR,21,544 - INFO,22,555 - WARNING,23,565 - enum class ColorType30,710 - DEFAULT,32,737 - RED,33,750 - GREEN,34,759 - BLUE,35,770 - ORANGE,36,780 - YELLOW,37,792 - AQUA38,804 - class Span52,1110 - [[nodiscard]] auto relative_to(const Span &span) const -> Span;59,1217 - [[nodiscard]] auto is_inside_span(const Span &span) const -> bool;61,1286 - [[nodiscard]] auto get_start_index() const -> size_t;63,1358 - [[nodiscard]] auto get_details() const -> Details 65,1417 - [[nodiscard]] auto get_end_index() const -> size_t;67,1475 - [[nodiscard]] auto get_width() const -> size_t;71,1575 - size_t start_index_;74,1639 - Details *details_;details_75,1664 - size_t end_index_;76,1687 - class Label79,1716 - [[nodiscard]] auto get_color() const -> ColorType;90,1989 - [[nodiscard]] auto get_line() const -> size_t;92,2045 - std::optional message_;95,2108 - ColorType color_;96,2149 - size_t line_;97,2171 - Span span_;98,2189 - class LabelBuilder101,2211 - auto build() -> Label;112,2451 - std::optional message_;115,2490 - std::optional color_;116,2531 - std::optional span_;117,2568 - struct AscendingLabels120,2605 - auto operator()(const Label *first, const Label *second) const -> bool;122,2634 - struct DescendingLabels125,2716 - auto operator()(const Label *first, const Label *second) const -> bool;127,2746 - class Details130,2828 - [[nodiscard]] auto get_line_source(const Span &span) const -> std::string;135,2910 - [[nodiscard]] auto get_label_line(const Label &label) const -> size_t;137,2990 - std::vector> line_spans_;147,3309 - std::string source_;148,3361 - std::string path_;149,3386 - class LabelGroup154,3461 - const std::string &spaces_prefix) const -> void;160,3589 - const std::string &spaces_prefix) -> void;165,3867 - const Labels &labels) const -> void;168,4027 - find_label_levels(const Labels &labels) -> std::vector<std::vector171,4130 - find_remove_overlapping_labels(Labels &labels) -> Labels;174,4231 - [[nodiscard]] auto find_labels_in_line(size_t line_index) const -> Labels;176,4296 - [[nodiscard]] auto get_first_label() const -> const Label 178,4376 - [[nodiscard]] auto get_details() const -> Details 182,4504 - [[nodiscard]] auto get_last_label() const -> const Label 184,4562 - const Label *first_label_;first_label_187,4638 - const Label *last_label_;last_label_188,4669 - Details *details_;details_189,4699 - Labels labels_;190,4722 - class FileGroup193,4748 - const std::string &spaces_prefix) const -> void;199,4866 - [[nodiscard]] auto get_biggest_displayed_number() const -> size_t;201,4931 - [[nodiscard]] auto get_details() const -> Details 206,5094 - std::vector label_groups_;209,5163 - Details *details_;details_210,5206 - class Report213,5235 - auto print(std::ostream &output) const -> void;219,5399 - [[nodiscard]] auto find_file_groups() const -> std::vector<std::vector221,5452 - [[nodiscard]] auto get_type() const -> ReportType;229,5750 - [[nodiscard]] auto get_code() const -> size_t;231,5806 - std::optional note_;234,5869 - std::vector