Style fixes.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
c4d7c9e2d8
commit
e30bfe1686
|
@ -16,7 +16,7 @@ namespace MalachScript {
|
|||
constexpr inline static bool Contains(FuncAttr set, FuncAttr flag) {
|
||||
return (static_cast<uint8_t>(set) & static_cast<uint8_t>(flag)) != 0;
|
||||
}
|
||||
constexpr inline static FuncAttr Set(FuncAttr set, FuncAttr flag){
|
||||
constexpr inline static FuncAttr Set(FuncAttr set, FuncAttr flag) {
|
||||
return static_cast<FuncAttr>(static_cast<uint8_t>(set) | static_cast<uint8_t>(flag));
|
||||
}
|
||||
};
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <cstdint>
|
||||
|
||||
namespace MalachScript{
|
||||
namespace MalachScript {
|
||||
enum class TypeMod : uint8_t {
|
||||
None = 0,
|
||||
RefIn = 1,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define MALACHSCRIPT_PARSEDEXPRESSION_HPP
|
||||
|
||||
namespace MalachScript::Parser {
|
||||
class ParsedExpression{};
|
||||
class ParsedExpression {};
|
||||
}
|
||||
|
||||
#endif // MALACHSCRIPT_PARSEDEXPRESSION_HPP
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include <cstdint>
|
||||
#include "NumericalLexers.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
uint8_t LexDecimalValue(char8_t c) {
|
||||
switch (c) {
|
||||
|
|
|
@ -273,7 +273,7 @@ namespace MalachScript::Parser {
|
|||
if (ParseIdentifier(identifier, current)) {
|
||||
PROGRESS_TOKEN(current);
|
||||
scope.push_back(identifier);
|
||||
if (current->GetKind() != LexTokenKind::ColonColonSymbol){
|
||||
if (current->GetKind() != LexTokenKind::ColonColonSymbol) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
@ -494,10 +494,9 @@ namespace MalachScript::Parser {
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (current->GetKind() != LexTokenKind::CloseCurlyParenthesisSymbol){
|
||||
if (current->GetKind() != LexTokenKind::CloseCurlyParenthesisSymbol) {
|
||||
LogError(Diagnostics::DiagnosticType::UnexpectedToken, current->GetSpan());
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
PROGRESS_TOKEN(current);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ using namespace MalachScript::Parser;
|
|||
#define LEX_TEST(script, ...) \
|
||||
TEST_CASE("Lex: " script) { \
|
||||
MalachScript::Diagnostics::Diagnostics diag; \
|
||||
auto lexer = Lexer(u8##script, u8##script, &diag); \
|
||||
auto lexer = Lexer(u8##script, u8##script, &diag); \
|
||||
const auto* token = lexer.Lex(); \
|
||||
CHECK(diag.GetMessages().empty()); \
|
||||
std::vector<LexTokenKind> vec = {__VA_ARGS__, LexTokenKind::EndOfFile}; \
|
||||
|
|
|
@ -38,7 +38,8 @@ PARSE_TEST("Parse class with virtprop", "class foobar { private bool foo { get;
|
|||
REQUIRE(script->GetStatements().size() == 1);
|
||||
auto firstStatement = script->GetStatements()[0].get();
|
||||
REQUIRE(firstStatement->GetKind() == Parser::ParsedStatementKind::Class);
|
||||
auto firstClassStatement = dynamic_cast<const MalachScript::Parser::ParsedClassStatement*>(firstStatement)->GetBody()[0].get();
|
||||
auto firstClassStatement =
|
||||
dynamic_cast<const MalachScript::Parser::ParsedClassStatement*>(firstStatement)->GetBody()[0].get();
|
||||
REQUIRE(firstClassStatement->GetKind() == Parser::ParsedStatementKind::VirtProp);
|
||||
auto virtPropStatement = dynamic_cast<const MalachScript::Parser::ParsedVirtPropStatement*>(firstClassStatement);
|
||||
REQUIRE(virtPropStatement->GetAccess() == MalachScript::AccessModifier::Private);
|
||||
|
|
Loading…
Reference in New Issue