diff options
Diffstat (limited to 'source/slang/slang-syntax.cpp')
| -rw-r--r-- | source/slang/slang-syntax.cpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/source/slang/slang-syntax.cpp b/source/slang/slang-syntax.cpp index d6e966aaa..62de6599c 100644 --- a/source/slang/slang-syntax.cpp +++ b/source/slang/slang-syntax.cpp @@ -20,23 +20,23 @@ void printDiagnosticArg(StringBuilder& sb, Decl* decl) void printDiagnosticArg(StringBuilder& sb, Type* type) { - sb << type->toString(); + type->toText(sb); } void printDiagnosticArg(StringBuilder& sb, Val* val) { - sb << val->toString(); + val->toText(sb); } void printDiagnosticArg(StringBuilder& sb, TypeExp const& type) { - sb << type.type->toString(); + type.type->toText(sb); } void printDiagnosticArg(StringBuilder& sb, QualType const& type) { if (type.type) - sb << type.type->toString(); + type.type->toText(sb); else sb << "<null>"; } @@ -1104,13 +1104,22 @@ Index getFilterCountImpl(const ReflectClassInfo& clsInfo, MemberFilterStyle filt String DeclRefBase::toString() const { - if (!decl) return ""; - - auto name = decl->getName(); - if (!name) return ""; + StringBuilder builder; + toText(builder); + return builder; + } - // TODO: need to print out substitutions too! - return name->text; + void DeclRefBase::toText(StringBuilder& out) const + { + if (decl) + { + auto name = decl->getName(); + if (name) + { + // TODO: need to print out substitutions too! + out << name->text; + } + } } bool SubstitutionSet::equals(const SubstitutionSet& substSet) const |
