base_index(0)
{ }
-void SourceMap::set_name(unsigned i, const std::string &n)
+void SourceMap::set_name(unsigned i, const string &n)
{
if(source_names.empty())
base_index = i;
source_names[i] = n;
}
+const string &SourceMap::get_name(unsigned i) const
+{
+ i -= base_index;
+ if(i<source_names.size())
+ return source_names[i];
+
+ static string empty;
+ return empty;
+}
+
void SourceMap::merge_from(const SourceMap &other)
{
if(other.base_index<base_index)