]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[4088] Minor tweaks in EvalContext
authorTomek Mrugalski <tomasz@isc.org>
Fri, 30 Oct 2015 07:00:07 +0000 (16:00 +0900)
committerTomek Mrugalski <tomasz@isc.org>
Fri, 30 Oct 2015 13:20:12 +0000 (22:20 +0900)
src/lib/eval/eval_context.cc

index 5ad51c1d35a6f94f46be4a0fa4a562b7d0dece85..de01092fa0fade5cfff75e698ccaec4d7e25f8fa 100644 (file)
@@ -17,7 +17,7 @@ EvalContext::parseFile(const std::string &filename)
 {
     file = filename;
     scan_begin();
-    isc::eval::EvalParser parser (*this);
+    isc::eval::EvalParser parser(*this);
     parser.set_debug_level(trace_parsing);
     int res = parser.parse();
     scan_end();
@@ -27,6 +27,11 @@ EvalContext::parseFile(const std::string &filename)
 int
 EvalContext::parseString(const std::string& str)
 {
+    /// @todo: Is there any way for the parser to read from a stream,
+    /// rather than a file? It would be better to use stringstream,
+    /// but it seems that the lexer operates on FILE* interface.
+
+    // Put the content into a file and then open that file for reading.
     remove("/tmp/eval");
     std::fstream f("/tmp/eval", std::ios::out);
 
@@ -40,9 +45,9 @@ EvalContext::parseString(const std::string& str)
 }
 
 void
-EvalContext::error (const isc::eval::location& l, const std::string& m)
+EvalContext::error(const isc::eval::location& l, const std::string& m)
 {
-  std::cerr << l << ": " << m << std::endl;
+    std::cerr << l << ": " << m << std::endl;
 }
 
 void