diff options
Diffstat (limited to 'include/ninja')
-rw-r--r-- | include/ninja/Ninja.hpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/include/ninja/Ninja.hpp b/include/ninja/Ninja.hpp index cd9be0a..e2b4ab5 100644 --- a/include/ninja/Ninja.hpp +++ b/include/ninja/Ninja.hpp @@ -12,7 +12,7 @@ namespace ninja NONE, VARIABLE_ALREADY_DEFINED, RULE_ALREADY_DEFINED, - RULE_AREADY_BUILT + INVALID_NAME }; class NinjaException : public std::runtime_error @@ -30,6 +30,7 @@ namespace ninja struct NinjaVariable { + NinjaVariable(const std::string &name); const std::string name; }; @@ -42,13 +43,22 @@ namespace ninja { NONE, VALUE, - VARIABLE + VARIABLE, + RAW }; NinjaArg() : type(Type::NONE) {} NinjaArg(const std::string &value) : type(Type::VALUE), arg(value) {} NinjaArg(const NinjaVariable &var) : type(Type::VARIABLE), arg(var.name) {} + static NinjaArg createRaw(const std::string &value) + { + NinjaArg arg; + arg.type = Type::RAW; + arg.arg = value; + return arg; + } + Type type; std::string arg; }; |