comparison tools/llvm-rc/ResourceScriptToken.cpp @ 148:63bd29f05246

merged
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 14 Aug 2019 19:46:37 +0900
parents c2174574ed3a
children
comparison
equal deleted inserted replaced
146:3fc4d5c3e21e 148:63bd29f05246
1 //===-- ResourceScriptToken.cpp ---------------------------------*- C++-*-===// 1 //===-- ResourceScriptToken.cpp ---------------------------------*- C++-*-===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // 4 // See https://llvm.org/LICENSE.txt for license information.
5 // This file is distributed under the University of Illinois Open Source 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 // License. See LICENSE.TXT for details.
7 // 6 //
8 //===---------------------------------------------------------------------===// 7 //===---------------------------------------------------------------------===//
9 // 8 //
10 // This file implements an interface defined in ResourceScriptToken.h. 9 // This file implements an interface defined in ResourceScriptToken.h.
11 // In particular, it defines an .rc script tokenizer. 10 // In particular, it defines an .rc script tokenizer.
279 278
280 bool Tokenizer::canStartIdentifier() const { 279 bool Tokenizer::canStartIdentifier() const {
281 assert(!streamEof()); 280 assert(!streamEof());
282 281
283 const char CurChar = Data[Pos]; 282 const char CurChar = Data[Pos];
284 return std::isalpha(CurChar) || CurChar == '_'; 283 return std::isalpha(CurChar) || CurChar == '_' || CurChar == '.';
285 } 284 }
286 285
287 bool Tokenizer::canContinueIdentifier() const { 286 bool Tokenizer::canContinueIdentifier() const {
288 assert(!streamEof()); 287 assert(!streamEof());
289 const char CurChar = Data[Pos]; 288 const char CurChar = Data[Pos];
290 return std::isalnum(CurChar) || CurChar == '_'; 289 return std::isalnum(CurChar) || CurChar == '_' || CurChar == '.' ||
290 CurChar == '/' || CurChar == '\\';
291 } 291 }
292 292
293 bool Tokenizer::canStartInt() const { 293 bool Tokenizer::canStartInt() const {
294 assert(!streamEof()); 294 assert(!streamEof());
295 return std::isdigit(Data[Pos]); 295 return std::isdigit(Data[Pos]);