Initial Parser Implementation and Feature Completion #1
@ -170,7 +170,7 @@ non_exportable_declaration =
|
||||
"switch" "(" <expression> ")" "{" <switch_case>* <default_case>? "}"
|
||||
|
||||
<match_case> =
|
||||
<type_name> ( "(" <identifier> ")" )? "->" <code_block>
|
||||
<type_name> ( "|" <identifier> "|" )? "->" <code_block>
|
||||
|
||||
<switch_case> =
|
||||
<expression> "->" <code_block>
|
||||
|
||||
@ -121,6 +121,9 @@ namespace arti::lang {
|
||||
Expected<ast::IfStmtNode>
|
||||
parseIfStatement();
|
||||
|
||||
Expected<ast::ElseBranchNode>
|
||||
parseElseStatement();
|
||||
|
||||
Expected<ast::DeferStmtNode>
|
||||
parseDeferStatement();
|
||||
|
||||
@ -142,6 +145,9 @@ namespace arti::lang {
|
||||
Expected<ast::SwitchStmtNode>
|
||||
parseSwitchStatement();
|
||||
|
||||
Expected<ast::StatementNode>
|
||||
parseForLoopStatement();
|
||||
|
||||
Expected<ast::CForStmtNode>
|
||||
parseCForStatement();
|
||||
|
||||
@ -157,6 +163,12 @@ namespace arti::lang {
|
||||
Expected<ast::InfLoopStmtNode>
|
||||
parseInfLoopStatement();
|
||||
|
||||
Expected<ast::ExpressionStmtNode>
|
||||
parseExpressionStatement();
|
||||
|
||||
Expected<ast::ExpressionNode>
|
||||
parseExpression();
|
||||
|
||||
private:
|
||||
std::string unitName;
|
||||
std::string sourceCode;
|
||||
|
||||
@ -20,3 +20,13 @@
|
||||
// //
|
||||
//============================================================================//
|
||||
|
||||
#include <artichoke/Parser/Parser.hpp>
|
||||
|
||||
namespace arti::lang {
|
||||
|
||||
Expected<ast::ExpressionNode>
|
||||
Parser::parseExpression() {
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace arti::lang
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user