@@ -649,20 +649,20 @@ impl exprBuilder {
649
649
// Remove expression tokens.
650
650
// Holds only indexing tokens.
651
651
// Includes brackets.
652
- tokens = tokens[len(exprTokens):]
652
+ mut bracketTokens : = tokens[len(exprTokens):]
653
653
654
654
// Catch slicing expressions.
655
- mut splitTokens := tokens [1 : len(tokens )-1] // Remove brackets.
655
+ mut splitTokens := bracketTokens [1 : len(bracketTokens )-1] // Remove brackets.
656
656
mut start, mut to := splitDelim(splitTokens, token::Colon)
657
657
if start != nil || to != nil {
658
- ret self.buildSlicing(exprTokens, start, to, errorToken, tokens [len(tokens )-1])
658
+ ret self.buildSlicing(exprTokens, start, to, errorToken, bracketTokens [len(bracketTokens )-1])
659
659
}
660
- if tokens [1].Id == token::DblColon {
660
+ if bracketTokens [1].Id == token::DblColon {
661
661
// Special case: catch x[::] and x[::index3] like expressions.
662
662
self.pushErr(errorToken, log::MiddleIndexRequired)
663
663
ret nil
664
664
}
665
- ret self.buildIndexing(exprTokens, tokens , errorToken)
665
+ ret self.buildIndexing(exprTokens, bracketTokens , errorToken)
666
666
}
667
667
668
668
fn buildExclRight(mut self, mut &tokens: []&token::Token): ast::ExprData {
@@ -818,12 +818,14 @@ impl exprBuilder {
818
818
}
819
819
820
820
fn buildKind(mut self, mut &tokens: []&token::Token): ast::ExprData {
821
- mut parts, errors := parts(tokens, token::Comma, true)
822
- if errors != nil {
823
- self.p.errors = append(self.p.errors, errors...)
824
- ret nil
825
- } else if len(parts) > 1 {
826
- ret self.buildTuple(parts)
821
+ if isTupleExpr(tokens) {
822
+ mut parts, errors := parts(tokens, token::Comma, true)
823
+ if errors != nil {
824
+ self.p.errors = append(self.p.errors, errors...)
825
+ ret nil
826
+ } else if len(parts) > 1 {
827
+ ret self.buildTuple(parts)
828
+ }
827
829
}
828
830
ret self.build(tokens)
829
831
}
0 commit comments