From 84fa046c7c961210af1a07e719a1c5a37d719f60 Mon Sep 17 00:00:00 2001 From: mundusnine Date: Mon, 7 Jun 2021 14:34:45 -0400 Subject: [PATCH] Fix custom types having a string_len of 0(always) --- stb_c_lexer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stb_c_lexer.h b/stb_c_lexer.h index be34f90..05b9c42 100644 --- a/stb_c_lexer.h +++ b/stb_c_lexer.h @@ -588,7 +588,6 @@ int stb_c_lexer_get_token(stb_lexer *lexer) { int n = 0; lexer->string = lexer->string_storage; - lexer->string_len = n; do { if (n+1 >= lexer->string_storage_len) return stb__clex_token(lexer, CLEX_parse_error, p, p+n); @@ -602,6 +601,7 @@ int stb_c_lexer_get_token(stb_lexer *lexer) STB_C_LEX_DOLLAR_IDENTIFIER( || p[n] == '$' ) ); lexer->string[n] = 0; + lexer->string_len = n; return stb__clex_token(lexer, CLEX_id, p, p+n-1); }