From 713fffa7aa0ac907e760d144e548d5d5fd1f3f4f Mon Sep 17 00:00:00 2001 From: Chris <Christopher.Happe@uni-duesseldorf.de> Date: Sat, 27 Feb 2021 10:48:33 +0100 Subject: [PATCH] Update spacing, wrong typing and prevent name shadowing --- benchmarks/Python_Primitives/CAN_BUS_tlc_exec.py | 5 ++--- .../main/python_magicstack_immutable/btypes/BInteger.py | 3 ++- .../stups/codegenerator/generators/MachineGenerator.java | 7 +++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/benchmarks/Python_Primitives/CAN_BUS_tlc_exec.py b/benchmarks/Python_Primitives/CAN_BUS_tlc_exec.py index 65589f2d0..58e89f0ea 100644 --- a/benchmarks/Python_Primitives/CAN_BUS_tlc_exec.py +++ b/benchmarks/Python_Primitives/CAN_BUS_tlc_exec.py @@ -3,7 +3,6 @@ from btypes.BInteger import BInteger from CAN_BUS_tlc import CAN_BUS_tlc - class CAN_BUS_tlc_exec: def __init__(self): @@ -4572,5 +4571,5 @@ class CAN_BUS_tlc_exec: if __name__ == '__main__': - exec = CAN_BUS_tlc_exec() - exec.simulate() + can_exec = CAN_BUS_tlc_exec() + can_exec.simulate() diff --git a/btypes_primitives/src/main/python_magicstack_immutable/btypes/BInteger.py b/btypes_primitives/src/main/python_magicstack_immutable/btypes/BInteger.py index f45245e1e..2170a6368 100644 --- a/btypes_primitives/src/main/python_magicstack_immutable/btypes/BInteger.py +++ b/btypes_primitives/src/main/python_magicstack_immutable/btypes/BInteger.py @@ -1,11 +1,12 @@ from btypes.BBoolean import * + class BInteger: def __init__(self, value): self.__value = value - def __add__(self, other: 'BInteger') -> 'BInteger': + def __add__(self, other): if type(other) == str: return str(self) + other return BInteger(self.__value + other.__value) diff --git a/src/main/java/de/hhu/stups/codegenerator/generators/MachineGenerator.java b/src/main/java/de/hhu/stups/codegenerator/generators/MachineGenerator.java index 35af4d8d3..efec3dc70 100644 --- a/src/main/java/de/hhu/stups/codegenerator/generators/MachineGenerator.java +++ b/src/main/java/de/hhu/stups/codegenerator/generators/MachineGenerator.java @@ -141,14 +141,13 @@ public class MachineGenerator implements AbstractVisitor<String, Void> { this.iterationConstructHandler = new IterationConstructHandler(currentGroup, this, nameHandler, typeGenerator, importGenerator); this.deferredSetAnalyzer = new DeferredSetAnalyzer(Integer.parseInt(deferredSetSize)); this.infiniteSetGenerator = new InfiniteSetGenerator(currentGroup, this, nameHandler); - - this.identifierGenerator = new IdentifierGenerator(currentGroup, this, nameHandler, parallelConstructHandler, declarationGenerator); + this.identifierGenerator = new IdentifierGenerator(currentGroup, this, nameHandler, parallelConstructHandler, declarationGenerator); this.recordStructGenerator = new RecordStructGenerator(currentGroup, this, typeGenerator, importGenerator, nameHandler); this.declarationGenerator = new DeclarationGenerator(currentGroup, this, typeGenerator, importGenerator, nameHandler, deferredSetAnalyzer); this.expressionGenerator = new ExpressionGenerator(currentGroup, this, useBigInteger, minint, maxint, nameHandler, importGenerator, declarationGenerator, identifierGenerator, typeGenerator, iterationConstructHandler, recordStructGenerator); - this.predicateGenerator = new PredicateGenerator(currentGroup, this, nameHandler, importGenerator, iterationConstructHandler, infiniteSetGenerator); - this.lambdaFunctionGenerator = new LambdaFunctionGenerator(currentGroup, expressionGenerator, predicateGenerator, typeGenerator, declarationGenerator); + this.predicateGenerator = new PredicateGenerator(currentGroup, this, nameHandler, importGenerator, iterationConstructHandler, infiniteSetGenerator); + this.lambdaFunctionGenerator = new LambdaFunctionGenerator(currentGroup, expressionGenerator, predicateGenerator, typeGenerator, declarationGenerator); this.recordStructAnalyzer = new RecordStructAnalyzer(recordStructGenerator); this.substitutionGenerator = new SubstitutionGenerator(currentGroup, this, nameHandler, typeGenerator, expressionGenerator, predicateGenerator, identifierGenerator, iterationConstructHandler, -- GitLab