diff options
Diffstat (limited to 'src/amberscript/parser.cc')
-rw-r--r-- | src/amberscript/parser.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/amberscript/parser.cc b/src/amberscript/parser.cc index fc5c948..50760f0 100644 --- a/src/amberscript/parser.cc +++ b/src/amberscript/parser.cc @@ -2907,7 +2907,7 @@ Result Parser::ParseValues(const std::string& name, } if (type::Type::IsFloat(segs[seg_idx].GetFormatMode())) { - if (!token->IsInteger() && !token->IsDouble()) { + if (!token->IsInteger() && !token->IsDouble() && !token->IsHex()) { return Result(std::string("Invalid value provided to ") + name + " command: " + token->ToOriginalString()); } @@ -2918,12 +2918,13 @@ Result Parser::ParseValues(const std::string& name, v.SetDoubleValue(token->AsDouble()); } else { - if (!token->IsInteger()) { + if (!token->IsInteger() && !token->IsHex()) { return Result(std::string("Invalid value provided to ") + name + " command: " + token->ToOriginalString()); } - v.SetIntValue(token->AsUint64()); + uint64_t val = token->IsHex() ? token->AsHex() : token->AsUint64(); + v.SetIntValue(val); } ++seg_idx; if (seg_idx >= segs.size()) |