Browse Source

LibCpp: Fix match_expression()

match_expression() will now return true if there's a match for a Name
node.
Itamar 4 years ago
parent
commit
ef95ddcbfa
1 changed files with 1 additions and 2 deletions
  1. 1 2
      Userland/Libraries/LibCpp/Parser.cpp

+ 1 - 2
Userland/Libraries/LibCpp/Parser.cpp

@@ -851,9 +851,8 @@ void Parser::error(StringView message)
 
 bool Parser::match_expression()
 {
-    auto token_type = peek().type();
     return match_literal()
-        || token_type == Token::Type::Identifier
+        || match_name()
         || match_unary_expression()
         || match_cpp_cast_expression()
         || match_c_style_cast_expression()