[Lldb-commits] [lldb] [LLDB] Add Lexer (with tests) for DIL (Data Inspection Language). (PR #123521)
Andy Hippo via lldb-commits
lldb-commits at lists.llvm.org
Sun Jan 19 13:01:57 PST 2025
================
@@ -0,0 +1,193 @@
+//===-- DILLexerTests.cpp --------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/ValueObject/DILLexer.h"
+#include "llvm/ADT/StringRef.h"
+#include "gtest/gtest.h"
+#include <string>
+
+using llvm::StringRef;
+
+TEST(DILLexerTests, SimpleTest) {
+ StringRef dil_input_expr("simple_var");
+ uint32_t tok_len = 10;
+ lldb_private::dil::DILLexer dil_lexer(dil_input_expr);
----------------
werat wrote:
IMO can drop `dil_` here. All these tests are in the context of DIL, so it's clear what it's all about.
```suggestion
lldb_private::dil::DILLexer lexer(input_expr);
```
https://github.com/llvm/llvm-project/pull/123521
More information about the lldb-commits
mailing list