2020-08-20 01:27:35 -07:00
|
|
|
#include "StringValue.h"
|
|
|
|
|
|
|
|
|
|
#include <format/format.h>
|
|
|
|
|
|
|
|
|
|
#include "clib/strutil.h"
|
2021-02-25 16:53:22 +01:00
|
|
|
#include "bscript/compiler/ast/NodeVisitor.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 );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StringValue::describe_to( fmt::Writer& w ) const
|
|
|
|
|
{
|
|
|
|
|
w << "string-value(" << Clib::getencodedquotedstring( value ) << ")";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Pol::Bscript::Compiler
|