From b307b5c93b6ab2d2102e81310e3441930f55e682 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 12 May 2026 23:41:05 +0300 Subject: [PATCH] fix lua syntax highlighting --- src/coders/commons.hpp | 4 ++++ src/coders/syntax_parser.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/coders/commons.hpp b/src/coders/commons.hpp index 990474990..d374cd92b 100644 --- a/src/coders/commons.hpp +++ b/src/coders/commons.hpp @@ -21,6 +21,10 @@ inline bool is_identifier_part(int c) { return is_identifier_start(c) || is_digit(c) || c == '-'; } +inline bool is_minimal_identifier_part(int c) { + return is_identifier_start(c) || is_digit(c); +} + inline bool is_json_identifier_start(int c) { return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_' || c == '.'; diff --git a/src/coders/syntax_parser.cpp b/src/coders/syntax_parser.cpp index 871cd3146..b0196ec2d 100644 --- a/src/coders/syntax_parser.cpp +++ b/src/coders/syntax_parser.cpp @@ -93,7 +93,7 @@ public: throw error("identifier expected"); } int start = pos; - while (hasNext() && is_identifier_part(source[pos])) { + while (hasNext() && is_minimal_identifier_part(source[pos])) { pos++; } return std::wstring(source.substr(start, pos - start));