From 8a425f03dd83841b9993953c07accfde7e423915 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Thu, 1 Sep 2016 22:48:05 +0000 Subject: [PATCH] Add comments. llvm-svn: 280423 --- lld/ELF/ScriptParser.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp index 559ec1b..671a272 100644 --- a/lld/ELF/ScriptParser.cpp +++ b/lld/ELF/ScriptParser.cpp @@ -60,7 +60,7 @@ std::vector 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 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) -- 2.7.4