Skip to content

Commit

Permalink
Do minor cleanups (#180)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ChAoSUnItY authored Jan 19, 2025
1 parent 9208d7d commit 09bb918
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ a.out
config
src/codegen.c
.session.mk

# vscode C/C++ plugin generated files
.vscode
3 changes: 3 additions & 0 deletions src/globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
* file "LICENSE" for information on usage and redistribution of this file.
*/

#include <stdbool.h>
#include <stdlib.h>

/* Global objects */

block_list_t BLOCKS;
Expand Down
2 changes: 2 additions & 0 deletions src/lexer.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* file "LICENSE" for information on usage and redistribution of this file.
*/

#include <stdbool.h>

/* lexer tokens */
typedef enum {
T_start, /* FIXME: it was intended to start the state machine. */
Expand Down
3 changes: 3 additions & 0 deletions src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
* file "LICENSE" for information on usage and redistribution of this file.
*/

#include <stdbool.h>
#include <stdlib.h>

/* C language syntactic analyzer */
int global_var_idx = 0;
int global_label_idx = 0;
Expand Down

0 comments on commit 09bb918

Please sign in to comment.