forked from OSchip/llvm-project
parent
0c4dd8de47
commit
8a425f03dd
|
@ -60,7 +60,7 @@ std::vector<StringRef> ScriptParserBase::tokenize(StringRef S) {
|
|||
if (S.empty())
|
||||
return Ret;
|
||||
|
||||
// Quoted token
|
||||
// Quoted token.
|
||||
if (S.startswith("\"")) {
|
||||
size_t E = S.find("\"", 1);
|
||||
if (E == StringRef::npos) {
|
||||
|
@ -72,10 +72,12 @@ std::vector<StringRef> ScriptParserBase::tokenize(StringRef S) {
|
|||
continue;
|
||||
}
|
||||
|
||||
// Unquoted token
|
||||
// Unquoted token. This is more relaxed than tokens in C-like language,
|
||||
// so that you can write "file-name.cpp" as one bare token, for example.
|
||||
size_t Pos = S.find_first_not_of(
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
|
||||
"0123456789_.$/\\~=+[]*?-:!<>");
|
||||
|
||||
// A character that cannot start a word (which is usually a
|
||||
// punctuation) forms a single character token.
|
||||
if (Pos == 0)
|
||||
|
|
Loading…
Reference in New Issue