Bug fixing

This commit is contained in:
Alexei Anoshenko 2025-07-06 12:54:59 +03:00
parent 73cc26b54e
commit 55a86011cd
2 changed files with 3 additions and 14 deletions

View File

@ -513,22 +513,11 @@ func invalidPropertyValue(tag PropertyName, value any) {
func isConstantName(text string) (bool, string) {
len := len(text)
if len <= 1 || text[0] != '@' {
if len <= 1 || text[0] != '@' ||
strings.ContainsAny(text, ",;|\"'`+(){}[]<>/\\*&%! \t\n\r") {
return false, ""
}
if len > 2 {
last := len - 1
if (text[1] == '`' && text[last] == '`') ||
(text[1] == '"' && text[last] == '"') ||
(text[1] == '\'' && text[last] == '\'') {
return true, text[2:last]
}
}
if strings.ContainsAny(text, ",;|\"'`+(){}[]<>/\\*&%! \t\n\r") {
return false, ""
}
return true, text[1:]
}

View File

@ -61,7 +61,7 @@ func (session *sessionData) resolveConstants(value string) (string, bool) {
}
func (session *sessionData) resolveConstantsNext(value string, prevTags []string) (string, bool) {
if !strings.Contains(value, "@") {
if !strings.ContainsRune(value, '@') {
return value, true
}