diff options
| author | Mel <mel@rnrd.eu> | 2025-06-30 23:15:23 +0200 |
|---|---|---|
| committer | Mel <mel@rnrd.eu> | 2025-06-30 23:15:23 +0200 |
| commit | 37217cf1b921a2a6e128b6134518912f0bd57f62 (patch) | |
| tree | 4a1f616355e02198735878e55c32347376848a93 /boot/catboot.h | |
| parent | 0737d287c29b404700bfaa07625177eb443dfab2 (diff) | |
| download | catskill-37217cf1b921a2a6e128b6134518912f0bd57f62.tar.zst catskill-37217cf1b921a2a6e128b6134518912f0bd57f62.zip | |
Factor out translation unit includes to seperate header
This allows both the usual build compiler and an LSP server like `clangd` to correctly locate symbols throughout every subunit. Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'boot/catboot.h')
| -rw-r--r-- | boot/catboot.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/boot/catboot.h b/boot/catboot.h new file mode 100644 index 0000000..4c40676 --- /dev/null +++ b/boot/catboot.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2025, Mel G. <mel@rnrd.eu> + * + * SPDX-License-Identifier: MPL-2.0 + */ + +#pragma once + +// include all partial translation units, for correct language server behaviour +// despite the fact that single translation units are not yet supported. + +// when included in the root of the translation unit, this will compile the whole project, +// however if included in a partial subunit, the `#pragma once` in the subunit will prevent +// multiple inclusions of the itself, only adding other files, thus allowing for an LSP like `clang` +// to find the definitions of all other functions and types in the project. +#include "common.c" +#include "lex.c" +#include "tree.c" +#include "parse.c" +#include "visit.c" |
