[lld] [ELF] Added `struct Token` and changed `next()` and `peek()` to return Token (PR #100180)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 23 12:33:30 PDT 2024


================
@@ -90,6 +90,22 @@ std::string ScriptLexer::getCurrentLocation() {
   return (filename + ":" + Twine(getLineNumber())).str();
 }
 
+std::string ScriptLexer::joinTokens(size_t begin, size_t end) {
+  auto itBegin = tokens.begin() + begin;
+  auto itEnd = tokens.begin() + end;
+
+  std::string S;
+  if (itBegin == itEnd)
+    return S;
+
+  S += (*itBegin).val;
+  while (++itBegin != itEnd) {
+    S += " ";
+    S += (*itBegin).val;
----------------
PiJoules wrote:

nit: same

https://github.com/llvm/llvm-project/pull/100180


More information about the llvm-commits mailing list