From e1a331a2e2945f2b90c00d0af4d1ba5f67dbd256 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 24 Mar 2022 11:12:19 -0400 Subject: C++ extractor parsing slang.h (#2162) * #include an absolute path didn't work - because paths were taken to always be relative. * Split doc extractor such that can be used in C++ extractor. * Compiles. Update the stdlib docs. * Fix issue on release builds. * Add support for extracting documentation to C++ extractor. * Dump out markup. Make enum value backing type take tokens. * Node::Type -> Node::Kind * More improvements around Node::Type -> Node::Kind * Support for parsing callable types. * Fix issue params for callable, and default value for variable. * Add support for static. * Improve handling parsing of contained types. * Small improvements around template consumption. * Improve dumping with markup/static. * Small improvements around reflection. * Add more flexible handling of markers. Allow reflection without markers. * Handling external "C" unsigned/signed --- source/compiler-core/slang-lexer.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/compiler-core') 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; }; -- cgit v1.2.3