mirror of
https://github.com/ksherlock/mpw.git
synced 2025-01-14 17:30:59 +00:00
trap file loading improvements
This commit is contained in:
parent
81ce611bfc
commit
23ff00baa7
@ -19,16 +19,24 @@
|
|||||||
action emplace {
|
action emplace {
|
||||||
|
|
||||||
auto iter = map.find(name);
|
auto iter = map.find(name);
|
||||||
if (iter != map.end() && iter->second != trap)
|
|
||||||
|
if (iter == map.end())
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Warning: redefining %s ($%04x -> $%04x)\n",
|
map[std::move(name)] = trap;
|
||||||
name.c_str(),
|
}
|
||||||
iter->second,
|
else
|
||||||
trap
|
{
|
||||||
|
if (iter->second != trap)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Warning: redefining %s ($%04x -> $%04x)\n",
|
||||||
|
name.c_str(),
|
||||||
|
iter->second,
|
||||||
|
trap
|
||||||
);
|
);
|
||||||
|
iter->second = trap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
map[std::move(name)] = trap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ws = [ \t];
|
ws = [ \t];
|
||||||
@ -112,7 +120,7 @@ std::unordered_map<std::string, uint32_t> LoadTrapFile(const std::string &path)
|
|||||||
|
|
||||||
const char *p = buffer.c_str();
|
const char *p = buffer.c_str();
|
||||||
const char *pe = p + buffer.length();
|
const char *pe = p + buffer.length();
|
||||||
const char *eof = pe;
|
//const char *eof = pe;
|
||||||
const char *ts;
|
const char *ts;
|
||||||
const char *te;
|
const char *te;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user