#include #include #include namespace pslang::ast { namespace { struct get_location_visitor : const_expression_visitor { using const_expression_visitor::apply; template location apply(Node const & node) { return node.location; } }; struct get_type_visitor : const_expression_visitor { using const_expression_visitor::apply; template types::type_ptr apply(primitive_literal_base const & node) { return std::make_unique(types::primitive_type{types::primitive_type_base{}}); } template types::type_ptr apply(Node const & node) { return node.inferred_type; } }; } location get_location(expression const & expression) { return get_location_visitor{}.apply(expression); } types::type_ptr get_type(expression const & expression) { return get_type_visitor{}.apply(expression); } }