Merge commit '99a2182dbe68dce338771ca673fccd14094719b0'

pull/252/head
Wilfred Hughes 2022-04-10 12:51:52 +07:00
commit 7a17daa64b
1 changed files with 2 additions and 4 deletions

@ -1,7 +1,5 @@
#include <tree_sitter/parser.h>
#define LOOKAHEAD_TYPE __typeof__(((TSLexer *)0)->lookahead)
enum TokenType {
STRING_FRAGMENT,
INDENTED_STRING_FRAGMENT,
@ -84,7 +82,7 @@ static bool scan_indented_string_fragment(TSLexer *lexer) {
}
}
static bool is_path_char(LOOKAHEAD_TYPE c) {
static bool is_path_char(char c) {
return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '-' || c == '+' || c == '_' || c == '.' || c == '/';
}
@ -93,7 +91,7 @@ static bool scan_path_start(TSLexer *lexer) {
bool have_sep = false;
bool have_after_sep = false;
LOOKAHEAD_TYPE c = lexer->lookahead;
char c = lexer->lookahead;
// unlike string_fragments which which are preceded by initial token (i.e. '"')
// and thus will have all leading external whitespace consumed,