Skip to content

Commit

Permalink
Expression fix and test case
Browse files Browse the repository at this point in the history
  • Loading branch information
jumanji144 committed Dec 10, 2022
1 parent da7b0f9 commit 7a2a9d5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public void visitInsn(int opcode) {

@Override
public void visitExpr(ExprGroup expr) throws AssemblerException {
throw new AssemblerException("Not implemented", expr.getStartLocation());
System.err.println("Expressions are not implemented");
}

@Override
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/me/darknet/assembler/parser/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ public Group group(ParserContext ctx) throws AssemblerException {
GroupType.LOOKUP_SWITCH,
GroupType.LABEL,
GroupType.CATCH,
GroupType.FRAME));
GroupType.FRAME,
GroupType.EXPR));
}
IdentifierGroup desc = ctx.explicitIdentifier();
next = ctx.peekTokenSilent();
Expand All @@ -234,7 +235,8 @@ public Group group(ParserContext ctx) throws AssemblerException {
GroupType.LOOKUP_SWITCH,
GroupType.LABEL,
GroupType.CATCH,
GroupType.FRAME));
GroupType.FRAME,
GroupType.EXPR));

}
IdentifierGroup paramName = ctx.explicitIdentifier();
Expand Down
5 changes: 5 additions & 0 deletions src/test/resources/features/Expressions.ja
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class public Expression extends java/lang/Object

method public static main ([Ljava/lang/String; args)V
expr System.out.println("Hello, World!"); end
end

0 comments on commit 7a2a9d5

Please sign in to comment.