[clang] [HLSL][RootSignature] Implement Lexing of DescriptorTables (PR #122981)

Finn Plummer via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 12 13:18:19 PST 2025


================
@@ -0,0 +1,166 @@
+#include "clang/Parse/ParseHLSLRootSignature.h"
+
+namespace clang {
+namespace hlsl {
+
+// Lexer Definitions
+
+static bool IsNumberChar(char C) {
+  // TODO(#126565): extend for float support exponents
+  return isdigit(C); // integer support
+}
+
+bool RootSignatureLexer::LexNumber(RootSignatureToken &Result) {
+  // Retrieve the possible number
+  StringRef NumSpelling = Buffer.take_while(IsNumberChar);
----------------
inbelic wrote:

Correct. It is the expected behaviour for this pr, as we are not expecting to handle floats until https://github.com/llvm/llvm-project/issues/126565. This was split out because I want to have a pr that will have dedicated documentation and testing to show that the float parsing is equivalent to DXC. Which I think would get bogged down and increase the scope when including it in this pr.

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


More information about the cfe-commits mailing list