|
@@ -30,12 +30,12 @@ var self=this;
|
|
|
function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
var $1;
|
|
|
-$1=_st(_st($Smalltalk())._current())._parse_(aString);
|
|
|
+$1=_st($Smalltalk())._parse_(aString);
|
|
|
return $1;
|
|
|
}, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString},smalltalk.ASTParsingTest)})},
|
|
|
args: ["aString"],
|
|
|
-source: "parse: aString\x0a\x09^ Smalltalk current parse: aString",
|
|
|
-messageSends: ["parse:", "current"],
|
|
|
+source: "parse: aString\x0a\x09^ Smalltalk parse: aString",
|
|
|
+messageSends: ["parse:"],
|
|
|
referencedClasses: ["Smalltalk"]
|
|
|
}),
|
|
|
smalltalk.ASTParsingTest);
|
|
@@ -787,13 +787,13 @@ fn: function (){
|
|
|
var self=this;
|
|
|
function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
-self._should_return_("foo ^Object",_st(_st($Smalltalk())._current())._at_("Object"));
|
|
|
+self._should_return_("foo ^Object",_st(_st($Smalltalk())._globals())._at_("Object"));
|
|
|
$ctx1.sendIdx["should:return:"]=1;
|
|
|
self._should_return_("foo ^NonExistent",nil);
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testPascalCaseGlobal",{},smalltalk.CodeGeneratorTest)})},
|
|
|
args: [],
|
|
|
-source: "testPascalCaseGlobal\x0a\x09self should: 'foo ^Object' return: (Smalltalk current at: 'Object').\x0a\x09self should: 'foo ^NonExistent' return: nil",
|
|
|
-messageSends: ["should:return:", "at:", "current"],
|
|
|
+source: "testPascalCaseGlobal\x0a\x09self should: 'foo ^Object' return: (Smalltalk globals at: 'Object').\x0a\x09self should: 'foo ^NonExistent' return: nil",
|
|
|
+messageSends: ["should:return:", "at:", "globals"],
|
|
|
referencedClasses: ["Smalltalk"]
|
|
|
}),
|
|
|
smalltalk.CodeGeneratorTest);
|
|
@@ -1142,12 +1142,12 @@ var self=this;
|
|
|
function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
var $1;
|
|
|
-$1=_st(_st($Smalltalk())._current())._parse_(aString);
|
|
|
+$1=_st($Smalltalk())._parse_(aString);
|
|
|
return $1;
|
|
|
}, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString},smalltalk.InterpreterTest)})},
|
|
|
args: ["aString"],
|
|
|
-source: "parse: aString\x0a\x09^ Smalltalk current parse: aString",
|
|
|
-messageSends: ["parse:", "current"],
|
|
|
+source: "parse: aString\x0a\x09^ Smalltalk parse: aString",
|
|
|
+messageSends: ["parse:"],
|
|
|
referencedClasses: ["Smalltalk"]
|
|
|
}),
|
|
|
smalltalk.InterpreterTest);
|
|
@@ -1381,15 +1381,15 @@ function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"
|
|
|
function $InvalidAssignmentError(){return smalltalk.InvalidAssignmentError||(typeof InvalidAssignmentError=="undefined"?nil:InvalidAssignmentError)}
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
src="foo self := 1";
|
|
|
-ast=_st(_st($Smalltalk())._current())._parse_(src);
|
|
|
+ast=_st($Smalltalk())._parse_(src);
|
|
|
self._should_raise_((function(){
|
|
|
return smalltalk.withContext(function($ctx2) {
|
|
|
return _st(self["@analyzer"])._visit_(ast);
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),$InvalidAssignmentError());
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testAssignment",{src:src,ast:ast},smalltalk.SemanticAnalyzerTest)})},
|
|
|
args: [],
|
|
|
-source: "testAssignment\x0a\x09| src ast |\x0a\x0a\x09src := 'foo self := 1'.\x0a\x09ast := Smalltalk current parse: src.\x0a\x09self should: [analyzer visit: ast] raise: InvalidAssignmentError",
|
|
|
-messageSends: ["parse:", "current", "should:raise:", "visit:"],
|
|
|
+source: "testAssignment\x0a\x09| src ast |\x0a\x0a\x09src := 'foo self := 1'.\x0a\x09ast := Smalltalk parse: src.\x0a\x09self should: [analyzer visit: ast] raise: InvalidAssignmentError",
|
|
|
+messageSends: ["parse:", "should:raise:", "visit:"],
|
|
|
referencedClasses: ["Smalltalk", "InvalidAssignmentError"]
|
|
|
}),
|
|
|
smalltalk.SemanticAnalyzerTest);
|
|
@@ -1404,13 +1404,13 @@ var src,ast;
|
|
|
function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
src="foo | a | a + 1. ^ a";
|
|
|
-ast=_st(_st($Smalltalk())._current())._parse_(src);
|
|
|
+ast=_st($Smalltalk())._parse_(src);
|
|
|
_st(self["@analyzer"])._visit_(ast);
|
|
|
self._deny_(_st(_st(ast)._scope())._hasNonLocalReturn());
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testNonLocalReturn",{src:src,ast:ast},smalltalk.SemanticAnalyzerTest)})},
|
|
|
args: [],
|
|
|
-source: "testNonLocalReturn\x0a\x09| src ast |\x0a\x0a\x09src := 'foo | a | a + 1. ^ a'.\x0a\x09ast := Smalltalk current parse: src.\x0a\x09analyzer visit: ast.\x0a\x0a\x09self deny: ast scope hasNonLocalReturn",
|
|
|
-messageSends: ["parse:", "current", "visit:", "deny:", "hasNonLocalReturn", "scope"],
|
|
|
+source: "testNonLocalReturn\x0a\x09| src ast |\x0a\x0a\x09src := 'foo | a | a + 1. ^ a'.\x0a\x09ast := Smalltalk parse: src.\x0a\x09analyzer visit: ast.\x0a\x0a\x09self deny: ast scope hasNonLocalReturn",
|
|
|
+messageSends: ["parse:", "visit:", "deny:", "hasNonLocalReturn", "scope"],
|
|
|
referencedClasses: ["Smalltalk"]
|
|
|
}),
|
|
|
smalltalk.SemanticAnalyzerTest);
|
|
@@ -1425,13 +1425,13 @@ var src,ast;
|
|
|
function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
src="foo | a | a + 1. [ [ ^ a] ]";
|
|
|
-ast=_st(_st($Smalltalk())._current())._parse_(src);
|
|
|
+ast=_st($Smalltalk())._parse_(src);
|
|
|
_st(self["@analyzer"])._visit_(ast);
|
|
|
self._assert_(_st(_st(ast)._scope())._hasNonLocalReturn());
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testNonLocalReturn2",{src:src,ast:ast},smalltalk.SemanticAnalyzerTest)})},
|
|
|
args: [],
|
|
|
-source: "testNonLocalReturn2\x0a\x09| src ast |\x0a\x0a\x09src := 'foo | a | a + 1. [ [ ^ a] ]'.\x0a\x09ast := Smalltalk current parse: src.\x0a\x09analyzer visit: ast.\x0a\x0a\x09self assert: ast scope hasNonLocalReturn",
|
|
|
-messageSends: ["parse:", "current", "visit:", "assert:", "hasNonLocalReturn", "scope"],
|
|
|
+source: "testNonLocalReturn2\x0a\x09| src ast |\x0a\x0a\x09src := 'foo | a | a + 1. [ [ ^ a] ]'.\x0a\x09ast := Smalltalk parse: src.\x0a\x09analyzer visit: ast.\x0a\x0a\x09self assert: ast scope hasNonLocalReturn",
|
|
|
+messageSends: ["parse:", "visit:", "assert:", "hasNonLocalReturn", "scope"],
|
|
|
referencedClasses: ["Smalltalk"]
|
|
|
}),
|
|
|
smalltalk.SemanticAnalyzerTest);
|
|
@@ -1447,7 +1447,7 @@ function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
var $4,$3,$2,$1;
|
|
|
src="foo | a | a + 1. [ | b | b := a ]";
|
|
|
-ast=_st(_st($Smalltalk())._current())._parse_(src);
|
|
|
+ast=_st($Smalltalk())._parse_(src);
|
|
|
_st(self["@analyzer"])._visit_(ast);
|
|
|
$4=_st(_st(_st(ast)._nodes())._first())._nodes();
|
|
|
$ctx1.sendIdx["nodes"]=1;
|
|
@@ -1458,8 +1458,8 @@ $1=_st($2).__eq_eq(_st(ast)._scope());
|
|
|
self._deny_($1);
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testScope",{src:src,ast:ast},smalltalk.SemanticAnalyzerTest)})},
|
|
|
args: [],
|
|
|
-source: "testScope\x0a\x09| src ast |\x0a\x0a\x09src := 'foo | a | a + 1. [ | b | b := a ]'.\x0a\x09ast := Smalltalk current parse: src.\x0a\x09analyzer visit: ast.\x0a\x0a\x09self deny: ast nodes first nodes last scope == ast scope.",
|
|
|
-messageSends: ["parse:", "current", "visit:", "deny:", "==", "scope", "last", "nodes", "first"],
|
|
|
+source: "testScope\x0a\x09| src ast |\x0a\x0a\x09src := 'foo | a | a + 1. [ | b | b := a ]'.\x0a\x09ast := Smalltalk parse: src.\x0a\x09analyzer visit: ast.\x0a\x0a\x09self deny: ast nodes first nodes last scope == ast scope.",
|
|
|
+messageSends: ["parse:", "visit:", "deny:", "==", "scope", "last", "nodes", "first"],
|
|
|
referencedClasses: ["Smalltalk"]
|
|
|
}),
|
|
|
smalltalk.SemanticAnalyzerTest);
|
|
@@ -1475,7 +1475,7 @@ function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
var $8,$7,$6,$5,$4,$3,$2,$1;
|
|
|
src="foo | a | a + 1. [ [ | b | b := a ] ]";
|
|
|
-ast=_st(_st($Smalltalk())._current())._parse_(src);
|
|
|
+ast=_st($Smalltalk())._parse_(src);
|
|
|
_st(self["@analyzer"])._visit_(ast);
|
|
|
$8=_st(_st(_st(ast)._nodes())._first())._nodes();
|
|
|
$ctx1.sendIdx["nodes"]=3;
|
|
@@ -1494,8 +1494,8 @@ $1=_st($2).__eq_eq(_st(ast)._scope());
|
|
|
self._deny_($1);
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testScope2",{src:src,ast:ast},smalltalk.SemanticAnalyzerTest)})},
|
|
|
args: [],
|
|
|
-source: "testScope2\x0a\x09| src ast |\x0a\x0a\x09src := 'foo | a | a + 1. [ [ | b | b := a ] ]'.\x0a\x09ast := Smalltalk current parse: src.\x0a\x09analyzer visit: ast.\x0a\x0a\x09self deny: ast nodes first nodes last nodes first nodes first scope == ast scope.",
|
|
|
-messageSends: ["parse:", "current", "visit:", "deny:", "==", "scope", "first", "nodes", "last"],
|
|
|
+source: "testScope2\x0a\x09| src ast |\x0a\x0a\x09src := 'foo | a | a + 1. [ [ | b | b := a ] ]'.\x0a\x09ast := Smalltalk parse: src.\x0a\x09analyzer visit: ast.\x0a\x0a\x09self deny: ast nodes first nodes last nodes first nodes first scope == ast scope.",
|
|
|
+messageSends: ["parse:", "visit:", "deny:", "==", "scope", "first", "nodes", "last"],
|
|
|
referencedClasses: ["Smalltalk"]
|
|
|
}),
|
|
|
smalltalk.SemanticAnalyzerTest);
|
|
@@ -1511,7 +1511,7 @@ function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
var $2,$1,$10,$9,$8,$7,$6,$5,$4,$3;
|
|
|
src="foo | a | a + 1. [ [ | b | b := a ] ]";
|
|
|
-ast=_st(_st($Smalltalk())._current())._parse_(src);
|
|
|
+ast=_st($Smalltalk())._parse_(src);
|
|
|
_st(self["@analyzer"])._visit_(ast);
|
|
|
$2=_st(ast)._scope();
|
|
|
$ctx1.sendIdx["scope"]=1;
|
|
@@ -1535,8 +1535,8 @@ $3=_st($4)._scopeLevel();
|
|
|
self._assert_equals_($3,(3));
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testScopeLevel",{src:src,ast:ast},smalltalk.SemanticAnalyzerTest)})},
|
|
|
args: [],
|
|
|
-source: "testScopeLevel\x0a\x09| src ast |\x0a\x0a\x09src := 'foo | a | a + 1. [ [ | b | b := a ] ]'.\x0a\x09ast := Smalltalk current parse: src.\x0a\x09analyzer visit: ast.\x0a\x0a\x09self assert: ast scope scopeLevel equals: 1.\x0a\x09self assert: ast nodes first nodes last nodes first nodes first scope scopeLevel equals: 3",
|
|
|
-messageSends: ["parse:", "current", "visit:", "assert:equals:", "scopeLevel", "scope", "first", "nodes", "last"],
|
|
|
+source: "testScopeLevel\x0a\x09| src ast |\x0a\x0a\x09src := 'foo | a | a + 1. [ [ | b | b := a ] ]'.\x0a\x09ast := Smalltalk parse: src.\x0a\x09analyzer visit: ast.\x0a\x0a\x09self assert: ast scope scopeLevel equals: 1.\x0a\x09self assert: ast nodes first nodes last nodes first nodes first scope scopeLevel equals: 3",
|
|
|
+messageSends: ["parse:", "visit:", "assert:equals:", "scopeLevel", "scope", "first", "nodes", "last"],
|
|
|
referencedClasses: ["Smalltalk"]
|
|
|
}),
|
|
|
smalltalk.SemanticAnalyzerTest);
|
|
@@ -1552,15 +1552,15 @@ function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"
|
|
|
function $UnknownVariableError(){return smalltalk.UnknownVariableError||(typeof UnknownVariableError=="undefined"?nil:UnknownVariableError)}
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
src="foo | a | b + a";
|
|
|
-ast=_st(_st($Smalltalk())._current())._parse_(src);
|
|
|
+ast=_st($Smalltalk())._parse_(src);
|
|
|
self._should_raise_((function(){
|
|
|
return smalltalk.withContext(function($ctx2) {
|
|
|
return _st(self["@analyzer"])._visit_(ast);
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),$UnknownVariableError());
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testUnknownVariables",{src:src,ast:ast},smalltalk.SemanticAnalyzerTest)})},
|
|
|
args: [],
|
|
|
-source: "testUnknownVariables\x0a\x09| src ast |\x0a\x0a\x09src := 'foo | a | b + a'.\x0a\x09ast := Smalltalk current parse: src.\x0a\x0a\x09self should: [ analyzer visit: ast ] raise: UnknownVariableError",
|
|
|
-messageSends: ["parse:", "current", "should:raise:", "visit:"],
|
|
|
+source: "testUnknownVariables\x0a\x09| src ast |\x0a\x0a\x09src := 'foo | a | b + a'.\x0a\x09ast := Smalltalk parse: src.\x0a\x0a\x09self should: [ analyzer visit: ast ] raise: UnknownVariableError",
|
|
|
+messageSends: ["parse:", "should:raise:", "visit:"],
|
|
|
referencedClasses: ["Smalltalk", "UnknownVariableError"]
|
|
|
}),
|
|
|
smalltalk.SemanticAnalyzerTest);
|
|
@@ -1576,15 +1576,15 @@ function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"
|
|
|
function $UnknownVariableError(){return smalltalk.UnknownVariableError||(typeof UnknownVariableError=="undefined"?nil:UnknownVariableError)}
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
src="foo | a b | [ c + 1. [ a + 1. d + 1 ]]";
|
|
|
-ast=_st(_st($Smalltalk())._current())._parse_(src);
|
|
|
+ast=_st($Smalltalk())._parse_(src);
|
|
|
self._should_raise_((function(){
|
|
|
return smalltalk.withContext(function($ctx2) {
|
|
|
return _st(self["@analyzer"])._visit_(ast);
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),$UnknownVariableError());
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testUnknownVariablesWithScope",{src:src,ast:ast},smalltalk.SemanticAnalyzerTest)})},
|
|
|
args: [],
|
|
|
-source: "testUnknownVariablesWithScope\x0a\x09| src ast |\x0a\x0a\x09src := 'foo | a b | [ c + 1. [ a + 1. d + 1 ]]'.\x0a\x09ast := Smalltalk current parse: src.\x0a\x09\x0a\x09self should: [ analyzer visit: ast ] raise: UnknownVariableError",
|
|
|
-messageSends: ["parse:", "current", "should:raise:", "visit:"],
|
|
|
+source: "testUnknownVariablesWithScope\x0a\x09| src ast |\x0a\x0a\x09src := 'foo | a b | [ c + 1. [ a + 1. d + 1 ]]'.\x0a\x09ast := Smalltalk parse: src.\x0a\x09\x0a\x09self should: [ analyzer visit: ast ] raise: UnknownVariableError",
|
|
|
+messageSends: ["parse:", "should:raise:", "visit:"],
|
|
|
referencedClasses: ["Smalltalk", "UnknownVariableError"]
|
|
|
}),
|
|
|
smalltalk.SemanticAnalyzerTest);
|
|
@@ -1599,12 +1599,12 @@ var src,ast;
|
|
|
function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
src="foo | a | a + 1";
|
|
|
-ast=_st(_st($Smalltalk())._current())._parse_(src);
|
|
|
+ast=_st($Smalltalk())._parse_(src);
|
|
|
_st(self["@analyzer"])._visit_(ast);
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testVariableShadowing",{src:src,ast:ast},smalltalk.SemanticAnalyzerTest)})},
|
|
|
args: [],
|
|
|
-source: "testVariableShadowing\x0a\x09| src ast |\x0a\x09src := 'foo | a | a + 1'.\x0a\x09ast := Smalltalk current parse: src.\x0a\x09analyzer visit: ast",
|
|
|
-messageSends: ["parse:", "current", "visit:"],
|
|
|
+source: "testVariableShadowing\x0a\x09| src ast |\x0a\x09src := 'foo | a | a + 1'.\x0a\x09ast := Smalltalk parse: src.\x0a\x09analyzer visit: ast",
|
|
|
+messageSends: ["parse:", "visit:"],
|
|
|
referencedClasses: ["Smalltalk"]
|
|
|
}),
|
|
|
smalltalk.SemanticAnalyzerTest);
|
|
@@ -1620,15 +1620,15 @@ function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"
|
|
|
function $ShadowingVariableError(){return smalltalk.ShadowingVariableError||(typeof ShadowingVariableError=="undefined"?nil:ShadowingVariableError)}
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
src="foo | a | a + 1. [ | a | a := 2 ]";
|
|
|
-ast=_st(_st($Smalltalk())._current())._parse_(src);
|
|
|
+ast=_st($Smalltalk())._parse_(src);
|
|
|
self._should_raise_((function(){
|
|
|
return smalltalk.withContext(function($ctx2) {
|
|
|
return _st(self["@analyzer"])._visit_(ast);
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),$ShadowingVariableError());
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testVariableShadowing2",{src:src,ast:ast},smalltalk.SemanticAnalyzerTest)})},
|
|
|
args: [],
|
|
|
-source: "testVariableShadowing2\x0a\x09| src ast |\x0a\x09src := 'foo | a | a + 1. [ | a | a := 2 ]'.\x0a\x09ast := Smalltalk current parse: src.\x0a\x09self should: [analyzer visit: ast] raise: ShadowingVariableError",
|
|
|
-messageSends: ["parse:", "current", "should:raise:", "visit:"],
|
|
|
+source: "testVariableShadowing2\x0a\x09| src ast |\x0a\x09src := 'foo | a | a + 1. [ | a | a := 2 ]'.\x0a\x09ast := Smalltalk parse: src.\x0a\x09self should: [analyzer visit: ast] raise: ShadowingVariableError",
|
|
|
+messageSends: ["parse:", "should:raise:", "visit:"],
|
|
|
referencedClasses: ["Smalltalk", "ShadowingVariableError"]
|
|
|
}),
|
|
|
smalltalk.SemanticAnalyzerTest);
|
|
@@ -1643,12 +1643,12 @@ var src,ast;
|
|
|
function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
src="foo | a | a + 1. [ | b | b := 2 ]";
|
|
|
-ast=_st(_st($Smalltalk())._current())._parse_(src);
|
|
|
+ast=_st($Smalltalk())._parse_(src);
|
|
|
_st(self["@analyzer"])._visit_(ast);
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testVariableShadowing3",{src:src,ast:ast},smalltalk.SemanticAnalyzerTest)})},
|
|
|
args: [],
|
|
|
-source: "testVariableShadowing3\x0a\x09| src ast |\x0a\x09src := 'foo | a | a + 1. [ | b | b := 2 ]'.\x0a\x09ast := Smalltalk current parse: src.\x0a\x09analyzer visit: ast",
|
|
|
-messageSends: ["parse:", "current", "visit:"],
|
|
|
+source: "testVariableShadowing3\x0a\x09| src ast |\x0a\x09src := 'foo | a | a + 1. [ | b | b := 2 ]'.\x0a\x09ast := Smalltalk parse: src.\x0a\x09analyzer visit: ast",
|
|
|
+messageSends: ["parse:", "visit:"],
|
|
|
referencedClasses: ["Smalltalk"]
|
|
|
}),
|
|
|
smalltalk.SemanticAnalyzerTest);
|
|
@@ -1663,12 +1663,12 @@ var src,ast;
|
|
|
function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
src="foo | a | a + 1. [ [ [ | b | b := 2 ] ] ]";
|
|
|
-ast=_st(_st($Smalltalk())._current())._parse_(src);
|
|
|
+ast=_st($Smalltalk())._parse_(src);
|
|
|
_st(self["@analyzer"])._visit_(ast);
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testVariableShadowing4",{src:src,ast:ast},smalltalk.SemanticAnalyzerTest)})},
|
|
|
args: [],
|
|
|
-source: "testVariableShadowing4\x0a\x09| src ast |\x0a\x09src := 'foo | a | a + 1. [ [ [ | b | b := 2 ] ] ]'.\x0a\x09ast := Smalltalk current parse: src.\x0a\x09analyzer visit: ast",
|
|
|
-messageSends: ["parse:", "current", "visit:"],
|
|
|
+source: "testVariableShadowing4\x0a\x09| src ast |\x0a\x09src := 'foo | a | a + 1. [ [ [ | b | b := 2 ] ] ]'.\x0a\x09ast := Smalltalk parse: src.\x0a\x09analyzer visit: ast",
|
|
|
+messageSends: ["parse:", "visit:"],
|
|
|
referencedClasses: ["Smalltalk"]
|
|
|
}),
|
|
|
smalltalk.SemanticAnalyzerTest);
|
|
@@ -1684,15 +1684,15 @@ function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"
|
|
|
function $ShadowingVariableError(){return smalltalk.ShadowingVariableError||(typeof ShadowingVariableError=="undefined"?nil:ShadowingVariableError)}
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
src="foo | a | a + 1. [ [ [ | a | a := 2 ] ] ]";
|
|
|
-ast=_st(_st($Smalltalk())._current())._parse_(src);
|
|
|
+ast=_st($Smalltalk())._parse_(src);
|
|
|
self._should_raise_((function(){
|
|
|
return smalltalk.withContext(function($ctx2) {
|
|
|
return _st(self["@analyzer"])._visit_(ast);
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),$ShadowingVariableError());
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testVariableShadowing5",{src:src,ast:ast},smalltalk.SemanticAnalyzerTest)})},
|
|
|
args: [],
|
|
|
-source: "testVariableShadowing5\x0a\x09| src ast |\x0a\x09src := 'foo | a | a + 1. [ [ [ | a | a := 2 ] ] ]'.\x0a\x09ast := Smalltalk current parse: src.\x0a\x09self should: [analyzer visit: ast] raise: ShadowingVariableError",
|
|
|
-messageSends: ["parse:", "current", "should:raise:", "visit:"],
|
|
|
+source: "testVariableShadowing5\x0a\x09| src ast |\x0a\x09src := 'foo | a | a + 1. [ [ [ | a | a := 2 ] ] ]'.\x0a\x09ast := Smalltalk parse: src.\x0a\x09self should: [analyzer visit: ast] raise: ShadowingVariableError",
|
|
|
+messageSends: ["parse:", "should:raise:", "visit:"],
|
|
|
referencedClasses: ["Smalltalk", "ShadowingVariableError"]
|
|
|
}),
|
|
|
smalltalk.SemanticAnalyzerTest);
|
|
@@ -1708,7 +1708,7 @@ function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
var $7,$6,$5,$4,$3,$2,$1,$15,$14,$13,$12,$11,$10,$9,$16,$8,$27,$26,$25,$24,$23,$22,$21,$20,$19,$18,$17,$39,$38,$37,$36,$35,$34,$33,$32,$31,$30,$29,$42,$41,$40,$28;
|
|
|
src="foo | a | a + 1. [ | b | b := a ]";
|
|
|
-ast=_st(_st($Smalltalk())._current())._parse_(src);
|
|
|
+ast=_st($Smalltalk())._parse_(src);
|
|
|
_st(self["@analyzer"])._visit_(ast);
|
|
|
$7=_st(ast)._nodes();
|
|
|
$ctx1.sendIdx["nodes"]=2;
|
|
@@ -1796,8 +1796,8 @@ $28=_st($29).__eq_eq($40);
|
|
|
self._assert_($28);
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testVariablesLookup",{src:src,ast:ast},smalltalk.SemanticAnalyzerTest)})},
|
|
|
args: [],
|
|
|
-source: "testVariablesLookup\x0a\x09| src ast |\x0a\x0a\x09src := 'foo | a | a + 1. [ | b | b := a ]'.\x0a\x09ast := Smalltalk current parse: src.\x0a\x09analyzer visit: ast.\x0a\x0a\x09\x22Binding for `a` in the message send\x22\x0a\x09self assert: ast nodes first nodes first receiver binding isTempVar.\x0a\x09self assert: ast nodes first nodes first receiver binding scope == ast scope.\x0a\x0a\x09\x22Binding for `b`\x22\x0a\x09self assert: ast nodes first nodes last nodes first nodes first left binding isTempVar.\x0a\x09self assert: ast nodes first nodes last nodes first nodes first left binding scope == ast nodes first nodes last scope.",
|
|
|
-messageSends: ["parse:", "current", "visit:", "assert:", "isTempVar", "binding", "receiver", "first", "nodes", "==", "scope", "left", "last"],
|
|
|
+source: "testVariablesLookup\x0a\x09| src ast |\x0a\x0a\x09src := 'foo | a | a + 1. [ | b | b := a ]'.\x0a\x09ast := Smalltalk parse: src.\x0a\x09analyzer visit: ast.\x0a\x0a\x09\x22Binding for `a` in the message send\x22\x0a\x09self assert: ast nodes first nodes first receiver binding isTempVar.\x0a\x09self assert: ast nodes first nodes first receiver binding scope == ast scope.\x0a\x0a\x09\x22Binding for `b`\x22\x0a\x09self assert: ast nodes first nodes last nodes first nodes first left binding isTempVar.\x0a\x09self assert: ast nodes first nodes last nodes first nodes first left binding scope == ast nodes first nodes last scope.",
|
|
|
+messageSends: ["parse:", "visit:", "assert:", "isTempVar", "binding", "receiver", "first", "nodes", "==", "scope", "left", "last"],
|
|
|
referencedClasses: ["Smalltalk"]
|
|
|
}),
|
|
|
smalltalk.SemanticAnalyzerTest);
|