================ @@ -0,0 +1,194 @@ +#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) { ---------------- llvm-beanz wrote:
As another note, lexing would usually identify the token, not try to interpret it, meaning any string of characters that meet the definition of a numeric constant. For example in the following code: ``` int8_t C = 2048; float F = -2.8; ``` The token sequence generated by the lexer is [ `int8_t`, `C`, `=`, `2048`, `;`, `float`, `F`, `=` ,`-`, `2.8`, `;`]. Lexing does not validate that 2048 cannot fit into C. I think most of what this function does is more accurately "parsing" a number rather than lexing. https://github.com/llvm/llvm-project/pull/122981 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits