diff options
Diffstat (limited to 'include/CompilerKit')
| -rw-r--r-- | include/CompilerKit/AE.h | 3 | ||||
| -rw-r--r-- | include/CompilerKit/AST.h | 24 | ||||
| -rw-r--r-- | include/CompilerKit/ErrorOr.h | 2 | ||||
| -rw-r--r-- | include/CompilerKit/XCOFF.h | 2 |
4 files changed, 19 insertions, 12 deletions
diff --git a/include/CompilerKit/AE.h b/include/CompilerKit/AE.h index 211f596..a8fe0a7 100644 --- a/include/CompilerKit/AE.h +++ b/include/CompilerKit/AE.h @@ -106,7 +106,7 @@ class AEReadableProtocol final { NECTAR_COPY_DELETE(AEReadableProtocol) /** - * @brief Read AE Record headers. + * @brief Reads the AE Record headers. * * @param raw the containing buffer * @param sz it's size (1 = one AERecordHeader, 2 two AERecordHeader(s)) @@ -114,7 +114,6 @@ class AEReadableProtocol final { */ AERecordHeaderPtr Read(char* raw, std::size_t sz) { if (!raw) return nullptr; - return this->Read_<AERecordHeader>(raw, sz * sizeof(AERecordHeader)); } diff --git a/include/CompilerKit/AST.h b/include/CompilerKit/AST.h index a1957a4..2d63a1f 100644 --- a/include/CompilerKit/AST.h +++ b/include/CompilerKit/AST.h @@ -82,17 +82,24 @@ struct SyntaxKeyword { }; struct SyntaxLeafList final { - struct SyntaxLeaf final { - // \brief User data type. - Int32 fUserType{0U}; - // \brief User data buffer. + struct SyntaxLeaf; + + struct SyntaxLeaf { + using Ptr = SyntaxLeaf*; + using Reference = SyntaxLeaf&; + using ConstReference = const SyntaxLeaf&; + + /// \brief User data type. + Int32 fUserType{}; + + /// \brief User data buffer. SyntaxKeyword fUserData{{}, KeywordKind::kKeywordKindInvalid}; - // \brief User data value + /// \brief User data value STLString fUserValue{}; - // \brief Next user data on list. - struct SyntaxLeaf* fNext{nullptr}; + /// \brief Next user data on list. + Ptr fNext{nullptr}; }; using ArrayType = std::vector<SyntaxLeaf>; @@ -147,7 +154,7 @@ class ICompilerFrontend { //! @brief Compile a syntax tree ouf of the text. //! Also takes the source file name for metadata. /// =========================================================== /// - virtual SyntaxLeafList::SyntaxLeaf Compile(STLString text, STLString file) { return {}; } + virtual SyntaxLeafList::SyntaxLeaf Compile(STLString& text, const STLString& file) { return {}; } /// =========================================================== /// //! @brief What language are we dealing with? @@ -162,4 +169,3 @@ class ICompilerFrontend { } // namespace CompilerKit #include <CompilerKit/AST.inl> - diff --git a/include/CompilerKit/ErrorOr.h b/include/CompilerKit/ErrorOr.h index 385cec4..8bb1b96 100644 --- a/include/CompilerKit/ErrorOr.h +++ b/include/CompilerKit/ErrorOr.h @@ -30,6 +30,8 @@ class ErrorOr final { public: using RefType = StrongRef<T>; + using Reference = T&; + using Ptr = T*; explicit ErrorOr(ErrorT err) : mId(err) {} explicit ErrorOr(std::nullptr_t null) {} diff --git a/include/CompilerKit/XCOFF.h b/include/CompilerKit/XCOFF.h index 2e796ab..8a32518 100644 --- a/include/CompilerKit/XCOFF.h +++ b/include/CompilerKit/XCOFF.h @@ -3,7 +3,7 @@ Copyright (C) 2024-2025 Amlal El Mahrouss, licensed under the Apache 2.0 license File: XCOFF.h - Purpose: XCOFF for NeKernel. + Purpose: XCOFF for Nectar. Revision History: |
