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>
|
<version>3.1.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<argLine>--enable-preview</argLine>
|
<argLine>--enable-preview</argLine>
|
||||||
|
<excludes>
|
||||||
|
<exclude>**/JavaTXCompilerTest.java</exclude>
|
||||||
|
</excludes>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
@ -475,7 +475,7 @@ blockStatement
|
|||||||
;
|
;
|
||||||
|
|
||||||
localVariableDeclaration
|
localVariableDeclaration
|
||||||
: variableModifier* (VAR identifier '=' expression | typeType variableDeclarators)
|
: variableModifier* (VAR | typeType) variableDeclarators
|
||||||
;
|
;
|
||||||
|
|
||||||
identifier
|
identifier
|
||||||
|
@ -380,16 +380,8 @@ public class StatementGenerator {
|
|||||||
} else {
|
} else {
|
||||||
type = TypeGenerator.convert(declaration.typeType(), reg, generics);
|
type = TypeGenerator.convert(declaration.typeType(), reg, generics);
|
||||||
}
|
}
|
||||||
if (Objects.isNull(declaration.variableDeclarators())) {
|
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 {
|
|
||||||
ret.addAll(generateLocalVariableAssignments(declaration.variableDeclarators().variableDeclarator(), type));
|
ret.addAll(generateLocalVariableAssignments(declaration.variableDeclarators().variableDeclarator(), type));
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user