op-assign expansion now end at ']' and '}' too
This commit is contained in:
@@ -510,8 +510,8 @@ func (parser *parser) expandOpAssign(scanner * scanner, tree *ast, tk *Token, al
|
||||
if t, err = tree.addToken(NewToken(tk.row, tk.col, opSym, opString)); err == nil {
|
||||
|
||||
var subTree *ast
|
||||
if subTree, err = parser.parseGeneral(scanner, false, allowVarRef, SymSemiColon, SymClosedRound); err == nil {
|
||||
if scanner.Previous().IsOneOfA(SymSemiColon, SymClosedRound) {
|
||||
if subTree, err = parser.parseGeneral(scanner, false, allowVarRef, SymSemiColon, SymClosedRound, SymClosedBrace, SymClosedSquare); err == nil {
|
||||
if scanner.Previous().IsOneOfA(SymSemiColon, SymClosedRound, SymClosedBrace, SymClosedSquare) {
|
||||
if err = scanner.UnreadToken(); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user