2026-07-25 23:01:18 +02:00
|
|
|
#include "bscript/compiler/ast/StringValue.h"
|
2020-08-20 01:27:35 -07:00
|
|
|
|
|
|
|
|
|
2021-02-25 16:53:22 +01:00
|
|
|
#include "bscript/compiler/ast/NodeVisitor.h"
|
2024-01-12 06:51:44 +01:00
|
|
|
#include "clib/strutil.h"
|
2020-08-20 01:27:35 -07:00
|
|
|
|
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
|
|
|
{
|
|
|
|
|
StringValue::StringValue( const SourceLocation& source_location, std::string value )
|
|
|
|
|
: Value( source_location ), value( std::move( value ) )
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StringValue::accept( NodeVisitor& visitor )
|
|
|
|
|
{
|
|
|
|
|
visitor.visit_string_value( *this );
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-12 06:51:44 +01:00
|
|
|
void StringValue::describe_to( std::string& w ) const
|
2020-08-20 01:27:35 -07:00
|
|
|
{
|
2024-01-12 06:51:44 +01:00
|
|
|
fmt::format_to( std::back_inserter( w ), "string-value({})",
|
|
|
|
|
Clib::getencodedquotedstring( value ) );
|
2020-08-20 01:27:35 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Pol::Bscript::Compiler
|