Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/cxx-gen-ast/src/kwgen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,17 @@ export default function kwgen(options: Options) {
} = options;

let out: string[] = [];
const emit = (s: string) => out.push(s);
const emit = (s: string = "") => out.push(s);

if (copyright !== undefined) {
emit("// Generated file by: kwgen.ts");
emit(copyright);
}

emit();
emit("#pragma once");
emit();

const keywordsByLength = Map.groupBy(keywords, (s) => s.length);

const lengths = Array.from(keywordsByLength.keys());
Expand Down
2 changes: 2 additions & 0 deletions src/parser/cxx/literals.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

#pragma once

#include <cxx/cxx_fwd.h>

#include <cstdint>
Expand Down
2 changes: 2 additions & 0 deletions src/parser/cxx/literals_fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

#pragma once

#include <cxx/cxx_fwd.h>

namespace cxx {
Expand Down
2 changes: 2 additions & 0 deletions src/parser/cxx/name_lookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

#pragma once

#include <cxx/ast_fwd.h>
#include <cxx/names_fwd.h>
#include <cxx/symbols_fwd.h>
Expand Down
2 changes: 2 additions & 0 deletions src/parser/cxx/private/c_keywords-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

#pragma once

static inline auto classifyC2(const char* s) -> cxx::TokenKind {
if (s[0] == 'd') {
if (s[1] == 'o') {
Expand Down
2 changes: 2 additions & 0 deletions src/parser/cxx/private/keywords-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

#pragma once

static inline auto classify2(const char* s) -> cxx::TokenKind {
if (s[0] == 'd') {
if (s[1] == 'o') {
Expand Down
2 changes: 2 additions & 0 deletions src/parser/cxx/private/pp_directives-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

#pragma once

enum class PreprocessorDirectiveKind {
T_IDENTIFIER,
T_DEFINE,
Expand Down
2 changes: 2 additions & 0 deletions src/parser/cxx/symbol_instantiation.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

#pragma once

#include <cxx/names_fwd.h>
#include <cxx/symbols_fwd.h>
#include <cxx/types_fwd.h>
Expand Down