Use automatic allocation for IF stacks and expansions

Switch to using `std::deque` for IF stacks (supports `.clear()`)
This commit is contained in:
Rangi42 authored and Sylvie committed 2024-02-29 13:44:08 -05:00
1 parent 31836967fa
commit af055ecd27
2 files changed
+23 -31

No files matched your search

+2 -3
View File
@@ -4,7 +4,6 @@
#define RGBDS_ASM_LEXER_H
#include <deque>
#include <stack>
#include "platform.hpp" // SSIZE_MAX
@@ -74,7 +73,7 @@ struct LexerState {
uint32_t colNo;
int lastToken;
std::stack<struct IfStackEntry> *ifStack;
std::deque<struct IfStackEntry> ifStack;
bool capturing; // Whether the text being lexed should be captured
size_t captureSize; // Amount of text captured
@@ -85,7 +84,7 @@ struct LexerState {
bool disableInterpolation;
size_t macroArgScanDistance; // Max distance already scanned for macro args
bool expandStrings;
std::deque<struct Expansion> *expansions; // Front is the innermost current expansion
std::deque<struct Expansion> expansions; // Front is the innermost current expansion
};
extern struct LexerState *lexerState;