Skip to content

Commit

Permalink
Mark ArrayLiteralNode with NewArray tag
Browse files Browse the repository at this point in the history
- also update dym test data

Signed-off-by: Stefan Marr <git@stefan-marr.de>
  • Loading branch information
smarr committed Jul 22, 2017
1 parent 18576e4 commit 0ab4555
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/som/interpreter/nodes/literals/ArrayLiteralNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import som.vm.constants.Classes;
import som.vmobjects.SArray;
import som.vmobjects.SArray.SMutableArray;
import tools.dym.Tags.NewArray;

public abstract class ArrayLiteralNode extends LiteralNode {
public static ArrayLiteralNode create(final ExpressionNode[] exprs, final SourceSection source) {
Expand All @@ -22,6 +23,15 @@ protected ArrayLiteralNode(final ExpressionNode[] expressions, final SourceSecti
this.expressions = expressions;
}

@Override
protected boolean isTaggedWith(final Class<?> tag) {
if (tag == NewArray.class) {
return true;
} else {
return super.isTaggedWith(tag);
}
}

private static final class Uninit extends ArrayLiteralNode {
private Uninit(final ExpressionNode[] expressions, final SourceSection source) {
super(expressions, source);
Expand Down
Binary file modified tests/dym/expected-results.tar.bz2
Binary file not shown.

0 comments on commit 0ab4555

Please sign in to comment.