We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 43a9f46 commit 193e616Copy full SHA for 193e616
rsql/lexer.go
@@ -235,20 +235,10 @@ func (l *Lexer) peekChar() byte {
235
236
func (l *Lexer) readIdentifier() string {
237
position := l.pos
238
- for isLetter(l.ch) || isDigit(l.ch) || l.ch == '.' || l.ch == '[' || l.ch == ']' || l.ch == '\'' || l.ch == '"' {
239
- // 如果遇到方括号,需要特殊处理以确保括号内容被正确包含
240
- if l.ch == '[' {
241
- l.readChar() // 跳过 '['
242
- // 继续读取直到找到匹配的 ']'
243
- for l.ch != ']' && l.ch != 0 {
244
- l.readChar()
245
- }
246
- if l.ch == ']' {
247
- l.readChar() // 跳过 ']'
248
249
- } else {
250
251
+ // 只处理基本标识符和点号(用于嵌套字段访问)
+ // 数组索引(方括号)应该由解析器处理,而不是词法分析器
+ for isLetter(l.ch) || isDigit(l.ch) || l.ch == '.' {
+ l.readChar()
252
}
253
return l.input[position:l.pos]
254
0 commit comments