fix boolean and char
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled

This commit is contained in:
Bruder John 2024-05-31 11:39:48 +02:00
parent e395c4d96b
commit cabea90760
4 changed files with 14 additions and 6 deletions

View File

@ -1,6 +1,8 @@
package ast.literal;
public class BooleanLiteralNode {
import ast.ASTNode;
public class BooleanLiteralNode implements ASTNode {
private String value;
public BooleanLiteralNode(String value) {this.value = value;}

View File

@ -1,6 +1,8 @@
package ast.literal;
public class CharLiteralNode {
import ast.ASTNode;
public class CharLiteralNode implements ASTNode {
public String value;
public CharLiteralNode(String value) {this.value = value;}

View File

@ -252,11 +252,11 @@ public class ASTBuilder extends SimpleJavaBaseVisitor<ASTNode> {
@Override
public ASTNode visitBooleanLiteral(SimpleJavaParser.BooleanLiteralContext ctx) {
return (ASTNode) new BooleanLiteralNode(ctx.getText());
return new BooleanLiteralNode(ctx.getText());
}
@Override
public ASTNode visitCharLiteral(SimpleJavaParser.CharLiteralContext ctx) {
return (ASTNode) new CharLiteralNode(ctx.getText());
return new CharLiteralNode(ctx.getText());
}
}

View File

@ -4,9 +4,13 @@ public class Example {
public static int testMethod(char x){
a = 12;
boolean test = true;
a = x;
test = false;
test.adf.ee = 1;
Test test = new Test();
}