瀏覽代碼

fixed a lexer bug with detecting alphanumeric character text (not happy about it though)

jp9000 12 年之前
父節點
當前提交
9743b0efc5
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      libobs/util/lexer.c

+ 2 - 2
libobs/util/lexer.c

@@ -241,9 +241,9 @@ static inline enum base_token_type get_char_token_type(const char ch)
 {
 	if (is_whitespace(ch))
 		return BASETOKEN_WHITESPACE;
-	else if (isdigit(ch))
+	else if (ch >= '0' && ch <= '9')
 		return BASETOKEN_DIGIT;
-	else if (isalpha(ch))
+	else if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
 		return BASETOKEN_ALPHA;
 
 	return BASETOKEN_OTHER;