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

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 23 12:25:22 PDT 2024


================
@@ -0,0 +1,177 @@
+//===- ScriptLexer.h --------------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the nums for LinkerScript lexer
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLD_ELF_SCRIPT_TOKENIZER_H
+#define LLD_ELF_SCRIPT_TOKENIZER_H
+
+namespace lld {
+namespace elf {
+enum class Kind {
----------------
MaskRay wrote:

`Kind` could cause ambiguity. I am open to suggestions, but if we aim for conciseness, `Tok` is a nice choice.

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


More information about the llvm-commits mailing list