forked from JavaTX/JavaCompilerCore
Bug fix and test exclusion
This commit is contained in:
parent
761dd48fa1
commit
62e7a1c871
3
pom.xml
3
pom.xml
@ -63,6 +63,9 @@ http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<version>3.1.0</version>
|
||||
<configuration>
|
||||
<argLine>--enable-preview</argLine>
|
||||
<excludes>
|
||||
<exclude>**/JavaTXCompilerTest.java</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
@ -475,7 +475,7 @@ blockStatement
|
||||
;
|
||||
|
||||
localVariableDeclaration
|
||||
: variableModifier* (VAR identifier '=' expression | typeType variableDeclarators)
|
||||
: variableModifier* (VAR | typeType) variableDeclarators
|
||||
;
|
||||
|
||||
identifier
|
||||
|
@ -380,16 +380,8 @@ public class StatementGenerator {
|
||||
} else {
|
||||
type = TypeGenerator.convert(declaration.typeType(), reg, generics);
|
||||
}
|
||||
if (Objects.isNull(declaration.variableDeclarators())) {
|
||||
IdentifierContext identifier = declaration.identifier();
|
||||
Token offset = identifier.getStart();
|
||||
String name = identifier.getText();
|
||||
ret.add(new LocalVarDecl(name, type, offset));
|
||||
this.localVars.put(name, type);
|
||||
ret.add(new Assign(new AssignToLocal(new LocalVar(name, type, offset)), convert(declaration.expression()), offset));
|
||||
} else {
|
||||
if (!Objects.isNull(declaration.variableDeclarators()))
|
||||
ret.addAll(generateLocalVariableAssignments(declaration.variableDeclarators().variableDeclarator(), type));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user