# HG changeset patch # User Jan Vrany # Date 1414710183 0 # Node ID b5b7a6db033ba4351d44fcadbffe9ec91a61fd66 # Parent b3e47bab2de69c07c80a1101407771676a5126dc Fix in PPCMethod>>addVariable: make sure variable is added only once. Having two variables with the same name is forbidden. diff -r b3e47bab2de6 -r b5b7a6db033b compiler/PPCMethod.st --- 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 " ! 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 " ! ! +!PPCMethod class methodsFor:'documentation'! + +version_HG + + ^ '$Changeset: $' +! ! +