MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenShadingLanguage / ASTvariable_ref

Method ASTvariable_ref

src/liboslcomp/ast.cpp:500–515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

498
499
500ASTvariable_ref::ASTvariable_ref (OSLCompilerImpl *comp, ustring name)
501 : ASTNode (variable_ref_node, comp), m_name(name), m_sym(NULL)
502{
503 m_sym = comp->symtab().find (name);
504 if (! m_sym) {
505 error ("'%s' was not declared in this scope", name.c_str());
506 // FIXME -- would be fun to troll through the symtab and try to
507 // find the things that almost matched and offer suggestions.
508 return;
509 }
510 if (m_sym->symtype() == SymTypeFunction) {
511 error ("function '%s' can't be used as a variable", name.c_str());
512 return;
513 }
514 m_typespec = m_sym->typespec();
515}
516
517
518

Callers

nothing calls this directly

Calls 4

c_strMethod · 0.80
symtypeMethod · 0.80
errorFunction · 0.50
findMethod · 0.45

Tested by

no test coverage detected