35 lines
558 B
C++
35 lines
558 B
C++
#include <pslang/ast/statement.hpp>
|
|
|
|
namespace pslang::ast
|
|
{
|
|
|
|
namespace
|
|
{
|
|
|
|
struct get_location_visitor
|
|
{
|
|
location operator()(expression_ptr const & node)
|
|
{
|
|
return get_location(*node);
|
|
}
|
|
|
|
template <typename Node>
|
|
location operator()(Node const & node)
|
|
{
|
|
return node.location;
|
|
}
|
|
};
|
|
|
|
}
|
|
|
|
location get_location(pre_statement const & statement)
|
|
{
|
|
return std::visit(get_location_visitor{}, statement);
|
|
}
|
|
|
|
location get_location(statement const & statement)
|
|
{
|
|
return std::visit(get_location_visitor{}, statement);
|
|
}
|
|
|
|
}
|