void MacroParser::_handle_macro(elements::Macro const* macro) { u::ref_ptr<const elements::Macro> macro_ptr = macro; // Expand it! _push_front(macro->expand()->c_str(), macro->beginLoc(), false); }
void MacroParser::_handle_include(statements::IncludeStatement const* stmt) { #ifndef NDEBUG _config->ostream(Verb::DETAIL) << "TRACE: Got include statement!" << std::endl; #endif Location l = stmt->beginLoc(); BOOST_FOREACH(ReferencedString const* name, *stmt) { fs::path p = fs::path(*name); try { // Try to resolve the name fs::path fullpath; // try to resolve the path of the file if (p.is_absolute() || !l.file()) { fullpath = p; } else if (!l.file()) { fullpath = fs::current_path() / p; } else { // Try a path relative to the current file we're in first // Then try resolving with our default path. fullpath = l.file()->parent_path() / p; if (!fs::exists(fullpath) || fs::is_directory(fullpath)) { fullpath = fs::current_path() / p; } } if (!fs::exists(fullpath)) { // We were unable to resolve the file.. std::ostream& out = _config->ostream(Verb::ERROR); out << "ERROR: " << l << ": Could not open file \"" << p.native() << "\". File does not exist." << std::endl; _stat = Status::ERR_SYNTAX; break; } if (fs::is_directory(fullpath)) { // We were unable to resolve the file.. std::ostream& out = _config->ostream(Verb::ERROR); out << "ERROR: " << l << ": Could not open file \"" << p.native() << "\". The file is a directory." << std::endl; _stat = Status::ERR_SYNTAX; break; // We can't open a directory. } // The file appears to be good. if (!_push_front(fullpath, false)) { std::ostream& out = _config->ostream(Verb::ERROR); out << "ERROR: " << l << ": An error occurred openning file \"" << p.native() << "\"." << std::endl; _stat = Status::ERR_IO; break; } } catch (fs::filesystem_error& err) { std::ostream& out = _config->ostream(Verb::ERROR); out << "ERROR: " << l << ": An error occurred openning file \"" << p.native() << "\"." << std::endl; _stat = Status::ERR_IO; break; } } }
inline void push_front(T&& aValue) { runtime_assert(_push_front(std::move(aValue)), "P12218319::deque::push_front : Failed to push item"); }
inline void push_front(const T& aValue) { T tmp = aValue; runtime_assert(_push_front(std::move(tmp)), "P12218319::deque::push_front : Failed to push item"); }
void List<I>::push_front(I data) { m_size++; Node<I> *n = new Node<I>(data); _push_front(n); }