Added support for comments in lxs file

This commit is contained in:
Thomas Ave 2016-05-27 17:34:00 +02:00
parent 48ed58f077
commit f3e0eb71d5
1 changed files with 2 additions and 2 deletions

View File

@ -21,14 +21,14 @@ namespace lxs {
std::vector<std::pair<std::string,std::string> > 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);