Fix some header #includes with clangd LSP (#1370)

Co-authored-by: ISSOtm <eldredhabert0@gmail.com>
This commit is contained in:
Sylvie
2024-03-21 15:13:10 -04:00
committed by GitHub
parent 32b4a6f284
commit 0300971a17
8 changed files with 17 additions and 21 deletions

View File

@@ -1,21 +1,23 @@
/* SPDX-License-Identifier: MIT */
#include "asm/fstack.hpp"
#include <sys/stat.h>
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <new>
#include <optional>
#include <stack>
#include <stdlib.h>
#include <string_view>
#include "error.hpp"
#include "helpers.hpp"
#include "linkdefs.hpp"
#include "platform.hpp" // S_ISDIR (stat macro)
#include "asm/fstack.hpp"
#include "asm/lexer.hpp"
#include "asm/macro.hpp"
#include "asm/main.hpp"
#include "asm/symbol.hpp"
@@ -23,14 +25,14 @@
struct Context {
FileStackNode *fileInfo;
LexerState lexerState;
uint32_t uniqueID;
MacroArgs *macroArgs; // Macro args are *saved* here
LexerState lexerState{};
uint32_t uniqueID = 0;
MacroArgs *macroArgs = nullptr; // Macro args are *saved* here
uint32_t nbReptIters = 0;
bool isForLoop = false;
int32_t forValue = 0;
int32_t forStep = 0;
std::string forName;
std::string forName{};
};
static std::stack<Context> contextStack;
@@ -236,9 +238,7 @@ static Context &newContext(FileStackNode &fileInfo) {
fileInfo.parent = contextStack.top().fileInfo;
fileInfo.lineNo = lexer_GetLineNo();
Context &context = contextStack.emplace();
context.fileInfo = &fileInfo;
return context;
return contextStack.emplace(Context{.fileInfo = &fileInfo});
}
void fstk_RunInclude(std::string const &path) {