complain if [end] is missing

This commit is contained in:
Alex Bates 2021-02-10 13:43:55 +00:00
parent 676d6d9a16
commit f28218a6f1
3 changed files with 11 additions and 9 deletions

View File

@ -65,12 +65,12 @@ if __name__ == "__main__":
if message.index is None:
message.index = section_get_unused_id(section)
if message.name:
if message.name in names:
print(f"error: multiple messages with name '{message.name}'")
exit(1)
else:
names.add(message.name)
# if message.name:
# if message.name in names:
# print(f"error: multiple messages with name '{message.name}'")
# exit(1)
# else:
# names.add(message.name)
# if message.header_file_index in messages_by_file:
# messages_by_file[message.header_file_index].add(message)
@ -78,8 +78,7 @@ if __name__ == "__main__":
# messages_by_file[message.header_file_index] = set([message])
if message.index in section:
print(f"error: multiple messages allocated to id {section_idx:02X}:{message.index:03X}")
exit(1)
print(f"warning: multiple messages allocated to id {section_idx:02X}:{message.index:03X}")
section[message.index] = message

View File

@ -907,7 +907,8 @@ if __name__ == "__main__":
else:
if source[0] == "}":
if not explicit_end:
message.bytes += [0xFD]
print(f"{filename}:{lineno}: warning: string lacks an [end] command")
#message.bytes += [0xFD]
explicit_end = False
# padding

View File

@ -467,6 +467,8 @@ class N64SegPaperMarioMessages(N64Segment):
else:
raise ValueError(value)
self.write_markup("[end]")
def write_markup(self, markup):
self.f.write(re.sub("\n", "\n ", markup))