28
28
import java .util .ArrayList ;
29
29
import java .util .Collection ;
30
30
import java .util .HashSet ;
31
- import java .util .LinkedHashSet ;
32
31
import java .util .List ;
33
32
import java .util .Set ;
33
+ import java .util .TreeSet ;
34
34
35
35
import com .oracle .graal .python .nodes .expression .ExpressionNode ;
36
36
import com .oracle .graal .python .nodes .function .FunctionDefinitionNode .KwDefaultExpressionNode ;
@@ -69,9 +69,9 @@ public enum ScopeKind {
69
69
* Symbols which are local variables but are closed over in nested scopes
70
70
*/
71
71
// variables that are referenced in enclosed contexts
72
- private LinkedHashSet <String > cellVars ;
72
+ private TreeSet <String > cellVars ;
73
73
// variables that are referenced from enclosing contexts
74
- private LinkedHashSet <String > freeVars ;
74
+ private TreeSet <String > freeVars ;
75
75
76
76
/**
77
77
* An optional field that stores translated nodes of default argument values.
@@ -174,7 +174,7 @@ public void addCellVar(String identifier) {
174
174
175
175
public void addCellVar (String identifier , boolean createFrameSlot ) {
176
176
if (cellVars == null ) {
177
- cellVars = new LinkedHashSet <>();
177
+ cellVars = new TreeSet <>();
178
178
}
179
179
cellVars .add (identifier );
180
180
if (createFrameSlot ) {
@@ -188,7 +188,7 @@ public void addFreeVar(String identifier) {
188
188
189
189
protected void addFreeVar (String identifier , boolean createFrameSlot ) {
190
190
if (freeVars == null ) {
191
- freeVars = new LinkedHashSet <>();
191
+ freeVars = new TreeSet <>();
192
192
}
193
193
freeVars .add (identifier );
194
194
if (createFrameSlot ) {
0 commit comments