(s string)
| 83 | } |
| 84 | |
| 85 | func parseIdentifierPart(s string) (string, bool) { |
| 86 | s = strings.TrimSpace(s) |
| 87 | if s == "" { |
| 88 | return "", false |
| 89 | } |
| 90 | if s[0] != '"' { |
| 91 | if strings.ContainsAny(s, "\" \t\n\r\f") { |
| 92 | return "", false |
| 93 | } |
| 94 | return strings.ToLower(s), true |
| 95 | } |
| 96 | if len(s) < 2 || s[len(s)-1] != '"' { |
| 97 | return "", false |
| 98 | } |
| 99 | |
| 100 | var ident strings.Builder |
| 101 | for i := 1; i < len(s)-1; i++ { |
| 102 | if s[i] == '"' { |
| 103 | if i+1 >= len(s)-1 || s[i+1] != '"' { |
| 104 | return "", false |
| 105 | } |
| 106 | ident.WriteByte('"') |
| 107 | i++ |
| 108 | continue |
| 109 | } |
| 110 | ident.WriteByte(s[i]) |
| 111 | } |
| 112 | return ident.String(), true |
| 113 | } |
no test coverage detected