4 #include <tree_sitter/parser.h>
10 #define CMD_IDENTIFIER_MAX_LENGTH 32
11 #define ESCAPE_CHAR '\\'
38 return (strcmp (
s,
"pfo") && !strncmp (
s,
"pf", 2)) || !strcmp (
s,
"Cf");
42 return !strncmp (
s,
"env", 3);
54 return !strncmp (
s,
"/*", 2) || !strcmp (
s,
"#");
62 return ch ==
'*' || ch ==
'(' || ch ==
'@' || ch ==
'|' || ch ==
'>' ||
63 ch ==
'.' || ch ==
'|' || ch ==
'%' || ch ==
'~' ||
68 return iswalpha (ch) || ch ==
'$' || ch ==
'?' || ch ==
':' || ch ==
'+' ||
69 ch ==
'=' || ch ==
'/' || ch ==
'_' || ch ==
'#' || ch ==
'\\' ||
79 return ch ==
'!' || ch ==
'?';
82 }
else if (res[0] ==
'<') {
85 return iswalnum (ch) || ch ==
'$' || ch ==
'?' || ch ==
'.' || ch ==
'!' ||
86 ch ==
'+' || ch ==
'=' || ch ==
'/' || ch ==
'*' ||
87 ch ==
'-' || ch ==
'&' || ch ==
'_' ||
93 return ch !=
'\0' && !iswspace(ch) && ch !=
'#' && ch !=
'@' &&
94 ch !=
'|' && ch !=
'>' && ch !=
';' &&
95 ch !=
')' && ch !=
'`' && ch !=
'~' && ch !=
'\\';
107 return before_last_ch ==
'?' && last_ch ==
'*';
111 return trd_last_ch ==
'?' && snd_last_ch ==
'*' && last_ch ==
'j';
185 if ((res[i_res - 1] ==
'?' && strcmp (res,
"??") != 0) ||
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
static bool scan_number(TSLexer *lexer, const bool *valid_symbols)
#define CMD_IDENTIFIER_MAX_LENGTH
static bool is_recursive_help_json(const int32_t trd_last_ch, const int32_t snd_last_ch, const int32_t last_ch)
static bool is_concat(const int32_t ch)
static bool is_interpret_cmd(const char *s)
static bool is_concat_eq_sep(const int32_t ch)
void tree_sitter_rzcmd_external_scanner_destroy(void *payload)
void * tree_sitter_rzcmd_external_scanner_create()
static bool is_recursive_help(const int32_t before_last_ch, const int32_t last_ch)
static bool is_at_cmd(const char *s)
static bool is_mid_command(const char *res, int len, const int32_t ch)
static bool is_pf_cmd(const char *s)
void tree_sitter_rzcmd_external_scanner_deserialize(void *payload, const char *buffer, unsigned length)
bool tree_sitter_rzcmd_external_scanner_scan(void *payload, TSLexer *lexer, const bool *valid_symbols)
static bool is_env_cmd(const char *s)
static bool is_comment(const char *s)
static bool is_special_start(const int32_t ch)
static bool is_concat_pf_dot(const int32_t ch)
static bool is_start_of_command(const int32_t ch)
unsigned tree_sitter_rzcmd_external_scanner_serialize(void *payload, char *buffer)
static bool is_remote_cmd(const char *s)
void(* advance)(TSLexer *, bool)