#include #include namespace pslang::ast { namespace { struct get_location_visitor : const_expression_visitor { using const_expression_visitor::apply; template location apply(numeric_literal_base const & node) { return node.location; } location apply(identifier const & node) { return node.location; } location apply(unary_operation const & node) { return node.location; } location apply(binary_operation const & node) { return node.location; } location apply(cast_operation const & node) { return node.location; } location apply(function_call const & node) { return node.location; } location apply(array const & node) { return node.location; } location apply(array_access const & node) { return node.location; } location apply(field_access const & node) { return node.location; } }; } location get_location(expression const & expression) { return get_location_visitor{}.apply(expression); } }