pslang/libs/ast/source/statement.cpp

32 lines
586 B
C++

#include <pslang/ast/statement.hpp>
namespace pslang::ast
{
namespace
{
location get_location_impl(expression_ptr const & statement)
{
return get_location(*statement);
}
template <typename Statement>
location get_location_impl(Statement const & statement)
{
return statement.location;
}
location get_location_impl(statement const & statement)
{
return std::visit([](auto const & statement){ return get_location_impl(statement); }, statement);
}
}
location get_location(statement const & statement)
{
return get_location_impl(statement);
}
}