From 6b47d350a0999bc42c344cf19fb200cb48b03487 Mon Sep 17 00:00:00 2001 From: garak Date: Tue, 17 Jan 2023 01:17:24 -0500 Subject: [PATCH] read multiple incbins and C arrays at once for situations where the same file could be opened many times --- include/core/parseutil.h | 6 ++-- src/core/parseutil.cpp | 59 +++++++++++++++++++++++++++++++++------- src/project.cpp | 17 ++++++------ 3 files changed, 60 insertions(+), 22 deletions(-) diff --git a/include/core/parseutil.h b/include/core/parseutil.h index 3fdd9286..198f4c95 100644 --- a/include/core/parseutil.h +++ b/include/core/parseutil.h @@ -13,8 +13,6 @@ -extern QMap gFileCache; - enum TokenClass { Number, Operator, @@ -51,9 +49,11 @@ public: static int textFileLineCount(const QString &path); QList parseAsm(const QString &filename); int evaluateDefine(const QString&, const QMap&); - QStringList readCArray(const QString &text, const QString &label); + QStringList readCArray(const QString &filename, const QString &label); + QMap readCArrayMulti(const QString &filename); QMap readNamedIndexCArray(const QString &text, const QString &label); QString readCIncbin(const QString &text, const QString &label); + QMap readCIncbinMulti(const QString &filepath); QStringList readCIncbinArray(const QString &filename, const QString &label); QMap readCDefines(const QString &filename, const QStringList &prefixes, QMap = { }); QStringList readCDefinesSorted(const QString&, const QStringList&, const QMap& = { }); diff --git a/src/core/parseutil.cpp b/src/core/parseutil.cpp index 7ba8d7f6..d69edb47 100644 --- a/src/core/parseutil.cpp +++ b/src/core/parseutil.cpp @@ -15,13 +15,9 @@ const QRegularExpression ParseUtil::re_poryScriptLabel("\\b(script)(\\((global|l const QRegularExpression ParseUtil::re_globalPoryScriptLabel("\\b(script)(\\((global)\\))?\\s*\\b(?