• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "gn/token.h"
6 
7 #include "base/logging.h"
8 
Token()9 Token::Token() : type_(INVALID), value_() {}
10 
Token(const Location & location,Type t,const std::string_view & v)11 Token::Token(const Location& location, Type t, const std::string_view& v)
12     : type_(t), value_(v), location_(location) {}
13 
IsIdentifierEqualTo(const char * v) const14 bool Token::IsIdentifierEqualTo(const char* v) const {
15   return type_ == IDENTIFIER && value_ == v;
16 }
17 
IsStringEqualTo(const char * v) const18 bool Token::IsStringEqualTo(const char* v) const {
19   return type_ == STRING && value_ == v;
20 }
21