diff --git a/src/julec/obj/cxx/scope.jule b/src/julec/obj/cxx/scope.jule index dab8635ff..8eab5ce77 100644 --- a/src/julec/obj/cxx/scope.jule +++ b/src/julec/obj/cxx/scope.jule @@ -472,21 +472,21 @@ impl scopeCoder { } fn mapLookupAssign(mut &self, mut &a: &MultiAssign) { - mut iem := (&IndexingExprModel)(a.R) + mut iem := (&IndexingExprModel)(a.Right) self.oc.ec.possibleRefExpr(iem.Expr.Model) self.oc.write(".lookup(") self.oc.ec.possibleRefExpr(iem.Index.Model) self.oc.write(", ") - if a.L[0] != nil { + if a.Left[0] != nil { self.oc.write("&(") - self.oc.ec.possibleRefExpr(a.L[0].Model) + self.oc.ec.possibleRefExpr(a.Left[0].Model) self.oc.write("), ") } else { self.oc.write("nullptr, ") } - if a.L[1] != nil { + if a.Left[1] != nil { self.oc.write("&(") - self.oc.ec.possibleRefExpr(a.L[1].Model) + self.oc.ec.possibleRefExpr(a.Left[1].Model) self.oc.write(")") } else { self.oc.write("nullptr") @@ -498,11 +498,11 @@ impl scopeCoder { self.oc.write("({\n") self.oc.addIndent() - mut tup := (&TupleExprModel)(a.R) + mut tup := (&TupleExprModel)(a.Right) for (i, mut r) in tup.Datas { self.oc.indent() - mut l := a.L[i] + mut l := a.Left[i] if l != nil { match type l.Model { | &Var: @@ -514,7 +514,7 @@ impl scopeCoder { self.oc.write(" = &(") self.oc.ec.possibleRefExpr(r.Model) self.oc.write(");\n") - a.L[i] = nil // Ignore handling for following statements. + a.Left[i] = nil // Ignore handling for following statements. continue } } @@ -527,7 +527,7 @@ impl scopeCoder { self.oc.write(";\n") } - for (i, mut l) in a.L { + for (i, mut l) in a.Left { if l == nil { continue } @@ -548,14 +548,14 @@ impl scopeCoder { self.oc.addIndent() self.oc.indent() - mut f := (&FnCallExprModel)(a.R) + mut f := (&FnCallExprModel)(a.Right) self.oc.tc.rc.codeMut1(self.oc.Buf, f.Func.Result) self.oc.write(" " + assignResultName + " = ") - self.oc.ec.possibleRefExpr(a.R) + self.oc.ec.possibleRefExpr(a.Right) self.oc.write(";\n") mut tup := f.Func.Result.Tup() - for (i, mut l) in a.L { + for (i, mut l) in a.Left { if l != nil { const r = assignResultName + "." + resultArgName self.oc.indent() @@ -604,13 +604,13 @@ impl scopeCoder { fn multiAssign(mut &self, mut a: &MultiAssign) { // Special cases. - match type a.R { + match type a.Right { | &IndexingExprModel: // Map lookup. self.mapLookupAssign(a) ret } - match type a.R { + match type a.Right { | &TupleExprModel: self.multiAssignTup(a) | &FnCallExprModel: diff --git a/src/julec/opt/deadcode/scope.jule b/src/julec/opt/deadcode/scope.jule index 8fe37245f..b680f8a4e 100644 --- a/src/julec/opt/deadcode/scope.jule +++ b/src/julec/opt/deadcode/scope.jule @@ -171,12 +171,12 @@ impl scopeDeadCode { } fn optimizeMultiAssign(mut &self, mut assign: &MultiAssign) { - for (_, mut l) in assign.L { + for (_, mut l) in assign.Left { if l != nil { self.optimizeExprModel(l.Model) } } - self.optimizeExprModel(assign.R) + self.optimizeExprModel(assign.Right) } fn optimizeStmt(mut &self, mut st: Stmt) { diff --git a/src/julec/opt/scope.jule b/src/julec/opt/scope.jule index 19ba4363f..059ad2a16 100644 --- a/src/julec/opt/scope.jule +++ b/src/julec/opt/scope.jule @@ -523,35 +523,35 @@ impl scopeOptimizer { } fn tryOptimizeSwap(mut &self, mut &assign: &MultiAssign): bool { - if !Assign || len(assign.L) != 2 || - assign.L[0] == nil || assign.L[1] == nil { + if !Assign || len(assign.Left) != 2 || + assign.Left[0] == nil || assign.Left[1] == nil { ret false } let mut tup: &TupleExprModel - match type assign.R { + match type assign.Right { | &TupleExprModel: - tup = (&TupleExprModel)(assign.R) + tup = (&TupleExprModel)(assign.Right) } if tup == nil || len(tup.Datas) != 2 { ret false } // Catch self assignments. - if equalModels(assign.L[0].Model, tup.Datas[0].Model) && - equalModels(assign.L[1].Model, tup.Datas[1].Model) { + if equalModels(assign.Left[0].Model, tup.Datas[0].Model) && + equalModels(assign.Left[1].Model, tup.Datas[1].Model) { self.removeCurrent() self.i-- // In next iteration, point to correct statement. ret true } // Catch swaps. - if !equalModels(assign.L[0].Model, tup.Datas[1].Model) || - !equalModels(assign.L[1].Model, tup.Datas[0].Model) { + if !equalModels(assign.Left[0].Model, tup.Datas[1].Model) || + !equalModels(assign.Left[1].Model, tup.Datas[0].Model) { ret false } mut model := &SwapExprModel{ - Left: assign.L[0], - Right: assign.L[1], + Left: assign.Left[0], + Right: assign.Left[1], } exprOptimizer.optimizeData(model.Left.Model, self.data) exprOptimizer.optimizeData(model.Right.Model, self.data) @@ -567,11 +567,11 @@ impl scopeOptimizer { } mut tup := (&TupleExprModel)(nil) - match type assign.R { + match type assign.Right { | &TupleExprModel: - tup = (&TupleExprModel)(assign.R) + tup = (&TupleExprModel)(assign.Right) } - for (i, mut l) in assign.L { + for (i, mut l) in assign.Left { if l != nil { if self.data.boundary != nil { if isBoundaryRiskyType(l.Kind) { @@ -602,7 +602,7 @@ impl scopeOptimizer { exprOptimizer.optimizeData(l.Model, self.data) } } - exprOptimizer.optimizeData(assign.R, self.data) + exprOptimizer.optimizeData(assign.Right, self.data) } fn optimizeRet(mut &self, mut r: &RetSt) { diff --git a/std/jule/sema/scope.jule b/std/jule/sema/scope.jule index 844fd7d66..08bc4f1cf 100644 --- a/std/jule/sema/scope.jule +++ b/std/jule/sema/scope.jule @@ -371,8 +371,8 @@ struct Assign { // Multi-declarative assignment. struct MultiAssign { - L: []&Data // Nil Model:s represents ingored expressions. - R: ExprModel + Left: []&Data // Nil Model:s represents ingored expressions. + Right: ExprModel } // Match-Case. @@ -1397,7 +1397,7 @@ impl scopeChecker { if r.Kind.Void() { self.s.pushErr(a.Right.Token, LogMsg.InvalidExpr) } - st.L = append(st.L, nil) + st.Left = append(st.Left, nil) ret } @@ -1425,7 +1425,7 @@ impl scopeChecker { }, } self.s.checkVarValue(v) - st.L = append(st.L, &Data{ + st.Left = append(st.Left, &Data{ Lvalue: !v.Constant, Mutable: v.Mutable, Reference: v.Reference, @@ -1458,7 +1458,7 @@ impl scopeChecker { errorToken: a.Setter, } checker.check() - st.L = append(st.L, l) + st.Left = append(st.Left, l) } fn checkMultiAssign(mut &self, mut &a: &AssignSt) { @@ -1490,7 +1490,7 @@ impl scopeChecker { } mut st := &MultiAssign{ - R: rd.Model, + Right: rd.Model, } for i in a.Left { mut lexpr := a.Left[i]