@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); } }
if (currentLocation != null && assignment.getLocation() != null && !assignment.getLocation().equals(currentLocation)) { return; assignment.getRightValue().setLocation(assignment.getLocation()); assignment.getRightValue().acceptVisitor(this);
@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"); } }
try { debugEmitter.emitStatementStart(); if (statement.getLocation() != null) { pushLocation(statement.getLocation()); if (statement.getLocation() != null) { popLocation();
@Override public void visit(AssignmentStatement statement) { pushLocation(statement.getLocation()); try { if (statement.getLeftValue() == null) {
if (currentLocation != null && assignment.getLocation() != null && !assignment.getLocation().equals(currentLocation)) { return; assignment.getRightValue().setLocation(assignment.getLocation()); assignment.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) { 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"); } }
try { debugEmitter.emitStatementStart(); if (statement.getLocation() != null) { pushLocation(statement.getLocation()); if (statement.getLocation() != null) { popLocation();
@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(); } }