summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-preprocessor.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2023-04-25 10:43:29 -0400
committerGitHub <noreply@github.com>2023-04-25 10:43:29 -0400
commit7b7c095b37e85ca3a8f55eff1c3d9643d467b8e0 (patch)
tree9c71955dbc956b0058b19818ca127c8132cda512 /source/slang/slang-preprocessor.cpp
parent284cee1f246c072f190c87c8fb60c1d2181e458f (diff)
Dictionary using lowerCamel (#2835)
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP lowerCamel Dictionary. * WIP more lowerCamel fixes for Dictionary. * Add/Remove/Clear * GetValue/Contains * Fix tabs in dictionary. Count -> getCount * Fix fields with caps. * Key -> key Value -> value Use m_ for members where appropriate. Use lowerCamel in linked list. * Some small fixes/improvements to Dictionary. * Kick CI.
Diffstat (limited to 'source/slang/slang-preprocessor.cpp')
-rw-r--r--source/slang/slang-preprocessor.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/source/slang/slang-preprocessor.cpp b/source/slang/slang-preprocessor.cpp
index 341e75ea4..ba96ac887 100644
--- a/source/slang/slang-preprocessor.cpp
+++ b/source/slang/slang-preprocessor.cpp
@@ -1143,7 +1143,7 @@ static MacroDefinition* LookupMacro(Environment* environment, Name* name)
for(Environment* e = environment; e; e = e->parent)
{
MacroDefinition* macro = NULL;
- if (e->macros.TryGetValue(name, macro))
+ if (e->macros.tryGetValue(name, macro))
return macro;
}
@@ -3022,7 +3022,7 @@ static void HandleIncludeDirective(PreprocessorDirectiveContext* context)
expectEndOfDirective(context);
// Check whether we've previously included this file and seen a `#pragma once` directive
- if(context->m_preprocessor->pragmaOnceUniqueIdentities.Contains(filePathInfo.uniqueIdentity))
+ if(context->m_preprocessor->pragmaOnceUniqueIdentities.contains(filePathInfo.uniqueIdentity))
{
return;
}
@@ -3093,7 +3093,7 @@ static void _parseMacroOps(
{
auto paramName = token.getName();
Index paramIndex = -1;
- if(!mapParamNameToIndex.TryGetValue(paramName, paramIndex))
+ if(!mapParamNameToIndex.tryGetValue(paramName, paramIndex))
{
continue;
}
@@ -3115,7 +3115,7 @@ static void _parseMacroOps(
}
auto paramName = paramNameToken.getName();
Index paramIndex = -1;
- if(!mapParamNameToIndex.TryGetValue(paramName, paramIndex))
+ if(!mapParamNameToIndex.tryGetValue(paramName, paramIndex))
{
GetSink(preprocessor)->diagnose(token.loc, Diagnostics::expectedMacroParameterAfterStringize);
continue;
@@ -3298,7 +3298,7 @@ static void HandleDefineDirective(PreprocessorDirectiveContext* context)
macro->params.add(param);
auto paramName = param.nameLoc.name;
- if(mapParamNameToIndex.ContainsKey(paramName))
+ if(mapParamNameToIndex.containsKey(paramName))
{
GetSink(context)->diagnose(param.nameLoc.loc, Diagnostics::duplicateMacroParameterName, name);
}
@@ -3390,7 +3390,7 @@ static void HandleUndefDirective(PreprocessorDirectiveContext* context)
if (macro != NULL)
{
// name was defined, so remove it
- env->macros.Remove(name);
+ env->macros.remove(name);
delete macro;
}
@@ -3565,7 +3565,7 @@ SLANG_PRAGMA_DIRECTIVE_CALLBACK(handlePragmaOnceDirective)
return;
}
- context->m_preprocessor->pragmaOnceUniqueIdentities.Add(issuedFromPathInfo.uniqueIdentity);
+ context->m_preprocessor->pragmaOnceUniqueIdentities.add(issuedFromPathInfo.uniqueIdentity);
}
// Information about a specific `#pragma` directive
@@ -3858,7 +3858,7 @@ Environment::~Environment()
{
for (auto pair : this->macros)
{
- auto macro = pair.Value;
+ auto macro = pair.value;
delete macro;
}
}
@@ -3899,7 +3899,7 @@ static void DefineMacro(
macro->nameAndLoc.loc = keyView->getRange().begin;
MacroDefinition* oldMacro = NULL;
- if (preprocessor->globalEnv.macros.TryGetValue(keyName, oldMacro))
+ if (preprocessor->globalEnv.macros.tryGetValue(keyName, oldMacro))
{
delete oldMacro;
}
@@ -4060,7 +4060,7 @@ TokenList preprocessSource(
{
for (auto p : *desc.defines)
{
- DefineMacro(&preprocessor, p.Key, p.Value);
+ DefineMacro(&preprocessor, p.key, p.value);
}
}