Rework identifier handling, adds typedef statement.
This commit is contained in:
@@ -21,18 +21,21 @@ namespace MalachScript::Parser {
|
||||
}
|
||||
|
||||
bool ParseClass(const ParsedStatement*& out);
|
||||
bool ParseTypeDef(const ParsedStatement*& out);
|
||||
bool ParseVirtProp(const ParsedStatement*& out);
|
||||
bool ParseFunc(const ParsedStatement*& out);
|
||||
bool ParseVar(const ParsedStatement*& out);
|
||||
bool ParseFuncDef(const ParsedStatement*& out);
|
||||
|
||||
std::u8string_view ParseIdentifier(const LexToken* token, bool& logError) {
|
||||
bool ParsePrimType(Identifier& out);
|
||||
bool ParseIdentifier(Identifier& out, const LexToken* token, bool& logError) {
|
||||
if (logError && token->GetKind() != LexTokenKind::Identifier) {
|
||||
LogError(Diagnostics::DiagnosticType::UnexpectedToken, token->GetSpan());
|
||||
logError = false;
|
||||
return std::u8string_view();
|
||||
return false;
|
||||
}
|
||||
return reinterpret_cast<const IdentifierToken*>(token)->GetValue();
|
||||
out = reinterpret_cast<const IdentifierToken*>(token)->GetValue();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user