From 1d2c5ce39d12adcb584d586952a59e15f2495f67 Mon Sep 17 00:00:00 2001 From: Spartan322 Date: Sat, 2 Sep 2023 23:56:26 -0400 Subject: Add Node Line/Column Generator Fix Errors.hpp dependency on v2script/Parser.hpp Add node location print to headless/main.cpp Add Node::line_col << operator Add Node::cast_to WARNING: Takes advantage of non-standard behavior in unordered_multimap THIS IS A HACK FOR NOW Only GCC unordered_multimap::equal_range sees elements backwards Prefer moving off of unordered_multimap to something like EASTL hash_multimap --- include/openvic-dataloader/v2script/Parser.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/openvic-dataloader/v2script/Parser.hpp') diff --git a/include/openvic-dataloader/v2script/Parser.hpp b/include/openvic-dataloader/v2script/Parser.hpp index 1c524b2..fb9022a 100644 --- a/include/openvic-dataloader/v2script/Parser.hpp +++ b/include/openvic-dataloader/v2script/Parser.hpp @@ -43,12 +43,18 @@ namespace ovdl::v2script { const FileNode* get_file_node() const; + void generate_node_location_map(); + + const ast::Node::line_col get_node_begin(const ast::NodeCPtr node) const; + const ast::Node::line_col get_node_end(const ast::NodeCPtr node) const; + Parser(Parser&&); Parser& operator=(Parser&&); ~Parser(); private: + friend class ::ovdl::v2script::ast::Node; class BufferHandler; std::unique_ptr _buffer_handler; std::unique_ptr _file_node; -- cgit v1.2.3-56-ga3b1