chore: remove unused repl-related configuration and placeholder files
This commit is contained in:
@@ -33,8 +33,10 @@ static RavaASTNode_t* _rava_parser_parse_method_declaration(RavaParser_t *parser
|
||||
_rava_parser_expect(parser, RAVA_TOKEN_LPAREN, "Expected '(' after method name");
|
||||
|
||||
while (!_rava_parser_check(parser, RAVA_TOKEN_RPAREN) &&
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_EOF)) {
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_EOF) &&
|
||||
!parser->had_error) {
|
||||
RavaASTNode_t *param_type = _rava_parser_parse_type(parser);
|
||||
if (!param_type) break;
|
||||
RavaASTNode_t *param = rava_ast_node_create(RAVA_AST_PARAM_DECL,
|
||||
parser->current_token->line,
|
||||
parser->current_token->column);
|
||||
@@ -124,7 +126,8 @@ RavaASTNode_t* _rava_parser_parse_class_declaration(RavaParser_t *parser) {
|
||||
_rava_parser_expect(parser, RAVA_TOKEN_LBRACE, "Expected '{' after class name");
|
||||
|
||||
while (!_rava_parser_check(parser, RAVA_TOKEN_RBRACE) &&
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_EOF)) {
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_EOF) &&
|
||||
!parser->had_error) {
|
||||
|
||||
RavaModifier_e *member_modifiers = NULL;
|
||||
size_t member_modifiers_count = 0;
|
||||
@@ -143,8 +146,10 @@ RavaASTNode_t* _rava_parser_parse_class_declaration(RavaParser_t *parser) {
|
||||
_rava_parser_expect(parser, RAVA_TOKEN_LPAREN, "Expected '(' after constructor name");
|
||||
|
||||
while (!_rava_parser_check(parser, RAVA_TOKEN_RPAREN) &&
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_EOF)) {
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_EOF) &&
|
||||
!parser->had_error) {
|
||||
RavaASTNode_t *param_type = _rava_parser_parse_type(parser);
|
||||
if (!param_type) break;
|
||||
RavaASTNode_t *param = rava_ast_node_create(RAVA_AST_PARAM_DECL,
|
||||
parser->current_token->line,
|
||||
parser->current_token->column);
|
||||
@@ -175,6 +180,7 @@ RavaASTNode_t* _rava_parser_parse_class_declaration(RavaParser_t *parser) {
|
||||
}
|
||||
|
||||
RavaASTNode_t *member_type = _rava_parser_parse_type(parser);
|
||||
if (!member_type) break;
|
||||
|
||||
if (_rava_parser_check(parser, RAVA_TOKEN_IDENTIFIER)) {
|
||||
char *name = strdup(parser->current_token->lexeme);
|
||||
@@ -204,6 +210,9 @@ RavaASTNode_t* _rava_parser_parse_class_declaration(RavaParser_t *parser) {
|
||||
rava_ast_node_add_child(class_decl, field);
|
||||
member_modifiers = NULL;
|
||||
}
|
||||
} else {
|
||||
free(member_modifiers);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,7 +244,8 @@ static RavaASTNode_t* _rava_parser_parse_interface_declaration(RavaParser_t *par
|
||||
_rava_parser_expect(parser, RAVA_TOKEN_LBRACE, "Expected '{' after interface name");
|
||||
|
||||
while (!_rava_parser_check(parser, RAVA_TOKEN_RBRACE) &&
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_EOF)) {
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_EOF) &&
|
||||
!parser->had_error) {
|
||||
|
||||
RavaModifier_e *member_modifiers = NULL;
|
||||
size_t member_modifiers_count = 0;
|
||||
@@ -243,6 +253,10 @@ static RavaASTNode_t* _rava_parser_parse_interface_declaration(RavaParser_t *par
|
||||
_rava_parser_parse_modifiers(parser, &member_modifiers, &member_modifiers_count);
|
||||
|
||||
RavaASTNode_t *member_type = _rava_parser_parse_type(parser);
|
||||
if (!member_type) {
|
||||
free(member_modifiers);
|
||||
break;
|
||||
}
|
||||
|
||||
if (_rava_parser_check(parser, RAVA_TOKEN_IDENTIFIER)) {
|
||||
char *name = strdup(parser->current_token->lexeme);
|
||||
@@ -261,6 +275,7 @@ static RavaASTNode_t* _rava_parser_parse_interface_declaration(RavaParser_t *par
|
||||
}
|
||||
} else {
|
||||
free(member_modifiers);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,7 +317,8 @@ static RavaASTNode_t* _rava_parser_parse_enum_declaration(RavaParser_t *parser)
|
||||
|
||||
while (!_rava_parser_check(parser, RAVA_TOKEN_RBRACE) &&
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_SEMICOLON) &&
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_EOF)) {
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_EOF) &&
|
||||
!parser->had_error) {
|
||||
|
||||
if (_rava_parser_check(parser, RAVA_TOKEN_IDENTIFIER)) {
|
||||
if (enum_decl->data.enum_decl.constants_count >= capacity) {
|
||||
@@ -319,6 +335,8 @@ static RavaASTNode_t* _rava_parser_parse_enum_declaration(RavaParser_t *parser)
|
||||
enum_decl->data.enum_decl.constants[enum_decl->data.enum_decl.constants_count++] =
|
||||
strdup(parser->current_token->lexeme);
|
||||
_rava_parser_advance(parser);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!_rava_parser_match(parser, RAVA_TOKEN_COMMA)) {
|
||||
@@ -328,7 +346,8 @@ static RavaASTNode_t* _rava_parser_parse_enum_declaration(RavaParser_t *parser)
|
||||
|
||||
if (_rava_parser_match(parser, RAVA_TOKEN_SEMICOLON)) {
|
||||
while (!_rava_parser_check(parser, RAVA_TOKEN_RBRACE) &&
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_EOF)) {
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_EOF) &&
|
||||
!parser->had_error) {
|
||||
|
||||
RavaModifier_e *member_modifiers = NULL;
|
||||
size_t member_modifiers_count = 0;
|
||||
@@ -336,6 +355,10 @@ static RavaASTNode_t* _rava_parser_parse_enum_declaration(RavaParser_t *parser)
|
||||
_rava_parser_parse_modifiers(parser, &member_modifiers, &member_modifiers_count);
|
||||
|
||||
RavaASTNode_t *member_type = _rava_parser_parse_type(parser);
|
||||
if (!member_type) {
|
||||
free(member_modifiers);
|
||||
break;
|
||||
}
|
||||
|
||||
if (_rava_parser_check(parser, RAVA_TOKEN_IDENTIFIER)) {
|
||||
char *name = strdup(parser->current_token->lexeme);
|
||||
@@ -366,6 +389,7 @@ static RavaASTNode_t* _rava_parser_parse_enum_declaration(RavaParser_t *parser)
|
||||
}
|
||||
} else {
|
||||
free(member_modifiers);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,9 +23,14 @@ RavaASTNode_t* _rava_parser_parse_block(RavaParser_t *parser) {
|
||||
|
||||
while (!_rava_parser_check(parser, RAVA_TOKEN_RBRACE) &&
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_EOF)) {
|
||||
if (parser->had_error) {
|
||||
break;
|
||||
}
|
||||
RavaASTNode_t *stmt = _rava_parser_parse_statement(parser);
|
||||
if (stmt) {
|
||||
rava_ast_node_add_child(block, stmt);
|
||||
} else if (parser->had_error) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,7 +216,8 @@ RavaASTNode_t* _rava_parser_parse_statement(RavaParser_t *parser) {
|
||||
_rava_parser_expect(parser, RAVA_TOKEN_LBRACE, "Expected '{' after switch");
|
||||
|
||||
while (!_rava_parser_check(parser, RAVA_TOKEN_RBRACE) &&
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_EOF)) {
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_EOF) &&
|
||||
!parser->had_error) {
|
||||
|
||||
if (_rava_parser_match(parser, RAVA_TOKEN_KEYWORD_CASE)) {
|
||||
RavaASTNode_t *case_node = rava_ast_node_create(RAVA_AST_CASE_STMT,
|
||||
@@ -224,10 +230,13 @@ RavaASTNode_t* _rava_parser_parse_statement(RavaParser_t *parser) {
|
||||
while (!_rava_parser_check(parser, RAVA_TOKEN_KEYWORD_CASE) &&
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_KEYWORD_DEFAULT) &&
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_RBRACE) &&
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_EOF)) {
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_EOF) &&
|
||||
!parser->had_error) {
|
||||
RavaASTNode_t *stmt = _rava_parser_parse_statement(parser);
|
||||
if (stmt) {
|
||||
rava_ast_node_add_child(case_node, stmt);
|
||||
} else if (parser->had_error) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,10 +253,13 @@ RavaASTNode_t* _rava_parser_parse_statement(RavaParser_t *parser) {
|
||||
while (!_rava_parser_check(parser, RAVA_TOKEN_KEYWORD_CASE) &&
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_KEYWORD_DEFAULT) &&
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_RBRACE) &&
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_EOF)) {
|
||||
!_rava_parser_check(parser, RAVA_TOKEN_EOF) &&
|
||||
!parser->had_error) {
|
||||
RavaASTNode_t *stmt = _rava_parser_parse_statement(parser);
|
||||
if (stmt) {
|
||||
rava_ast_node_add_child(default_node, stmt);
|
||||
} else if (parser->had_error) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user