From f3e0eb71d5481cc9776bb38a8fd44d64d62fde57 Mon Sep 17 00:00:00 2001 From: Thomas Ave Date: Fri, 27 May 2016 17:34:00 +0200 Subject: [PATCH] Added support for comments in lxs file --- src/inputparser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/inputparser.cpp b/src/inputparser.cpp index 00e3f6f..b63efaa 100644 --- a/src/inputparser.cpp +++ b/src/inputparser.cpp @@ -21,14 +21,14 @@ namespace lxs { std::vector > result; unsigned int i=0; while(std::getline(is,line)) { - if(line.length() == 0) continue; i++; + size_t start = line.find_first_not_of(" \t\v\f\r"); + if(line.length() == 0 || (start != std::string::npos && line.length() > start && line[start] == '#')) continue; std::size_t loc = line.find_first_of('='); if(loc == std::string::npos) { std::cerr << "Invalid syntax on line " << i << ": no '=' found!" << std::endl; exit(1); } - size_t start = line.find_first_not_of(" \t\v\f\r"); if(start == loc) { std::cerr << "Invalid syntax on line " << i << ": no valid tokenname specified!" << std::endl; exit(1);