parser.go: square brackets are also allowed after a variable

This commit is contained in:
2024-05-25 03:32:13 +02:00
parent 76dd01afcd
commit fa136cb70b
+1 -1
View File
@@ -407,7 +407,7 @@ func (self *parser) parseGeneral(scanner *scanner, allowForest bool, allowVarRef
if currentTerm != nil {
sym = currentTerm.symbol()
}
if sym == SymList || sym == SymString || sym == SymDict || sym == SymExpression {
if sym == SymList || sym == SymString || sym == SymDict || sym == SymExpression || sym == SymVariable {
indexTk := NewToken(listTerm.tk.row, listTerm.tk.col, SymIndex, listTerm.source())
indexTerm := newTerm(indexTk)
if err = tree.addTerm(indexTerm); err == nil {