mirror of https://github.com/anoshenko/rui.git
Bug fixing
This commit is contained in:
parent
73cc26b54e
commit
55a86011cd
|
@ -513,22 +513,11 @@ func invalidPropertyValue(tag PropertyName, value any) {
|
||||||
|
|
||||||
func isConstantName(text string) (bool, string) {
|
func isConstantName(text string) (bool, string) {
|
||||||
len := len(text)
|
len := len(text)
|
||||||
if len <= 1 || text[0] != '@' {
|
if len <= 1 || text[0] != '@' ||
|
||||||
|
strings.ContainsAny(text, ",;|\"'`+(){}[]<>/\\*&%! \t\n\r") {
|
||||||
return false, ""
|
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:]
|
return true, text[1:]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ func (session *sessionData) resolveConstants(value string) (string, bool) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (session *sessionData) resolveConstantsNext(value string, prevTags []string) (string, bool) {
|
func (session *sessionData) resolveConstantsNext(value string, prevTags []string) (string, bool) {
|
||||||
if !strings.Contains(value, "@") {
|
if !strings.ContainsRune(value, '@') {
|
||||||
return value, true
|
return value, true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue