summaryrefslogtreecommitdiff
path: root/tools/scaninc/source_file.cpp
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2020-06-26 19:49:22 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2020-06-27 10:21:36 -0400
commit9ac9b8cefc392958f57c0d2aceb308e3f15dfbec (patch)
treee3768f619f27f19f6d3cf87405bda4e69a79711a /tools/scaninc/source_file.cpp
parentc7a27c188361ac6cb261b3e86792560d4b295483 (diff)
Create fixrom to monkeypatch makerom
Dep scanning for o2narc targets Remove post-failure script because it can't be made to work
Diffstat (limited to 'tools/scaninc/source_file.cpp')
-rw-r--r--tools/scaninc/source_file.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/scaninc/source_file.cpp b/tools/scaninc/source_file.cpp
index 5d0281a4..4f51cd48 100644
--- a/tools/scaninc/source_file.cpp
+++ b/tools/scaninc/source_file.cpp
@@ -39,8 +39,18 @@ SourceFileType GetFileType(std::string& path)
return SourceFileType::Header;
else if (extension == "inc")
return SourceFileType::Inc;
- else
- FATAL_ERROR("Unrecognized extension \"%s\"\n", extension.c_str());
+ else if (extension == "txt")
+ {
+ std::string trunc = path.substr(0, pos);
+ pos = trunc.find_last_of('.');
+ if (pos != std::string::npos)
+ {
+ std::string ext2 = trunc.substr(pos + 1);
+ if (ext2 == "json")
+ return SourceFileType::Cpp;
+ }
+ }
+ FATAL_ERROR("Unrecognized extension \"%s\"\n", extension.c_str());
// Unreachable
return SourceFileType::Cpp;