mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
Rules: No longer lexes RHS of settings
This commit is contained in:
parent
1a559d4215
commit
ae3627761d
1 changed files with 7 additions and 1 deletions
|
@ -30,6 +30,7 @@
|
|||
#include <shared.h>
|
||||
#include <format.h>
|
||||
#include <sstream>
|
||||
#include <iostream> // TODO Remove
|
||||
#include <tuple>
|
||||
#include <inttypes.h>
|
||||
|
||||
|
@ -375,7 +376,12 @@ void Rules::parseRuleSettings (
|
|||
if (tokens.size () >= 3 && tokens[1] == "=")
|
||||
{
|
||||
auto name = join (".", hierarchy) + "." + tokens[0];
|
||||
auto value = Lexer::dequote (join (" ", std::vector <std::string> (tokens.begin () + 2, tokens.end ())));
|
||||
|
||||
auto equals = line.find ('=');
|
||||
if (equals == std::string::npos)
|
||||
throw format ("Syntax error in rule: missing '=' in line '{1}'.", line);
|
||||
|
||||
auto value = Lexer::dequote (trim (line.substr (equals + 1)));
|
||||
set (name, value);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue