Fix in PPCMethod>>addVariable: make sure variable is added only once.
Having two variables with the same name is forbidden.
--- a/compiler/PPCMethod.st Thu Oct 30 23:01:54 2014 +0000
+++ b/compiler/PPCMethod.st Thu Oct 30 23:03:03 2014 +0000
@@ -7,6 +7,7 @@
category:'PetitCompiler-Core'
!
+
!PPCMethod class methodsFor:'instance creation'!
new
@@ -28,7 +29,9 @@
!
addVariable: name
- variables add: name.
+ (variables includes: name) ifFalse:[ variables add: name ].
+
+ "Modified: / 30-10-2014 / 23:00:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
allowInline
@@ -108,9 +111,18 @@
!PPCMethod methodsFor:'initialization'!
initialize
- buffer := WriteStream on: ''.
- indentation := 1.
- variables := OrderedCollection new.
- canInline := false
+ buffer := WriteStream on: ''.
+ indentation := 1.
+ variables := OrderedCollection new.
+ canInline := false
+
+ "Modified: / 30-10-2014 / 22:59:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
+!PPCMethod class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+