Commit 8d5dca26 authored by Francis Dupont's avatar Francis Dupont Committed by Tomek Mrugalski

[5014_phase2] Added Element position

parent 07f4340e
This diff is collapsed.
......@@ -85,6 +85,15 @@ Parser6Context::fatal (const std::string& what)
isc_throw(Dhcp6ParseError, what);
}
isc::data::Element::Position
Parser6Context::loc2pos(isc::dhcp::location& loc)
{
const std::string& file = *loc.begin.filename;
const uint32_t line = loc.begin.line;
const uint32_t pos = loc.begin.column;
return (isc::data::Element::Position(file, line, pos));
}
void
Parser6Context::enter(const ParserContext& ctx)
{
......
......@@ -92,6 +92,12 @@ public:
/// Used by YY_FATAL_ERROR macro so required to be static.
static void fatal(const std::string& what);
/// @brief Convert position
///
/// Convert a bison location into an element position
/// (take the begin, the end is lost)
isc::data::Element::Position loc2pos(isc::dhcp::location& loc);
/// @brief Defines syntactic contexts for lexical tie-ins
typedef enum {
/// at toplevel
......
......@@ -389,7 +389,7 @@ TEST_F(JSONFileBackendTest, recursiveInclude) {
"}";
string include = "\"eth\", <?include \"" + string(TEST_INCLUDE) + "\"?>";
string msg = "configuration error using file '" + string(TEST_FILE) +
"': Too many nested include.";
"': Too many nested include.";
writeFile(TEST_FILE, config_recursive_include);
writeFile(TEST_INCLUDE, include);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment