Skip to content

Commit 7d840bb

Browse files
authored
Mark all internal functions as static (#48)
1 parent 7e05de5 commit 7d840bb

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

docs/js/tree-sitter-parser.wasm

-34 Bytes
Binary file not shown.

src/tree_sitter_comment/chars.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
#include "chars.h"
22

3-
bool is_upper(int32_t c)
3+
static bool is_upper(int32_t c)
44
{
55
const int32_t upper = 65;
66
const int32_t lower = 90;
77
return c >= upper && c <= lower;
88
}
99

10-
bool is_digit(int32_t c)
10+
static bool is_digit(int32_t c)
1111
{
1212
const int32_t upper = 48;
1313
const int32_t lower = 57;
1414
return c >= upper && c <= lower;
1515
}
1616

17-
bool is_newline(int32_t c)
17+
static bool is_newline(int32_t c)
1818
{
1919
const int32_t newline_chars[] = {
2020
CHAR_EOF,
@@ -30,7 +30,7 @@ bool is_newline(int32_t c)
3030
return false;
3131
}
3232

33-
bool is_space(int32_t c)
33+
static bool is_space(int32_t c)
3434
{
3535
const int32_t space_chars[] = {
3636
CHAR_SPACE,
@@ -50,7 +50,7 @@ bool is_space(int32_t c)
5050
}
5151

5252
/// Check if the character is allowed inside the name.
53-
bool is_internal_char(int32_t c)
53+
static bool is_internal_char(int32_t c)
5454
{
5555
const int32_t valid_chars[] = {
5656
'-',

src/tree_sitter_comment/chars.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
#define CHAR_TAB '\t'
1414
#define CHAR_VERTICAL_TAB '\v'
1515

16-
bool is_internal_char(int32_t c);
17-
bool is_newline(int32_t c);
18-
bool is_space(int32_t c);
19-
bool is_upper(int32_t c);
20-
bool is_digit(int32_t c);
16+
static bool is_internal_char(int32_t c);
17+
static bool is_newline(int32_t c);
18+
static bool is_space(int32_t c);
19+
static bool is_upper(int32_t c);
20+
static bool is_digit(int32_t c);
2121

2222
#endif /* ifndef TREE_SITTER_COMMENT_CHARS_H */

src/tree_sitter_comment/parser.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/// - TODO(stsewd):
1414
/// - TODO(stsewd): text
1515
/// - TODO (stsewd): text
16-
bool parse_tagname(TSLexer* lexer, const bool* valid_symbols)
16+
static bool parse_tagname(TSLexer* lexer, const bool* valid_symbols)
1717
{
1818
if (!is_upper(lexer->lookahead) || !valid_symbols[T_TAGNAME]) {
1919
return false;
@@ -81,7 +81,7 @@ bool parse_tagname(TSLexer* lexer, const bool* valid_symbols)
8181
return true;
8282
}
8383

84-
bool parse(TSLexer* lexer, const bool* valid_symbols)
84+
static bool parse(TSLexer* lexer, const bool* valid_symbols)
8585
{
8686
// If all valid symbols are true, tree-sitter is in correction mode.
8787
// We don't want to parse anything in that case.

src/tree_sitter_comment/parser.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include <tree_sitter/parser.h>
55

6-
bool parse_tagname(TSLexer* lexer, const bool* valid_symbols);
7-
bool parse(TSLexer* lexer, const bool* valid_symbols);
6+
static bool parse_tagname(TSLexer* lexer, const bool* valid_symbols);
7+
static bool parse(TSLexer* lexer, const bool* valid_symbols);
88

99
#endif /* ifndef TREE_SITTER_COMMENT_PARSER_H */

tree-sitter-comment.wasm

-34 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)