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: mark helper functions static #16

Merged
merged 1 commit into from
Jul 30, 2023
Merged
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
18 changes: 9 additions & 9 deletions src/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ enum TokenType
NO_SPACE
};

void tsawk_debug(TSLexer *lexer)
static void tsawk_debug(TSLexer *lexer)
{
if (lexer->lookahead == '\r')
{
Expand All @@ -38,7 +38,7 @@ void tsawk_debug(TSLexer *lexer)
lexer->is_at_included_range_start(lexer) ? "true" : "false");
}

bool tsawk_next_chars_eq(TSLexer *lexer, char *word)
static bool tsawk_next_chars_eq(TSLexer *lexer, char *word)
{
for (int i = 0; i < strlen(word); i++)
{
Expand All @@ -52,12 +52,12 @@ bool tsawk_next_chars_eq(TSLexer *lexer, char *word)
return true;
}

bool tsawk_is_whitespace(int32_t chr)
static bool tsawk_is_whitespace(int32_t chr)
{
return chr == ' ' || chr == '\t';
}

bool tsawk_is_line_continuation(TSLexer *lexer)
static bool tsawk_is_line_continuation(TSLexer *lexer)
{
if (lexer->lookahead == '\\')
{
Expand All @@ -73,12 +73,12 @@ bool tsawk_is_line_continuation(TSLexer *lexer)
return false;
}

bool tsawk_is_statement_terminator(int32_t chr)
static bool tsawk_is_statement_terminator(int32_t chr)
{
return chr == '\n' || chr == ';';
}

bool tsawk_skip_whitespace(TSLexer *lexer, bool skip_newlines, bool capture)
static bool tsawk_skip_whitespace(TSLexer *lexer, bool skip_newlines, bool capture)
{
bool skipped = false;

Expand All @@ -91,7 +91,7 @@ bool tsawk_skip_whitespace(TSLexer *lexer, bool skip_newlines, bool capture)
return skipped;
}

void tsawk_skip_comment(TSLexer *lexer)
static void tsawk_skip_comment(TSLexer *lexer)
{
if (lexer->lookahead != '#')
{
Expand All @@ -113,7 +113,7 @@ void tsawk_skip_comment(TSLexer *lexer)
}
}

bool tsawk_is_if_else_separator(TSLexer *lexer)
static bool tsawk_is_if_else_separator(TSLexer *lexer)
{
while (tsawk_is_whitespace(lexer->lookahead) || tsawk_is_statement_terminator(lexer->lookahead) || lexer->lookahead == '\r')
{
Expand All @@ -131,7 +131,7 @@ bool tsawk_is_if_else_separator(TSLexer *lexer)
return tsawk_next_chars_eq(lexer, "else");
}

bool tsawk_is_concatenating_space(TSLexer *lexer)
static bool tsawk_is_concatenating_space(TSLexer *lexer)
{
bool had_whitespace = tsawk_skip_whitespace(lexer, false, true);

Expand Down