summaryrefslogtreecommitdiff
path: root/source/slang/slang-preprocessor.h
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-10-29 14:49:26 +0800
committerGitHub <noreply@github.com>2024-10-29 14:49:26 +0800
commitf65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 (patch)
treeea1d61342cd29368e19135000ec2948813096205 /source/slang/slang-preprocessor.h
parenta729c15e9dce9f5116a38afc66329ab2ca4cea54 (diff)
format
* format * Minor test fixes * enable checking cpp format in ci
Diffstat (limited to 'source/slang/slang-preprocessor.h')
-rw-r--r--source/slang/slang-preprocessor.h72
1 files changed, 36 insertions, 36 deletions
diff --git a/source/slang/slang-preprocessor.h b/source/slang/slang-preprocessor.h
index d8698cd01..bde79b649 100644
--- a/source/slang/slang-preprocessor.h
+++ b/source/slang/slang-preprocessor.h
@@ -2,12 +2,12 @@
#ifndef SLANG_PREPROCESSOR_H_INCLUDED
#define SLANG_PREPROCESSOR_H_INCLUDED
-#include "../core/slang-basic.h"
-
-#include "../compiler-core/slang-lexer.h"
#include "../compiler-core/slang-include-system.h"
+#include "../compiler-core/slang-lexer.h"
+#include "../core/slang-basic.h"
-namespace Slang {
+namespace Slang
+{
class DiagnosticSink;
class Linkage;
@@ -17,76 +17,76 @@ enum class SourceLanguage : SlangSourceLanguageIntegral;
namespace preprocessor
{
- struct Preprocessor;
+struct Preprocessor;
}
using preprocessor::Preprocessor;
- /// A handler for callbacks invoked by the preprocessor.
- ///
- /// A client of the preprocessor can implement its own `PreprocessorHandler` subtype
- /// in order to insert custom logic that implements higher-level policies
- /// that the preprocessor shouldn't need to understand.
- ///
+/// A handler for callbacks invoked by the preprocessor.
+///
+/// A client of the preprocessor can implement its own `PreprocessorHandler` subtype
+/// in order to insert custom logic that implements higher-level policies
+/// that the preprocessor shouldn't need to understand.
+///
struct PreprocessorHandler
{
virtual void handleEndOfTranslationUnit(Preprocessor* preprocessor);
virtual void handleFileDependency(SourceFile* sourceFile);
};
- /// Description of a preprocessor options/dependencies
+/// Description of a preprocessor options/dependencies
struct PreprocessorDesc
{
- /// Required: sink to use when emitting preprocessor diagnostic messages
+ /// Required: sink to use when emitting preprocessor diagnostic messages
DiagnosticSink* sink = nullptr;
- /// Required: name pool to use when creating `Name`s from strings
+ /// Required: name pool to use when creating `Name`s from strings
NamePool* namePool = nullptr;
- /// Required: file system to use when looking up files
+ /// Required: file system to use when looking up files
ISlangFileSystemExt* fileSystem = nullptr;
- /// Required: source manager to use when loading source files
+ /// Required: source manager to use when loading source files
SourceManager* sourceManager = nullptr;
- /// Optional: include system to use when resolving `#include` directives
- IncludeSystem* includeSystem = nullptr;
+ /// Optional: include system to use when resolving `#include` directives
+ IncludeSystem* includeSystem = nullptr;
- /// Optional: preprocessor `#define`s to assume are set on input
+ /// Optional: preprocessor `#define`s to assume are set on input
Dictionary<String, String> const* defines = nullptr;
- /// Optional: handler for callbacks invoked during preprocessing
+ /// Optional: handler for callbacks invoked during preprocessing
PreprocessorHandler* handler = nullptr;
- /// Optional: additional information for code assist.
+ /// Optional: additional information for code assist.
PreprocessorContentAssistInfo* contentAssistInfo = nullptr;
};
- /// Take a source `file` and preprocess it into a list of tokens.
+/// Take a source `file` and preprocess it into a list of tokens.
TokenList preprocessSource(
- SourceFile* file,
+ SourceFile* file,
PreprocessorDesc const& desc,
SourceLanguage& outDetectedLanguage);
- /// Convenience wrapper for `preprocessSource` when a `Linkage` is available
+/// Convenience wrapper for `preprocessSource` when a `Linkage` is available
TokenList preprocessSource(
- SourceFile* file,
- DiagnosticSink* sink,
- IncludeSystem* includeSystem,
- Dictionary<String, String> const& defines,
- Linkage* linkage,
- SourceLanguage& outDetectedLanguage,
- PreprocessorHandler* handler = nullptr);
+ SourceFile* file,
+ DiagnosticSink* sink,
+ IncludeSystem* includeSystem,
+ Dictionary<String, String> const& defines,
+ Linkage* linkage,
+ SourceLanguage& outDetectedLanguage,
+ PreprocessorHandler* handler = nullptr);
// The following functions are intended to be used inside of implementations
// of the `PreprocessorHandler` interface, in order to query the current
// state of the preprocessor.
- /// Try to look up a macro with the given `macroName` and produce its value as a string
+/// Try to look up a macro with the given `macroName` and produce its value as a string
Result findMacroValue(
- Preprocessor* preprocessor,
- char const* macroName,
- String& outValue,
- SourceLoc& outLoc);
+ Preprocessor* preprocessor,
+ char const* macroName,
+ String& outValue,
+ SourceLoc& outLoc);
} // namespace Slang