@Override public void visit(AssignmentStatement statement) { if (statement.getLeftValue() != null) { statement.getLeftValue().acceptVisitor(this); } statement.getRightValue().acceptVisitor(this); }
@Override public void visit(AssignmentStatement statement) { try { output.writeByte(statement.getLeftValue() != null ? 0 : 1); writeLocation(statement.getLocation()); if (statement.getLeftValue() != null) { writeExpr(statement.getLeftValue()); } writeExpr(statement.getRightValue()); output.writeBoolean(statement.isAsync()); } catch (IOException e) { throw new IOExceptionWrapper(e); } }
@Override public void visit(AssignmentStatement statement) { if (statement.getLeftValue() != null) { statement.getLeftValue().acceptVisitor(this); writer.print(" = "); } statement.getRightValue().acceptVisitor(this); writer.println(";"); }
pushLocation(statement.getLocation()); try { if (statement.getLeftValue() == null) { statement.getRightValue().acceptVisitor(this); if (resultExpr instanceof InvocationExpr && tryApplyConstructor((InvocationExpr) resultExpr)) { statement.getRightValue().acceptVisitor(this); Expr right = resultExpr; Expr left = statement.getLeftValue(); if (!(statement.getLeftValue() instanceof VariableExpr)) { statement.getLeftValue().acceptVisitor(this); left = resultExpr; } else { int varIndex = ((VariableExpr) statement.getLeftValue()).getIndex(); if (!preservedVars[varIndex] && initialWriteFrequences[varIndex] == 1 && constants[varIndex] != null) {
if (!(assignment.getLeftValue() instanceof VariableExpr)) { return false; VariableExpr var = (VariableExpr) assignment.getLeftValue(); if (!(expr.getArguments().get(0) instanceof VariableExpr)) { return false;
if (firstAssignment.getLeftValue() == null || secondAssignment.getRightValue() == null) { return null; if (!(firstAssignment.getLeftValue() instanceof VariableExpr) || !(secondAssignment.getLeftValue() instanceof VariableExpr)) { return null; VariableExpr firstLhs = (VariableExpr) firstAssignment.getLeftValue(); VariableExpr secondLhs = (VariableExpr) secondAssignment.getLeftValue(); if (firstLhs.getIndex() == secondLhs.getIndex()) { ConditionalExpr conditionalExpr = new ConditionalExpr();
return; if (!(assignment.getLeftValue() instanceof VariableExpr)) { return; VariableExpr var = (VariableExpr) assignment.getLeftValue(); if (friendlyToDebugger) { if (currentLocation != null && assignment.getLocation() != null
if (statement.getLeftValue() != null) { if (statement.isAsync()) { writer.append(context.tempVarName()); } else { precedence = Precedence.COMMA; statement.getLeftValue().acceptVisitor(this); if (statement.isAsync()) { emitSuspendChecker(); if (statement.getLeftValue() != null) { precedence = Precedence.COMMA; statement.getLeftValue().acceptVisitor(this); writer.ws().append("=").ws().append(context.tempVarName()).append(";").softNewLine();
@Override public void visit(AssignmentStatement statement) { Expr left = statement.getLeftValue(); if (left == null) { accept(statement.getRightValue()); result.acceptVisitor(typeInference); if (typeInference.getResult() != null) { result = new WasmDrop(result); result.setLocation(statement.getLocation()); } } else if (left instanceof VariableExpr) { VariableExpr varExpr = (VariableExpr) left; WasmLocal local = function.getLocalVariables().get(varExpr.getIndex() - firstVariable); accept(statement.getRightValue()); result = new WasmSetLocal(local, result); result.setLocation(statement.getLocation()); } else if (left instanceof QualificationExpr) { QualificationExpr lhs = (QualificationExpr) left; storeField(lhs.getQualified(), lhs.getField(), statement.getRightValue(), statement.getLocation()); } else if (left instanceof SubscriptExpr) { SubscriptExpr lhs = (SubscriptExpr) left; storeArrayItem(lhs, statement.getRightValue()); } else { throw new UnsupportedOperationException("This expression is not supported yet"); } }
@Override public void visit(AssignmentStatement statement) { if (statement.getLeftValue() != null) { statement.getLeftValue().acceptVisitor(this); } statement.getRightValue().acceptVisitor(this); }
@Override public void visit(AssignmentStatement statement) { try { output.writeByte(statement.getLeftValue() != null ? 0 : 1); writeLocation(statement.getLocation()); if (statement.getLeftValue() != null) { writeExpr(statement.getLeftValue()); } writeExpr(statement.getRightValue()); output.writeBoolean(statement.isAsync()); } catch (IOException e) { throw new IOExceptionWrapper(e); } }
@Override public void visit(AssignmentStatement statement) { pushLocation(statement.getLocation()); try { if (statement.getLeftValue() == null) { statement.getRightValue().acceptVisitor(this); if (resultExpr instanceof InvocationExpr && tryApplyConstructor((InvocationExpr) resultExpr)) { resultStmt = new SequentialStatement(); } else { statement.setRightValue(resultExpr); resultStmt = statement; } } else { statement.getRightValue().acceptVisitor(this); Expr right = resultExpr; Expr left = statement.getLeftValue(); if (!(statement.getLeftValue() instanceof VariableExpr)) { statement.getLeftValue().acceptVisitor(this); left = resultExpr; } statement.setLeftValue(left); statement.setRightValue(right); resultStmt = statement; } } finally { popLocation(); } }
if (!(assignment.getLeftValue() instanceof VariableExpr)) { return false; VariableExpr var = (VariableExpr) assignment.getLeftValue(); if (!(expr.getArguments().get(0) instanceof VariableExpr)) { return false;
return; if (!(assignment.getLeftValue() instanceof VariableExpr)) { return; VariableExpr var = (VariableExpr) assignment.getLeftValue(); if (friendlyToDebugger) { if (currentLocation != null && assignment.getLocation() != null
if (firstAssignment.getLeftValue() == null || secondAssignment.getRightValue() == null) { return null; if (!(firstAssignment.getLeftValue() instanceof VariableExpr) || !(secondAssignment.getLeftValue() instanceof VariableExpr)) { return null; VariableExpr firstLhs = (VariableExpr) firstAssignment.getLeftValue(); VariableExpr secondLhs = (VariableExpr) secondAssignment.getLeftValue(); if (firstLhs.getIndex() == secondLhs.getIndex()) { ConditionalExpr conditionalExpr = new ConditionalExpr();
if (statement.getLeftValue() != null) { if (statement.isAsync()) { writer.append(context.tempVarName()); } else { precedence = Precedence.COMMA; statement.getLeftValue().acceptVisitor(this); if (statement.isAsync()) { emitSuspendChecker(); if (statement.getLeftValue() != null) { precedence = Precedence.COMMA; statement.getLeftValue().acceptVisitor(this); writer.ws().append("=").ws().append(context.tempVarName()).append(";").softNewLine();
@Override public void visit(AssignmentStatement statement) { Expr left = statement.getLeftValue(); if (left == null) { accept(statement.getRightValue()); result.acceptVisitor(typeInference); if (typeInference.getResult() != null) { result = new WasmDrop(result); result.setLocation(statement.getLocation()); } } else if (left instanceof VariableExpr) { VariableExpr varExpr = (VariableExpr) left; WasmLocal local = function.getLocalVariables().get(varExpr.getIndex() - firstVariable); accept(statement.getRightValue()); result = new WasmSetLocal(local, result); result.setLocation(statement.getLocation()); } else if (left instanceof QualificationExpr) { QualificationExpr lhs = (QualificationExpr) left; storeField(lhs.getQualified(), lhs.getField(), statement.getRightValue(), statement.getLocation()); } else if (left instanceof SubscriptExpr) { SubscriptExpr lhs = (SubscriptExpr) left; storeArrayItem(lhs, statement.getRightValue()); } else { throw new UnsupportedOperationException("This expression is not supported yet"); } }