diff options
Diffstat (limited to 'source/compiler-core/slang-lexer.cpp')
| -rw-r--r-- | source/compiler-core/slang-lexer.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/source/compiler-core/slang-lexer.cpp b/source/compiler-core/slang-lexer.cpp index 653c43dba..a5eab67dd 100644 --- a/source/compiler-core/slang-lexer.cpp +++ b/source/compiler-core/slang-lexer.cpp @@ -951,7 +951,23 @@ namespace Slang case '5': case '6': case '7': case '8': case '9': return _lexNumberAfterDecimalPoint(lexer, 10); - // TODO(tfoley): handle ellipsis (`...`) + case '.': + // Note: consuming the second `.` here means that + // we cannot back up and return a `.` token by itself + // any more. We thus end up having distinct tokens for + // `.`, `..`, and `...` even though the `..` case is + // not part of HLSL. + // + _advance(lexer); + switch(_peek(lexer)) + { + case '.': + _advance(lexer); + return TokenType::Ellipsis; + + default: + return TokenType::DotDot; + } default: return TokenType::Dot; |
