fix boolean and char
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
This commit is contained in:
parent
e395c4d96b
commit
cabea90760
@ -1,6 +1,8 @@
|
|||||||
package ast.literal;
|
package ast.literal;
|
||||||
|
|
||||||
public class BooleanLiteralNode {
|
import ast.ASTNode;
|
||||||
|
|
||||||
|
public class BooleanLiteralNode implements ASTNode {
|
||||||
private String value;
|
private String value;
|
||||||
|
|
||||||
public BooleanLiteralNode(String value) {this.value = value;}
|
public BooleanLiteralNode(String value) {this.value = value;}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package ast.literal;
|
package ast.literal;
|
||||||
|
|
||||||
public class CharLiteralNode {
|
import ast.ASTNode;
|
||||||
|
|
||||||
|
public class CharLiteralNode implements ASTNode {
|
||||||
public String value;
|
public String value;
|
||||||
|
|
||||||
public CharLiteralNode(String value) {this.value = value;}
|
public CharLiteralNode(String value) {this.value = value;}
|
||||||
|
@ -252,11 +252,11 @@ public class ASTBuilder extends SimpleJavaBaseVisitor<ASTNode> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ASTNode visitBooleanLiteral(SimpleJavaParser.BooleanLiteralContext ctx) {
|
public ASTNode visitBooleanLiteral(SimpleJavaParser.BooleanLiteralContext ctx) {
|
||||||
return (ASTNode) new BooleanLiteralNode(ctx.getText());
|
return new BooleanLiteralNode(ctx.getText());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ASTNode visitCharLiteral(SimpleJavaParser.CharLiteralContext ctx) {
|
public ASTNode visitCharLiteral(SimpleJavaParser.CharLiteralContext ctx) {
|
||||||
return (ASTNode) new CharLiteralNode(ctx.getText());
|
return new CharLiteralNode(ctx.getText());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,13 @@ public class Example {
|
|||||||
|
|
||||||
public static int testMethod(char x){
|
public static int testMethod(char x){
|
||||||
|
|
||||||
a = 12;
|
boolean test = true;
|
||||||
|
|
||||||
a = x;
|
test = false;
|
||||||
|
|
||||||
|
test.adf.ee = 1;
|
||||||
|
|
||||||
|
Test test = new Test();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user