Implements indexing with period identifier style (`foo.bar`)
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-06-17 15:45:33 +02:00
parent d06b04cae9
commit d91caa7f32
17 changed files with 207 additions and 32 deletions

View File

@@ -41,6 +41,10 @@ public:
throw EvaluationException("Can't index this EvalValue");
}
virtual shared_ptr<EvalValue> IndexValue(uint32_t hash){
throw EvaluationException("Can't index this EvalValue");
}
virtual void SetIndexValue(EvalValue *key, shared_ptr<EvalValue> value){
throw EvaluationException("Can't index this EvalValue");
}

View File

@@ -41,6 +41,10 @@ public:
return this -> _table->at(hash);
}
shared_ptr<EvalValue> IndexValue(uint32_t hash) final{
return this -> _table->at(hash);
}
shared_ptr<EvalValue> IndexValue(const char* val){
auto hash = HashedString::ConstHash(val);
return this -> _table -> at(hash);