summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/compiler-core/slang-lexer.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/compiler-core/slang-lexer.h b/source/compiler-core/slang-lexer.h
index 23458d396..3a2506d85 100644
--- a/source/compiler-core/slang-lexer.h
+++ b/source/compiler-core/slang-lexer.h
@@ -62,6 +62,11 @@ namespace Slang
}
struct ParsingCursor
{
+ bool operator==(const ParsingCursor& rhs) const { return tokenReaderCursor == rhs.tokenReaderCursor; }
+ bool operator!=(const ParsingCursor& rhs) const { return !(*this == rhs); }
+
+ bool isValid() const { return tokenReaderCursor != nullptr; }
+
Token nextToken;
const Token* tokenReaderCursor = nullptr;
};