Skip to content

Commit 09bb918

Browse files
authored
Do minor cleanups (#180)
Due to current shecc's implementation, modern editors with common lsp such as VSCode with C/C++ plugin is unable to properly analyze from main.c, even though the code is correct. Thus we adds some system header inclusion in certain files to resolve and suppress error message. Notice that due to current frontend's limitation, including defs.h in C source files other than main.c would result weird error, thus this is not introduced in this commit. In addition, it's annoying that VSCode always generate .vscode folder with some plugin-specific setting config files. Therefore, we also ignore it to prevent accidentally adding the config file to stage.
1 parent 9208d7d commit 09bb918

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ a.out
88
config
99
src/codegen.c
1010
.session.mk
11+
12+
# vscode C/C++ plugin generated files
13+
.vscode

src/globals.c

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
* file "LICENSE" for information on usage and redistribution of this file.
66
*/
77

8+
#include <stdbool.h>
9+
#include <stdlib.h>
10+
811
/* Global objects */
912

1013
block_list_t BLOCKS;

src/lexer.c

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* file "LICENSE" for information on usage and redistribution of this file.
66
*/
77

8+
#include <stdbool.h>
9+
810
/* lexer tokens */
911
typedef enum {
1012
T_start, /* FIXME: it was intended to start the state machine. */

src/parser.c

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
* file "LICENSE" for information on usage and redistribution of this file.
66
*/
77

8+
#include <stdbool.h>
9+
#include <stdlib.h>
10+
811
/* C language syntactic analyzer */
912
int global_var_idx = 0;
1013
int global_label_idx = 0;

0 commit comments

Comments
 (0)