Implements namespace statement.

This commit is contained in:
2020-10-09 11:54:43 +02:00
parent 2fb1b68ead
commit 43f080cc48
6 changed files with 69 additions and 32 deletions

View File

@@ -9,7 +9,7 @@ namespace MalachScript::Parser {
public:
Parser(std::u8string_view scriptName, const LexToken* firstToken, Diagnostics::Diagnostics* diagnostics)
: _scriptName(scriptName), _diagnostics(diagnostics), _currentToken(firstToken) {}
ParsedScriptStatement* Parse();
const ParsedScriptStatement* Parse();
private:
std::u8string_view _scriptName;
@@ -20,8 +20,10 @@ namespace MalachScript::Parser {
_diagnostics->LogError(type, _scriptName, span);
}
const ParsedScriptStatement* ParseScript();
bool ParseClass(const ParsedStatement*& out);
bool ParseTypeDef(const ParsedStatement*& out);
bool ParseNamespace(const ParsedStatement*& out);
bool ParseVirtProp(const ParsedStatement*& out);
bool ParseFunc(const ParsedStatement*& out);
bool ParseVar(const ParsedStatement*& out);