Add comments.

llvm-svn: 280423
This commit is contained in:
Rui Ueyama 2016-09-01 22:48:05 +00:00
parent 0c4dd8de47
commit 8a425f03dd
1 changed files with 4 additions and 2 deletions

View File

@ -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)