Initial Parser Implementation and Feature Completion #1

Merged
me merged 16 commits from parser-dev into main 2025-12-28 11:54:12 -06:00
4 changed files with 1251 additions and 11 deletions
Showing only changes of commit a3d5c0ac68 - Show all commits

View File

@ -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>

View File

@ -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;

View File

@ -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