[clang] [HLSL] Support vector swizzles on scalars (PR #67700)

via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 12 11:29:53 PDT 2023


================
@@ -1950,6 +1950,10 @@ bool Lexer::LexNumericConstant(Token &Result, const char *CurPtr) {
   while (isPreprocessingNumberBody(C)) {
     CurPtr = ConsumeChar(CurPtr, Size, Result);
     PrevCh = C;
+    if (LangOpts.HLSL && C == '.' && (*CurPtr == 'x' || *CurPtr == 'r')) {
+      CurPtr--;
----------------
cor3ntin wrote:

Indeed!

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


More information about the cfe-commits mailing list