-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added access modifier node for API and output. * Rewrote typescript visitor to explicitly pick child nodes. * Added optional fallback to default children parsing. * Added different error handling behaviors for not implemented nodes. * Added placeholder ecmascript language.
- Loading branch information
1 parent
f5e34f5
commit 9ea1059
Showing
59 changed files
with
1,968 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* @file core/nodes/access_modifier.h | ||
* @brief The access_modifier node API. | ||
* | ||
* @author Mykola Morozov | ||
* @copyright (c) 2023 Evenfall-Tech | ||
* | ||
* This library is released under MPL-2.0 <https://github.com/Evenfall-Tech/Crosslight/blob/master/LICENSE> license. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <stdlib.h> | ||
#include "core/definitions.h" | ||
|
||
CL_BEGIN_C_DECLS | ||
|
||
/** | ||
* @brief Access modifier type. Access modifiers do not support type combinations. | ||
*/ | ||
enum cl_node_access_modifier_type { | ||
access_modifier_none = 0, /**< No access modifier. Acts as a fallback, should not be used normally. */ | ||
access_modifier_public = 1, /**< The type or member can be accessed by any other code in the current or other compilation units. */ | ||
access_modifier_protected = 2, /**< The type or member can be accessed only by sibling members or derivatives of the parent type. */ | ||
access_modifier_private = 3, /**< The type or member can be accessed only by sibling members. */ | ||
}; | ||
|
||
/** | ||
* @brief Access modifier for types, members, and other nodes. | ||
*/ | ||
struct cl_node_access_modifier { | ||
enum cl_node_access_modifier_type type; /**< Type of the access modifier. Does not support type combinations. */ | ||
}; | ||
|
||
/** | ||
* @brief Delete the content of and the payload itself. | ||
* | ||
* @param[in] payload The payload to delete along with its content. | ||
* @param[in] term The memory termination function. | ||
* @return `0` if deletion failed, `1` otherwise. | ||
*/ | ||
CL_API size_t cl_node_access_modifier_term(struct cl_node_access_modifier* payload, void(*term)(void*)); | ||
|
||
CL_END_C_DECLS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma once | ||
|
||
#include "core/nodes/access_modifier.h" | ||
#include "lang/builders/allocator.hpp" | ||
|
||
namespace cl::lang::builders { | ||
|
||
class builder; | ||
class allocator; | ||
|
||
builder access_modifier(const allocator& m, enum cl_node_access_modifier_type type); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
libs/cpp/lang/include/lang/exceptions/not_implemented_parsing_exception.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#pragma once | ||
|
||
#include "lang/exceptions/parsing_exception.hpp" | ||
|
||
namespace cl::lang::exceptions { | ||
|
||
class CL_API_OBJ not_implemented_parsing_exception : public parsing_exception { | ||
public: | ||
explicit not_implemented_parsing_exception(const std::string& what_arg); | ||
explicit not_implemented_parsing_exception(const char* what_arg); | ||
[[nodiscard]] const char* what() const noexcept override; | ||
|
||
protected: | ||
std::string _message; | ||
}; | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
libs/cpp/lang/include/lang/exceptions/not_supported_parsing_exception.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#pragma once | ||
|
||
#include "lang/exceptions/parsing_exception.hpp" | ||
|
||
namespace cl::lang::exceptions { | ||
|
||
class CL_API_OBJ not_supported_parsing_exception : public parsing_exception { | ||
public: | ||
explicit not_supported_parsing_exception(const std::string& what_arg); | ||
explicit not_supported_parsing_exception(const char* what_arg); | ||
[[nodiscard]] const char* what() const noexcept override; | ||
|
||
protected: | ||
std::string _message; | ||
}; | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
libs/cpp/lang/include/lang/exceptions/parsing_exception.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
|
||
#include <exception> | ||
#include <string> | ||
#include "lang/def_visibility.hpp" | ||
|
||
namespace cl::lang::exceptions { | ||
|
||
class CL_API_OBJ parsing_exception : public std::exception { | ||
public: | ||
explicit parsing_exception(const std::string& what_arg); | ||
explicit parsing_exception(const char* what_arg); | ||
[[nodiscard]] const char* what() const noexcept override; | ||
|
||
protected: | ||
std::string _message; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.