}
+const Interpreter::ParsedDefinition &Interpreter::GetDefinition(const string &identifier) const {
+ try {
+ return parsedDefinitions.at(identifier);
+ } catch (...) {
+ throw std::runtime_error("cannot find definition for " + identifier);
+ }
+}
+
+
void *Interpreter::GetObject(int typeId, const std::string &name) {
map<string, ParsedDefinition>::const_iterator i(parsedDefinitions.find(name));
if (i != parsedDefinitions.end()) {
}
}
} else {
- Postpone(typeId, id, fd.Offset(), i->second->GetIdentifier(), fd.TypeId());
+ Postpone(typeId, id, fd.Offset(), i->second->GetIdentifier(), fd.TypeId(), !fd.IsReferenced());
}
}
}
return v.IsLiteral() || source.IsDefined(v.GetIdentifier());
}
-void Interpreter::Postpone(int type, int id, std::ptrdiff_t offset, const std::string &identifier, int linkedType) {
+void Interpreter::Postpone(int type, int id, std::ptrdiff_t offset, const std::string &identifier, int linkedType, bool inlined) {
char *str(new char[identifier.size() + 1]);
std::memcpy(str, identifier.c_str(), identifier.size());
str[identifier.size()] = '\0';
- postponedDefinitions.push_back(PostponedDefinition(type, id, offset, str, linkedType));
+ postponedDefinitions.push_back(PostponedDefinition(type, id, offset, str, linkedType, inlined));
}