MCPcopy Create free account
hub / github.com/carbonengine/trinity / NewFunctionParameter

Function NewFunctionParameter

shadercompiler/ParserUtils.cpp:1213–1232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1211}
1212
1213ASTNode* NewFunctionParameter( ParserState& state, const Type& type, const InlineString& name )
1214{
1215 auto param = state.NewNode( NT_FUNCTION_PARAMETER );
1216 auto symbol = state.GetSymbolTable().AddSymbol( name ? name : state.AllocateName() );
1217 symbol->type = type;
1218 symbol->definition = param;
1219 param->SetType( symbol->type );
1220 param->SetSymbol( symbol );
1221 if( type.arrayDimensions )
1222 {
1223 auto brackets = state.NewNode( NT_BRACKET_LIST );
1224 brackets->AddChild( nullptr );
1225 param->AddChild( brackets );
1226 }
1227 else
1228 {
1229 param->AddChild( nullptr );
1230 }
1231 return param;
1232}
1233
1234
1235ASTNode* NewFunctionParameter( ParserState& state, const Type& type, const char* name )

Callers 4

GatherSystemFieldsFunction · 0.85
GatherSystemInputsFunction · 0.85
PatchShaderFunction · 0.85
PatchRtShaderFunction · 0.85

Calls 8

MakeInlineStringFunction · 0.85
NewNodeMethod · 0.80
AddSymbolMethod · 0.80
AllocateNameMethod · 0.80
SetSymbolMethod · 0.80
AddChildMethod · 0.80
GetSymbolMethod · 0.80
SetTypeMethod · 0.45

Tested by

no test coverage detected