Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tidy #167

Merged
merged 2 commits into from
Jun 24, 2024
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
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Checks: "clang-diagnostic-*,clang-analyzer-*,cppcoreguidelines-*,modernize-*,-modernize-use-trailing-return-type"
WarningsAsErrors: true
HeaderFilterRegex: ""
AnalyzeTemporaryDtors: false
FormatStyle: google
ExtraArgsBefore: ["--std=c11"]
2 changes: 1 addition & 1 deletion bindings/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int main(int argc, char **argv) {

// Build a syntax tree based on source code stored in a string.
TSTree *tree = ts_parser_parse_string(parser, NULL, data, file_size);
TSNode root_node = ts_tree_root_node(tree);
// TSNode root_node = ts_tree_root_node(tree);
// assert(ts_node_child_count(root_node) > 0);

// Free all of the heap-allocated memory.
Expand Down
14 changes: 9 additions & 5 deletions src/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,25 @@
#define unused_attr
#endif

#ifndef fprintf_s
#define fprintf_s fprintf // NOLINT
#endif

#ifdef DEBUG_PRINT
#define dbg_print(...) \
do { \
fprintf(stderr, " \033[96;1mparse: \033[0m"); \
fprintf(stderr, __VA_ARGS__); \
fprintf_s(stderr, " \033[96;1mparse: \033[0m"); \
fprintf_s(stderr, __VA_ARGS__); \
} while (0)
#else
#define dbg_print(...)
#endif

#define panic(...) \
do { \
fprintf(stderr, "panic at %s:%d: ", __FILE_NAME__, __LINE__); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); \
fprintf_s(stderr, "panic at %s:%d: ", __FILE_NAME__, __LINE__); \
fprintf_s(stderr, __VA_ARGS__); \
fprintf_s(stderr, "\n"); \
exit(1); \
} while (0);

Expand Down
Loading