1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 16:55:09 +00:00

LibJS: rename JS::DeclarationType => JS::DeclarationKind

Many other parsers call it with this name.

Also Type can be confusing in this context since the DeclarationType is
not the type (number, string, etc.) of the variables that are being
declared by the VariableDeclaration.
This commit is contained in:
Emanuele Torre 2020-04-08 11:59:18 +02:00 committed by Andreas Kling
parent 44f8161166
commit 38dfd04633
6 changed files with 37 additions and 37 deletions

View file

@ -658,19 +658,19 @@ NonnullRefPtr<FunctionNodeType> Parser::parse_function_node()
NonnullRefPtr<VariableDeclaration> Parser::parse_variable_declaration()
{
DeclarationType declaration_type;
DeclarationKind declaration_kind;
switch (m_parser_state.m_current_token.type()) {
case TokenType::Var:
declaration_type = DeclarationType::Var;
declaration_kind = DeclarationKind::Var;
consume(TokenType::Var);
break;
case TokenType::Let:
declaration_type = DeclarationType::Let;
declaration_kind = DeclarationKind::Let;
consume(TokenType::Let);
break;
case TokenType::Const:
declaration_type = DeclarationType::Const;
declaration_kind = DeclarationKind::Const;
consume(TokenType::Const);
break;
default:
@ -692,7 +692,7 @@ NonnullRefPtr<VariableDeclaration> Parser::parse_variable_declaration()
}
break;
}
return create_ast_node<VariableDeclaration>(declaration_type, move(declarations));
return create_ast_node<VariableDeclaration>(declaration_kind, move(declarations));
}
NonnullRefPtr<ThrowStatement> Parser::parse_throw_statement()