diff --git a/.gitignore b/.gitignore index 178d87a..07794fa 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,5 @@ SqueakDebug.log # Metacello-github cache /github-cache github-*.zip + +**/.DS_STORE diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..29dda75 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,90 @@ +# AGENTS.md + +Always read and follow the coding conventions in `~/.opencode/AGENTS.md`. + +## What This Is + +A **Pharo Smalltalk** project (not Python) that provides a Famix AST representation for Python code, built on TreeSitter. Part of the [moosetechnology/FAST](https://github.com/moosetechnology/FAST) ecosystem. + +Source code format: **Tonel** (all source in `src/`). + +## Build & Test + +This is a Pharo Smalltalk project. There are no npm/pip/make commands. + +**Install dependencies in a Pharo image:** +```smalltalk +Metacello new + githubUser: 'moosetechnology' project: 'FAST-Python' commitish: 'main' path: 'src'; + baseline: 'FASTPython'; + load +``` + +**CI command (what actually runs):** +```bash +smalltalkci -s Pharo64-13 # or Pharo64-14 +``` +CI is defined in `.github/workflows/tests.yml`. Tests run via `smalltalkci` using the `smalltalk.ston` spec. Coverage is collected in lcov format for `FAST-Python.*` packages. + +There is no local test runner script outside of `smalltalkci`. You need a Pharo image with the project loaded to run tests interactively. + +## Package Structure + +``` +src/ + BaselineOfFASTPython/ -- Metacello baseline (dependency & group definitions) + FAST-Python-Model-Generator/ -- Metamodel generator (Famix code generation) + FAST-Python-Model/ -- Generated model classes (FASTPy*), do NOT edit by hand + FAST-Python-Model-Tests/ -- Model-level tests + FAST-Python-Tools/ -- Importer, CFG, local resolver, SSA, TreeSitter visitor + FAST-Python-Tools-Tests/ -- Tests for tools (importer, CFG, resolver, SSA) +``` + +**Baseline groups:** +- `Core` = Model + Tools +- `Generator` = Model-Generator only +- `Tests` = Model-Tests + Tools-Tests + +**Dependencies** (from baseline): +- `FAST` v3: `github://moosetechnology/FAST:v3/src` (loads `'All'` group) +- `TreeSitter` v2.0.0: `github://Evref-BL/Pharo-Tree-Sitter:v.2.0.0/src` + +## Critical: Model Files Are Generated + +`FAST-Python-Model/` contains ~130 generated class files (`FASTPy*`). These are produced by `FASTPythonMetamodelGenerator` in `FAST-Python-Model-Generator/`. **Do not edit model files directly** -- edit the generator and re-run it. The generator also produces a visitor trait (`FASTPyTVisitor`). + +## Key Entry Points + +| Class | Role | +|-------|------| +| `FASTPythonImporter` | Parse Python source string or file → FAST model. Extends `TSFASTAbstractImporter`. | +| `FASTPythonTreeSitterVisitor` | Walks TreeSitter CST → builds FAST model. 1100+ lines, the core import logic. | +| `FASTPythonCFGVisitor` | Builds control flow graph. Uses `FASTTCFGUtility` trait from FAST. | +| `FASTPythonLocalResolverVisitor` | Links entity usages to their local declarations (scope-aware). | +| `FASTPythonSSAVisitor` | SSA transform. Uses `FASTCFGTVisitor` trait from FAST. Requires local resolution first. | +| `FASTPythonMetamodelGenerator` | Generates the Famix metamodel. Run via `FASTPythonMetamodelGenerator new generate`. | + +**Typical analysis pipeline:** +```smalltalk +model := FASTPythonImporter parseFile: aFile. +FASTPythonLocalResolverVisitor resolve: model module. +model allFunctionDefinitions first cfg. "CFG" +FASTPythonSSAVisitor resolve: model allFunctionDefinitions first. "SSA (after resolution)" +``` + +## Testing + +- **Base test class**: `FASTPythonAbstractTestCase` (in Tools-Tests) -- provides a `parse:` helper that wraps `FASTPythonImporter` with error reporting. +- **Importer tests**: `FASTPythonImporterTest` extends `TSFASTAbstractImporterTest` (from TreeSitter). The test file is ~53k lines -- generated tests for every AST node type. Test generation snippet is in the class comment. +- **CFG/Resolver/SSA tests**: `FASTPythonCFGTest`, `FASTPythonLocalResolverTest`, `FASTPythonSSATest`. + +## Gotchas + +- **TreeSitter python grammar version matters**: After v0.25, expression statements were removed from the tree. If tests fail unexpectedly, check your `tree-sitter-python` version first (see README). +- **Pharo 13 is the primary target**; Pharo 14 is also tested. The baseline references `FAST:v3` which requires Moose 13. +- **The importer uses the master branch** of `TSLibrariesPython` (hardcoded in `FASTPythonTreeSitterVisitor class >> initialize`). +- **`expression --|> statement`**: In Python, expressions can be expression statements. This is reflected in the model hierarchy and affects how the visitor processes nodes. +- **CFG uses `FASTTCFGUtility`** from FAST (the parent project). SSA uses `FASTCFGTVisitor`. These traits define the core graph traversal protocol. +- **Local resolver scope management**: The resolver maintains a `scopes` stack. Shadowing is handled by checking entity kind consistency (same kind = shared declaration, different kind = new declaration). +- **Python 3 only for resolver**: The local resolver is Python 3 scoped. Python 2 comprehension scoping (no scope) is not supported (issue #26). +- **Non-local declarations are not deduplicated**: Each access to an unknown field creates a separate `FASTNonLocalDeclaration` (issue #26 in the repo). diff --git a/README.md b/README.md index 0a8a9f1..f69c3f1 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,22 @@ Famix AST representation for Python based on TreeSitter + + +- [FAST-Python](#fast-python) + - [Installation](#installation) + - [Quick start](#quick-start) + - [Documentation](#documentation) + - [Control flow graph](#control-flow-graph) + - [Local resolutions](#local-resolutions) + - [Single Static Assignment (SSA)](#single-static-assignment-ssa) + - [Moose versions compatibility](#moose-versions-compatibility) + - [TreeSitter python version compatibility](#treesitter-python-version-compatibility) + - [Python version compatibility](#python-version-compatibility) + - [Contact](#contact) + + + ## Installation To install this project on your Pharo image, execute the following script: @@ -47,6 +63,8 @@ Or The best documentation to read about this project is located in Pharo Tree Sitter's repository here: [https://github.com/Evref-BL/Pharo-Tree-Sitter/blob/main/resources/doc/fast_importer.md](https://github.com/Evref-BL/Pharo-Tree-Sitter/blob/main/resources/doc/fast_importer.md) and here: [https://github.com/Evref-BL/Pharo-Tree-Sitter/blob/main/resources/doc/ts_utilities.md](https://github.com/Evref-BL/Pharo-Tree-Sitter/blob/main/resources/doc/ts_utilities.md) +You can find the documentation on some analysis possible here: [Analysis documentation](resources/doc/analysis.md). + ## Control flow graph @@ -64,6 +82,35 @@ A CFG can be done on a function, method, class, module or lambda. You can visualize it in the inspector as a visualization and you can also export your CFG as a mermaid visualization using `#asMermaidScript` +For more information check the analysis documentation linked above. + +## Local resolutions + +It is possible to apply a local name resolution on a FAST-Python model by executing this piece of code: + +```smalltalk +FASTPythonLocalResolverVisitor resolve: model module "Can be any behavioral entity" +``` + +Once this is executed, all nodes resolved will be able to provide a `#localDeclaration` pointing to the declaration/first use of the entity. This local declaration also knows all the `#localUses` of the entity. + +For more information check the analysis documentation linked above. + +## Single Static Assignment (SSA) + +It is possible to build the SSA of a FAST-Python model like this: + + +It can be run like this: + +```smalltalk +FASTPythonSSAVisitor resolve: model module +``` + +Then we can ask to any node representing a variable access `#ssaVersion`. This version is able to tell us where are the read and write accesses of this particular version of the variable. + +For more information check the analysis documentation linked above. + ## Moose versions compatibility | Version | Compatible Moose versions | diff --git a/resources/doc/analysis.md b/resources/doc/analysis.md new file mode 100644 index 0000000..5be6183 --- /dev/null +++ b/resources/doc/analysis.md @@ -0,0 +1,414 @@ +# Doing analysis on FASTPython + +A general note: When we import an entity, we cannot know if it is a variable, a function, a class... So the analysis works better for entities declared in the file for multiple parts of this documentation. + +> Note: Currently, analysis done with FASTPython are mostly done to analyse variables. So the documentation will be centered on analysis of variables and the algos are mostly tested on variables analysis and not functions, methods, ...ß + +- [Doing analysis on FASTPython](#doing-analysis-on-fastpython) + - [Local resolution](#local-resolution) + - [Shadowing](#shadowing) + - [Querying local resolver information](#querying-local-resolver-information) + - [Static Single Assignment (SSA)](#static-single-assignment-ssa) + - [Building](#building) + - [Exploiting the SSA](#exploiting-the-ssa) + - [Assigned expressions](#assigned-expressions) + - [Limitations of local resolver and SSA](#limitations-of-local-resolver-and-ssa) + - [Attribute accesses](#attribute-accesses) + - [Subscript content](#subscript-content) + - [Instance variables](#instance-variables) + - [Python 2 VS Python 3](#python-2-vs-python-3) + - [Global and Non local statement](#global-and-non-local-statement) + - [FAST Python visitor](#fastpython-visitor) + - [Control Flow Graph (CFG)](#control-flow-graph-cfg) + - [FAST utilities](#fast-utilities) + - [Examples of analysis](#examples-of-analysis) + +## Local resolution + +FASTPython includes `FASTPythonLocalResolverVisitor`. Its goal is to link each entities to their first declaration. This works for all named entities. +You can link: +- Variables +- Functions +- Methods +- Imports + +During analysis it is recommended to have a resolved FASTPython: + +```smalltalk +FASTPythonLocalResolverVisitor resolve: aModule "could be any behavioral entity of a FASTPython model." +``` + +Once this is done, you can ask any node that can represent a variable for its `#localDeclaration`. It will return the first definition of the entity if it is in the file. If the entity is not declared in the file, it will return a `FASTNonLocalDeclaration`. + +The local declaration knows all the usages of the entity in the model. We can get them by asking `#localUses`. + +### Shadowing + +In Python anything named can shadow anything named. For example we can declare a global variable then shadow it with an import, then shadow it with a function... + +In the case of a shadowing, we manage it in two distinct ways: +- If we know for sure that the entity will be the same kind of entity (for example, if the entity stays a variable because we assign two times values to the same variable), then they keep the same local declaration +- If the entity kind is different (for example we shadow a global variable with a function) or if we are not sure (if we shadow something with an imported entity for example), then we create a new local declaration + +### Querying local resolver information + +It is possible to ask a few things to the nodes once the resolution is done: +- `node localDeclaration` returns the first node that declared the entity we are querying +- `node localDeclaration localUses` returns all uses of the node (declarations and usage) +- `node allAccesses` if the node is a variable, returns all the read and write accesses to the variable +- `node allReadAccesses` if the node is a variable, returns all the read accesses to the variable +- `node allWriteAccesses` if the node is a variable, returns all the write accesses to the variable +- `node variableDeclarator` if the node that is a variable write access, it will return the node assigning the variable (can be an assignment, augmented assignment, for loop or for in clause) +- `node allAssignedExpressionsMap` if the node is a variable, return a map of all expressions used to assigned the variable. The keys of the map are all the write accesses of this variable and the values are the expressions used for the assignment. + +For `#allAssignedExpressionsMap`, be carful, `x = 3` is not the only way to assign a variable. Take those cases into account: + +```python +x = 3 +``` + +For x + +Assigned expression: `3` + +```python +x, (y, z) = (3, (4, 5)) +``` + +Assigned expression: `(3, (4, 5))` + +> Note: in case of tuples or lists, we do not select the right element in the tuple/list. Especially since it can be given via a variable or a call. + +```python +for x in range(0): + print(x) +``` + +Assigned expression: `range(0)` + +```python +[c for c in coll] +``` + +Assigned expression: `coll` + +```python +x += 1 +``` + +Assigned expression: `1` + +Be carful, it does not know with the addition method of `x` will do if it is an object. + +## Static Single Assignment (SSA) + +### Building + +FASTPython includes `FASTPythonSSAVisitor` to build a SSA form of the AST. The goal of the SSA is to know for each use of a variable, the assignation or assignations linked to this usage. + +It can be run like this: + +```smalltalk +FASTPythonSSAVisitor resolve: model module +``` + +Another possibility is to import via `FASTPythonImporter` using `#parseAndResolve:` or `parseFileAndResolve:` instead of just parsing. + +```smalltalk +FASTPythonImporter parseAndResolve: 'x = 3 +print(x)' withPlateformLineEndings +``` + +### Exploiting the SSA + +Two little examples: + +```python +x.y = 4 # x.y_1 +print(x.y) # x.y_1 +x.y = 6 # x.y_2 +print(x.y) # x.y_2 +``` + +Here we have only one variable, but with two assignments. We know that the first printing prints the value assigned in line 1 and the second prints the value in the second assignment. + +```python +x.y = 4 # x.y_1 +print(x.y) # x.y_1 + +if z > 3: + x.y = 3 # x.y_2 + +print(x.y) # Phi(x.y_1, x.y_2) +``` + +In this new case, the second printing can have two different value depending on z. Then, we return a collection of those values. + +You can ask any node representing a variable for its `#ssaVersion`. This version can either be a `FASTVariableVersionSSA` or a `FASTPhiVersionSSA`. It will be a Phi if it can have multiple versions. + +All versions know the local declaration of the variable (which allow to find all usages independently of the assignment) and you can use `#localUses` to find all the uses of the variable **for the current SSA version**. + +For example: + +```python +x = 2 # x_1 +print(x) # x_1 + +if z > 3: + x = 3 # x_2 + print(x) # x_2 +else: + x = 4 # x_3 + +print(x) # Phi(x_2, x_3) +``` + +Asking `#ssaVersion` to the `FASTPyVariable` node of `x = 3`, it will return the version number 2. If you ask its local uses, it will return. The one of the assignment (write access), the one of the second printing (read access) and the one of the last printing (read access). + +It is possible to ask to a model or a group for the SSA versions inside it using `#allSSAVersions`. + +On top of this, it is possible to get information via the SSA directly with the API of the variables nodes: +- `node versionAccesses` returns all the read and write accesses for this sepcific version of the variable +- `node versionReadAccesses` returns all the real accesses for this specific version of the variable +- `node versionWriteAccesses` returns all the write accesses for this specific version of the variable + +### Assigned expressions + +It is also possible to query what is assigned in variables once the SSA is done: +- `node variableDeclarator` for a node that is a write access to a variable, it will return the node assigning the variable +- `node assignedExpressionsMap` for a variable, return a map of all expressions used to assigned the variable. The keys of the map are the write accesses that can impact the value of this variable. In some cases there will be only one. But if the variable is assigned in a conditional expression, it will get one entry by assignment that can impact the current variable value + +> Note: you can find some warnings on this in the section [Querying local resolver information](#querying-local-resolver-information). They are the same. + +## Limitations of local resolver and SSA + +Multiple limitations are present in those two algorithms. Some because it is impossible to do. Some others because we did not take the time to push the implementation further. + +### Attribute accesses + +Attribute accesses globaly work, but not in some specific cases. Here is an example: + +```python +x.y.z = 3 +a = x.y +print(a.z) +``` + +Here the printing of `a.z` should be linked to the declaration `x.y.z = 3` but this is currently not supported. + + +### Subscript content + +Currently to identify a subscript in the local resolver and the SSA, we check the content of the subscript as a string but this is too lax. Here are a few examples of problems with subscripts: + +```python +x = 2 + +y[x] = 3 + +x = 3 + +y[x] +``` + +Here the second subscript will declare the first one as local declaration even if it is a different index in this case. + +```python +x[0:4] + +x[:4] +``` + +Here the two subscripts are the same, byt since we compare strings, it will be seen as different. + +We could improve this by checking the expression instide instead of the souce code. + +### Instance variables + +Instance variables cannot be managed well by a SSA since there are no declaration of instance variables in python and we do not know in which order the methods will be invoked. + +Some API to query instance variables is also available and will be described later in this documentation. + +### Python 2 VS Python 3 + +The local resolver and SSA are currently based on Python 3 behavior and not Python 2. In the future we could support both. + +This has some implications, for example: + +```python +[x for x in coll] +print(x) +``` + +Here, the printing will be linked to an nonlocal declaration because in Python 3, list comprehensions are scoped and x is only declared in the comprehension. In Python 2, x would have leaked the comprehension. + +### Global and Non local statement + +For now the LR does not manage global and non local statements. + +## FAST Python visitor + +FASTPython comes with a visitor either used in the form of a trait to use with `FASTPyTVisitor` or a class to subclass with `FASTPythonVisitor`. + +Be careful, in some usage of the visitor some visit methods need to be overriden to change the visit order. For example, in a visitor I needed to ensure that function parameters are visited before the statements of the function. + +For more information about FASTPython visitor you can read [this blog post on the Moose wiki](https://modularmoose.org/blog/2026-05-20-improving-visitor-generator-copy/). + +## Control Flow Graph (CFG) + +It is possible to get a control flow graph of a behavioral entities in FASTPython. + +I can be used like this: + +```smalltalk +FASTPythonCFGVisitor buildCFGOf: aModel allFunctionDefinitions first. + +"or" + +aModel allFunctionDefinitions first cfg +``` + +I can take one of five different entities to build a CFG: + +• a FASTPyModule +• a FASTPyFunctionDefinition +• a FASTPyMethodDefinition +• a FASTPyLambda +• a FASTPyClassDefinition + +It is also possible to ask for a "full" CFG that returns a dictionary with the CFG on the entity and also the CFGs of all definitions found inside of this entity. + +Once we have the CFG, we can use `FASTCFGTVisitor` to visit it. This visitor will visit all expressions in the CFG and all the next blocks. +It has the nice feature of visiting all blocks inside a conditional node before visiting the next blocks. It visit them branch by branch and allows the user to hook behavior between the branches. + +This visitor and the python visitor are used to build the SSA if you need an example of real usage. + +For more information on FAST CFG you can read this [article on the Moose wiki](https://modularmoose.org/developers/fast-cfg/). + +## FAST utilities + +Some properties and helpers got added to FAST to get more information out of the AST. Here some of them will be described. + +Some general properties got added such as: +- `FASTPyMethodDefinition>>isStatic` to know if a method is static +- `FASTPyMethodDefinition>>isAbstract` to know if a method is abstract +- `FASTPyMethodDefinition>>selfName` to know the name of the self parameter (will be nil for static methods) + +For nodes representing a write access to a variable (it is possible to find them easily once we resolved our project with the local resolver or the SSA), we can find the expressions used in their writing by using `#assignedExpressions` on the node. + +> Note: you can find some warnings on this in the section [Querying local resolver information](#querying-local-resolver-information). They are the same. + +TODO: Document more + +## Examples of analysis + +In this section I'll show how to answer some questions I was asked to answer with FAST-Python. + +The examples will use `#parseAndResolve:` from the python importer that parse a piece of code and launch the local resolver and SSA resolution. + +For example: + +```smalltalk +code := 'x = 2 +print(x)' withPlatformLineEndings. "Platform line ending are needed because cr line returns are not supported in Python parsers." + +model := FASTPythonImporter parseAndResolve: code. "Import and resolve with local resolver and SSA." +``` + +Let's use this piece of Python code as example: + +```python +x = 2 + +print(x) + +x = 3 + +if z > 4: + x = 5 + +print(x) +``` + +**Where is a variable defined?** + +We can do this: + +```smalltalk +lastVariableAccess := model module statements last arguments first. + +lastVariableAccess ssaVersion. "a FASTVariablePhiVersionSSA ['x_3', 'x_2'] <= We see here that this variable can come from 2 assignments depending on a condition>" + +lastVariableAccess versionWriteAccesses. "an OrderedCollection(PyVariable(18 - 18) PyVariable(36 - 36))" +``` + +This will return the write accesses that impacted this use of the variable. It will ignore the write accesses that cannot have an impact of this variable. + +**Where is a variable read?** + +With the same python snippet as before we can do: + +```smalltalk +lastVariableAccess := model module statements last arguments first. + +lastVariableAccess versionReadAccesses "an OrderedCollection(PyIdentifier(50 - 50))" +``` + +This will return every reading of the variable you are checking for the current SSA version. It ignores all read accesses that are not for this version of the variable. + +**Where is a variable read independently of versions?** + +Let's imagine we want all read access to the variable and not just the ones for the current SSA version. We can do: + +```smalltalk +variable := model module statements first left. "We could get any access to the variable here, not only the first one." + +variable allReadAccesses. "an OrderedCollection(PyIdentifier(14 - 14) PyIdentifier(50 - 50))" +``` +**Where is a variable writen independently of version?** + +Same as before, we can use the local declaration: + +```smalltalk +variable := model module statements first left. "We could get any access to the variable here, not only the first one." + +variable allWriteAccesses "an OrderedCollection(PyVariable(1 - 1) PyVariable(18 - 18) PyVariable(36 - 36))" +``` + +> We can also use `#allAccesses` and `#versionAccesses` to mix read and write accesses. + +**What is the assignment node of the variable I am manipulating?** + +It is possible to get the nodes doing the assignments this way: + +```smalltalk +lastVariableAccess := model module statements last arguments first. + +lastVariableAccess ssaVersion writeAccesses collect: [ :access | access variableDeclarator ] "an OrderedCollection(PyAssignment(18 - 22) PyAssignment(36 - 40))" +``` + +The assignments nodes can be an assignment, a for, an augmented assignment or a for in clause. + +Do not forget that an assignment can be done to a tuple or list. + +Also, there can be multiple ones, as shown in the example, in case of a phi version. + +**What expressions are used to do the assignment?** + +It is possible to know all possible expressions involved in the assignment of a variable like this: + +```smalltalk +lastVariableAccess := model module statements last arguments first. + +lastVariableAccess assignedExpressionsMap + +"a Dictionary( + PyVariable(18 - 18)->#( PyInteger(22 - 22) ) + PyVariable(36 - 36)->#( PyInteger(40 - 40) ) )" +``` + +It returns a dictionary with the possible write accesses as key and the expressions involved in the writing as values. + +> Note: you can find some warnings on this in the section [Querying local resolver information](#querying-local-resolver-information). They are the same. + +> Note 2: You can also use `#allAssignedExpressionsMap` if you want to consider all write accesses to a variable and not just the one impacting a specific access. Or you can use `#assignedExpressions` on a specific write access to have information only on this one. \ No newline at end of file diff --git a/src/BaselineOfFASTPython/BaselineOfFASTPython.class.st b/src/BaselineOfFASTPython/BaselineOfFASTPython.class.st index 332dec6..5128a1a 100644 --- a/src/BaselineOfFASTPython/BaselineOfFASTPython.class.st +++ b/src/BaselineOfFASTPython/BaselineOfFASTPython.class.st @@ -21,7 +21,7 @@ BaselineOfFASTPython >> baseline: spec [ spec package: 'FAST-Python-Model' with: [ spec requires: #( 'FAST' 'TreeSitter' ) ]; package: 'FAST-Python-Model-Generator'; - package: 'FAST-Python-Model-Tests' with: [ spec requires: #( 'FAST-Python-Model' ) ]; + package: 'FAST-Python-Model-Tests' with: [ spec requires: #( 'FAST-Python-Model' 'FAST-Python-Tools' ) ]; package: 'FAST-Python-Tools' with: [ spec requires: #( 'FAST-Python-Model' ) ]; package: 'FAST-Python-Tools-Tests' with: [ spec requires: #( 'FAST-Python-Tools' ) ]. diff --git a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st index 5a4ca7d..daac685 100644 --- a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st +++ b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st @@ -157,7 +157,8 @@ Class { 'tAwaitable', 'tExecutable', 'tBreakStatement', - 'tContinueStatement' + 'tContinueStatement', + 'tCanBeVariable' ], #category : 'FAST-Python-Model-Generator', #package : 'FAST-Python-Model-Generator' @@ -287,6 +288,7 @@ FASTPythonMetamodelGenerator >> defineClasses [ genericType := builder newClassNamed: #GenericType. globalStatement := builder newClassNamed: #GlobalStatement. identifier := builder newClassNamed: #Identifier. + identifier withTesting. ifClause := builder newClassNamed: #IfClause. ifStatement := builder newClassNamed: #IfStatement. import := builder newClassNamed: #Import. @@ -301,6 +303,7 @@ FASTPythonMetamodelGenerator >> defineClasses [ lambda := builder newClassNamed: #Lambda. lambdaParameters := builder newClassNamed: #LambdaParameters. list := builder newClassNamed: #List. + list withTesting. listComprehension := builder newClassNamed: #ListComprehension. literal := builder newAbstractClassNamed: #Literal. matchStatement := builder newClassNamed: #MatchStatement. @@ -325,7 +328,8 @@ FASTPythonMetamodelGenerator >> defineClasses [ slice := builder newClassNamed: #Slice. (splat := builder newClassNamed: #Splat) comment: 'In Python a collection (list or dictionary) splat is the unpacking of a collection in a call or in the definition of another definition like `[ *list , 4 ]` or `func(*list)`'. - splatParameter := builder newClassNamed: #SplatParameter. + (splatParameter := builder newClassNamed: #SplatParameter) comment: + 'A splat parameter is a parameter that is a list slpat such as *args or a dictionary splat such as **kwargs.'. splatType := builder newClassNamed: #SplatType. statement := builder newAbstractClassNamed: #Statement. string := builder newClassNamed: #String. @@ -333,6 +337,7 @@ FASTPythonMetamodelGenerator >> defineClasses [ thenClause := builder newClassNamed: #ThenClause. tryStatement := builder newClassNamed: #TryStatement. tuple := builder newClassNamed: #Tuple. + tuple withTesting. type := builder newClassNamed: #Type. typeAliasStatement := builder newClassNamed: #TypeAliasStatement. typeConversion := builder newClassNamed: #TypeConversion. @@ -372,6 +377,7 @@ FASTPythonMetamodelGenerator >> defineHierarchy [ attribute --|> tAsPatternTarget. attribute --|> tSplatParameterTarget. attribute --|> tNamedEntity. + attribute --|> tCanBeVariable. augmentedAssignment --|> assignment. @@ -487,6 +493,8 @@ FASTPythonMetamodelGenerator >> defineHierarchy [ identifier --|> tReturnReferenceable. identifier --|> tAsPatternTarget. identifier --|> tSplatParameterTarget. + identifier --|> tNamedEntity. + identifier --|> tCanBeVariable. ifClause --|> expression. "This is wrong! I am just here temporarily until we rework the relation to the for in clause (I need to be able to be a clause of a list comprehension)" @@ -553,6 +561,7 @@ FASTPythonMetamodelGenerator >> defineHierarchy [ pair --|> expression. parameter --|> tVariableEntity. + parameter --|> tCanBeVariable. passStatement --|> statement. @@ -590,6 +599,7 @@ FASTPythonMetamodelGenerator >> defineHierarchy [ subscript --|> expression. subscript --|> tReturnReferenceable. subscript --|> tAsPatternTarget. + subscript --|> tCanBeVariable. tAsPatternTarget --|> tAsPatternSource. @@ -864,6 +874,8 @@ FASTPythonMetamodelGenerator >> defineTraits [ tCallable := (builder newTraitNamed: #TCallable) comment: 'I represent something that can be the receiver of a call'. + tCanBeVariable := (builder newTraitNamed: #TCanBeVariable) comment: 'Represent everything that can be a variable. Used for the LocalResolver and the SSA builder. Maybe I should be merged with TAssignable?'. + tClassPatternElement := (builder newTraitNamed: #TClassPatternElement) comment: 'I represent the elements of a class pattern in python pattern matcher. The first element is the class name, the others the arguments.'. tDecoratorExpression := (builder newTraitNamed: #TDecoratorExpression) comment: 'I represent an entity that *can* be the expression of a decorator.'. diff --git a/src/FAST-Python-Model-Tests/FASTPythonAbstractTestCase.class.st b/src/FAST-Python-Model-Tests/FASTPythonAbstractTestCase.class.st new file mode 100644 index 0000000..d7690ee --- /dev/null +++ b/src/FAST-Python-Model-Tests/FASTPythonAbstractTestCase.class.st @@ -0,0 +1,23 @@ +Class { + #name : 'FASTPythonAbstractTestCase', + #superclass : 'TestCase', + #instVars : [ + 'model' + ], + #category : 'FAST-Python-Model-Tests', + #package : 'FAST-Python-Model-Tests' +} + +{ #category : 'testing' } +FASTPythonAbstractTestCase class >> isAbstract [ + + ^ self = FASTPythonAbstractTestCase +] + +{ #category : 'running' } +FASTPythonAbstractTestCase >> parse: aString [ + + ^ model := FASTPythonImporter new + errorReportBlock: [ :i | i errors ifNotEmpty: [ self fail: 'Errors happened during parsing. Errors: ' , i errors printString ] ]; + parse: aString withPlatformLineEndings +] diff --git a/src/FAST-Python-Model-Tests/FASTPythonAttributeAccessTest.class.st b/src/FAST-Python-Model-Tests/FASTPythonAttributeAccessTest.class.st new file mode 100644 index 0000000..07f3a94 --- /dev/null +++ b/src/FAST-Python-Model-Tests/FASTPythonAttributeAccessTest.class.st @@ -0,0 +1,64 @@ +Class { + #name : 'FASTPythonAttributeAccessTest', + #superclass : 'FASTPythonAbstractTestCase', + #category : 'FAST-Python-Model-Tests', + #package : 'FAST-Python-Model-Tests' +} + +{ #category : 'tests' } +FASTPythonAttributeAccessTest >> testIsInstanceVariableAccess [ + + | writeAccess writeAccessToObject readAccess | + self parse: 'class Class: + def method(self, author: str, obj): + self.author = author + obj.toto = author + return self.author'. + + writeAccess := model module statements first statements first statements first left. + self assert: writeAccess name equals: 'author'. + self assert: writeAccess isInstanceVariableAccess. + + writeAccessToObject := model module statements first statements first statements second left. + self assert: writeAccessToObject name equals: 'toto'. + self deny: writeAccessToObject isInstanceVariableAccess. + + readAccess := model module statements first statements first statements third expression. + self assert: readAccess name equals: 'author'. + self assert: readAccess isInstanceVariableAccess +] + +{ #category : 'tests' } +FASTPythonAttributeAccessTest >> testIsWriteVariableAccess [ + + | writeAccess readAccess | + self parse: 'class Class: + def method(self, author: str, obj): + self.author = author + return self.author'. + + writeAccess := model module statements first statements first statements first left. + self assert: writeAccess name equals: 'author'. + self assert: writeAccess isInstanceVariableAccess. + self assert: writeAccess isVariableWriteAccess. + + readAccess := model module statements first statements first statements second expression. + self assert: readAccess name equals: 'author'. + self assert: readAccess isInstanceVariableAccess. + self deny: readAccess isVariableWriteAccess +] + +{ #category : 'tests' } +FASTPythonAttributeAccessTest >> testMethodDefinition [ + + | method | + self parse: 'class Class: + def method(self, author: str): + self.author = author + return self.author'. + + method := model module statements first statements first. + + self assert: method statements first left methodDefinition equals: method. + self assert: method statements second expression methodDefinition equals: method +] diff --git a/src/FAST-Python-Model-Tests/FASTPythonMethodDefinitionTest.class.st b/src/FAST-Python-Model-Tests/FASTPythonMethodDefinitionTest.class.st new file mode 100644 index 0000000..727e025 --- /dev/null +++ b/src/FAST-Python-Model-Tests/FASTPythonMethodDefinitionTest.class.st @@ -0,0 +1,68 @@ +Class { + #name : 'FASTPythonMethodDefinitionTest', + #superclass : 'FASTPythonAbstractTestCase', + #category : 'FAST-Python-Model-Tests', + #package : 'FAST-Python-Model-Tests' +} + +{ #category : 'tests' } +FASTPythonMethodDefinitionTest >> testIsAbstract [ + + | method1 method2 | + self parse: 'class Class(ABC): + def method(self, author: str): + self.author = author + return self.author + + @abstractmethod + def method2(param): + pass'. + + method1 := model module statements first statements first. + self deny: method1 isAbstract. + method2 := model module statements first statements second. + self assert: method2 isAbstract +] + +{ #category : 'tests' } +FASTPythonMethodDefinitionTest >> testIsStatic [ + + | method1 method2 | + self parse: 'class Class: + def method(self, author: str): + self.author = author + return self.author + + @staticmethod + def method2(param): + return param'. + + method1 := model module statements first statements first. + self deny: method1 isStatic. + method2 := model module statements first statements second. + self assert: method2 isStatic +] + +{ #category : 'tests' } +FASTPythonMethodDefinitionTest >> testSelfName [ + + | method1 method2 method3 | + self parse: 'class Class: + def method(self, author: str): + self.author = author + return self.author + + def method2(this): + return this.author + + @staticmethod + def method3(param): + return param'. + + method1 := model module statements first statements first. + self assert: method1 selfName equals: 'self'. + method2 := model module statements first statements second. + self assert: method2 selfName equals: 'this'. + method3 := model module statements first statements third. + self assert: method3 selfName isNil +] diff --git a/src/FAST-Python-Model/FASTPyAssignment.class.st b/src/FAST-Python-Model/FASTPyAssignment.class.st index bbc885c..a4aa481 100644 --- a/src/FAST-Python-Model/FASTPyAssignment.class.st +++ b/src/FAST-Python-Model/FASTPyAssignment.class.st @@ -42,6 +42,12 @@ FASTPyAssignment class >> annotation [ ] +{ #category : 'accessing' } +FASTPyAssignment >> assignedExpressions [ + + ^ { self right } +] + { #category : 'testing' } FASTPyAssignment >> isDeclaration [ diff --git a/src/FAST-Python-Model/FASTPyAttributeAccess.class.st b/src/FAST-Python-Model/FASTPyAttributeAccess.class.st index b00b6a1..3fdd8be 100644 --- a/src/FAST-Python-Model/FASTPyAttributeAccess.class.st +++ b/src/FAST-Python-Model/FASTPyAttributeAccess.class.st @@ -40,8 +40,8 @@ I represent an access to an attribute such as `module.globalVariable`. Class { #name : 'FASTPyAttributeAccess', #superclass : 'FASTPyExpression', - #traits : 'FASTPyTAsPatternTarget + FASTPyTReturnReferenceable + FASTPyTSplatParameterTarget + FASTTNamedEntity', - #classTraits : 'FASTPyTAsPatternTarget classTrait + FASTPyTReturnReferenceable classTrait + FASTPyTSplatParameterTarget classTrait + FASTTNamedEntity classTrait', + #traits : 'FASTPyTAsPatternTarget + FASTPyTCanBeVariable + FASTPyTReturnReferenceable + FASTPyTSplatParameterTarget + FASTTNamedEntity', + #classTraits : 'FASTPyTAsPatternTarget classTrait + FASTPyTCanBeVariable classTrait + FASTPyTReturnReferenceable classTrait + FASTPyTSplatParameterTarget classTrait + FASTTNamedEntity classTrait', #instVars : [ '#value => FMOne type: #FASTPyExpression opposite: #parentAttributeObject' ], @@ -58,6 +58,25 @@ FASTPyAttributeAccess class >> annotation [ ] +{ #category : 'testing' } +FASTPyAttributeAccess >> isInstanceVariableAccess [ + + self methodDefinition ifNotNil: [ :method | ^ self value isIdentifier and: [ self value name = method selfName ] ]. + + ^ false +] + +{ #category : 'accessing' } +FASTPyAttributeAccess >> methodDefinition [ + "In case I am inside a method definition, return this method." + + ^ (self containersOfType: FASTPyMethodDefinition) + ifNotEmpty: [ :methods | + self assert: methods size = 1. + methods anyOne ] + ifEmpty: [ nil ] +] + { #category : 'accessing' } FASTPyAttributeAccess >> value [ "Relation named: #value type: #FASTPyExpression opposite: #parentAttributeObject" @@ -73,3 +92,14 @@ FASTPyAttributeAccess >> value: anObject [ value := anObject ] + +{ #category : 'accessing' } +FASTPyAttributeAccess >> variableDeclarator [ + "In the case I represent a write access to a variable, I return the node representing my assignment." + + "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" + + self selfOrTopmostAssignableCollection parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. + + ^ super variableDeclarator +] diff --git a/src/FAST-Python-Model/FASTPyEntity.class.st b/src/FAST-Python-Model/FASTPyEntity.class.st index 97ffa8b..3e6401d 100644 --- a/src/FAST-Python-Model/FASTPyEntity.class.st +++ b/src/FAST-Python-Model/FASTPyEntity.class.st @@ -50,6 +50,12 @@ FASTPyEntity class >> metamodel [ ^ FASTPyModel metamodel ] +{ #category : 'accessing' } +FASTPyEntity >> assignedExpressions [ + + ^ Array empty +] + { #category : 'testing' } FASTPyEntity >> hasImmediateSource [ @@ -99,6 +105,19 @@ FASTPyEntity >> isExpression [ ^ false ] +{ #category : 'testing' } +FASTPyEntity >> isIdentifier [ + + + ^ false +] + +{ #category : 'testing' } +FASTPyEntity >> isInstanceVariableAccess [ + + ^ false +] + { #category : 'testing' } FASTPyEntity >> isInvocation [ @@ -106,6 +125,13 @@ FASTPyEntity >> isInvocation [ ^ false ] +{ #category : 'testing' } +FASTPyEntity >> isList [ + + + ^ false +] + { #category : 'testing' } FASTPyEntity >> isLiteral [ @@ -148,9 +174,85 @@ FASTPyEntity >> isStringLiteral [ ^ false ] +{ #category : 'testing' } +FASTPyEntity >> isTuple [ + + + ^ false +] + { #category : 'testing' } FASTPyEntity >> isVariableEntity [ ^ false ] + +{ #category : 'testing' } +FASTPyEntity >> isVariableWriteAccess [ + "I am used in the LR and SSA builder to know if I represent the assignment of a variable." + + ^ self variableDeclarator isNotNil +] + +{ #category : 'accessing' } +FASTPyEntity >> shadowedBy [ + + + + ^ self attributeAt: #shadowedBy ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTPyEntity >> shadowedBy: aFASTEntity [ + + | otherSide | + otherSide := self shadowedBy. + + otherSide == aFASTEntity ifTrue: [ ^ aFASTEntity ]. + + aFASTEntity + ifNil: [ + self attributeAt: #shadowedBy put: aFASTEntity. + otherSide shadowing: nil ] + ifNotNil: [ + self attributeAt: #shadowedBy put: aFASTEntity. + aFASTEntity shadowing: self ] +] + +{ #category : 'accessing' } +FASTPyEntity >> shadowing [ + + + + ^ self attributeAt: #shadowing ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTPyEntity >> shadowing: aFASTEntity [ + + | otherSide | + otherSide := self shadowing. + + otherSide == aFASTEntity ifTrue: [ ^ aFASTEntity ]. + + aFASTEntity + ifNil: [ + self attributeAt: #shadowing put: aFASTEntity. + otherSide shadowedBy: nil ] + ifNotNil: [ + self attributeAt: #shadowing put: aFASTEntity. + aFASTEntity shadowedBy: self ] +] + +{ #category : 'accessing' } +FASTPyEntity >> variableDeclarator [ + "In case I am a write access to a variable, I return the node categorized as my declaration. Else I return nil. + Nodes representing potential variable write access should override me. + + I am used by the LocalResolver and potentially SSA" + + ^ nil +] diff --git a/src/FAST-Python-Model/FASTPyForInClause.class.st b/src/FAST-Python-Model/FASTPyForInClause.class.st index 36f36da..741360b 100644 --- a/src/FAST-Python-Model/FASTPyForInClause.class.st +++ b/src/FAST-Python-Model/FASTPyForInClause.class.st @@ -31,6 +31,12 @@ FASTPyForInClause class >> annotation [ ] +{ #category : 'accessing' } +FASTPyForInClause >> assignedExpressions [ + + ^ { self right } +] + { #category : 'accessing' } FASTPyForInClause >> left [ "Relation named: #left type: #FASTPyExpression opposite: #parentForInClauseLeft" diff --git a/src/FAST-Python-Model/FASTPyForStatement.class.st b/src/FAST-Python-Model/FASTPyForStatement.class.st index 657ccd3..9b38302 100644 --- a/src/FAST-Python-Model/FASTPyForStatement.class.st +++ b/src/FAST-Python-Model/FASTPyForStatement.class.st @@ -49,6 +49,12 @@ FASTPyForStatement class >> annotation [ ] +{ #category : 'accessing' } +FASTPyForStatement >> assignedExpressions [ + + ^ { self right } +] + { #category : 'accessing' } FASTPyForStatement >> left [ "Relation named: #left type: #FASTPyExpression opposite: #parentForStatementLeft" diff --git a/src/FAST-Python-Model/FASTPyIdentifier.class.st b/src/FAST-Python-Model/FASTPyIdentifier.class.st index 949880f..1b96fbd 100644 --- a/src/FAST-Python-Model/FASTPyIdentifier.class.st +++ b/src/FAST-Python-Model/FASTPyIdentifier.class.st @@ -6,6 +6,7 @@ | Relation | Origin | Opposite | Type | Comment | |---| | `caller` | `FASTPyTCallable` | `callee` | `FASTPyCall` | The call entity calling me (if it's the case)| +| `invokedIn` | `FASTTNamedEntity` | `invoked` | `FASTTInvocation` | Optional invocation where this name is used| | `parentAsPatternSource` | `FASTPyTAsPatternSource` | `source` | `FASTPyAsPattern` | | | `parentAsPatternTarget` | `FASTPyTAsPatternTarget` | `target` | `FASTPyAsPattern` | | | `parentAssignmentLeft` | `FASTPyTAssignable` | `left` | `FASTPyAssignment` | | @@ -19,13 +20,21 @@ | `parentSplatParameter` | `FASTPyTSplatParameterTarget` | `target` | `FASTPySplatParameter` | | +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `name` | `String` | nil | | +| `startPos` | `Number` | nil | | " Class { #name : 'FASTPyIdentifier', #superclass : 'FASTPyExpression', - #traits : 'FASTPyTAsPatternTarget + FASTPyTReturnReferenceable + FASTPyTSplatParameterTarget', - #classTraits : 'FASTPyTAsPatternTarget classTrait + FASTPyTReturnReferenceable classTrait + FASTPyTSplatParameterTarget classTrait', + #traits : 'FASTPyTAsPatternTarget + FASTPyTCanBeVariable + FASTPyTReturnReferenceable + FASTPyTSplatParameterTarget + FASTTNamedEntity', + #classTraits : 'FASTPyTAsPatternTarget classTrait + FASTPyTCanBeVariable classTrait + FASTPyTReturnReferenceable classTrait + FASTPyTSplatParameterTarget classTrait + FASTTNamedEntity classTrait', #category : 'FAST-Python-Model-Entities', #package : 'FAST-Python-Model', #tag : 'Entities' @@ -38,3 +47,27 @@ FASTPyIdentifier class >> annotation [ ] + +{ #category : 'testing' } +FASTPyIdentifier >> isIdentifier [ + + + ^ true +] + +{ #category : 'accessing' } +FASTPyIdentifier >> variableDeclarator [ + "In the case I represent a write access to a variable, I return the node representing my assignment." + + | assignedNode | + "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" + assignedNode := self selfOrTopmostAssignableCollection. + + assignedNode parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. + + assignedNode parentForStatementLeft ifNotNil: [ :for | ^ for ]. + + assignedNode parentForInClauseLeft ifNotNil: [ :clause | ^ clause ]. + + ^ super variableDeclarator +] diff --git a/src/FAST-Python-Model/FASTPyImportedEntity.class.st b/src/FAST-Python-Model/FASTPyImportedEntity.class.st index be0334c..f5c8600 100644 --- a/src/FAST-Python-Model/FASTPyImportedEntity.class.st +++ b/src/FAST-Python-Model/FASTPyImportedEntity.class.st @@ -53,6 +53,12 @@ FASTPyImportedEntity >> alias: anObject [ alias := anObject ] +{ #category : 'testing' } +FASTPyImportedEntity >> hasAlias [ + + ^ self alias isNotNil +] + { #category : 'accessing' } FASTPyImportedEntity >> import [ "Relation named: #import type: #FASTPyImport opposite: #importedEntities" diff --git a/src/FAST-Python-Model/FASTPyList.class.st b/src/FAST-Python-Model/FASTPyList.class.st index 23cce16..1407d41 100644 --- a/src/FAST-Python-Model/FASTPyList.class.st +++ b/src/FAST-Python-Model/FASTPyList.class.st @@ -29,3 +29,10 @@ FASTPyList class >> annotation [ ] + +{ #category : 'testing' } +FASTPyList >> isList [ + + + ^ true +] diff --git a/src/FAST-Python-Model/FASTPyMethodDefinition.class.st b/src/FAST-Python-Model/FASTPyMethodDefinition.class.st index a5b34e6..00ccc49 100644 --- a/src/FAST-Python-Model/FASTPyMethodDefinition.class.st +++ b/src/FAST-Python-Model/FASTPyMethodDefinition.class.st @@ -51,6 +51,31 @@ FASTPyMethodDefinition class >> annotation [ ] +{ #category : 'testing' } +FASTPyMethodDefinition >> hasDecoratorNamed: aString [ + "A method is static in python if it has the `@staticmethod` decorator." + + ^ self decorators anySatisfy: [ :decorator | decorator expression isIdentifier and: [ decorator expression name = aString ] ] +] + +{ #category : 'testing' } +FASTPyMethodDefinition >> isAbstract [ + + + + + ^ self hasDecoratorNamed: 'abstractmethod' +] + +{ #category : 'testing' } +FASTPyMethodDefinition >> isStatic [ + + + + + ^ self hasDecoratorNamed: 'staticmethod' +] + { #category : 'accessing' } FASTPyMethodDefinition >> returnType [ "Relation named: #returnType type: #FASTPyType opposite: #parentMethodDefinition" @@ -65,3 +90,14 @@ FASTPyMethodDefinition >> returnType: anObject [ returnType := anObject ] + +{ #category : 'accessing' } +FASTPyMethodDefinition >> selfName [ + + + + + self isStatic ifTrue: [ ^ nil ]. + + ^ self parameters first name +] diff --git a/src/FAST-Python-Model/FASTPyParameter.class.st b/src/FAST-Python-Model/FASTPyParameter.class.st index 1560e7f..12865a0 100644 --- a/src/FAST-Python-Model/FASTPyParameter.class.st +++ b/src/FAST-Python-Model/FASTPyParameter.class.st @@ -29,8 +29,8 @@ Class { #name : 'FASTPyParameter', #superclass : 'FASTPyEntity', - #traits : 'FASTTVariableEntity', - #classTraits : 'FASTTVariableEntity classTrait', + #traits : 'FASTPyTCanBeVariable + FASTTVariableEntity', + #classTraits : 'FASTPyTCanBeVariable classTrait + FASTTVariableEntity classTrait', #instVars : [ '#defaultValue => FMOne type: #FASTPyExpression opposite: #parentDefaultParameterValue', '#type => FMOne type: #FASTPyType opposite: #parentParameter' @@ -88,3 +88,10 @@ FASTPyParameter >> type: anObject [ type := anObject ] + +{ #category : 'accessing' } +FASTPyParameter >> variableDeclarator [ + "For parameters, they are their own declarator." + + ^ self +] diff --git a/src/FAST-Python-Model/FASTPySplatParameter.class.st b/src/FAST-Python-Model/FASTPySplatParameter.class.st index 24cd9d4..a21eac2 100644 --- a/src/FAST-Python-Model/FASTPySplatParameter.class.st +++ b/src/FAST-Python-Model/FASTPySplatParameter.class.st @@ -1,4 +1,6 @@ " +A splat parameter is a parameter that is a list slpat such as *args or a dictionary splat such as **kwargs. + ## Relations ====================== diff --git a/src/FAST-Python-Model/FASTPySubscript.class.st b/src/FAST-Python-Model/FASTPySubscript.class.st index 690b271..0e56153 100644 --- a/src/FAST-Python-Model/FASTPySubscript.class.st +++ b/src/FAST-Python-Model/FASTPySubscript.class.st @@ -29,8 +29,8 @@ Class { #name : 'FASTPySubscript', #superclass : 'FASTPyExpression', - #traits : 'FASTPyTAsPatternTarget + FASTPyTReturnReferenceable', - #classTraits : 'FASTPyTAsPatternTarget classTrait + FASTPyTReturnReferenceable classTrait', + #traits : 'FASTPyTAsPatternTarget + FASTPyTCanBeVariable + FASTPyTReturnReferenceable', + #classTraits : 'FASTPyTAsPatternTarget classTrait + FASTPyTCanBeVariable classTrait + FASTPyTReturnReferenceable classTrait', #instVars : [ '#indices => FMMany type: #FASTPyTSliceIndex opposite: #parentSubscriptIndex', '#value => FMOne type: #FASTPyExpression opposite: #parentSubscriptValue' @@ -86,3 +86,13 @@ FASTPySubscript >> value: anObject [ value := anObject ] + +{ #category : 'accessing' } +FASTPySubscript >> variableDeclarator [ + "In the case I represent a write access to a variable, I return the node representing my assignment." + + "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" + self selfOrTopmostAssignableCollection parentAssignmentLeft ifNotNil: [ :assignment | ^ assignment ]. + + ^ super variableDeclarator +] diff --git a/src/FAST-Python-Model/FASTPyTCanBeVariable.trait.st b/src/FAST-Python-Model/FASTPyTCanBeVariable.trait.st new file mode 100644 index 0000000..ceb58fd --- /dev/null +++ b/src/FAST-Python-Model/FASTPyTCanBeVariable.trait.st @@ -0,0 +1,19 @@ +" +Represent everything that can be a variable. Used for the LocalResolver and the SSA builder. Maybe I should be merged with TAssignable? + + +" +Trait { + #name : 'FASTPyTCanBeVariable', + #category : 'FAST-Python-Model-Traits', + #package : 'FAST-Python-Model', + #tag : 'Traits' +} + +{ #category : 'meta' } +FASTPyTCanBeVariable classSide >> annotation [ + + + + +] diff --git a/src/FAST-Python-Model/FASTPyTVisitor.trait.st b/src/FAST-Python-Model/FASTPyTVisitor.trait.st index 6eece1e..d1f6f4f 100644 --- a/src/FAST-Python-Model/FASTPyTVisitor.trait.st +++ b/src/FAST-Python-Model/FASTPyTVisitor.trait.st @@ -69,6 +69,7 @@ FASTPyTVisitor >> visitFASTPyAttributeAccess: anAttributeAccess [ self visitFASTPyTAsPatternTarget: anAttributeAccess. + self visitFASTPyTCanBeVariable: anAttributeAccess. self visitFASTPyTReturnReferenceable: anAttributeAccess. self visitFASTPyTSplatParameterTarget: anAttributeAccess. self visitFASTTNamedEntity: anAttributeAccess. @@ -489,8 +490,10 @@ FASTPyTVisitor >> visitFASTPyIdentifier: anIdentifier [ self visitFASTPyTAsPatternTarget: anIdentifier. + self visitFASTPyTCanBeVariable: anIdentifier. self visitFASTPyTReturnReferenceable: anIdentifier. self visitFASTPyTSplatParameterTarget: anIdentifier. + self visitFASTTNamedEntity: anIdentifier. self visitFASTPyExpression: anIdentifier ] @@ -716,6 +719,7 @@ FASTPyTVisitor >> visitFASTPyPair: aPair [ FASTPyTVisitor >> visitFASTPyParameter: aParameter [ + self visitFASTPyTCanBeVariable: aParameter. self visitFASTTVariableEntity: aParameter. self visitEntity: aParameter type. @@ -845,6 +849,7 @@ FASTPyTVisitor >> visitFASTPySubscript: aSubscript [ self visitFASTPyTAsPatternTarget: aSubscript. + self visitFASTPyTCanBeVariable: aSubscript. self visitFASTPyTReturnReferenceable: aSubscript. self visitFASTPyExpression: aSubscript. @@ -889,6 +894,13 @@ FASTPyTVisitor >> visitFASTPyTCallable: aTCallable [ ] +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTPyTCanBeVariable: aTCanBeVariable [ + + + +] + { #category : 'visiting' } FASTPyTVisitor >> visitFASTPyTClassPatternElement: aTClassPatternElement [ @@ -1295,7 +1307,9 @@ FASTPyTVisitor >> visitFASTTStringLiteral: aTStringLiteral [ FASTPyTVisitor >> visitFASTTVariableEntity: aTVariableEntity [ - self visitFASTTNamedEntity: aTVariableEntity. + "We do not visit all behaviorals because some classes already visit it in their superclasses in this language implementation. Visiting them here also would cause a double visit of this trait." + ({ FASTPyVariable } includes: aTVariableEntity class) + ifFalse: [ self visitFASTTNamedEntity: aTVariableEntity ]. ] diff --git a/src/FAST-Python-Model/FASTPyTuple.class.st b/src/FAST-Python-Model/FASTPyTuple.class.st index 6f59475..4a059d7 100644 --- a/src/FAST-Python-Model/FASTPyTuple.class.st +++ b/src/FAST-Python-Model/FASTPyTuple.class.st @@ -30,3 +30,10 @@ FASTPyTuple class >> annotation [ ] + +{ #category : 'testing' } +FASTPyTuple >> isTuple [ + + + ^ true +] diff --git a/src/FAST-Python-Tools-Tests/FASTPyAttributeAccess.extension.st b/src/FAST-Python-Tools-Tests/FASTPyAttributeAccess.extension.st new file mode 100644 index 0000000..1b02491 --- /dev/null +++ b/src/FAST-Python-Tools-Tests/FASTPyAttributeAccess.extension.st @@ -0,0 +1,7 @@ +Extension { #name : 'FASTPyAttributeAccess' } + +{ #category : '*FAST-Python-Tools-Tests' } +FASTPyAttributeAccess >> localResolverKind [ + + ^ #variable +] diff --git a/src/FAST-Python-Tools-Tests/FASTPythonAbstractTestCase.class.st b/src/FAST-Python-Tools-Tests/FASTPythonAbstractTestCase.class.st deleted file mode 100644 index 72f2c13..0000000 --- a/src/FAST-Python-Tools-Tests/FASTPythonAbstractTestCase.class.st +++ /dev/null @@ -1,14 +0,0 @@ -Class { - #name : 'FASTPythonAbstractTestCase', - #superclass : 'TestCase', - #category : 'FAST-Python-Tools-Tests', - #package : 'FAST-Python-Tools-Tests' -} - -{ #category : 'running' } -FASTPythonAbstractTestCase >> parse: aString [ - - ^ FASTPythonImporter new - errorReportBlock: [ :i | i errors ifNotEmpty: [ self fail: 'Errors happened during parsing. Errors: ' , i errors printString ] ]; - parse: aString withPlatformLineEndings -] diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 535c4d7..bb88754 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -4,14 +4,16 @@ Class { #instVars : [ 'startBlock' ], - #category : 'FAST-Python-Tools-Tests', - #package : 'FAST-Python-Tools-Tests' + #category : 'FAST-Python-Tools-Tests-Algos', + #package : 'FAST-Python-Tools-Tests', + #tag : 'Algos' } { #category : 'running' } FASTPythonCFGTest >> buildCFGForFunction: aString [ - startBlock := FASTPythonCFGVisitor buildCFGOf: (self parse: aString) allFunctionDefinitions first + self parse: aString. + startBlock := FASTPythonCFGVisitor buildCFGOf: model allFunctionDefinitions first ] { #category : 'tests' } @@ -83,6 +85,20 @@ print(i)') allModules first. self assertEmpty: startBlock nextBlocks ] +{ #category : 'tests' } +FASTPythonCFGTest >> testContainingLambdas [ + "Regression test. The CFG was duplicating the lambda node until now." + + self buildCFGForFunction: 'def funct(): + l = lambda x: x + 2 + l(4)'. + + self assert: startBlock isStart. + self assert: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assertEmpty: startBlock nextBlocks +] + { #category : 'tests' } FASTPythonCFGTest >> testFunctionInFunction [ @@ -129,8 +145,8 @@ FASTPythonCFGTest >> testFunctionWithConditionalExpression [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyCall). - self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyCall). + self assert: (startBlock statements second isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -162,17 +178,17 @@ FASTPythonCFGTest >> testFunctionWithFor [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. forBlock := startBlock nextTrueBlock. self deny: forBlock isConditional. self deny: forBlock isFinal. - self assert: forBlock statements size equals: 1. - self assert: (forBlock statements first isOfType: FASTPyCall). + self assert: forBlock statements size equals: 2. + self assert: (forBlock statements first isOfType: FASTPyIdentifier). + self assert: (forBlock statements second isOfType: FASTPyCall). self assert: forBlock nextBlock equals: startBlock. nullBlock := startBlock nextFalseBlock. @@ -194,22 +210,22 @@ FASTPythonCFGTest >> testFunctionWithForConditionDoesNotMixWithPreviousStatement self deny: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: (startBlock statements first isOfType: FASTPyCall). forCondition := startBlock nextBlock. self assert: forCondition isConditional. self deny: forCondition isFinal. - self assert: forCondition statements size equals: 2. - self assert: (forCondition statements first class isOfType: FASTPyIdentifier). - self assert: (forCondition statements second class isOfType: FASTPyIdentifier). + self assert: forCondition statements size equals: 1. + self assert: (forCondition statements first isOfType: FASTPyIdentifier). self assert: forCondition nextBlocks size equals: 2. self assert: (forCondition nextBlocks select: #isNullBlock) size equals: 1. forBlock := forCondition nextTrueBlock. self deny: forBlock isConditional. self deny: forBlock isFinal. - self assert: forBlock statements size equals: 1. - self assert: (forBlock statements first isOfType: FASTPyCall). + self assert: forBlock statements size equals: 2. + self assert: (forBlock statements first isOfType: FASTPyIdentifier). + self assert: (forBlock statements second isOfType: FASTPyCall). self assert: forBlock nextBlock equals: forCondition. nullBlock := forCondition nextFalseBlock. @@ -230,18 +246,18 @@ FASTPythonCFGTest >> testFunctionWithForWithBreak [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. forBlock := startBlock nextTrueBlock. self deny: forBlock isConditional. self deny: forBlock isFinal. - self assert: forBlock statements size equals: 2. - self assert: (forBlock statements first isOfType: FASTPyCall). - self assert: (forBlock statements second isOfType: FASTPyBreakStatement). + self assert: forBlock statements size equals: 3. + self assert: (forBlock statements first isOfType: FASTPyIdentifier). + self assert: (forBlock statements second isOfType: FASTPyCall). + self assert: (forBlock statements third isOfType: FASTPyBreakStatement). nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. @@ -264,18 +280,18 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThen [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -306,18 +322,18 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThen2 [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -355,18 +371,18 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenBreakingAndElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -407,18 +423,18 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenBreakingAndElseBreaking self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -465,18 +481,18 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenElifAndElseAllBreaking self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -535,18 +551,18 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenElifBreakingAndElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -604,18 +620,18 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakingIfThenElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -653,18 +669,18 @@ FASTPythonCFGTest >> testFunctionWithForWithContinue [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. forBlock := startBlock nextTrueBlock. self deny: forBlock isConditional. self deny: forBlock isFinal. - self assert: forBlock statements size equals: 2. - self assert: (forBlock statements first isOfType: FASTPyCall). - self assert: (forBlock statements second isOfType: FASTPyContinueStatement). + self assert: forBlock statements size equals: 3. + self assert: (forBlock statements first isOfType: FASTPyIdentifier). + self assert: (forBlock statements second isOfType: FASTPyCall). + self assert: (forBlock statements third isOfType: FASTPyContinueStatement). self assert: forBlock nextBlock equals: startBlock. nullBlock := startBlock nextFalseBlock. @@ -687,18 +703,18 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThen [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -729,18 +745,18 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThen2 [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -778,18 +794,18 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenContinuingAndElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -830,18 +846,18 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenContinuingAndElseCon self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -888,18 +904,18 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenElifAndElseAllContin self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -958,18 +974,18 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenElifContinuingAndEls self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -1027,18 +1043,18 @@ FASTPythonCFGTest >> testFunctionWithForWithContinuingIfThenElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -1077,18 +1093,18 @@ FASTPythonCFGTest >> testFunctionWithForWithElseWithBreakInAllBranches [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). forBlock := startBlock nextTrueBlock. self deny: forBlock isConditional. self deny: forBlock isFinal. - self assert: forBlock statements size equals: 2. - self assert: (forBlock statements first isOfType: FASTPyCall). - self assert: (forBlock statements second isOfType: FASTPyBreakStatement). + self assert: forBlock statements size equals: 3. + self assert: (forBlock statements first isOfType: FASTPyIdentifier). + self assert: (forBlock statements second isOfType: FASTPyCall). + self assert: (forBlock statements third isOfType: FASTPyBreakStatement). elseBlock := startBlock nextFalseBlock. self deny: elseBlock isNullBlock. @@ -1117,18 +1133,18 @@ FASTPythonCFGTest >> testFunctionWithForWithElseWithBreakInIf [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). forBlock := startBlock nextTrueBlock. self assert: forBlock isConditional. self deny: forBlock isFinal. - self assert: forBlock statements size equals: 2. - self assert: (forBlock statements first isOfType: FASTPyCall). - self assert: (forBlock statements second isOfType: FASTPyComparisonOperator). + self assert: forBlock statements size equals: 3. + self assert: (forBlock statements first isOfType: FASTPyIdentifier). + self assert: (forBlock statements second isOfType: FASTPyCall). + self assert: (forBlock statements third isOfType: FASTPyComparisonOperator). self assert: forBlock nextFalseBlock equals: startBlock. thenBlock := forBlock nextTrueBlock. @@ -1162,17 +1178,17 @@ FASTPythonCFGTest >> testFunctionWithForWithElseWithoutBreak [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). forBlock := startBlock nextTrueBlock. self deny: forBlock isConditional. self deny: forBlock isFinal. - self assert: forBlock statements size equals: 1. - self assert: (forBlock statements first isOfType: FASTPyCall). + self assert: forBlock statements size equals: 2. + self assert: (forBlock statements first isOfType: FASTPyIdentifier). + self assert: (forBlock statements second isOfType: FASTPyCall). self assert: forBlock nextBlock equals: startBlock. elseBlock := startBlock nextFalseBlock. @@ -1202,18 +1218,18 @@ FASTPythonCFGTest >> testFunctionWithForWithIfInElif [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyIdentifier). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. self deny: ifConditionalBlock isFinal. - self assert: ifConditionalBlock statements size equals: 2. - self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + self assert: ifConditionalBlock statements size equals: 3. + self assert: (ifConditionalBlock statements first isOfType: FASTPyIdentifier). + self assert: (ifConditionalBlock statements second isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements third isOfType: FASTPyComparisonOperator). thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. @@ -1281,7 +1297,7 @@ FASTPythonCFGTest >> testFunctionWithIfInElif [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1347,7 +1363,7 @@ FASTPythonCFGTest >> testFunctionWithIfInElif2 [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1413,8 +1429,8 @@ FASTPythonCFGTest >> testFunctionWithIfThen [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyCall). - self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyCall). + self assert: (startBlock statements second isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1443,8 +1459,8 @@ FASTPythonCFGTest >> testFunctionWithIfThenAtEnd [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyCall). - self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyCall). + self assert: (startBlock statements second isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -1473,7 +1489,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenAtStart [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1505,7 +1521,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElif [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1551,7 +1567,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElifElif [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1611,7 +1627,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElifElifElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1675,7 +1691,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElifElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1726,8 +1742,8 @@ FASTPythonCFGTest >> testFunctionWithIfThenElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyCall). - self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyCall). + self assert: (startBlock statements second isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1766,8 +1782,8 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseAtEnd [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyCall). - self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyCall). + self assert: (startBlock statements second isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1804,7 +1820,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseAtStart [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1843,7 +1859,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseInIfThen [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -1851,8 +1867,8 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseInIfThen [ self assert: thenBlock isConditional. self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 2. - self assert: (thenBlock statements first class isOfType: FASTPyCall). - self assert: (thenBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyComparisonOperator). thenBlock2 := thenBlock nextTrueBlock. self deny: thenBlock2 isConditional. @@ -1887,7 +1903,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenInIfThen [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -1895,8 +1911,8 @@ FASTPythonCFGTest >> testFunctionWithIfThenInIfThen [ self assert: thenBlock isConditional. self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 2. - self assert: (thenBlock statements first class isOfType: FASTPyCall). - self assert: (thenBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyComparisonOperator). thenBlock2 := thenBlock nextTrueBlock. self deny: thenBlock2 isConditional. @@ -1927,7 +1943,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenInIfThenElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -1935,8 +1951,8 @@ FASTPythonCFGTest >> testFunctionWithIfThenInIfThenElse [ self assert: thenBlock isConditional. self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 2. - self assert: (thenBlock statements first class isOfType: FASTPyCall). - self assert: (thenBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyComparisonOperator). thenBlock2 := thenBlock nextTrueBlock. self deny: thenBlock2 isConditional. @@ -1978,8 +1994,8 @@ FASTPythonCFGTest >> testFunctionWithMatch [ self assert: startBlock isSwitch. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyCall). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyCall). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 3. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -2034,8 +2050,8 @@ FASTPythonCFGTest >> testFunctionWithMatchWith2IdenticalCase [ self assert: startBlock isSwitch. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyCall). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyCall). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -2082,8 +2098,8 @@ FASTPythonCFGTest >> testFunctionWithMatchWithCondition [ self assert: startBlock isSwitch. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyCall). - self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: (startBlock statements first isOfType: FASTPyCall). + self assert: (startBlock statements second isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 3. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -2180,7 +2196,7 @@ FASTPythonCFGTest >> testFunctionWithTry [ self deny: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: (startBlock statements first isOfType: FASTPyCall). self assert: startBlock nextBlocks size equals: 1. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -2231,7 +2247,7 @@ FASTPythonCFGTest >> testFunctionWithTryWihtMultipleExcepts [ self deny: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: (startBlock statements first isOfType: FASTPyCall). self assert: startBlock nextBlocks size equals: 1. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -2300,7 +2316,7 @@ FASTPythonCFGTest >> testFunctionWithTryWithElse [ self deny: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: (startBlock statements first isOfType: FASTPyCall). self assert: startBlock nextBlocks size equals: 1. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -2378,7 +2394,7 @@ FASTPythonCFGTest >> testFunctionWithTryWithElseAndFinally [ self deny: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: (startBlock statements first isOfType: FASTPyCall). self assert: startBlock nextBlocks size equals: 1. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -2454,7 +2470,7 @@ FASTPythonCFGTest >> testFunctionWithTryWithFinally [ self deny: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: (startBlock statements first isOfType: FASTPyCall). self assert: startBlock nextBlocks size equals: 1. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -2513,7 +2529,7 @@ FASTPythonCFGTest >> testFunctionWithWhile [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -2548,7 +2564,7 @@ FASTPythonCFGTest >> testFunctionWithWhileBreakingInWhile [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -2603,7 +2619,7 @@ FASTPythonCFGTest >> testFunctionWithWhileBreakingInWhile2 [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -2655,13 +2671,13 @@ FASTPythonCFGTest >> testFunctionWithWhileDoesNotMixWithPreviousStatements [ self deny: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: (startBlock statements first isOfType: FASTPyCall). whileCondition := startBlock nextBlock. self assert: whileCondition isConditional. self deny: whileCondition isFinal. self assert: whileCondition statements size equals: 1. - self assert: (whileCondition statements first class isOfType: FASTPyComparisonOperator). + self assert: (whileCondition statements first isOfType: FASTPyComparisonOperator). self assert: whileCondition nextBlocks size equals: 2. self assert: (whileCondition nextBlocks select: #isNullBlock) size equals: 1. @@ -2692,7 +2708,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreak [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -2725,7 +2741,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -2766,7 +2782,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen2 [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -2814,7 +2830,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenBreakingAndElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -2865,7 +2881,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenBreakingAndElseBreaki self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -2922,7 +2938,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifAndElseAllBreakin self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -2991,7 +3007,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifBreakingAndElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -3059,7 +3075,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakingIfThenElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -3107,7 +3123,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinue [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -3140,7 +3156,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThen [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -3181,7 +3197,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThen2 [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -3229,7 +3245,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenContinuingAndElse self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -3280,7 +3296,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenContinuingAndElseC self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -3337,7 +3353,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenElifAndElseAllCont self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -3406,7 +3422,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenElifContinuingAndE self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -3474,7 +3490,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinuingIfThenElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -3523,7 +3539,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithElseWithBreakInAllBranches [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -3562,7 +3578,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithElseWithBreakInIf [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -3606,7 +3622,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithElseWithoutBreak [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -3645,7 +3661,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithIfInElif [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). diff --git a/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st index fcebba6..538a68a 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st @@ -37,8 +37,9 @@ Dictionary new Class { #name : 'FASTPythonImporterTest', #superclass : 'TSFASTAbstractImporterTest', - #category : 'FAST-Python-Tools-Tests', - #package : 'FAST-Python-Tools-Tests' + #category : 'FAST-Python-Tools-Tests-Importer', + #package : 'FAST-Python-Tools-Tests', + #tag : 'Importer' } { #category : 'class initialization' } @@ -124,6 +125,7 @@ FASTPythonImporterTest >> testAsPatternWithAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'get'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'get'. stack pop. stack pop. @@ -141,6 +143,7 @@ FASTPythonImporterTest >> testAsPatternWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'container'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'container'. stack pop. stack pop. stack pop. @@ -196,6 +199,7 @@ FASTPythonImporterTest >> testAsPatternWithList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'open'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'open'. stack pop. stack pop. @@ -212,11 +216,13 @@ FASTPythonImporterTest >> testAsPatternWithList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'reader'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'reader'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'writer'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'writer'. stack pop. stack pop. stack pop. @@ -270,6 +276,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceAttributeAccess [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -279,6 +286,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceAttributeAccess [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. stack pop. @@ -332,6 +340,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -341,6 +350,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceCall [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. stack pop. @@ -384,6 +394,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceIdentifier [ stack push: self topEntity source. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation target" @@ -392,6 +403,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceIdentifier [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. stack pop. @@ -443,6 +455,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceSubscript [ stack push: (stack top indices at: 1). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation value" @@ -451,6 +464,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -460,6 +474,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceSubscript [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. stack pop. @@ -515,6 +530,7 @@ FASTPythonImporterTest >> testAsPatternWithSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'get'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'get'. stack pop. stack pop. @@ -558,6 +574,7 @@ FASTPythonImporterTest >> testAsPatternWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'targets'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'targets'. stack pop. stack pop. stack pop. @@ -614,6 +631,7 @@ FASTPythonImporterTest >> testAsPatternWithTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'open'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'open'. stack pop. stack pop. @@ -630,11 +648,13 @@ FASTPythonImporterTest >> testAsPatternWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'g'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'g'. stack pop. stack pop. stack pop. @@ -710,6 +730,7 @@ FASTPythonImporterTest >> testAssertStatement [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack push: (stack top operands at: 2). @@ -842,6 +863,7 @@ FASTPythonImporterTest >> testAssignmentInAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -886,6 +908,7 @@ FASTPythonImporterTest >> testAssignmentInList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'remote'. stack pop. stack pop. @@ -930,11 +953,13 @@ FASTPythonImporterTest >> testAssignmentInPatternList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -1000,11 +1025,13 @@ FASTPythonImporterTest >> testAssignmentInSlice [ stack push: (stack top components at: 1). self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. stack push: (stack top components at: 2). self assert: self topEntity sourceCode equals: 'j'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'j'. stack pop. stack pop. @@ -1014,6 +1041,7 @@ FASTPythonImporterTest >> testAssignmentInSlice [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'lst'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'lst'. stack pop. stack pop. @@ -1022,7 +1050,8 @@ FASTPythonImporterTest >> testAssignmentInSlice [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'seq'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'seq' ] { #category : 'tests - assignments' } @@ -1066,6 +1095,7 @@ FASTPythonImporterTest >> testAssignmentInSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'variables'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'variables'. stack pop. stack pop. @@ -1109,11 +1139,13 @@ FASTPythonImporterTest >> testAssignmentInTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -1122,7 +1154,8 @@ FASTPythonImporterTest >> testAssignmentInTuple [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - assignments' } @@ -1166,7 +1199,8 @@ FASTPythonImporterTest >> testAssignmentToAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - assignments' } @@ -1268,6 +1302,7 @@ FASTPythonImporterTest >> testAssignmentToBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -1276,7 +1311,8 @@ FASTPythonImporterTest >> testAssignmentToBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - assignments' } @@ -1321,7 +1357,8 @@ FASTPythonImporterTest >> testAssignmentToCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - assignments' } @@ -1468,6 +1505,7 @@ FASTPythonImporterTest >> testAssignmentToConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -1475,7 +1513,8 @@ FASTPythonImporterTest >> testAssignmentToConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - assignments' } @@ -1683,7 +1722,8 @@ FASTPythonImporterTest >> testAssignmentToIdentifier [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'element' ] { #category : 'tests - assignments' } @@ -1766,6 +1806,7 @@ FASTPythonImporterTest >> testAssignmentToLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -1818,7 +1859,92 @@ FASTPythonImporterTest >> testAssignmentToList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'remote' +] + +{ #category : 'tests - assignments' } +FASTPythonImporterTest >> testAssignmentToListSplatInTuple [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testAssignmentToListSplatInTuple " + + self parse: 'a, *b = [1, 2, 3]'. + + self assert: (fast allWithType: FASTPyAssignment) size equals: 1. + self assert: (fast allWithType: FASTPyIdentifier) size equals: 1. + self assert: (fast allWithType: FASTPyInteger) size equals: 3. + self assert: (fast allWithType: FASTPyList) size equals: 1. + self assert: (fast allWithType: FASTPyModule) size equals: 1. + self assert: (fast allWithType: FASTPySplat) size equals: 1. + self assert: (fast allWithType: FASTPyTuple) size equals: 1. + self assert: (fast allWithType: FASTPyVariable) size equals: 1. + + stack push: fast rootEntities anyOne containedEntities first. + self assert: self topEntity sourceCode equals: 'a, *b = [1, 2, 3]'. + self assert: (self topEntity isOfType: FASTPyAssignment). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'a, *b'. + self assert: (self topEntity isOfType: FASTPyTuple). + + "Testing value of multivalued relation initializers" + self assert: self topEntity initializers size equals: 2. + + stack push: (stack top initializers at: 1). + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. + stack pop. + + stack push: (stack top initializers at: 2). + self assert: self topEntity sourceCode equals: '*b'. + self assert: (self topEntity isOfType: FASTPySplat). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'b'. + self assert: (self topEntity isOfType: FASTPyVariable). + self assert: (self topEntity isOfType: FASTTVariableEntity). + self assert: self topEntity name equals: 'b'. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: '[1, 2, 3]'. + self assert: (self topEntity isOfType: FASTPyList). + + "Testing value of multivalued relation initializers" + self assert: self topEntity initializers size equals: 3. + + stack push: (stack top initializers at: 1). + self assert: self topEntity sourceCode equals: '1'. + self assert: (self topEntity isOfType: FASTPyInteger). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTNumericalLiteral). + stack pop. + + stack push: (stack top initializers at: 2). + self assert: self topEntity sourceCode equals: '2'. + self assert: (self topEntity isOfType: FASTPyInteger). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTNumericalLiteral). + stack pop. + + stack push: (stack top initializers at: 3). + self assert: self topEntity sourceCode equals: '3'. + self assert: (self topEntity isOfType: FASTPyInteger). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTNumericalLiteral) ] { #category : 'tests - assignments' } @@ -1865,6 +1991,7 @@ FASTPythonImporterTest >> testAssignmentToList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -1880,6 +2007,7 @@ FASTPythonImporterTest >> testAssignmentToList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -1906,7 +2034,8 @@ FASTPythonImporterTest >> testAssignmentToList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - assignments' } @@ -1986,7 +2115,8 @@ FASTPythonImporterTest >> testAssignmentToNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - assignments' } @@ -2030,11 +2160,13 @@ FASTPythonImporterTest >> testAssignmentToPatternList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b' ] { #category : 'tests - assignments' } @@ -2126,6 +2258,7 @@ FASTPythonImporterTest >> testAssignmentToSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -2141,6 +2274,7 @@ FASTPythonImporterTest >> testAssignmentToSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -2167,7 +2301,8 @@ FASTPythonImporterTest >> testAssignmentToSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - assignments' } @@ -2258,7 +2393,8 @@ FASTPythonImporterTest >> testAssignmentToSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - assignments' } @@ -2442,7 +2578,8 @@ FASTPythonImporterTest >> testAssignmentType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - accesses' } @@ -2467,7 +2604,8 @@ FASTPythonImporterTest >> testAttributeAccess [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - accesses' } @@ -2500,7 +2638,8 @@ FASTPythonImporterTest >> testAttributeAccessNested [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - attributes' } @@ -2533,7 +2672,8 @@ FASTPythonImporterTest >> testAttributeAccessOnAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - attributes' } @@ -2615,6 +2755,7 @@ FASTPythonImporterTest >> testAttributeAccessOnBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -2623,7 +2764,8 @@ FASTPythonImporterTest >> testAttributeAccessOnBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - attributes' } @@ -2658,7 +2800,8 @@ FASTPythonImporterTest >> testAttributeAccessOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - attributes' } @@ -2775,6 +2918,7 @@ FASTPythonImporterTest >> testAttributeAccessOnConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -2782,7 +2926,8 @@ FASTPythonImporterTest >> testAttributeAccessOnConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - attributes' } @@ -2878,6 +3023,7 @@ FASTPythonImporterTest >> testAttributeAccessOnDictionary_comprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -2886,6 +3032,7 @@ FASTPythonImporterTest >> testAttributeAccessOnDictionary_comprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -2902,6 +3049,7 @@ FASTPythonImporterTest >> testAttributeAccessOnDictionary_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -2909,7 +3057,8 @@ FASTPythonImporterTest >> testAttributeAccessOnDictionary_comprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - attributes' } @@ -2988,7 +3137,8 @@ FASTPythonImporterTest >> testAttributeAccessOnIdentifier [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - attributes' } @@ -3021,7 +3171,8 @@ FASTPythonImporterTest >> testAttributeAccessOnList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'remote' ] { #category : 'tests - attributes' } @@ -3058,6 +3209,7 @@ FASTPythonImporterTest >> testAttributeAccessOnList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -3073,6 +3225,7 @@ FASTPythonImporterTest >> testAttributeAccessOnList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -3099,7 +3252,8 @@ FASTPythonImporterTest >> testAttributeAccessOnList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - attributes' } @@ -3159,7 +3313,8 @@ FASTPythonImporterTest >> testAttributeAccessOnNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - attributes' } @@ -3231,6 +3386,7 @@ FASTPythonImporterTest >> testAttributeAccessOnSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -3246,6 +3402,7 @@ FASTPythonImporterTest >> testAttributeAccessOnSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -3272,7 +3429,8 @@ FASTPythonImporterTest >> testAttributeAccessOnSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - attributes' } @@ -3343,7 +3501,8 @@ FASTPythonImporterTest >> testAttributeAccessOnSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - attributes' } @@ -3404,11 +3563,13 @@ FASTPythonImporterTest >> testAttributeAccessOnTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b' ] { #category : 'tests - attributes' } @@ -3471,7 +3632,8 @@ FASTPythonImporterTest >> testAttributeAccessWithReceiverParenthesised [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - assignments' } @@ -3506,6 +3668,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentInAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '+='. @@ -3599,6 +3762,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentInSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. self assert: self topEntity operator equals: '+='. @@ -3644,11 +3808,13 @@ FASTPythonImporterTest >> testAugmentedAssignmentInTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. self assert: self topEntity operator equals: '+='. @@ -3705,7 +3871,8 @@ FASTPythonImporterTest >> testAugmentedAssignmentToAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - assignments' } @@ -3809,7 +3976,8 @@ FASTPythonImporterTest >> testAugmentedAssignmentToCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - assignments' } @@ -3904,6 +4072,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentToConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -3911,7 +4080,8 @@ FASTPythonImporterTest >> testAugmentedAssignmentToConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - assignments' } @@ -3985,7 +4155,8 @@ FASTPythonImporterTest >> testAugmentedAssignmentToIdentifier [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'element' ] { #category : 'tests - assignments' } @@ -4078,7 +4249,8 @@ FASTPythonImporterTest >> testAugmentedAssignmentToSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - assignments' } @@ -4151,7 +4323,8 @@ FASTPythonImporterTest >> testAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'future'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'future' ] { #category : 'tests - await' } @@ -4187,6 +4360,7 @@ FASTPythonImporterTest >> testAwaitAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -4195,7 +4369,8 @@ FASTPythonImporterTest >> testAwaitAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - await' } @@ -4230,6 +4405,7 @@ FASTPythonImporterTest >> testAwaitAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -4238,7 +4414,8 @@ FASTPythonImporterTest >> testAwaitAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - await' } @@ -4274,6 +4451,7 @@ FASTPythonImporterTest >> testAwaitCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. @@ -4282,7 +4460,8 @@ FASTPythonImporterTest >> testAwaitCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - await' } @@ -4329,6 +4508,7 @@ FASTPythonImporterTest >> testAwaitConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -4337,6 +4517,7 @@ FASTPythonImporterTest >> testAwaitConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -4345,7 +4526,8 @@ FASTPythonImporterTest >> testAwaitConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - await' } @@ -4372,6 +4554,7 @@ FASTPythonImporterTest >> testAwaitIdentifier [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation callee" @@ -4379,7 +4562,8 @@ FASTPythonImporterTest >> testAwaitIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - await' } @@ -4425,6 +4609,7 @@ FASTPythonImporterTest >> testAwaitSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -4433,7 +4618,8 @@ FASTPythonImporterTest >> testAwaitSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - operators' } @@ -4513,6 +4699,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -4530,7 +4717,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -4642,6 +4830,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -4659,6 +4848,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -4668,6 +4858,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -4678,7 +4869,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - operators' } @@ -4714,6 +4906,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -4732,7 +4925,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - operators' } @@ -4889,6 +5083,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -4905,6 +5100,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithConditionalExpression [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -4914,6 +5110,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithConditionalExpression [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -4923,7 +5120,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -5056,6 +5254,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -5064,6 +5263,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -5080,6 +5280,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -5088,6 +5289,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -5113,6 +5315,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -5121,6 +5324,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -5137,6 +5341,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -5144,7 +5349,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -5246,6 +5452,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithIdentifier [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. self assert: self topEntity operator equals: '+'. @@ -5254,7 +5461,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithIdentifier [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - operators' } @@ -5326,6 +5534,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'remote'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -5342,7 +5551,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'remote' ] { #category : 'tests - operators' } @@ -5379,6 +5589,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -5394,6 +5605,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -5421,6 +5633,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -5440,6 +5653,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -5455,6 +5669,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -5481,7 +5696,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - operators' } @@ -5516,6 +5732,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. self assert: self topEntity operator equals: ') + ('. @@ -5533,7 +5750,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - operators' } @@ -5624,6 +5842,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -5639,6 +5858,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -5666,6 +5886,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -5685,6 +5906,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -5700,6 +5922,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -5726,7 +5949,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - operators' } @@ -5809,6 +6033,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -5835,7 +6060,8 @@ FASTPythonImporterTest >> testBinaryOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - operators' } @@ -5907,11 +6133,13 @@ FASTPythonImporterTest >> testBinaryOperatorWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -5929,11 +6157,13 @@ FASTPythonImporterTest >> testBinaryOperatorWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b' ] { #category : 'tests - operators' } @@ -6110,6 +6340,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6127,7 +6358,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -6162,6 +6394,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '&'. @@ -6171,6 +6404,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6189,6 +6423,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '&'. @@ -6197,7 +6432,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - operators' } @@ -6239,6 +6475,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6248,6 +6485,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6258,6 +6496,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6267,7 +6506,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - operators' } @@ -6303,6 +6543,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6321,7 +6562,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - operators' } @@ -6486,6 +6728,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -6502,6 +6745,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithConditionalExpression [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6511,6 +6755,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithConditionalExpression [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -6520,7 +6765,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -6712,6 +6958,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithIdentifier [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6720,7 +6967,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithIdentifier [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - operators' } @@ -6827,6 +7075,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -6844,7 +7093,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - operators' } @@ -6981,6 +7231,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -7007,7 +7258,8 @@ FASTPythonImporterTest >> testBooleanOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - operators' } @@ -7079,11 +7331,13 @@ FASTPythonImporterTest >> testBooleanOperatorWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. self assert: self topEntity operator equals: 'and'. @@ -7101,11 +7355,13 @@ FASTPythonImporterTest >> testBooleanOperatorWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b' ] { #category : 'tests - operators' } @@ -7241,6 +7497,7 @@ FASTPythonImporterTest >> testCalWithArgumentAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -7249,7 +7506,8 @@ FASTPythonImporterTest >> testCalWithArgumentAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7284,6 +7542,7 @@ FASTPythonImporterTest >> testCalWithArgumentAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -7292,7 +7551,8 @@ FASTPythonImporterTest >> testCalWithArgumentAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7340,6 +7600,7 @@ FASTPythonImporterTest >> testCalWithArgumentBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -7348,7 +7609,8 @@ FASTPythonImporterTest >> testCalWithArgumentBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7384,6 +7646,7 @@ FASTPythonImporterTest >> testCalWithArgumentBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -7393,6 +7656,7 @@ FASTPythonImporterTest >> testCalWithArgumentBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -7401,7 +7665,8 @@ FASTPythonImporterTest >> testCalWithArgumentBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7437,6 +7702,7 @@ FASTPythonImporterTest >> testCalWithArgumentCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. @@ -7445,7 +7711,8 @@ FASTPythonImporterTest >> testCalWithArgumentCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7480,11 +7747,13 @@ FASTPythonImporterTest >> testCalWithArgumentComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -7494,7 +7763,8 @@ FASTPythonImporterTest >> testCalWithArgumentComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7531,7 +7801,8 @@ FASTPythonImporterTest >> testCalWithArgumentComplexe [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7578,6 +7849,7 @@ FASTPythonImporterTest >> testCalWithArgumentConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -7586,6 +7858,7 @@ FASTPythonImporterTest >> testCalWithArgumentConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -7594,7 +7867,8 @@ FASTPythonImporterTest >> testCalWithArgumentConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7648,6 +7922,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -7657,7 +7932,8 @@ FASTPythonImporterTest >> testCalWithArgumentDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7701,6 +7977,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -7709,6 +7986,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -7725,6 +8003,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -7733,6 +8012,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -7742,7 +8022,8 @@ FASTPythonImporterTest >> testCalWithArgumentDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7777,6 +8058,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionarySplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'kwargs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'kwargs'. stack pop. stack pop. @@ -7785,7 +8067,8 @@ FASTPythonImporterTest >> testCalWithArgumentDictionarySplat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7821,7 +8104,8 @@ FASTPythonImporterTest >> testCalWithArgumentEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7858,7 +8142,8 @@ FASTPythonImporterTest >> testCalWithArgumentFalse [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7895,7 +8180,8 @@ FASTPythonImporterTest >> testCalWithArgumentFloat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7922,6 +8208,7 @@ FASTPythonImporterTest >> testCalWithArgumentIdentifier [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation callee" @@ -7929,7 +8216,8 @@ FASTPythonImporterTest >> testCalWithArgumentIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -7966,7 +8254,8 @@ FASTPythonImporterTest >> testCalWithArgumentInteger [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8003,6 +8292,7 @@ FASTPythonImporterTest >> testCalWithArgumentLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -8021,7 +8311,8 @@ FASTPythonImporterTest >> testCalWithArgumentLambda [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8067,7 +8358,8 @@ FASTPythonImporterTest >> testCalWithArgumentList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8113,6 +8405,7 @@ FASTPythonImporterTest >> testCalWithArgumentListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -8122,6 +8415,7 @@ FASTPythonImporterTest >> testCalWithArgumentListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -8138,6 +8432,7 @@ FASTPythonImporterTest >> testCalWithArgumentListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -8165,6 +8460,7 @@ FASTPythonImporterTest >> testCalWithArgumentListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -8175,7 +8471,8 @@ FASTPythonImporterTest >> testCalWithArgumentListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8210,6 +8507,7 @@ FASTPythonImporterTest >> testCalWithArgumentListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -8218,7 +8516,8 @@ FASTPythonImporterTest >> testCalWithArgumentListSplat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8254,7 +8553,8 @@ FASTPythonImporterTest >> testCalWithArgumentNone [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8290,6 +8590,7 @@ FASTPythonImporterTest >> testCalWithArgumentNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -8298,7 +8599,8 @@ FASTPythonImporterTest >> testCalWithArgumentNotOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8344,7 +8646,8 @@ FASTPythonImporterTest >> testCalWithArgumentSet [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8390,6 +8693,7 @@ FASTPythonImporterTest >> testCalWithArgumentSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -8399,6 +8703,7 @@ FASTPythonImporterTest >> testCalWithArgumentSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -8415,6 +8720,7 @@ FASTPythonImporterTest >> testCalWithArgumentSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -8442,6 +8748,7 @@ FASTPythonImporterTest >> testCalWithArgumentSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -8452,7 +8759,8 @@ FASTPythonImporterTest >> testCalWithArgumentSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8489,7 +8797,8 @@ FASTPythonImporterTest >> testCalWithArgumentString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8535,6 +8844,7 @@ FASTPythonImporterTest >> testCalWithArgumentSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -8543,7 +8853,8 @@ FASTPythonImporterTest >> testCalWithArgumentSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8580,7 +8891,8 @@ FASTPythonImporterTest >> testCalWithArgumentTrue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8615,11 +8927,13 @@ FASTPythonImporterTest >> testCalWithArgumentTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -8628,7 +8942,8 @@ FASTPythonImporterTest >> testCalWithArgumentTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8664,6 +8979,7 @@ FASTPythonImporterTest >> testCalWithArgumentUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -8673,7 +8989,8 @@ FASTPythonImporterTest >> testCalWithArgumentUnaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -8710,7 +9027,8 @@ FASTPythonImporterTest >> testCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'print' ] { #category : 'tests - calls' } @@ -8746,6 +9064,7 @@ FASTPythonImporterTest >> testCallArgumentWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'CFG'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'CFG'. stack pop. stack pop. @@ -8754,7 +9073,8 @@ FASTPythonImporterTest >> testCallArgumentWithAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -8810,6 +9130,7 @@ FASTPythonImporterTest >> testCallArgumentWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'train_bs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'train_bs'. stack pop. stack pop. self assert: self topEntity operator equals: '*'. @@ -8820,6 +9141,7 @@ FASTPythonImporterTest >> testCallArgumentWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'epochs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'epochs'. stack pop. stack pop. @@ -8828,7 +9150,8 @@ FASTPythonImporterTest >> testCallArgumentWithBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -8910,6 +9233,7 @@ FASTPythonImporterTest >> testCallArgumentWithCall [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'data'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'data'. stack pop. stack pop. stack pop. @@ -8920,7 +9244,8 @@ FASTPythonImporterTest >> testCallArgumentWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -8955,11 +9280,13 @@ FASTPythonImporterTest >> testCallArgumentWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'shape0'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'shape0'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'resize'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'resize'. stack pop. self assert: self topEntity operators equals: #('!='). stack pop. @@ -8969,7 +9296,8 @@ FASTPythonImporterTest >> testCallArgumentWithComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -9032,6 +9360,7 @@ FASTPythonImporterTest >> testCallArgumentWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'pred_ids'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'pred_ids'. stack pop. stack pop. @@ -9055,6 +9384,7 @@ FASTPythonImporterTest >> testCallArgumentWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'pred_classes'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'pred_classes'. stack pop. stack pop. stack pop. @@ -9064,7 +9394,8 @@ FASTPythonImporterTest >> testCallArgumentWithDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -9108,7 +9439,8 @@ FASTPythonImporterTest >> testCallArgumentWithEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -9163,7 +9495,8 @@ FASTPythonImporterTest >> testCallArgumentWithKeywordArgument [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -9191,6 +9524,7 @@ FASTPythonImporterTest >> testCallArgumentWithList [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'img'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'img'. stack pop. stack push: (stack top arguments at: 2). @@ -9203,11 +9537,13 @@ FASTPythonImporterTest >> testCallArgumentWithList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'pady'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'pady'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'padx'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'padx'. stack pop. stack pop. @@ -9216,7 +9552,8 @@ FASTPythonImporterTest >> testCallArgumentWithList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -9262,7 +9599,8 @@ FASTPythonImporterTest >> testCallChained [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'function'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'function' ] { #category : 'tests - calls' } @@ -9318,6 +9656,7 @@ FASTPythonImporterTest >> testCallLambda [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -9371,7 +9710,8 @@ FASTPythonImporterTest >> testCallOnAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - calls' } @@ -9406,7 +9746,8 @@ FASTPythonImporterTest >> testCallOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory' ] { #category : 'tests - calls' } @@ -9453,6 +9794,7 @@ FASTPythonImporterTest >> testCallOnConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -9460,7 +9802,8 @@ FASTPythonImporterTest >> testCallOnConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - calls' } @@ -9486,7 +9829,8 @@ FASTPythonImporterTest >> testCallOnIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - calls' } @@ -9523,6 +9867,7 @@ FASTPythonImporterTest >> testCallOnLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -9577,7 +9922,8 @@ FASTPythonImporterTest >> testCallOnSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'functions'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'functions' ] { #category : 'tests - calls' } @@ -9633,7 +9979,8 @@ FASTPythonImporterTest >> testCallSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'coll'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'coll' ] { #category : 'tests - calls' } @@ -9668,7 +10015,8 @@ FASTPythonImporterTest >> testCallWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'tqdm'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'tqdm' ] { #category : 'tests - calls' } @@ -9714,6 +10062,7 @@ FASTPythonImporterTest >> testCallWithGeneratorExpression [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '*'. @@ -9723,6 +10072,7 @@ FASTPythonImporterTest >> testCallWithGeneratorExpression [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -9739,6 +10089,7 @@ FASTPythonImporterTest >> testCallWithGeneratorExpression [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -9766,6 +10117,7 @@ FASTPythonImporterTest >> testCallWithGeneratorExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -9776,7 +10128,8 @@ FASTPythonImporterTest >> testCallWithGeneratorExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'sum'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'sum' ] { #category : 'tests - operators' } @@ -9866,6 +10219,7 @@ FASTPythonImporterTest >> testClassDefinitionWithMetaclass [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'MyMeta'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'MyMeta'. stack pop. stack pop. self assert: self topEntity name equals: 'aClass'. @@ -9913,6 +10267,7 @@ FASTPythonImporterTest >> testClassDefinitionWithMetaclassCustomizations [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'MyMeta'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'MyMeta'. stack pop. stack pop. @@ -9975,16 +10330,19 @@ FASTPythonImporterTest >> testClassDefinitionWithMultipleSuperclasses [ stack push: (stack top superclasses at: 1). self assert: self topEntity sourceCode equals: 'Super1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Super1'. stack pop. stack push: (stack top superclasses at: 2). self assert: self topEntity sourceCode equals: 'Super2'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Super2'. stack pop. stack push: (stack top superclasses at: 3). self assert: self topEntity sourceCode equals: 'Super3'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Super3' ] { #category : 'tests - classes' } @@ -10029,7 +10387,8 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'module'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'module' ] { #category : 'tests - classes' } @@ -10075,7 +10434,8 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory' ] { #category : 'tests - classes' } @@ -10132,6 +10492,7 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassConditionalExpression stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'Super2'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Super2'. stack pop. "Testing value of monovalue relation thenExpression" @@ -10139,7 +10500,8 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassConditionalExpression stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'Super1'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Super1' ] { #category : 'tests - classes' } @@ -10175,7 +10537,8 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassIdentifier [ stack push: (stack top superclasses at: 1). self assert: self topEntity sourceCode equals: 'SuperClass'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'SuperClass' ] { #category : 'tests - classes' } @@ -10219,7 +10582,8 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - classes' } @@ -10274,7 +10638,8 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'classes'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'classes' ] { #category : 'tests - classes' } @@ -10319,6 +10684,7 @@ FASTPythonImporterTest >> testClassDefinitionWithTypeParameters [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'K'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'K'. stack pop. stack pop. @@ -10331,7 +10697,8 @@ FASTPythonImporterTest >> testClassDefinitionWithTypeParameters [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'V'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'V' ] { #category : 'tests - comments' } @@ -10391,6 +10758,7 @@ FASTPythonImporterTest >> testCommentInArgumentList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'funct'. stack pop. "Testing value of multivalued relation comments" @@ -10455,6 +10823,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -10510,6 +10879,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -10546,6 +10916,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -10562,6 +10933,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithBooleanOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack push: (stack top operands at: 2). @@ -10605,6 +10977,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. @@ -10694,6 +11067,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithConditionalExpression [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack push: (stack top operands at: 2). @@ -10709,7 +11083,8 @@ FASTPythonImporterTest >> testComparisonOperatorWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -10798,6 +11173,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithEllipsis [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack push: (stack top operands at: 2). @@ -10901,6 +11277,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithIdentifier [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack push: (stack top operands at: 2). @@ -11045,6 +11422,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithNotOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack push: (stack top operands at: 2). @@ -11176,6 +11554,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. @@ -11253,11 +11632,13 @@ FASTPythonImporterTest >> testComparisonOperatorWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -11373,6 +11754,7 @@ FASTPythonImporterTest >> testConcatenatedString [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'name'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'name'. stack pop. stack pop. stack pop. @@ -11426,6 +11808,7 @@ FASTPythonImporterTest >> testConditionalExpression [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -11512,6 +11895,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -11528,7 +11912,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - conditional expressions' } @@ -11574,6 +11959,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -11583,6 +11969,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -11600,6 +11987,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -11608,7 +11996,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - conditional expressions' } @@ -11654,6 +12043,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -11663,6 +12053,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -11680,6 +12071,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -11688,7 +12080,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - conditional expressions' } @@ -11735,6 +12128,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. @@ -11752,7 +12146,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory' ] { #category : 'tests - conditional expressions' } @@ -11797,11 +12192,13 @@ FASTPythonImporterTest >> testConditionalExpressionWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -11819,11 +12216,13 @@ FASTPythonImporterTest >> testConditionalExpressionWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>') ] @@ -11909,6 +12308,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -11918,6 +12318,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionAttribute [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -11963,6 +12364,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -11972,6 +12374,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -11981,6 +12384,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBinaryOperator [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12026,6 +12430,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBooleanOperator stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -12035,6 +12440,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBooleanOperator stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -12044,6 +12450,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBooleanOperator stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12090,6 +12497,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. @@ -12099,6 +12507,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionCall [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12143,11 +12552,13 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionComparisonOperat stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -12158,6 +12569,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionComparisonOperat stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12205,6 +12617,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionComplexe [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12260,6 +12673,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionConditionalExpre stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12268,6 +12682,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionConditionalExpre stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -12277,6 +12692,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionConditionalExpre stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12324,6 +12740,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionFalse [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12371,6 +12788,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionFloat [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12407,6 +12825,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionIdentifier [ stack push: self topEntity condition. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation elseExpression" @@ -12415,6 +12834,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionIdentifier [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12461,6 +12881,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionInteger [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12506,6 +12927,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -12515,6 +12937,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionNotOperator [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12569,6 +12992,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'functions'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'functions'. stack pop. stack pop. @@ -12578,6 +13002,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionSubscript [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12625,6 +13050,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionTrue [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12670,6 +13096,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -12680,6 +13107,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionUnaryOperator [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12744,6 +13172,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12752,6 +13181,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -12779,6 +13209,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -12786,7 +13217,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - conditional expressions' } @@ -12850,6 +13282,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -12883,7 +13316,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - conditional expressions' } @@ -12937,6 +13371,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -12945,6 +13380,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -12961,6 +13397,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -12969,6 +13406,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -12993,6 +13431,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -13001,6 +13440,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -13017,6 +13457,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -13024,7 +13465,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - conditional expressions' } @@ -13202,6 +13644,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithIdentifier [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation thenExpression" @@ -13209,7 +13652,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithIdentifier [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - conditional expressions' } @@ -13304,6 +13748,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -13331,6 +13776,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -13461,6 +13907,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -13470,6 +13917,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -13486,6 +13934,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -13513,6 +13962,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -13539,6 +13989,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -13548,6 +13999,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -13564,6 +14016,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -13590,7 +14043,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - conditional expressions' } @@ -13635,6 +14089,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -13650,7 +14105,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - conditional expressions' } @@ -13742,6 +14198,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -13758,7 +14215,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - conditional expressions' } @@ -13785,6 +14243,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithPatternList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). @@ -13808,6 +14267,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithPatternList [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. "Testing value of monovalue relation thenExpression" @@ -13816,12 +14276,14 @@ FASTPythonImporterTest >> testConditionalExpressionWithPatternList [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. stack push: (stack top initializers at: 3). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b' ] { #category : 'tests - conditional expressions' } @@ -13942,6 +14404,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -13951,6 +14414,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -13967,6 +14431,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -13994,6 +14459,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -14020,6 +14486,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -14029,6 +14496,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -14045,6 +14513,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -14071,7 +14540,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - conditional expressions' } @@ -14175,6 +14645,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'functions'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'functions'. stack pop. stack pop. @@ -14200,7 +14671,8 @@ FASTPythonImporterTest >> testConditionalExpressionWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'functions'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'functions' ] { #category : 'tests - conditional expressions' } @@ -14292,11 +14764,13 @@ FASTPythonImporterTest >> testConditionalExpressionWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -14313,11 +14787,13 @@ FASTPythonImporterTest >> testConditionalExpressionWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - conditional expressions' } @@ -14363,6 +14839,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -14381,6 +14858,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-' ] @@ -14443,6 +14921,7 @@ FASTPythonImporterTest >> testConstrainedType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. @@ -14458,7 +14937,8 @@ FASTPythonImporterTest >> testConstrainedType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'T'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T' ] { #category : 'tests - statements' } @@ -14539,6 +15019,7 @@ def funct(): stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'decorator'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'decorator'. stack pop. stack pop. self assert: self topEntity name equals: 'funct'. @@ -14585,6 +15066,7 @@ class MyComponent: pass'. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'register_component'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'register_component'. stack pop. stack pop. self assert: self topEntity name equals: 'MyComponent'. @@ -14632,6 +15114,7 @@ def func(): pass'. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'public'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'public'. stack pop. stack pop. self assert: self topEntity name equals: 'func'. @@ -14693,6 +15176,7 @@ FASTPythonImporterTest >> testDecoratorOnMethodDefinition [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'public'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'public'. stack pop. stack pop. self assert: self topEntity name equals: 'meth'. @@ -14749,6 +15233,7 @@ def funct(): pass'. stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'functools'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'functools'. stack pop. stack pop. stack pop. @@ -14816,6 +15301,7 @@ def funct(): pass'. stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. stack pop. @@ -14875,6 +15361,7 @@ def funct(): pass'. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. "Testing value of multivalued relation parameters" @@ -14952,6 +15439,7 @@ def funct(): pass'. stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'decorators'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'decorators'. stack pop. stack pop. stack pop. @@ -15003,6 +15491,7 @@ def funct(): stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'decoratorA'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'decoratorA'. stack pop. stack pop. @@ -15016,6 +15505,7 @@ def funct(): stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'decoratorB'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'decoratorB'. stack pop. stack pop. self assert: self topEntity name equals: 'funct'. @@ -15123,6 +15613,7 @@ FASTPythonImporterTest >> testDefaultParameterWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15180,6 +15671,7 @@ FASTPythonImporterTest >> testDefaultParameterWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15250,6 +15742,7 @@ FASTPythonImporterTest >> testDefaultParameterWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15308,6 +15801,7 @@ FASTPythonImporterTest >> testDefaultParameterWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -15317,6 +15811,7 @@ FASTPythonImporterTest >> testDefaultParameterWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15376,6 +15871,7 @@ FASTPythonImporterTest >> testDefaultParameterWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15433,11 +15929,13 @@ FASTPythonImporterTest >> testDefaultParameterWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -15558,6 +16056,7 @@ FASTPythonImporterTest >> testDefaultParameterWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -15566,6 +16065,7 @@ FASTPythonImporterTest >> testDefaultParameterWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -15642,6 +16142,7 @@ FASTPythonImporterTest >> testDefaultParameterWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -15709,6 +16210,7 @@ FASTPythonImporterTest >> testDefaultParameterWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -15717,6 +16219,7 @@ FASTPythonImporterTest >> testDefaultParameterWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -15733,6 +16236,7 @@ FASTPythonImporterTest >> testDefaultParameterWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -15741,6 +16245,7 @@ FASTPythonImporterTest >> testDefaultParameterWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -15940,6 +16445,7 @@ FASTPythonImporterTest >> testDefaultParameterWithIdentifier [ stack push: self topEntity defaultValue. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity name equals: 'x'. stack pop. @@ -16047,6 +16553,7 @@ FASTPythonImporterTest >> testDefaultParameterWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -16185,6 +16692,7 @@ FASTPythonImporterTest >> testDefaultParameterWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -16194,6 +16702,7 @@ FASTPythonImporterTest >> testDefaultParameterWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -16210,6 +16719,7 @@ FASTPythonImporterTest >> testDefaultParameterWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -16237,6 +16747,7 @@ FASTPythonImporterTest >> testDefaultParameterWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -16346,6 +16857,7 @@ FASTPythonImporterTest >> testDefaultParameterWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -16474,6 +16986,7 @@ FASTPythonImporterTest >> testDefaultParameterWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -16483,6 +16996,7 @@ FASTPythonImporterTest >> testDefaultParameterWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -16499,6 +17013,7 @@ FASTPythonImporterTest >> testDefaultParameterWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -16526,6 +17041,7 @@ FASTPythonImporterTest >> testDefaultParameterWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -16646,6 +17162,7 @@ FASTPythonImporterTest >> testDefaultParameterWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -16753,11 +17270,13 @@ FASTPythonImporterTest >> testDefaultParameterWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -16816,6 +17335,7 @@ FASTPythonImporterTest >> testDefaultParameterWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -16884,6 +17404,7 @@ FASTPythonImporterTest >> testDefaultTypedParameter [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -16942,6 +17463,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -16959,6 +17481,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithAttribute [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17016,6 +17539,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17033,6 +17557,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithAwait [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17103,6 +17628,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17120,6 +17646,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithBinaryOperator [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17178,6 +17705,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -17187,6 +17715,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17204,6 +17733,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithBooleanOperator [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17263,6 +17793,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17280,6 +17811,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithCall [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17337,11 +17869,13 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -17360,6 +17894,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithComparisonOperator [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17428,6 +17963,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithComplexe [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17497,6 +18033,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -17505,6 +18042,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -17522,6 +18060,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithConditionalExpression [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17598,6 +18137,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -17616,6 +18156,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionary [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17682,6 +18223,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -17690,6 +18232,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -17706,6 +18249,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -17714,6 +18258,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -17732,6 +18277,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionaryComprehension [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17799,6 +18345,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithEllipsis [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17867,6 +18414,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithFalse [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17935,6 +18483,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithFloat [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -17984,6 +18533,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithIdentifier [ stack push: self topEntity defaultValue. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity name equals: 'x'. @@ -18000,6 +18550,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithIdentifier [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18068,6 +18619,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithInteger [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18126,6 +18678,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -18153,6 +18706,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithLambda [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18230,6 +18784,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithList [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18299,6 +18854,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -18308,6 +18864,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -18324,6 +18881,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -18351,6 +18909,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -18370,6 +18929,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithListComprehension [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18437,6 +18997,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithNone [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18495,6 +19056,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -18512,6 +19074,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithNotOperator [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18589,6 +19152,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSet [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18658,6 +19222,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -18667,6 +19232,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -18683,6 +19249,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -18710,6 +19277,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -18729,6 +19297,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSetComprehension [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18797,6 +19366,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithString [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18865,6 +19435,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -18882,6 +19453,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSubscript [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -18950,6 +19522,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithTrue [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -19007,11 +19580,13 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity name equals: 'x'. @@ -19029,6 +19604,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithTuple [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -19087,6 +19663,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -19105,6 +19682,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithUnaryOperator [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -19138,7 +19716,8 @@ FASTPythonImporterTest >> testDelStatement [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'coll'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'coll' ] { #category : 'tests - statements' } @@ -19171,7 +19750,8 @@ FASTPythonImporterTest >> testDelStatementAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - statements' } @@ -19204,11 +19784,13 @@ FASTPythonImporterTest >> testDelStatementExpressionList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'rate'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'rate'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'add_baudrate_if_supported'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'add_baudrate_if_supported' ] { #category : 'tests - statements' } @@ -19242,11 +19824,13 @@ FASTPythonImporterTest >> testDelStatementMultiple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'obj1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj1'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'obj2'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj2'. stack pop. stack push: (stack top initializers at: 3). @@ -19259,7 +19843,8 @@ FASTPythonImporterTest >> testDelStatementMultiple [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - statements' } @@ -19311,7 +19896,8 @@ FASTPythonImporterTest >> testDelStatementSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - statements' } @@ -19467,6 +20053,7 @@ FASTPythonImporterTest >> testDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -19475,6 +20062,7 @@ FASTPythonImporterTest >> testDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k'. stack pop. stack pop. @@ -19498,11 +20086,13 @@ FASTPythonImporterTest >> testDictionaryComprehension [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -19528,7 +20118,8 @@ FASTPythonImporterTest >> testDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'class_indices'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'class_indices' ] { #category : 'tests - comprehensions' } @@ -19567,6 +20158,7 @@ FASTPythonImporterTest >> testDictionaryComprehensionWithIfClause [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -19575,6 +20167,7 @@ FASTPythonImporterTest >> testDictionaryComprehensionWithIfClause [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k'. stack pop. stack pop. @@ -19591,6 +20184,7 @@ FASTPythonImporterTest >> testDictionaryComprehensionWithIfClause [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. stack push: (stack top operands at: 2). @@ -19622,11 +20216,13 @@ FASTPythonImporterTest >> testDictionaryComprehensionWithIfClause [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -19652,7 +20248,8 @@ FASTPythonImporterTest >> testDictionaryComprehensionWithIfClause [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'class_indices'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'class_indices' ] { #category : 'tests - splats' } @@ -19687,6 +20284,7 @@ FASTPythonImporterTest >> testDictionarySplatInCall [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'kwargs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'kwargs'. stack pop. stack pop. @@ -19695,7 +20293,8 @@ FASTPythonImporterTest >> testDictionarySplatInCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -19731,6 +20330,7 @@ FASTPythonImporterTest >> testDictionarySplatInDictionary [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'd1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'd1'. stack pop. stack pop. @@ -19799,6 +20399,7 @@ FASTPythonImporterTest >> testDictionarySplatOnAttributeAccess [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. stack pop. @@ -19808,7 +20409,8 @@ FASTPythonImporterTest >> testDictionarySplatOnAttributeAccess [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'funct' ] { #category : 'tests - splats' } @@ -19852,6 +20454,7 @@ FASTPythonImporterTest >> testDictionarySplatOnBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'default_args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'default_args'. stack pop. self assert: self topEntity operator equals: '|'. @@ -19861,6 +20464,7 @@ FASTPythonImporterTest >> testDictionarySplatOnBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'subprocess_args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'subprocess_args'. stack pop. stack pop. stack pop. @@ -19870,7 +20474,8 @@ FASTPythonImporterTest >> testDictionarySplatOnBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -19915,6 +20520,7 @@ FASTPythonImporterTest >> testDictionarySplatOnBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'extra'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'extra'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -19933,7 +20539,8 @@ FASTPythonImporterTest >> testDictionarySplatOnBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -19977,6 +20584,7 @@ FASTPythonImporterTest >> testDictionarySplatOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'get_config'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'get_config'. stack pop. stack pop. stack pop. @@ -19986,7 +20594,8 @@ FASTPythonImporterTest >> testDictionarySplatOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'funct' ] { #category : 'tests - splats' } @@ -20041,6 +20650,7 @@ FASTPythonImporterTest >> testDictionarySplatOnDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k'. stack pop. "Testing value of monovalue relation value" @@ -20057,6 +20667,7 @@ FASTPythonImporterTest >> testDictionarySplatOnDictionaryComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. self assert: self topEntity operator equals: '*'. @@ -20092,11 +20703,13 @@ FASTPythonImporterTest >> testDictionarySplatOnDictionaryComprehension [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. stack pop. @@ -20106,6 +20719,7 @@ FASTPythonImporterTest >> testDictionarySplatOnDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'items'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'items'. stack pop. stack pop. stack pop. @@ -20116,7 +20730,8 @@ FASTPythonImporterTest >> testDictionarySplatOnDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'funct' ] { #category : 'tests - splats' } @@ -20151,6 +20766,7 @@ FASTPythonImporterTest >> testDictionarySplatOnParenthesis [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'kwargs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'kwargs'. stack pop. stack pop. @@ -20159,7 +20775,8 @@ FASTPythonImporterTest >> testDictionarySplatOnParenthesis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -20213,6 +20830,7 @@ FASTPythonImporterTest >> testDictionarySplatOnSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'd'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'd'. stack pop. stack pop. stack pop. @@ -20222,7 +20840,8 @@ FASTPythonImporterTest >> testDictionarySplatOnSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'funct' ] { #category : 'tests - function definitions' } @@ -20313,7 +20932,8 @@ FASTPythonImporterTest >> testDictionaryWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - collections' } @@ -20431,6 +21051,7 @@ FASTPythonImporterTest >> testDictionaryWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -20439,7 +21060,8 @@ FASTPythonImporterTest >> testDictionaryWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - collections' } @@ -20492,7 +21114,8 @@ FASTPythonImporterTest >> testDictionaryWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - collections' } @@ -20663,6 +21286,7 @@ FASTPythonImporterTest >> testDictionaryWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -20670,7 +21294,8 @@ FASTPythonImporterTest >> testDictionaryWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -20916,7 +21541,8 @@ FASTPythonImporterTest >> testDictionaryWithIdentifier [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'element' ] { #category : 'tests - collections' } @@ -21015,6 +21641,7 @@ FASTPythonImporterTest >> testDictionaryWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -21128,7 +21755,8 @@ FASTPythonImporterTest >> testDictionaryWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - collections' } @@ -21183,6 +21811,7 @@ FASTPythonImporterTest >> testDictionaryWithList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -21198,6 +21827,7 @@ FASTPythonImporterTest >> testDictionaryWithList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -21224,7 +21854,8 @@ FASTPythonImporterTest >> testDictionaryWithList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -21320,7 +21951,8 @@ FASTPythonImporterTest >> testDictionaryWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - collections' } @@ -21428,6 +22060,7 @@ FASTPythonImporterTest >> testDictionaryWithSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -21443,6 +22076,7 @@ FASTPythonImporterTest >> testDictionaryWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -21469,7 +22103,8 @@ FASTPythonImporterTest >> testDictionaryWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -21504,6 +22139,7 @@ FASTPythonImporterTest >> testDictionaryWithSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'base'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'base'. stack pop. stack pop. @@ -21634,7 +22270,8 @@ FASTPythonImporterTest >> testDictionaryWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - collections' } @@ -21918,6 +22555,7 @@ except exceptions.Exception: pass' withPlatformLineEndings. stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'exceptions'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'exceptions'. stack pop. stack pop. @@ -21984,6 +22622,7 @@ except Exception(): pass' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception'. stack pop. stack pop. @@ -22058,6 +22697,7 @@ except Exception if n > 1 else Error: pass' withPlatformLineEndings. stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'n'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'n'. stack pop. stack push: (stack top operands at: 2). @@ -22075,6 +22715,7 @@ except Exception if n > 1 else Error: pass' withPlatformLineEndings. stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'Error'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Error'. stack pop. "Testing value of monovalue relation thenExpression" @@ -22083,6 +22724,7 @@ except Exception if n > 1 else Error: pass' withPlatformLineEndings. stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception'. stack pop. stack pop. @@ -22139,6 +22781,7 @@ except Exception: pass' withPlatformLineEndings. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception'. stack pop. "Testing value of multivalued relation statements" @@ -22213,6 +22856,7 @@ except exceptions[2]: pass' withPlatformLineEndings. stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'exceptions'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'exceptions'. stack pop. stack pop. @@ -22270,6 +22914,7 @@ except Exception as e: pass' withPlatformLineEndings. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception'. stack pop. "Testing value of multivalued relation statements" @@ -22310,7 +22955,8 @@ FASTPythonImporterTest >> testExecStatementOfIdentifier [ stack push: self topEntity code. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - statements' } @@ -22346,11 +22992,13 @@ FASTPythonImporterTest >> testExecStatementWithScopes [ stack push: (stack top scopes at: 1). self assert: self topEntity sourceCode equals: 'globals_dict'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'globals_dict'. stack pop. stack push: (stack top scopes at: 2). self assert: self topEntity sourceCode equals: 'locals_dict'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'locals_dict' ] { #category : 'tests - literals' } @@ -22413,6 +23061,7 @@ FASTPythonImporterTest >> testForStatement [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -22463,6 +23112,7 @@ FASTPythonImporterTest >> testForStatementWithABreak [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation right" @@ -22512,6 +23162,7 @@ FASTPythonImporterTest >> testForStatementWithABreak [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation callee" @@ -22520,6 +23171,7 @@ FASTPythonImporterTest >> testForStatementWithABreak [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'fun'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'fun'. stack pop. stack pop. @@ -22560,6 +23212,7 @@ FASTPythonImporterTest >> testForStatementWithAContinue [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation right" @@ -22609,6 +23262,7 @@ FASTPythonImporterTest >> testForStatementWithAContinue [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation callee" @@ -22617,6 +23271,7 @@ FASTPythonImporterTest >> testForStatementWithAContinue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'fun'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'fun'. stack pop. stack pop. @@ -22685,6 +23340,7 @@ else: print("Hello")' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'print'. stack pop. stack pop. stack pop. @@ -22695,6 +23351,7 @@ else: print("Hello")' withPlatformLineEndings. stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation right" @@ -22744,6 +23401,7 @@ else: print("Hello")' withPlatformLineEndings. stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation callee" @@ -22751,7 +23409,8 @@ else: print("Hello")' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'fun'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'fun' ] { #category : 'tests - advanced statements' } @@ -22780,6 +23439,7 @@ FASTPythonImporterTest >> testForStatementWithExpressionList [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -22795,11 +23455,13 @@ FASTPythonImporterTest >> testForStatementWithExpressionList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -22846,6 +23508,7 @@ FASTPythonImporterTest >> testForStatementWithForInClauseAndTuplePattern [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'idx'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'idx'. stack pop. stack push: (stack top initializers at: 2). @@ -22858,11 +23521,13 @@ FASTPythonImporterTest >> testForStatementWithForInClauseAndTuplePattern [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'heights'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'heights'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'widths'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'widths'. stack pop. stack pop. stack pop. @@ -22873,6 +23538,7 @@ FASTPythonImporterTest >> testForStatementWithForInClauseAndTuplePattern [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'data'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'data'. stack pop. "Testing value of multivalued relation statements" @@ -22890,16 +23556,19 @@ FASTPythonImporterTest >> testForStatementWithForInClauseAndTuplePattern [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'idx'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'idx'. stack pop. stack push: (stack top arguments at: 2). self assert: self topEntity sourceCode equals: 'heights'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'heights'. stack pop. stack push: (stack top arguments at: 3). self assert: self topEntity sourceCode equals: 'widths'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'widths'. stack pop. "Testing value of monovalue relation callee" @@ -22907,7 +23576,8 @@ FASTPythonImporterTest >> testForStatementWithForInClauseAndTuplePattern [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'print' ] { #category : 'tests - imports' } @@ -23404,6 +24074,7 @@ FASTPythonImporterTest >> testFunctionDefinitionWithReturnType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. @@ -23508,6 +24179,7 @@ FASTPythonImporterTest >> testGeneratorExpression [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '*'. @@ -23517,6 +24189,7 @@ FASTPythonImporterTest >> testGeneratorExpression [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -23533,6 +24206,7 @@ FASTPythonImporterTest >> testGeneratorExpression [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -23559,7 +24233,8 @@ FASTPythonImporterTest >> testGeneratorExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -23596,6 +24271,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -23612,6 +24288,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAttribute [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -23638,7 +24315,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -23674,6 +24352,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -23690,6 +24369,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAwait [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -23716,7 +24396,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -23753,6 +24434,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -23762,6 +24444,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -23778,6 +24461,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBinaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -23804,7 +24488,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -23841,6 +24526,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -23850,6 +24536,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -23866,6 +24553,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBooleanOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -23892,7 +24580,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -23929,6 +24618,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. @@ -23945,6 +24635,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithCall [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -23971,7 +24662,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24007,11 +24699,13 @@ FASTPythonImporterTest >> testGeneratorExpressionWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'str'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'str'. stack pop. self assert: self topEntity operators equals: #('in'). stack pop. @@ -24029,6 +24723,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithComparisonOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24055,7 +24750,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24101,6 +24797,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithComplexe [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24127,7 +24824,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithComplexe [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24175,6 +24873,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -24183,6 +24882,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -24199,6 +24899,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithConditionalExpression [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24225,7 +24926,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24279,6 +24981,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -24296,6 +24999,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionary [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24322,7 +25026,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24366,6 +25071,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -24374,6 +25080,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -24390,6 +25097,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -24398,6 +25106,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -24415,6 +25124,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24441,7 +25151,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24486,6 +25197,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithEllipsis [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24512,7 +25224,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24558,6 +25271,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithFalse [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24584,7 +25298,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithFalse [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24630,6 +25345,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithFloat [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24656,7 +25372,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithFloat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24684,6 +25401,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIdentifier [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. "Testing value of multivalued relation forClauses" @@ -24699,6 +25417,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIdentifier [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24725,7 +25444,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24754,6 +25474,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation conditions" @@ -24769,6 +25490,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIfClause [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -24793,6 +25515,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24819,7 +25542,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIfClause [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24864,6 +25588,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithInteger [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24890,7 +25615,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithInteger [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -24928,6 +25654,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -24954,6 +25681,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithLambda [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -24980,7 +25708,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithLambda [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25024,6 +25753,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithList [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25050,7 +25780,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25095,6 +25826,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -25104,6 +25836,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -25120,6 +25853,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -25147,6 +25881,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -25165,6 +25900,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25191,7 +25927,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25217,6 +25954,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleForClauses [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation forClauses" @@ -25232,6 +25970,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'row'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'row'. stack pop. "Testing value of monovalue relation right" @@ -25240,6 +25979,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'matrix'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'matrix'. stack pop. stack pop. @@ -25253,6 +25993,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25260,7 +26001,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'row'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'row' ] { #category : 'tests - comprehensions' } @@ -25290,6 +26032,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation conditions" @@ -25313,6 +26056,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -25354,6 +26098,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -25390,6 +26135,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25416,7 +26162,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleIfClause [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25461,6 +26208,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithNone [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25487,7 +26235,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithNone [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25524,6 +26273,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -25540,6 +26290,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithNotOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25566,7 +26317,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithNotOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25620,6 +26372,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSet [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25646,7 +26399,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSet [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25691,6 +26445,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -25700,6 +26455,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -25716,6 +26472,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -25743,6 +26500,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -25761,6 +26519,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25787,7 +26546,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25833,6 +26593,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithString [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25859,7 +26620,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25905,6 +26667,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. @@ -25921,6 +26684,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSubscript [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -25947,7 +26711,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -25993,6 +26758,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithTrue [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -26019,7 +26785,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithTrue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -26055,6 +26822,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -26071,6 +26839,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithTuple [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -26097,7 +26866,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -26134,6 +26904,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -26151,6 +26922,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithUnaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -26177,7 +26949,8 @@ FASTPythonImporterTest >> testGeneratorExpressionWithUnaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - types' } @@ -26241,6 +27014,7 @@ FASTPythonImporterTest >> testGenericType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T'. stack pop. stack pop. stack pop. @@ -26316,6 +27090,7 @@ FASTPythonImporterTest >> testGenericTypeWithMultipleParameters [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'str'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'str'. stack pop. stack pop. @@ -26329,6 +27104,7 @@ FASTPythonImporterTest >> testGenericTypeWithMultipleParameters [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T'. stack pop. stack pop. stack pop. @@ -26398,7 +27174,8 @@ FASTPythonImporterTest >> testGlobalStatement [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'counter'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'counter' ] { #category : 'tests - statements' } @@ -26479,16 +27256,19 @@ FASTPythonImporterTest >> testGlobalStatementMultiple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack push: (stack top initializers at: 3). self assert: self topEntity sourceCode equals: 'z'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'z' ] { #category : 'tests - advanced statements' } @@ -26528,6 +27308,7 @@ FASTPythonImporterTest >> testIf [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -26600,6 +27381,7 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -26691,6 +27473,7 @@ elif x < 10: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -26726,6 +27509,7 @@ elif x < 10: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -26813,6 +27597,7 @@ elif x == 60: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -26848,6 +27633,7 @@ elif x == 60: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -26891,6 +27677,7 @@ elif x == 60: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -26983,6 +27770,7 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -27018,6 +27806,7 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -27061,6 +27850,7 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -27156,6 +27946,7 @@ FASTPythonImporterTest >> testIfStatementWithABreak [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. stack push: (stack top operands at: 2). @@ -27219,6 +28010,7 @@ FASTPythonImporterTest >> testIfStatementWithAContinue [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. stack push: (stack top operands at: 2). @@ -27430,7 +28222,8 @@ FASTPythonImporterTest >> testImportInFunction [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'np'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'np' ] { #category : 'tests - imports' } @@ -27605,6 +28398,7 @@ FASTPythonImporterTest >> testInterpolation [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'name'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'name'. stack pop. stack pop. @@ -27617,7 +28411,8 @@ FASTPythonImporterTest >> testInterpolation [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'value' ] { #category : 'tests - interpolations' } @@ -27660,7 +28455,8 @@ FASTPythonImporterTest >> testInterpolationWithAttributeAccess [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'CFG'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'CFG' ] { #category : 'tests - interpolations' } @@ -27705,6 +28501,7 @@ FASTPythonImporterTest >> testInterpolationWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'k'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k'. stack pop. self assert: self topEntity operator equals: '+'. @@ -27759,6 +28556,7 @@ FASTPythonImporterTest >> testInterpolationWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -27767,7 +28565,8 @@ FASTPythonImporterTest >> testInterpolationWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - interpolations' } @@ -27822,7 +28621,8 @@ FASTPythonImporterTest >> testInterpolationWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'myMethod'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'myMethod' ] { #category : 'tests - interpolations' } @@ -27865,11 +28665,13 @@ FASTPythonImporterTest >> testInterpolationWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('==') ] @@ -27915,6 +28717,7 @@ FASTPythonImporterTest >> testInterpolationWithComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation forClauses" @@ -27930,6 +28733,7 @@ FASTPythonImporterTest >> testInterpolationWithComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -27937,7 +28741,8 @@ FASTPythonImporterTest >> testInterpolationWithComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'items'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'items' ] { #category : 'tests - interpolations' } @@ -27981,6 +28786,7 @@ FASTPythonImporterTest >> testInterpolationWithConditionalExpression [ stack push: self topEntity condition. self assert: self topEntity sourceCode equals: 'cond'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'cond'. stack pop. "Testing value of monovalue relation elseExpression" @@ -27989,6 +28795,7 @@ FASTPythonImporterTest >> testInterpolationWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -27996,7 +28803,8 @@ FASTPythonImporterTest >> testInterpolationWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: ''. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: '' ] { #category : 'tests - interpolations' } @@ -28089,6 +28897,7 @@ FASTPythonImporterTest >> testInterpolationWithLambda [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '*'. @@ -28153,6 +28962,7 @@ FASTPythonImporterTest >> testInterpolationWithSubscript [ stack push: (stack top indices at: 1). self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation value" @@ -28160,7 +28970,8 @@ FASTPythonImporterTest >> testInterpolationWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'label_order'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'label_order' ] { #category : 'tests - interpolations' } @@ -28195,6 +29006,7 @@ FASTPythonImporterTest >> testInterpolationWithTypeConversion [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'text'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'text'. stack pop. self assert: self topEntity typeConversion equals: 'r' ] @@ -28241,6 +29053,7 @@ FASTPythonImporterTest >> testKeywordArgumentToAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -28250,7 +29063,8 @@ FASTPythonImporterTest >> testKeywordArgumentToAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28294,6 +29108,7 @@ FASTPythonImporterTest >> testKeywordArgumentToAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -28303,7 +29118,8 @@ FASTPythonImporterTest >> testKeywordArgumentToAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28360,6 +29176,7 @@ FASTPythonImporterTest >> testKeywordArgumentToBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -28369,7 +29186,8 @@ FASTPythonImporterTest >> testKeywordArgumentToBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28414,6 +29232,7 @@ FASTPythonImporterTest >> testKeywordArgumentToBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -28423,6 +29242,7 @@ FASTPythonImporterTest >> testKeywordArgumentToBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -28432,7 +29252,8 @@ FASTPythonImporterTest >> testKeywordArgumentToBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28477,6 +29298,7 @@ FASTPythonImporterTest >> testKeywordArgumentToCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. stack pop. @@ -28486,7 +29308,8 @@ FASTPythonImporterTest >> testKeywordArgumentToCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28530,11 +29353,13 @@ FASTPythonImporterTest >> testKeywordArgumentToComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -28545,7 +29370,8 @@ FASTPythonImporterTest >> testKeywordArgumentToComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28592,7 +29418,8 @@ FASTPythonImporterTest >> testKeywordArgumentToComplexe [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28648,6 +29475,7 @@ FASTPythonImporterTest >> testKeywordArgumentToConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -28656,6 +29484,7 @@ FASTPythonImporterTest >> testKeywordArgumentToConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -28665,7 +29494,8 @@ FASTPythonImporterTest >> testKeywordArgumentToConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28728,6 +29558,7 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -28738,7 +29569,8 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28791,6 +29623,7 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -28799,6 +29632,7 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -28815,6 +29649,7 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -28823,6 +29658,7 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -28833,7 +29669,8 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28879,7 +29716,8 @@ FASTPythonImporterTest >> testKeywordArgumentToEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28926,7 +29764,8 @@ FASTPythonImporterTest >> testKeywordArgumentToFalse [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -28973,7 +29812,8 @@ FASTPythonImporterTest >> testKeywordArgumentToFloat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29009,6 +29849,7 @@ FASTPythonImporterTest >> testKeywordArgumentToIdentifier [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -29017,7 +29858,8 @@ FASTPythonImporterTest >> testKeywordArgumentToIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29064,7 +29906,8 @@ FASTPythonImporterTest >> testKeywordArgumentToInteger [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29110,6 +29953,7 @@ FASTPythonImporterTest >> testKeywordArgumentToLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -29129,7 +29973,8 @@ FASTPythonImporterTest >> testKeywordArgumentToLambda [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29185,7 +30030,8 @@ FASTPythonImporterTest >> testKeywordArgumentToList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29240,6 +30086,7 @@ FASTPythonImporterTest >> testKeywordArgumentToListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -29249,6 +30096,7 @@ FASTPythonImporterTest >> testKeywordArgumentToListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -29265,6 +30113,7 @@ FASTPythonImporterTest >> testKeywordArgumentToListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -29292,6 +30141,7 @@ FASTPythonImporterTest >> testKeywordArgumentToListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -29303,7 +30153,8 @@ FASTPythonImporterTest >> testKeywordArgumentToListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29347,6 +30198,7 @@ FASTPythonImporterTest >> testKeywordArgumentToListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. stack pop. @@ -29356,7 +30208,8 @@ FASTPythonImporterTest >> testKeywordArgumentToListSplat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29402,7 +30255,8 @@ FASTPythonImporterTest >> testKeywordArgumentToNone [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29447,6 +30301,7 @@ FASTPythonImporterTest >> testKeywordArgumentToNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. stack pop. @@ -29456,7 +30311,8 @@ FASTPythonImporterTest >> testKeywordArgumentToNotOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29512,7 +30368,8 @@ FASTPythonImporterTest >> testKeywordArgumentToSet [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29567,6 +30424,7 @@ FASTPythonImporterTest >> testKeywordArgumentToSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -29576,6 +30434,7 @@ FASTPythonImporterTest >> testKeywordArgumentToSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -29592,6 +30451,7 @@ FASTPythonImporterTest >> testKeywordArgumentToSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -29619,6 +30479,7 @@ FASTPythonImporterTest >> testKeywordArgumentToSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -29630,7 +30491,8 @@ FASTPythonImporterTest >> testKeywordArgumentToSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29677,7 +30539,8 @@ FASTPythonImporterTest >> testKeywordArgumentToString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29732,6 +30595,7 @@ FASTPythonImporterTest >> testKeywordArgumentToSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -29741,7 +30605,8 @@ FASTPythonImporterTest >> testKeywordArgumentToSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29788,7 +30653,8 @@ FASTPythonImporterTest >> testKeywordArgumentToTrue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29832,11 +30698,13 @@ FASTPythonImporterTest >> testKeywordArgumentToTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -29846,7 +30714,8 @@ FASTPythonImporterTest >> testKeywordArgumentToTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - calls' } @@ -29891,6 +30760,7 @@ FASTPythonImporterTest >> testKeywordArgumentToUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -29901,7 +30771,8 @@ FASTPythonImporterTest >> testKeywordArgumentToUnaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f' ] { #category : 'tests - function definitions' } @@ -30009,6 +30880,7 @@ FASTPythonImporterTest >> testLambdaWithDefaultParameter [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -30056,6 +30928,7 @@ FASTPythonImporterTest >> testLambdaWithDictionarySplatParameter [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -30109,6 +30982,7 @@ FASTPythonImporterTest >> testLambdaWithKeywordSeparator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'fp'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'fp'. stack pop. self assert: self topEntity operator equals: '+'. @@ -30118,6 +30992,7 @@ FASTPythonImporterTest >> testLambdaWithKeywordSeparator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30169,6 +31044,7 @@ FASTPythonImporterTest >> testLambdaWithListSplatParameter [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -30221,6 +31097,7 @@ FASTPythonImporterTest >> testLambdaWithParameter [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '*'. @@ -30230,6 +31107,7 @@ FASTPythonImporterTest >> testLambdaWithParameter [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30276,6 +31154,7 @@ FASTPythonImporterTest >> testLambdaWithParameters [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. self assert: self topEntity operator equals: '+'. @@ -30285,6 +31164,7 @@ FASTPythonImporterTest >> testLambdaWithParameters [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -30339,6 +31219,7 @@ FASTPythonImporterTest >> testLambdaWithPositionalSeparator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'fp'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'fp'. stack pop. self assert: self topEntity operator equals: '+'. @@ -30348,6 +31229,7 @@ FASTPythonImporterTest >> testLambdaWithPositionalSeparator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30448,6 +31330,7 @@ FASTPythonImporterTest >> testListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '*'. @@ -30457,6 +31340,7 @@ FASTPythonImporterTest >> testListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30473,6 +31357,7 @@ FASTPythonImporterTest >> testListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -30499,7 +31384,8 @@ FASTPythonImporterTest >> testListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -30536,6 +31422,7 @@ FASTPythonImporterTest >> testListComprehensionWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30552,6 +31439,7 @@ FASTPythonImporterTest >> testListComprehensionWithAttribute [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -30578,7 +31466,8 @@ FASTPythonImporterTest >> testListComprehensionWithAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -30614,6 +31503,7 @@ FASTPythonImporterTest >> testListComprehensionWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30630,6 +31520,7 @@ FASTPythonImporterTest >> testListComprehensionWithAwait [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -30656,7 +31547,8 @@ FASTPythonImporterTest >> testListComprehensionWithAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -30693,6 +31585,7 @@ FASTPythonImporterTest >> testListComprehensionWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -30702,6 +31595,7 @@ FASTPythonImporterTest >> testListComprehensionWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -30718,6 +31612,7 @@ FASTPythonImporterTest >> testListComprehensionWithBinaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -30744,7 +31639,8 @@ FASTPythonImporterTest >> testListComprehensionWithBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -30781,6 +31677,7 @@ FASTPythonImporterTest >> testListComprehensionWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -30790,6 +31687,7 @@ FASTPythonImporterTest >> testListComprehensionWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -30806,6 +31704,7 @@ FASTPythonImporterTest >> testListComprehensionWithBooleanOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -30832,7 +31731,8 @@ FASTPythonImporterTest >> testListComprehensionWithBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -30869,6 +31769,7 @@ FASTPythonImporterTest >> testListComprehensionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. @@ -30885,6 +31786,7 @@ FASTPythonImporterTest >> testListComprehensionWithCall [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -30911,7 +31813,8 @@ FASTPythonImporterTest >> testListComprehensionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -30947,11 +31850,13 @@ FASTPythonImporterTest >> testListComprehensionWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'str'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'str'. stack pop. self assert: self topEntity operators equals: #('in'). stack pop. @@ -30969,6 +31874,7 @@ FASTPythonImporterTest >> testListComprehensionWithComparisonOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -30995,7 +31901,8 @@ FASTPythonImporterTest >> testListComprehensionWithComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31041,6 +31948,7 @@ FASTPythonImporterTest >> testListComprehensionWithComplexe [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31067,7 +31975,8 @@ FASTPythonImporterTest >> testListComprehensionWithComplexe [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31115,6 +32024,7 @@ FASTPythonImporterTest >> testListComprehensionWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -31123,6 +32033,7 @@ FASTPythonImporterTest >> testListComprehensionWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -31139,6 +32050,7 @@ FASTPythonImporterTest >> testListComprehensionWithConditionalExpression [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31165,7 +32077,8 @@ FASTPythonImporterTest >> testListComprehensionWithConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31219,6 +32132,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -31236,6 +32150,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionary [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31262,7 +32177,8 @@ FASTPythonImporterTest >> testListComprehensionWithDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31306,6 +32222,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -31314,6 +32231,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -31330,6 +32248,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -31338,6 +32257,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -31355,6 +32275,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31381,7 +32302,8 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31426,6 +32348,7 @@ FASTPythonImporterTest >> testListComprehensionWithEllipsis [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31452,7 +32375,8 @@ FASTPythonImporterTest >> testListComprehensionWithEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31498,6 +32422,7 @@ FASTPythonImporterTest >> testListComprehensionWithFalse [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31524,7 +32449,8 @@ FASTPythonImporterTest >> testListComprehensionWithFalse [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31570,6 +32496,7 @@ FASTPythonImporterTest >> testListComprehensionWithFloat [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31596,7 +32523,8 @@ FASTPythonImporterTest >> testListComprehensionWithFloat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31624,6 +32552,7 @@ FASTPythonImporterTest >> testListComprehensionWithIdentifier [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. "Testing value of multivalued relation forClauses" @@ -31639,6 +32568,7 @@ FASTPythonImporterTest >> testListComprehensionWithIdentifier [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31665,7 +32595,8 @@ FASTPythonImporterTest >> testListComprehensionWithIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31694,6 +32625,7 @@ FASTPythonImporterTest >> testListComprehensionWithIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation conditions" @@ -31709,6 +32641,7 @@ FASTPythonImporterTest >> testListComprehensionWithIfClause [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -31733,6 +32666,7 @@ FASTPythonImporterTest >> testListComprehensionWithIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31759,7 +32693,8 @@ FASTPythonImporterTest >> testListComprehensionWithIfClause [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31804,6 +32739,7 @@ FASTPythonImporterTest >> testListComprehensionWithInteger [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31830,7 +32766,8 @@ FASTPythonImporterTest >> testListComprehensionWithInteger [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31868,6 +32805,7 @@ FASTPythonImporterTest >> testListComprehensionWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -31894,6 +32832,7 @@ FASTPythonImporterTest >> testListComprehensionWithLambda [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31920,7 +32859,8 @@ FASTPythonImporterTest >> testListComprehensionWithLambda [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -31964,6 +32904,7 @@ FASTPythonImporterTest >> testListComprehensionWithList [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -31990,7 +32931,8 @@ FASTPythonImporterTest >> testListComprehensionWithList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32034,6 +32976,7 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -32043,6 +32986,7 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -32059,6 +33003,7 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -32086,6 +33031,7 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -32104,6 +33050,7 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32130,7 +33077,8 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32156,6 +33104,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleForClauses [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation forClauses" @@ -32171,6 +33120,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'row'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'row'. stack pop. "Testing value of monovalue relation right" @@ -32179,6 +33129,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'matrix'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'matrix'. stack pop. stack pop. @@ -32192,6 +33143,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32199,7 +33151,8 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'row'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'row' ] { #category : 'tests - comprehensions' } @@ -32229,6 +33182,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation conditions" @@ -32252,6 +33206,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -32293,6 +33248,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -32329,6 +33285,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32355,7 +33312,8 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleIfClause [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32400,6 +33358,7 @@ FASTPythonImporterTest >> testListComprehensionWithNone [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32426,7 +33385,8 @@ FASTPythonImporterTest >> testListComprehensionWithNone [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32463,6 +33423,7 @@ FASTPythonImporterTest >> testListComprehensionWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -32479,6 +33440,7 @@ FASTPythonImporterTest >> testListComprehensionWithNotOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32505,7 +33467,8 @@ FASTPythonImporterTest >> testListComprehensionWithNotOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32551,6 +33514,7 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation callee" @@ -32559,6 +33523,7 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'abs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'abs'. stack pop. stack pop. self assert: self topEntity operator equals: '+'. @@ -32578,6 +33543,7 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation callee" @@ -32586,6 +33552,7 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'abs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'abs'. stack pop. stack pop. stack pop. @@ -32610,11 +33577,13 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -32623,7 +33592,8 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'points'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'points' ] { #category : 'tests - comprehensions' } @@ -32677,6 +33647,7 @@ FASTPythonImporterTest >> testListComprehensionWithSet [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32703,7 +33674,8 @@ FASTPythonImporterTest >> testListComprehensionWithSet [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32748,6 +33720,7 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -32757,6 +33730,7 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -32773,6 +33747,7 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -32800,6 +33775,7 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -32818,6 +33794,7 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32844,7 +33821,8 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32890,6 +33868,7 @@ FASTPythonImporterTest >> testListComprehensionWithString [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -32916,7 +33895,8 @@ FASTPythonImporterTest >> testListComprehensionWithString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -32962,6 +33942,7 @@ FASTPythonImporterTest >> testListComprehensionWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. @@ -32978,6 +33959,7 @@ FASTPythonImporterTest >> testListComprehensionWithSubscript [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -33004,7 +33986,8 @@ FASTPythonImporterTest >> testListComprehensionWithSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -33050,6 +34033,7 @@ FASTPythonImporterTest >> testListComprehensionWithTrue [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -33076,7 +34060,8 @@ FASTPythonImporterTest >> testListComprehensionWithTrue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -33112,6 +34097,7 @@ FASTPythonImporterTest >> testListComprehensionWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -33128,6 +34114,7 @@ FASTPythonImporterTest >> testListComprehensionWithTuple [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -33154,7 +34141,8 @@ FASTPythonImporterTest >> testListComprehensionWithTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -33191,6 +34179,7 @@ FASTPythonImporterTest >> testListComprehensionWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -33208,6 +34197,7 @@ FASTPythonImporterTest >> testListComprehensionWithUnaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -33234,7 +34224,8 @@ FASTPythonImporterTest >> testListComprehensionWithUnaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - splats' } @@ -33269,6 +34260,7 @@ FASTPythonImporterTest >> testListSplatInCall [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -33277,7 +34269,8 @@ FASTPythonImporterTest >> testListSplatInCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33311,6 +34304,7 @@ FASTPythonImporterTest >> testListSplatInList [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -33362,6 +34356,7 @@ FASTPythonImporterTest >> testListSplatOnAttributeAccess [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. stack pop. @@ -33371,7 +34366,8 @@ FASTPythonImporterTest >> testListSplatOnAttributeAccess [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33415,6 +34411,7 @@ FASTPythonImporterTest >> testListSplatOnBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -33424,6 +34421,7 @@ FASTPythonImporterTest >> testListSplatOnBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. stack pop. @@ -33433,7 +34431,8 @@ FASTPythonImporterTest >> testListSplatOnBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33477,6 +34476,7 @@ FASTPythonImporterTest >> testListSplatOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'getList'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'getList'. stack pop. stack pop. stack pop. @@ -33486,7 +34486,8 @@ FASTPythonImporterTest >> testListSplatOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33548,7 +34549,8 @@ FASTPythonImporterTest >> testListSplatOnList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33601,6 +34603,7 @@ FASTPythonImporterTest >> testListSplatOnListComprehension [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. "Testing value of monovalue relation callee" @@ -33609,6 +34612,7 @@ FASTPythonImporterTest >> testListSplatOnListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'format'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'format'. stack pop. stack pop. @@ -33625,6 +34629,7 @@ FASTPythonImporterTest >> testListSplatOnListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. "Testing value of monovalue relation right" @@ -33633,6 +34638,7 @@ FASTPythonImporterTest >> testListSplatOnListComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'FILES'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'FILES'. stack pop. stack pop. stack pop. @@ -33643,7 +34649,8 @@ FASTPythonImporterTest >> testListSplatOnListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33678,6 +34685,7 @@ FASTPythonImporterTest >> testListSplatOnParenthesis [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -33686,7 +34694,8 @@ FASTPythonImporterTest >> testListSplatOnParenthesis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33732,7 +34741,8 @@ FASTPythonImporterTest >> testListSplatOnString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33786,6 +34796,7 @@ FASTPythonImporterTest >> testListSplatOnSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. stack pop. @@ -33795,7 +34806,8 @@ FASTPythonImporterTest >> testListSplatOnSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - splats' } @@ -33838,6 +34850,7 @@ FASTPythonImporterTest >> testListSplatOnTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'func'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func'. stack pop. stack push: (stack top initializers at: 2). @@ -33850,6 +34863,7 @@ FASTPythonImporterTest >> testListSplatOnTuple [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. stack pop. @@ -33860,7 +34874,8 @@ FASTPythonImporterTest >> testListSplatOnTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'funct'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'funct' ] { #category : 'tests - function definitions' } @@ -33932,7 +34947,8 @@ FASTPythonImporterTest >> testListWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - collections' } @@ -34012,6 +35028,7 @@ FASTPythonImporterTest >> testListWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -34020,7 +35037,8 @@ FASTPythonImporterTest >> testListWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - collections' } @@ -34054,7 +35072,8 @@ FASTPythonImporterTest >> testListWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - collections' } @@ -34168,6 +35187,7 @@ FASTPythonImporterTest >> testListWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -34175,7 +35195,8 @@ FASTPythonImporterTest >> testListWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -34328,7 +35349,8 @@ FASTPythonImporterTest >> testListWithIdentifier [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'element' ] { #category : 'tests - collections' } @@ -34389,6 +35411,7 @@ FASTPythonImporterTest >> testListWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -34463,7 +35486,8 @@ FASTPythonImporterTest >> testListWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - collections' } @@ -34499,6 +35523,7 @@ FASTPythonImporterTest >> testListWithList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -34514,6 +35539,7 @@ FASTPythonImporterTest >> testListWithList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -34540,7 +35566,8 @@ FASTPythonImporterTest >> testListWithList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -34598,7 +35625,8 @@ FASTPythonImporterTest >> testListWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - collections' } @@ -34668,6 +35696,7 @@ FASTPythonImporterTest >> testListWithSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -34683,6 +35712,7 @@ FASTPythonImporterTest >> testListWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -34709,7 +35739,8 @@ FASTPythonImporterTest >> testListWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -34743,6 +35774,7 @@ FASTPythonImporterTest >> testListWithSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -34819,7 +35851,8 @@ FASTPythonImporterTest >> testListWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - collections' } @@ -34971,7 +36004,8 @@ FASTPythonImporterTest >> testMatchAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - match' } @@ -35027,7 +36061,8 @@ FASTPythonImporterTest >> testMatchCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'func'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'func' ] { #category : 'tests - match' } @@ -35194,7 +36229,8 @@ FASTPythonImporterTest >> testMatchIdentifier [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - match' } @@ -35377,7 +36413,8 @@ FASTPythonImporterTest >> testMatchPatternComplexOperation [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'value' ] { #category : 'tests - match' } @@ -35434,7 +36471,8 @@ FASTPythonImporterTest >> testMatchPatternComplexe [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -35544,7 +36582,8 @@ FASTPythonImporterTest >> testMatchPatternDictionary [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -35590,6 +36629,7 @@ FASTPythonImporterTest >> testMatchPatternDictionarySplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'kwargs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'kwargs'. stack pop. stack pop. @@ -35607,7 +36647,8 @@ FASTPythonImporterTest >> testMatchPatternDictionarySplat [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -35662,7 +36703,8 @@ FASTPythonImporterTest >> testMatchPatternDictionarySplatUnnamed [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -35799,7 +36841,8 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithDictionary [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -35889,7 +36932,8 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithNoValues [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -35970,6 +37014,7 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'kwargs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'kwargs'. stack pop. stack pop. stack pop. @@ -35988,7 +37033,8 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithSplat [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36097,7 +37143,8 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithVariables [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36153,7 +37200,8 @@ FASTPythonImporterTest >> testMatchPatternDottedName [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'value' ] { #category : 'tests - match' } @@ -36210,7 +37258,8 @@ FASTPythonImporterTest >> testMatchPatternFalse [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36267,7 +37316,8 @@ FASTPythonImporterTest >> testMatchPatternFloat [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36324,7 +37374,8 @@ FASTPythonImporterTest >> testMatchPatternInteger [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36391,7 +37442,8 @@ FASTPythonImporterTest >> testMatchPatternKeyword [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36466,7 +37518,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithClass [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36555,7 +37608,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithComplexPattern [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36621,7 +37675,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithDottedName [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36687,7 +37742,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithIdentifier [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36754,7 +37810,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithInteger [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36830,7 +37887,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithList [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36906,7 +37964,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithTuple [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -36989,7 +38048,8 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithUnion [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37062,7 +38122,8 @@ FASTPythonImporterTest >> testMatchPatternList [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'value' ] { #category : 'tests - match' } @@ -37143,7 +38204,8 @@ FASTPythonImporterTest >> testMatchPatternListInList [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37189,6 +38251,7 @@ FASTPythonImporterTest >> testMatchPatternListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'list'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'list'. stack pop. stack pop. @@ -37206,7 +38269,8 @@ FASTPythonImporterTest >> testMatchPatternListSplat [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37261,7 +38325,8 @@ FASTPythonImporterTest >> testMatchPatternListSplatUnnamed [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37323,6 +38388,7 @@ FASTPythonImporterTest >> testMatchPatternListWithSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. stack pop. @@ -37341,7 +38407,8 @@ FASTPythonImporterTest >> testMatchPatternListWithSplat [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37430,7 +38497,8 @@ FASTPythonImporterTest >> testMatchPatternListWithTuple [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37486,7 +38554,8 @@ FASTPythonImporterTest >> testMatchPatternNone [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37543,7 +38612,8 @@ FASTPythonImporterTest >> testMatchPatternString [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37600,7 +38670,8 @@ FASTPythonImporterTest >> testMatchPatternTrue [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37673,7 +38744,8 @@ FASTPythonImporterTest >> testMatchPatternTuple [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'value' ] { #category : 'tests - match' } @@ -37753,7 +38825,8 @@ FASTPythonImporterTest >> testMatchPatternUnion [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37835,7 +38908,8 @@ FASTPythonImporterTest >> testMatchPatternUnionClassPattern [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -37936,7 +39010,8 @@ FASTPythonImporterTest >> testMatchPatternUnionDictionary [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -38009,7 +39084,8 @@ FASTPythonImporterTest >> testMatchPatternUnionDottedName [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -38091,7 +39167,8 @@ FASTPythonImporterTest >> testMatchPatternUnionList [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -38173,7 +39250,8 @@ FASTPythonImporterTest >> testMatchPatternUnionTuple [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -38230,7 +39308,8 @@ FASTPythonImporterTest >> testMatchPatternWithAlias [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'value'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'value' ] { #category : 'tests - match' } @@ -38278,6 +39357,7 @@ FASTPythonImporterTest >> testMatchPatternWithGuard [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'n'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'n'. stack pop. stack push: (stack top operands at: 2). @@ -38312,7 +39392,8 @@ FASTPythonImporterTest >> testMatchPatternWithGuard [ stack push: self topEntity subject. self assert: self topEntity sourceCode equals: 'status'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'status' ] { #category : 'tests - match' } @@ -38544,6 +39625,7 @@ FASTPythonImporterTest >> testMethodWithReturnType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'CSVDataset'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'CSVDataset'. stack pop. stack pop. @@ -38706,6 +39788,7 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -38773,6 +39856,7 @@ else: stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). @@ -38890,7 +39974,8 @@ FASTPythonImporterTest >> testNonlocalStatement [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'counter'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'counter' ] { #category : 'tests - statements' } @@ -38971,16 +40056,19 @@ FASTPythonImporterTest >> testNonlocalStatementMultiple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack push: (stack top initializers at: 3). self assert: self topEntity sourceCode equals: 'z'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'z' ] { #category : 'tests - operators' } @@ -39030,7 +40118,8 @@ FASTPythonImporterTest >> testNotOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -39065,6 +40154,7 @@ FASTPythonImporterTest >> testNotOperatorWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '&'. @@ -39073,7 +40163,8 @@ FASTPythonImporterTest >> testNotOperatorWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -39108,6 +40199,7 @@ FASTPythonImporterTest >> testNotOperatorWithBooleanOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: 'or'. @@ -39117,7 +40209,8 @@ FASTPythonImporterTest >> testNotOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - operators' } @@ -39152,7 +40245,8 @@ FASTPythonImporterTest >> testNotOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - operators' } @@ -39261,6 +40355,7 @@ FASTPythonImporterTest >> testNotOperatorWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -39276,7 +40371,8 @@ FASTPythonImporterTest >> testNotOperatorWithConditionalExpression [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - operators' } @@ -39380,7 +40476,8 @@ FASTPythonImporterTest >> testNotOperatorWithIdentifier [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - operators' } @@ -39465,7 +40562,8 @@ FASTPythonImporterTest >> testNotOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - operators' } @@ -39571,7 +40669,8 @@ FASTPythonImporterTest >> testNotOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - operators' } @@ -39804,7 +40903,8 @@ FASTPythonImporterTest >> testPrintStatmentWithChevron [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'file_object'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'file_object' ] { #category : 'tests - raise statement' } @@ -39853,7 +40953,8 @@ FASTPythonImporterTest >> testRaiseAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'module'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'module' ] { #category : 'tests - raise statement' } @@ -39887,6 +40988,7 @@ FASTPythonImporterTest >> testRaiseBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'ValueError'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'ValueError'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -39895,7 +40997,8 @@ FASTPythonImporterTest >> testRaiseBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'TypeError'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'TypeError' ] { #category : 'tests - raise statement' } @@ -39940,7 +41043,8 @@ FASTPythonImporterTest >> testRaiseCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'Exception'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception' ] { #category : 'tests - raise statement' } @@ -39964,7 +41068,8 @@ FASTPythonImporterTest >> testRaiseIdentifier [ stack push: self topEntity exception. self assert: self topEntity sourceCode equals: 'Exception'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception' ] { #category : 'tests - raise statement' } @@ -39997,6 +41102,7 @@ FASTPythonImporterTest >> testRaiseSubscript [ stack push: (stack top indices at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation value" @@ -40004,7 +41110,8 @@ FASTPythonImporterTest >> testRaiseSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'exceptions'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'exceptions' ] { #category : 'tests - literals' } @@ -40252,6 +41359,7 @@ FASTPythonImporterTest >> testReturnMultiple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'len'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'len'. stack pop. stack pop. @@ -40404,6 +41512,7 @@ FASTPythonImporterTest >> testSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'k1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k1'. stack pop. "Testing value of multivalued relation forClauses" @@ -40419,6 +41528,7 @@ FASTPythonImporterTest >> testSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'k1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k1'. stack pop. "Testing value of monovalue relation right" @@ -40443,7 +41553,8 @@ FASTPythonImporterTest >> testSetComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'v'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v' ] { #category : 'tests - comprehensions' } @@ -40480,6 +41591,7 @@ FASTPythonImporterTest >> testSetComprehensionWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -40496,6 +41608,7 @@ FASTPythonImporterTest >> testSetComprehensionWithAttribute [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -40522,7 +41635,8 @@ FASTPythonImporterTest >> testSetComprehensionWithAttribute [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -40558,6 +41672,7 @@ FASTPythonImporterTest >> testSetComprehensionWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -40574,6 +41689,7 @@ FASTPythonImporterTest >> testSetComprehensionWithAwait [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -40600,7 +41716,8 @@ FASTPythonImporterTest >> testSetComprehensionWithAwait [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -40637,6 +41754,7 @@ FASTPythonImporterTest >> testSetComprehensionWithBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -40646,6 +41764,7 @@ FASTPythonImporterTest >> testSetComprehensionWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -40662,6 +41781,7 @@ FASTPythonImporterTest >> testSetComprehensionWithBinaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -40688,7 +41808,8 @@ FASTPythonImporterTest >> testSetComprehensionWithBinaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -40725,6 +41846,7 @@ FASTPythonImporterTest >> testSetComprehensionWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -40734,6 +41856,7 @@ FASTPythonImporterTest >> testSetComprehensionWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -40750,6 +41873,7 @@ FASTPythonImporterTest >> testSetComprehensionWithBooleanOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -40776,7 +41900,8 @@ FASTPythonImporterTest >> testSetComprehensionWithBooleanOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -40813,6 +41938,7 @@ FASTPythonImporterTest >> testSetComprehensionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. @@ -40829,6 +41955,7 @@ FASTPythonImporterTest >> testSetComprehensionWithCall [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -40855,7 +41982,8 @@ FASTPythonImporterTest >> testSetComprehensionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -40891,11 +42019,13 @@ FASTPythonImporterTest >> testSetComprehensionWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'str'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'str'. stack pop. self assert: self topEntity operators equals: #('in'). stack pop. @@ -40913,6 +42043,7 @@ FASTPythonImporterTest >> testSetComprehensionWithComparisonOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -40939,7 +42070,8 @@ FASTPythonImporterTest >> testSetComprehensionWithComparisonOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -40985,6 +42117,7 @@ FASTPythonImporterTest >> testSetComprehensionWithComplexe [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41011,7 +42144,8 @@ FASTPythonImporterTest >> testSetComprehensionWithComplexe [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41059,6 +42193,7 @@ FASTPythonImporterTest >> testSetComprehensionWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -41067,6 +42202,7 @@ FASTPythonImporterTest >> testSetComprehensionWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -41083,6 +42219,7 @@ FASTPythonImporterTest >> testSetComprehensionWithConditionalExpression [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41109,7 +42246,8 @@ FASTPythonImporterTest >> testSetComprehensionWithConditionalExpression [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41163,6 +42301,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. stack pop. @@ -41180,6 +42319,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionary [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41206,7 +42346,8 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionary [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41250,6 +42391,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -41258,6 +42400,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -41274,6 +42417,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -41282,6 +42426,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. stack pop. @@ -41299,6 +42444,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41325,7 +42471,8 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41370,6 +42517,7 @@ FASTPythonImporterTest >> testSetComprehensionWithEllipsis [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41396,7 +42544,8 @@ FASTPythonImporterTest >> testSetComprehensionWithEllipsis [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41442,6 +42591,7 @@ FASTPythonImporterTest >> testSetComprehensionWithFalse [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41468,7 +42618,8 @@ FASTPythonImporterTest >> testSetComprehensionWithFalse [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41514,6 +42665,7 @@ FASTPythonImporterTest >> testSetComprehensionWithFloat [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41540,7 +42692,8 @@ FASTPythonImporterTest >> testSetComprehensionWithFloat [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41568,6 +42721,7 @@ FASTPythonImporterTest >> testSetComprehensionWithIdentifier [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. "Testing value of multivalued relation forClauses" @@ -41583,6 +42737,7 @@ FASTPythonImporterTest >> testSetComprehensionWithIdentifier [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41609,7 +42764,8 @@ FASTPythonImporterTest >> testSetComprehensionWithIdentifier [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41639,6 +42795,7 @@ FASTPythonImporterTest >> testSetComprehensionWithIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'k1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k1'. stack pop. "Testing value of multivalued relation conditions" @@ -41654,6 +42811,7 @@ FASTPythonImporterTest >> testSetComprehensionWithIfClause [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'k1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k1'. stack pop. stack push: (stack top operands at: 2). @@ -41678,6 +42836,7 @@ FASTPythonImporterTest >> testSetComprehensionWithIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'k1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'k1'. stack pop. "Testing value of monovalue relation right" @@ -41702,7 +42861,8 @@ FASTPythonImporterTest >> testSetComprehensionWithIfClause [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'v'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v' ] { #category : 'tests - comprehensions' } @@ -41747,6 +42907,7 @@ FASTPythonImporterTest >> testSetComprehensionWithInteger [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41773,7 +42934,8 @@ FASTPythonImporterTest >> testSetComprehensionWithInteger [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41811,6 +42973,7 @@ FASTPythonImporterTest >> testSetComprehensionWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -41837,6 +43000,7 @@ FASTPythonImporterTest >> testSetComprehensionWithLambda [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41863,7 +43027,8 @@ FASTPythonImporterTest >> testSetComprehensionWithLambda [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41907,6 +43072,7 @@ FASTPythonImporterTest >> testSetComprehensionWithList [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -41933,7 +43099,8 @@ FASTPythonImporterTest >> testSetComprehensionWithList [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -41978,6 +43145,7 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -41987,6 +43155,7 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -42003,6 +43172,7 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -42030,6 +43200,7 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -42048,6 +43219,7 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42074,7 +43246,8 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42100,6 +43273,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleForClauses [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation forClauses" @@ -42115,6 +43289,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'row'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'row'. stack pop. "Testing value of monovalue relation right" @@ -42123,6 +43298,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'matrix'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'matrix'. stack pop. stack pop. @@ -42136,6 +43312,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleForClauses [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42143,7 +43320,8 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleForClauses [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'row'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'row' ] { #category : 'tests - comprehensions' } @@ -42173,6 +43351,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleIfClause [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation conditions" @@ -42196,6 +43375,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -42237,6 +43417,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleIfClause [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '%'. @@ -42273,6 +43454,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleIfClause [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42299,7 +43481,8 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleIfClause [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42344,6 +43527,7 @@ FASTPythonImporterTest >> testSetComprehensionWithNone [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42370,7 +43554,8 @@ FASTPythonImporterTest >> testSetComprehensionWithNone [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42407,6 +43592,7 @@ FASTPythonImporterTest >> testSetComprehensionWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. @@ -42423,6 +43609,7 @@ FASTPythonImporterTest >> testSetComprehensionWithNotOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42449,7 +43636,8 @@ FASTPythonImporterTest >> testSetComprehensionWithNotOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42503,6 +43691,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSet [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42529,7 +43718,8 @@ FASTPythonImporterTest >> testSetComprehensionWithSet [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42573,6 +43763,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -42582,6 +43773,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -42598,6 +43790,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -42625,6 +43818,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range'. stack pop. stack pop. stack pop. @@ -42643,6 +43837,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42669,7 +43864,8 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42715,6 +43911,7 @@ FASTPythonImporterTest >> testSetComprehensionWithString [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42741,7 +43938,8 @@ FASTPythonImporterTest >> testSetComprehensionWithString [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42787,6 +43985,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs'. stack pop. stack pop. @@ -42803,6 +44002,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSubscript [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42829,7 +44029,8 @@ FASTPythonImporterTest >> testSetComprehensionWithSubscript [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42875,6 +44076,7 @@ FASTPythonImporterTest >> testSetComprehensionWithTrue [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42901,7 +44103,8 @@ FASTPythonImporterTest >> testSetComprehensionWithTrue [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -42937,6 +44140,7 @@ FASTPythonImporterTest >> testSetComprehensionWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -42953,6 +44157,7 @@ FASTPythonImporterTest >> testSetComprehensionWithTuple [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -42979,7 +44184,8 @@ FASTPythonImporterTest >> testSetComprehensionWithTuple [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - comprehensions' } @@ -43016,6 +44222,7 @@ FASTPythonImporterTest >> testSetComprehensionWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -43033,6 +44240,7 @@ FASTPythonImporterTest >> testSetComprehensionWithUnaryOperator [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of monovalue relation right" @@ -43059,7 +44267,8 @@ FASTPythonImporterTest >> testSetComprehensionWithUnaryOperator [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -43092,7 +44301,8 @@ FASTPythonImporterTest >> testSetWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - collections' } @@ -43172,6 +44382,7 @@ FASTPythonImporterTest >> testSetWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -43180,7 +44391,8 @@ FASTPythonImporterTest >> testSetWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - collections' } @@ -43214,7 +44426,8 @@ FASTPythonImporterTest >> testSetWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - collections' } @@ -43328,6 +44541,7 @@ FASTPythonImporterTest >> testSetWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -43335,7 +44549,8 @@ FASTPythonImporterTest >> testSetWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -43488,7 +44703,8 @@ FASTPythonImporterTest >> testSetWithIdentifier [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'element' ] { #category : 'tests - collections' } @@ -43549,6 +44765,7 @@ FASTPythonImporterTest >> testSetWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -43624,7 +44841,8 @@ FASTPythonImporterTest >> testSetWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - collections' } @@ -43660,6 +44878,7 @@ FASTPythonImporterTest >> testSetWithList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -43675,6 +44894,7 @@ FASTPythonImporterTest >> testSetWithList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -43701,7 +44921,8 @@ FASTPythonImporterTest >> testSetWithList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -43759,7 +44980,8 @@ FASTPythonImporterTest >> testSetWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - collections' } @@ -43828,6 +45050,7 @@ FASTPythonImporterTest >> testSetWithSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -43843,6 +45066,7 @@ FASTPythonImporterTest >> testSetWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -43869,7 +45093,8 @@ FASTPythonImporterTest >> testSetWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -43903,6 +45128,7 @@ FASTPythonImporterTest >> testSetWithSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args'. stack pop. stack pop. @@ -43979,7 +45205,8 @@ FASTPythonImporterTest >> testSetWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - collections' } @@ -44133,6 +45360,7 @@ FASTPythonImporterTest >> testSliceAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. stack pop. @@ -44142,7 +45370,8 @@ FASTPythonImporterTest >> testSliceAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44185,6 +45414,7 @@ FASTPythonImporterTest >> testSliceBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. self assert: self topEntity operator equals: '+'. @@ -44194,6 +45424,7 @@ FASTPythonImporterTest >> testSliceBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. stack pop. @@ -44208,6 +45439,7 @@ FASTPythonImporterTest >> testSliceBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. self assert: self topEntity operator equals: '+'. @@ -44217,6 +45449,7 @@ FASTPythonImporterTest >> testSliceBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. stack pop. @@ -44233,7 +45466,8 @@ FASTPythonImporterTest >> testSliceBinaryOperator [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'lst'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'lst' ] { #category : 'tests - subscripts' } @@ -44284,7 +45518,8 @@ FASTPythonImporterTest >> testSliceBoolean [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'lst'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'lst' ] { #category : 'tests - subscripts' } @@ -44335,6 +45570,7 @@ FASTPythonImporterTest >> testSliceCall [ stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation callee" @@ -44343,6 +45579,7 @@ FASTPythonImporterTest >> testSliceCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'indexOf'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'indexOf'. stack pop. stack pop. stack pop. @@ -44352,7 +45589,8 @@ FASTPythonImporterTest >> testSliceCall [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44394,6 +45632,7 @@ FASTPythonImporterTest >> testSliceConditionalExpression [ stack push: self topEntity condition. self assert: self topEntity sourceCode equals: 'cond'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'cond'. stack pop. "Testing value of monovalue relation elseExpression" @@ -44402,6 +45641,7 @@ FASTPythonImporterTest >> testSliceConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'b'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b'. stack pop. "Testing value of monovalue relation thenExpression" @@ -44410,12 +45650,14 @@ FASTPythonImporterTest >> testSliceConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack pop. stack push: (stack top components at: 2). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. stack pop. @@ -44424,7 +45666,8 @@ FASTPythonImporterTest >> testSliceConditionalExpression [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'lst'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'lst' ] { #category : 'tests - subscripts' } @@ -44457,7 +45700,8 @@ FASTPythonImporterTest >> testSliceEmpty [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44508,7 +45752,8 @@ FASTPythonImporterTest >> testSliceNone [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44542,6 +45787,7 @@ FASTPythonImporterTest >> testSliceParenthesis [ stack push: (stack top components at: 1). self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. stack push: (stack top components at: 2). @@ -44555,6 +45801,7 @@ FASTPythonImporterTest >> testSliceParenthesis [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -44564,6 +45811,7 @@ FASTPythonImporterTest >> testSliceParenthesis [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'h'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'h'. stack pop. stack pop. stack pop. @@ -44573,7 +45821,8 @@ FASTPythonImporterTest >> testSliceParenthesis [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44628,7 +45877,8 @@ FASTPythonImporterTest >> testSliceReverse [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44679,6 +45929,7 @@ FASTPythonImporterTest >> testSliceSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'pady'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'pady'. stack pop. stack pop. @@ -44702,6 +45953,7 @@ FASTPythonImporterTest >> testSliceSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'pady'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'pady'. stack pop. stack pop. stack pop. @@ -44711,7 +45963,8 @@ FASTPythonImporterTest >> testSliceSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44800,7 +46053,8 @@ FASTPythonImporterTest >> testSliceUnaryOperator [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44833,11 +46087,13 @@ FASTPythonImporterTest >> testSliceVariables [ stack push: (stack top components at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top components at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. @@ -44846,7 +46102,8 @@ FASTPythonImporterTest >> testSliceVariables [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44890,7 +46147,8 @@ FASTPythonImporterTest >> testSliceWithEnd [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44934,7 +46192,8 @@ FASTPythonImporterTest >> testSliceWithStart [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -44992,7 +46251,8 @@ FASTPythonImporterTest >> testSliceWithStartStopStep [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -45036,7 +46296,8 @@ FASTPythonImporterTest >> testSliceWithStep [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - types' } @@ -45165,7 +46426,8 @@ FASTPythonImporterTest >> testSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'row'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'row' ] { #category : 'tests - subscripts' } @@ -45209,7 +46471,8 @@ FASTPythonImporterTest >> testSubscriptOnAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - subscripts' } @@ -45253,7 +46516,8 @@ FASTPythonImporterTest >> testSubscriptOnAttributeWithParenthesis [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'os'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'os' ] { #category : 'tests - subscripts' } @@ -45296,7 +46560,8 @@ FASTPythonImporterTest >> testSubscriptOnAwait [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - subscripts' } @@ -45341,6 +46606,7 @@ FASTPythonImporterTest >> testSubscriptOnBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operator equals: '+'. @@ -45349,7 +46615,8 @@ FASTPythonImporterTest >> testSubscriptOnBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - subscripts' } @@ -45394,7 +46661,8 @@ FASTPythonImporterTest >> testSubscriptOnCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - subscripts' } @@ -45450,6 +46718,7 @@ FASTPythonImporterTest >> testSubscriptOnConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -45457,7 +46726,8 @@ FASTPythonImporterTest >> testSubscriptOnConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - subscripts' } @@ -45518,7 +46788,8 @@ FASTPythonImporterTest >> testSubscriptOnDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - subscripts' } @@ -45571,6 +46842,7 @@ FASTPythonImporterTest >> testSubscriptOnDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -45579,6 +46851,7 @@ FASTPythonImporterTest >> testSubscriptOnDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -45595,6 +46868,7 @@ FASTPythonImporterTest >> testSubscriptOnDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -45602,7 +46876,8 @@ FASTPythonImporterTest >> testSubscriptOnDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - subscripts' } @@ -45637,7 +46912,8 @@ FASTPythonImporterTest >> testSubscriptOnIdentifier [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - subscripts' } @@ -45736,6 +47012,7 @@ FASTPythonImporterTest >> testSubscriptOnListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -45745,6 +47022,7 @@ FASTPythonImporterTest >> testSubscriptOnListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -45761,6 +47039,7 @@ FASTPythonImporterTest >> testSubscriptOnListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -45787,7 +47066,8 @@ FASTPythonImporterTest >> testSubscriptOnListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - subscripts' } @@ -45830,7 +47110,8 @@ FASTPythonImporterTest >> testSubscriptOnListSplat [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - subscripts' } @@ -45929,6 +47210,7 @@ FASTPythonImporterTest >> testSubscriptOnSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -45938,6 +47220,7 @@ FASTPythonImporterTest >> testSubscriptOnSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -45954,6 +47237,7 @@ FASTPythonImporterTest >> testSubscriptOnSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -45980,7 +47264,8 @@ FASTPythonImporterTest >> testSubscriptOnSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - subscripts' } @@ -46069,7 +47354,8 @@ FASTPythonImporterTest >> testSubscriptOnSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - subscripts' } @@ -46113,11 +47399,13 @@ FASTPythonImporterTest >> testSubscriptOnTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - subscripts' } @@ -46162,6 +47450,7 @@ FASTPythonImporterTest >> testSubscriptOnUnaryOperator [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '-' @@ -46198,6 +47487,7 @@ FASTPythonImporterTest >> testSubscriptWithAttributeInSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'obj'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj'. stack pop. stack pop. @@ -46206,7 +47496,8 @@ FASTPythonImporterTest >> testSubscriptWithAttributeInSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'coll'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'coll' ] { #category : 'tests - subscripts' } @@ -46262,7 +47553,8 @@ FASTPythonImporterTest >> testSubscriptWithBinaryOperator [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'values'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'values' ] { #category : 'tests - subscripts' } @@ -46294,6 +47586,7 @@ FASTPythonImporterTest >> testSubscriptWithEllipsis [ stack push: (stack top indices at: 2). self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation value" @@ -46301,7 +47594,8 @@ FASTPythonImporterTest >> testSubscriptWithEllipsis [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'imgs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'imgs' ] { #category : 'tests - subscripts' } @@ -46343,7 +47637,8 @@ FASTPythonImporterTest >> testSubscriptWithTwoIndicies [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'loc'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'loc' ] { #category : 'tests - subscripts' } @@ -46416,7 +47711,8 @@ FASTPythonImporterTest >> testSubscriptWithTwoSlices [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'arr'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'arr' ] { #category : 'tests - literals' } @@ -46539,6 +47835,7 @@ else: print(1)' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'print'. stack pop. stack pop. stack pop. @@ -46557,6 +47854,7 @@ else: print(1)' withPlatformLineEndings. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception'. stack pop. "Testing value of multivalued relation statements" @@ -46617,6 +47915,7 @@ finally: print(1)' withPlatformLineEndings. stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Exception'. stack pop. "Testing value of multivalued relation statements" @@ -46661,6 +47960,7 @@ finally: print(1)' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'print'. stack pop. stack pop. stack pop. @@ -46779,6 +48079,7 @@ FASTPythonImporterTest >> testTupleExpressionWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'toto'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'toto'. stack pop. stack pop. @@ -46947,6 +48248,7 @@ FASTPythonImporterTest >> testTupleOverview [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'bytearray'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'bytearray'. stack pop. stack pop. @@ -46986,7 +48288,8 @@ FASTPythonImporterTest >> testTupleOverview [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'self'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'self' ] { #category : 'tests - collections' } @@ -47019,7 +48322,8 @@ FASTPythonImporterTest >> testTupleWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -47064,7 +48368,8 @@ FASTPythonImporterTest >> testTupleWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -47098,6 +48403,7 @@ FASTPythonImporterTest >> testTupleWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -47106,7 +48412,8 @@ FASTPythonImporterTest >> testTupleWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - collections' } @@ -47140,7 +48447,8 @@ FASTPythonImporterTest >> testTupleWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory' ] { #category : 'tests - collections' } @@ -47173,11 +48481,13 @@ FASTPythonImporterTest >> testTupleWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>') ] @@ -47250,6 +48560,7 @@ FASTPythonImporterTest >> testTupleWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -47257,7 +48568,8 @@ FASTPythonImporterTest >> testTupleWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -47308,7 +48620,8 @@ FASTPythonImporterTest >> testTupleWithDictionary [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -47350,6 +48663,7 @@ FASTPythonImporterTest >> testTupleWithDictionaryComprehension [ stack push: self topEntity key. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation value" @@ -47358,6 +48672,7 @@ FASTPythonImporterTest >> testTupleWithDictionaryComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -47374,6 +48689,7 @@ FASTPythonImporterTest >> testTupleWithDictionaryComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'v'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'v'. stack pop. "Testing value of monovalue relation right" @@ -47381,7 +48697,8 @@ FASTPythonImporterTest >> testTupleWithDictionaryComprehension [ stack push: self topEntity right. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - collections' } @@ -47482,7 +48799,8 @@ FASTPythonImporterTest >> testTupleWithIdentifier [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -47543,6 +48861,7 @@ FASTPythonImporterTest >> testTupleWithLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -47631,6 +48950,7 @@ FASTPythonImporterTest >> testTupleWithListComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -47640,6 +48960,7 @@ FASTPythonImporterTest >> testTupleWithListComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -47656,6 +48977,7 @@ FASTPythonImporterTest >> testTupleWithListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -47682,7 +49004,8 @@ FASTPythonImporterTest >> testTupleWithListComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -47714,7 +49037,8 @@ FASTPythonImporterTest >> testTupleWithListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - collections' } @@ -47772,7 +49096,8 @@ FASTPythonImporterTest >> testTupleWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - collections' } @@ -47851,6 +49176,7 @@ FASTPythonImporterTest >> testTupleWithSetComprehension [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. self assert: self topEntity operator equals: '+'. @@ -47860,6 +49186,7 @@ FASTPythonImporterTest >> testTupleWithSetComprehension [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. @@ -47876,6 +49203,7 @@ FASTPythonImporterTest >> testTupleWithSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -47902,7 +49230,8 @@ FASTPythonImporterTest >> testTupleWithSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - collections' } @@ -47971,7 +49300,8 @@ FASTPythonImporterTest >> testTupleWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - collections' } @@ -48029,11 +49359,13 @@ FASTPythonImporterTest >> testTupleWithTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - collections' } @@ -48067,6 +49399,7 @@ FASTPythonImporterTest >> testTupleWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-' ] @@ -48197,6 +49530,7 @@ FASTPythonImporterTest >> testTypeAliasStatement [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'MyInt'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'MyInt'. stack pop. stack pop. @@ -48212,7 +49546,8 @@ FASTPythonImporterTest >> testTypeAliasStatement [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int' ] { #category : 'tests - statements' } @@ -48257,6 +49592,7 @@ FASTPythonImporterTest >> testTypeAliasStatementInBlock [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'MyInt'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'MyInt'. stack pop. stack pop. @@ -48272,7 +49608,8 @@ FASTPythonImporterTest >> testTypeAliasStatementInBlock [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int' ] { #category : 'tests - types' } @@ -48319,6 +49656,7 @@ FASTPythonImporterTest >> testTypeAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'subprocess'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'subprocess'. stack pop. stack pop. stack pop. @@ -48375,6 +49713,7 @@ FASTPythonImporterTest >> testTypeBinaryOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. self assert: self topEntity operator equals: '|'. @@ -48384,6 +49723,7 @@ FASTPythonImporterTest >> testTypeBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'str'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'str'. stack pop. stack pop. stack pop. @@ -48441,6 +49781,7 @@ FASTPythonImporterTest >> testTypeCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. stack pop. stack pop. @@ -48783,6 +50124,7 @@ FASTPythonImporterTest >> testTypeIdentifier [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'Path'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Path'. stack pop. stack pop. @@ -48942,6 +50284,7 @@ FASTPythonImporterTest >> testTypeList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'object'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'object'. stack pop. stack pop. stack pop. @@ -48999,6 +50342,7 @@ FASTPythonImporterTest >> testTypeListComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T'. stack pop. "Testing value of multivalued relation forClauses" @@ -49014,6 +50358,7 @@ FASTPythonImporterTest >> testTypeListComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T'. stack pop. "Testing value of monovalue relation right" @@ -49030,6 +50375,7 @@ FASTPythonImporterTest >> testTypeListComprehension [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T'. stack pop. stack pop. stack pop. @@ -49191,7 +50537,8 @@ FASTPythonImporterTest >> testTypeParametersInFunctionDefinition [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'T'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T' ] { #category : 'tests - types' } @@ -49237,6 +50584,7 @@ FASTPythonImporterTest >> testTypeParametersMultiple [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'T'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'T'. stack pop. stack pop. @@ -49250,6 +50598,7 @@ FASTPythonImporterTest >> testTypeParametersMultiple [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'K'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'K'. stack pop. stack pop. @@ -49262,7 +50611,8 @@ FASTPythonImporterTest >> testTypeParametersMultiple [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'L'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'L' ] { #category : 'tests - types' } @@ -49579,6 +50929,7 @@ FASTPythonImporterTest >> testTypedListSplatParameter [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'Any'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Any'. stack pop. stack pop. stack pop. @@ -49636,6 +50987,7 @@ FASTPythonImporterTest >> testTypedParameter [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'Path'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'Path'. stack pop. stack pop. stack pop. @@ -49697,6 +51049,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '~' @@ -49733,6 +51086,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithAwait [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '~' @@ -49790,6 +51144,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithBinaryOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'e'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'e'. stack pop. stack pop. self assert: self topEntity operator equals: '-'. @@ -49829,6 +51184,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'or'. @@ -49838,6 +51194,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. stack pop. self assert: self topEntity operator equals: '~(' @@ -49876,6 +51233,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'factory'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'factory'. stack pop. stack pop. self assert: self topEntity operator equals: '~' @@ -49912,11 +51270,13 @@ FASTPythonImporterTest >> testUnaryOperatorWithComparisonOperator [ stack push: (stack top operands at: 1). self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack push: (stack top operands at: 2). self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. self assert: self topEntity operators equals: #('>'). stack pop. @@ -49995,6 +51355,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -50003,6 +51364,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithConditionalExpression [ stack push: self topEntity thenExpression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '~(' @@ -50089,6 +51451,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithIdentifier [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '~' ] @@ -50154,6 +51517,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old'. stack pop. stack pop. self assert: self topEntity operator equals: '~(' @@ -50230,6 +51594,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. stack pop. self assert: self topEntity operator equals: '~' @@ -50295,6 +51660,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithUnaryOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: '-'. stack pop. @@ -50377,6 +51743,7 @@ FASTPythonImporterTest >> testUnionType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'bytes'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'bytes'. stack pop. stack pop. stack pop. @@ -50392,6 +51759,7 @@ FASTPythonImporterTest >> testUnionType [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'int'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'int'. stack pop. stack pop. stack pop. @@ -50446,7 +51814,8 @@ FASTPythonImporterTest >> testVariableDeclaration [ stack push: self topEntity content. self assert: self topEntity sourceCode equals: 'ModuleType'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'ModuleType' ] { #category : 'tests - assignments' } @@ -50507,7 +51876,8 @@ FASTPythonImporterTest >> testWalrusAttribute [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - assignments' } @@ -50589,6 +51959,7 @@ FASTPythonImporterTest >> testWalrusBooleanOperator [ stack push: self topEntity leftOperand. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. self assert: self topEntity operator equals: 'and'. @@ -50597,7 +51968,8 @@ FASTPythonImporterTest >> testWalrusBooleanOperator [ stack push: self topEntity rightOperand. self assert: self topEntity sourceCode equals: 'y'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y' ] { #category : 'tests - assignments' } @@ -50632,7 +52004,8 @@ FASTPythonImporterTest >> testWalrusCall [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'obj'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'obj' ] { #category : 'tests - assignments' } @@ -50741,6 +52114,7 @@ FASTPythonImporterTest >> testWalrusConditionalExpression [ stack push: self topEntity elseExpression. self assert: self topEntity sourceCode equals: 'y'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'y'. stack pop. "Testing value of monovalue relation thenExpression" @@ -50756,7 +52130,8 @@ FASTPythonImporterTest >> testWalrusConditionalExpression [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests - assignments' } @@ -50914,7 +52289,8 @@ FASTPythonImporterTest >> testWalrusIdentifier [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'element'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'element' ] { #category : 'tests - assignments' } @@ -50977,6 +52353,7 @@ FASTPythonImporterTest >> testWalrusLambda [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x'. stack pop. "Testing value of multivalued relation parameters" @@ -51019,7 +52396,8 @@ FASTPythonImporterTest >> testWalrusList [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'remote'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'remote' ] { #category : 'tests - assignments' } @@ -51052,7 +52430,8 @@ FASTPythonImporterTest >> testWalrusListSplat [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'args'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'args' ] { #category : 'tests - assignments' } @@ -51089,6 +52468,7 @@ FASTPythonImporterTest >> testWalrusList_comprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -51104,6 +52484,7 @@ FASTPythonImporterTest >> testWalrusList_comprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -51130,7 +52511,8 @@ FASTPythonImporterTest >> testWalrusList_comprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - assignments' } @@ -51190,7 +52572,8 @@ FASTPythonImporterTest >> testWalrusNotOperator [ stack push: self topEntity argument. self assert: self topEntity sourceCode equals: 'old'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'old' ] { #category : 'tests - assignments' } @@ -51224,12 +52607,14 @@ FASTPythonImporterTest >> testWalrusPatternList [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b' ] { #category : 'tests - assignments' } @@ -51301,6 +52686,7 @@ FASTPythonImporterTest >> testWalrusSetComprehension [ stack push: self topEntity body. self assert: self topEntity sourceCode equals: 'random'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'random'. stack pop. "Testing value of multivalued relation forClauses" @@ -51316,6 +52702,7 @@ FASTPythonImporterTest >> testWalrusSetComprehension [ stack push: self topEntity left. self assert: self topEntity sourceCode equals: 'i'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'i'. stack pop. "Testing value of monovalue relation right" @@ -51342,7 +52729,8 @@ FASTPythonImporterTest >> testWalrusSetComprehension [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'range'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'range' ] { #category : 'tests - assignments' } @@ -51413,7 +52801,8 @@ FASTPythonImporterTest >> testWalrusSubscript [ stack push: self topEntity value. self assert: self topEntity sourceCode equals: 'attrs'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'attrs' ] { #category : 'tests - assignments' } @@ -51474,11 +52863,13 @@ FASTPythonImporterTest >> testWalrusTuple [ stack push: (stack top initializers at: 1). self assert: self topEntity sourceCode equals: 'a'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'a'. stack pop. stack push: (stack top initializers at: 2). self assert: self topEntity sourceCode equals: 'b'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'b' ] { #category : 'tests - assignments' } @@ -51631,6 +53022,7 @@ else: print("Hello")' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'print'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'print'. stack pop. stack pop. stack pop. @@ -51650,6 +53042,7 @@ else: print("Hello")' withPlatformLineEndings. stack push: (stack top arguments at: 1). self assert: self topEntity sourceCode equals: 'c'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'c'. stack pop. "Testing value of monovalue relation callee" @@ -51657,7 +53050,8 @@ else: print("Hello")' withPlatformLineEndings. stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'fun'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'fun' ] { #category : 'tests - with statements' } @@ -51694,6 +53088,7 @@ FASTPythonImporterTest >> testWithStatement [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'open'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'open'. stack pop. stack pop. @@ -51747,6 +53142,7 @@ FASTPythonImporterTest >> testWithStatementWithAsPattern [ stack push: self topEntity callee. self assert: self topEntity sourceCode equals: 'open'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'open'. stack pop. stack pop. @@ -51756,6 +53152,7 @@ FASTPythonImporterTest >> testWithStatementWithAsPattern [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'f'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'f'. stack pop. stack pop. @@ -51799,6 +53196,7 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity source. self assert: self topEntity sourceCode equals: 'expr1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'expr1'. stack pop. "Testing value of monovalue relation target" @@ -51807,6 +53205,7 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'target1'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'target1'. stack pop. stack pop. @@ -51820,6 +53219,7 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity source. self assert: self topEntity sourceCode equals: 'expr2'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'expr2'. stack pop. "Testing value of monovalue relation target" @@ -51828,6 +53228,7 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'target2'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'target2'. stack pop. stack pop. @@ -51841,6 +53242,7 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity source. self assert: self topEntity sourceCode equals: 'expr3'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'expr3'. stack pop. "Testing value of monovalue relation target" @@ -51849,6 +53251,7 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ stack push: self topEntity target. self assert: self topEntity sourceCode equals: 'target3'. self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'target3'. stack pop. stack pop. @@ -51897,7 +53300,8 @@ FASTPythonImporterTest >> testYieldFrom [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'tests' } @@ -51921,7 +53325,8 @@ FASTPythonImporterTest >> testYieldWithIdentifier [ stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'x'. - self assert: (self topEntity isOfType: FASTPyIdentifier) + self assert: (self topEntity isOfType: FASTPyIdentifier). + self assert: self topEntity name equals: 'x' ] { #category : 'running' } diff --git a/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st new file mode 100644 index 0000000..78b5900 --- /dev/null +++ b/src/FAST-Python-Tools-Tests/FASTPythonLocalResolverTest.class.st @@ -0,0 +1,1979 @@ +Class { + #name : 'FASTPythonLocalResolverTest', + #superclass : 'FASTPythonAbstractTestCase', + #category : 'FAST-Python-Tools-Tests-Algos', + #package : 'FAST-Python-Tools-Tests', + #tag : 'Algos' +} + +{ #category : 'resolving' } +FASTPythonLocalResolverTest >> parseAndResolve: aString [ + + self parse: aString. + FASTPythonLocalResolverVisitor resolve: model module +] + +{ #category : 'tests - if' } +FASTPythonLocalResolverTest >> testAssignInElif [ + + | assignedVariable1 assignedVariable2 usedVariable | + self parseAndResolve: 'if a: + x = 1 +elif b: + x = 2 +else: + function() + +print(x)'. + + assignedVariable1 := model module statements first thenClause statements first left. + self assert: assignedVariable1 localDeclaration equals: assignedVariable1. + self assert: assignedVariable1 localDeclaration name equals: 'x'. + self assert: assignedVariable1 localDeclaration isVariableWriteAccess. + self deny: assignedVariable1 localDeclaration isNonLocalDeclaration. + self assert: assignedVariable1 localDeclaration localUses size equals: 3. + self assert: assignedVariable1 localDeclaration localUses first equals: assignedVariable1. + + assignedVariable2 := model module statements first elifClauses first statements first left. + self assert: assignedVariable2 localDeclaration equals: assignedVariable1. + self assert: assignedVariable2 equals: assignedVariable1 localDeclaration localUses second. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable1. + self deny: usedVariable localDeclaration isNonLocalDeclaration. + self assert: usedVariable equals: assignedVariable1 localDeclaration localUses third +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testAssignUnpacking [ + + | assignedVariable1 assignedVariable2 | + self parseAndResolve: 'a, *b = [1, 2, 3]'. + + assignedVariable1 := model module statements first left initializers first. + self assert: assignedVariable1 localDeclaration equals: assignedVariable1. + self assert: assignedVariable1 localDeclaration name equals: 'a'. + self assert: assignedVariable1 localDeclaration isVariableWriteAccess. + self deny: assignedVariable1 localDeclaration isNonLocalDeclaration. + self assert: assignedVariable1 localDeclaration localUses size equals: 1. + self assert: assignedVariable1 localDeclaration variableDeclarator equals: model module statements first. + + assignedVariable2 := model module statements first left initializers second expression. + self assert: assignedVariable2 localDeclaration equals: assignedVariable2. + self assert: assignedVariable2 localDeclaration name equals: 'b'. + self assert: assignedVariable2 localDeclaration isVariableWriteAccess. + self deny: assignedVariable2 localDeclaration isNonLocalDeclaration. + self assert: assignedVariable2 localDeclaration localUses size equals: 1. + self assert: assignedVariable2 localDeclaration variableDeclarator equals: model module statements first +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testAssignementToList [ + + | assignedVariableX assignedVariableY usedVariableX | + self parseAndResolve: '[x, y] = [1, 2] + +print(x)'. + + assignedVariableX := model module statements first left initializers first. + self assert: assignedVariableX localDeclaration equals: assignedVariableX. + self assert: assignedVariableX localDeclaration name equals: 'x'. + self assert: assignedVariableX localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableX localDeclaration isVariableWriteAccess. + self deny: assignedVariableX localDeclaration isNonLocalDeclaration. + self assert: assignedVariableX localDeclaration localUses size equals: 2. + self assert: assignedVariableX localDeclaration localUses first equals: assignedVariableX. + + usedVariableX := model module statements second arguments first. + self assert: usedVariableX localDeclaration equals: assignedVariableX. + self assert: usedVariableX equals: assignedVariableX localDeclaration localUses second. + + assignedVariableY := model module statements first left initializers second. + self assert: assignedVariableY localDeclaration equals: assignedVariableY. + self assert: assignedVariableY localDeclaration name equals: 'y'. + self assert: assignedVariableY localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableY localDeclaration isVariableWriteAccess. + self deny: assignedVariableY localDeclaration isNonLocalDeclaration. + self assert: assignedVariableY localDeclaration localUses size equals: 1. + self assert: assignedVariableY localDeclaration localUses first equals: assignedVariableY +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testAssignementToListInLists [ + + | assignedVariableX assignedVariableY assignedVariableZ usedVariableX usedVariableY usedVariableZ | + self parseAndResolve: '[x, [y, z]] = [1, [2, 4]] + +print(x) +print(y) +print(z)'. + + assignedVariableX := model module statements first left initializers first. + self assert: assignedVariableX localDeclaration equals: assignedVariableX. + self assert: assignedVariableX localDeclaration name equals: 'x'. + self assert: assignedVariableX localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableX localDeclaration isVariableWriteAccess. + self deny: assignedVariableX localDeclaration isNonLocalDeclaration. + self assert: assignedVariableX localDeclaration localUses size equals: 2. + self assert: assignedVariableX localDeclaration localUses first equals: assignedVariableX. + + usedVariableX := model module statements second arguments first. + self assert: usedVariableX localDeclaration equals: assignedVariableX. + self assert: usedVariableX equals: assignedVariableX localDeclaration localUses second. + + assignedVariableY := model module statements first left initializers second initializers first. + self assert: assignedVariableY localDeclaration equals: assignedVariableY. + self assert: assignedVariableY localDeclaration name equals: 'y'. + self assert: assignedVariableY localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableY localDeclaration isVariableWriteAccess. + self deny: assignedVariableY localDeclaration isNonLocalDeclaration. + self assert: assignedVariableY localDeclaration localUses size equals: 2. + self assert: assignedVariableY localDeclaration localUses first equals: assignedVariableY. + + usedVariableY := model module statements third arguments first. + self assert: usedVariableY localDeclaration equals: assignedVariableY. + self assert: usedVariableY equals: assignedVariableY localDeclaration localUses second. + + assignedVariableZ := model module statements first left initializers second initializers second. + self assert: assignedVariableZ localDeclaration equals: assignedVariableZ. + self assert: assignedVariableZ localDeclaration name equals: 'z'. + self assert: assignedVariableZ localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableZ localDeclaration isVariableWriteAccess. + self deny: assignedVariableZ localDeclaration isNonLocalDeclaration. + self assert: assignedVariableZ localDeclaration localUses size equals: 2. + self assert: assignedVariableZ localDeclaration localUses first equals: assignedVariableZ. + + usedVariableZ := model module statements fourth arguments first. + self assert: usedVariableZ localDeclaration equals: assignedVariableZ. + self assert: usedVariableZ equals: assignedVariableZ localDeclaration localUses second +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testAssignementToTuple [ + + | assignedVariableX assignedVariableY usedVariableX | + self parseAndResolve: 'x, y = 1, 2 + +print(x)'. + + assignedVariableX := model module statements first left initializers first. + self assert: assignedVariableX localDeclaration equals: assignedVariableX. + self assert: assignedVariableX localDeclaration name equals: 'x'. + self assert: assignedVariableX localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableX localDeclaration isVariableWriteAccess. + self deny: assignedVariableX localDeclaration isNonLocalDeclaration. + self assert: assignedVariableX localDeclaration localUses size equals: 2. + self assert: assignedVariableX localDeclaration localUses first equals: assignedVariableX. + + usedVariableX := model module statements second arguments first. + self assert: usedVariableX localDeclaration equals: assignedVariableX. + self assert: usedVariableX equals: assignedVariableX localDeclaration localUses second. + + assignedVariableY := model module statements first left initializers second. + self assert: assignedVariableY localDeclaration equals: assignedVariableY. + self assert: assignedVariableY localDeclaration name equals: 'y'. + self assert: assignedVariableY localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableY localDeclaration isVariableWriteAccess. + self deny: assignedVariableY localDeclaration isNonLocalDeclaration. + self assert: assignedVariableY localDeclaration localUses size equals: 1. + self assert: assignedVariableY localDeclaration localUses first equals: assignedVariableY +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testAssignementToTupleInTuples [ + + | assignedVariableX assignedVariableY assignedVariableZ usedVariableX usedVariableY usedVariableZ | + self parseAndResolve: 'x, (y, z) = 1, (2, 4) + +print(x) +print(y) +print(z)'. + + assignedVariableX := model module statements first left initializers first. + self assert: assignedVariableX localDeclaration equals: assignedVariableX. + self assert: assignedVariableX localDeclaration name equals: 'x'. + self assert: assignedVariableX localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableX localDeclaration isVariableWriteAccess. + self deny: assignedVariableX localDeclaration isNonLocalDeclaration. + self assert: assignedVariableX localDeclaration localUses size equals: 2. + self assert: assignedVariableX localDeclaration localUses first equals: assignedVariableX. + + usedVariableX := model module statements second arguments first. + self assert: usedVariableX localDeclaration equals: assignedVariableX. + self assert: usedVariableX equals: assignedVariableX localDeclaration localUses second. + + assignedVariableY := model module statements first left initializers second initializers first. + self assert: assignedVariableY localDeclaration equals: assignedVariableY. + self assert: assignedVariableY localDeclaration name equals: 'y'. + self assert: assignedVariableY localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableY localDeclaration isVariableWriteAccess. + self deny: assignedVariableY localDeclaration isNonLocalDeclaration. + self assert: assignedVariableY localDeclaration localUses size equals: 2. + self assert: assignedVariableY localDeclaration localUses first equals: assignedVariableY. + + usedVariableY := model module statements third arguments first. + self assert: usedVariableY localDeclaration equals: assignedVariableY. + self assert: usedVariableY equals: assignedVariableY localDeclaration localUses second. + + assignedVariableZ := model module statements first left initializers second initializers second. + self assert: assignedVariableZ localDeclaration equals: assignedVariableZ. + self assert: assignedVariableZ localDeclaration name equals: 'z'. + self assert: assignedVariableZ localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariableZ localDeclaration isVariableWriteAccess. + self deny: assignedVariableZ localDeclaration isNonLocalDeclaration. + self assert: assignedVariableZ localDeclaration localUses size equals: 2. + self assert: assignedVariableZ localDeclaration localUses first equals: assignedVariableZ. + + usedVariableZ := model module statements fourth arguments first. + self assert: usedVariableZ localDeclaration equals: assignedVariableZ. + self assert: usedVariableZ equals: assignedVariableZ localDeclaration localUses second +] + +{ #category : 'tests - non local declarations' } +FASTPythonLocalResolverTest >> testAttributeAccessHalfResolved [ + "Here x is resolved but y is not resolved locally." + + | import importedEntity receiver value | + self parseAndResolve: 'import x + +x.y'. + + import := model module statements first. + importedEntity := import importedEntities first. + self assert: importedEntity localDeclaration equals: import. + self assert: importedEntity localDeclaration importedEntities first segments last equals: 'x'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + receiver := model module statements second value. + self assert: receiver localDeclaration equals: import. + self deny: receiver localDeclaration isNonLocalDeclaration. + self assert: receiver localDeclaration localUses second equals: receiver. + + value := model module statements second. + self assert: value localDeclaration name equals: 'x.y'. + self assert: value localDeclaration isNonLocalDeclaration. + self assert: value localDeclaration localUses size equals: 1. + self assert: value localDeclaration localUses first equals: value +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testAugmentedAssignInConditionalLinksToExistingDeclaration [ + + | assignedVariable augmentedVariable usedVariable | + self parseAndResolve: 'x = 3 + +if a: + x += 1 + +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + + augmentedVariable := model module statements second thenClause statements first left. + self assert: augmentedVariable localDeclaration equals: assignedVariable. + self assert: augmentedVariable equals: assignedVariable localDeclaration localUses second. + + usedVariable := model module statements third arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses third +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testAugmentedAssignLinksToExistingDeclaration [ + + | assignedVariable augmentedVariable usedVariable | + self parseAndResolve: 'x = 3 + +x += 1 + +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + augmentedVariable := model module statements second left. + self assert: augmentedVariable localDeclaration equals: assignedVariable. + self assert: augmentedVariable equals: assignedVariable localDeclaration localUses second. + + usedVariable := model module statements third arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses third +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testCallOnGlobal [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x = 1 +x()'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second callee. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testCallOnGlobalAttribute [ + + | assignedVariable usedVariable | + self parseAndResolve: 'y.x = 1 +y.x()'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second callee. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testCallOnGlobalSlice [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x[1] = 1 +x[1]()'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration value name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second callee. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testCommentedGlobalUsage [ + + | assignedVariable | + self parseAndResolve: 'x = 3 + +# {x: 2}'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 1. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testDeclarationAndUsageOfGlobalInModule [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x = 1 +x'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - for' } +FASTPythonLocalResolverTest >> testForElseAssignLinks [ + + | forVariable elseVariable usedVariable | + self parseAndResolve: 'for x in range(5): + pass +else: + x = 10 + +print(x)'. + + forVariable := model module statements first left. + self assert: forVariable localDeclaration equals: forVariable. + self assert: forVariable localDeclaration name equals: 'x'. + self assert: forVariable localDeclaration isVariableWriteAccess. + self deny: forVariable localDeclaration isNonLocalDeclaration. + self assert: forVariable localDeclaration localUses size equals: 3. + + elseVariable := model module statements first elseClause statements first left. + self assert: elseVariable localDeclaration equals: forVariable. + self assert: elseVariable equals: forVariable localDeclaration localUses second. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: forVariable. + self assert: usedVariable equals: forVariable localDeclaration localUses third +] + +{ #category : 'tests - imports' } +FASTPythonLocalResolverTest >> testFromImportedEntity [ + + | import importedEntity call | + self parseAndResolve: 'from matplotlib import __version__ + +print(__version__)'. + + import := model module statements first. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self deny: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first segments last equals: '__version__'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + call := model module statements second arguments first. + self assert: call localDeclaration equals: import. + self assert: call equals: importedEntity localDeclaration localUses second +] + +{ #category : 'tests - imports' } +FASTPythonLocalResolverTest >> testFromImportedEntityWithAlias [ + + | import importedEntity call | + self parseAndResolve: 'from matplotlib import __version__ as v + +print(v)'. + + import := model module statements first. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self assert: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first alias equals: 'v'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + call := model module statements second arguments first. + self assert: call localDeclaration equals: import. + self assert: call equals: importedEntity localDeclaration localUses second +] + +{ #category : 'tests - imports' } +FASTPythonLocalResolverTest >> testFromImportedEntityWithAliasDoesNotShadowVariable [ + + | import importedEntity call assignedVariable usedVariable1 usedVariable2 | + self parseAndResolve: 'x = 1 + +print(x) + +from y import x as func + +func() + +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable1 := model module statements second arguments first. + self assert: usedVariable1 localDeclaration equals: assignedVariable. + self assert: usedVariable1 equals: assignedVariable localDeclaration localUses second. + + usedVariable2 := model module statements fifth arguments first. + self assert: usedVariable2 localDeclaration equals: assignedVariable. + self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third. + + import := model module statements third. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self assert: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first alias equals: 'func'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + call := model module statements fourth callee. + self assert: call localDeclaration equals: import. + self assert: call equals: importedEntity localDeclaration localUses second +] + +{ #category : 'tests - functions' } +FASTPythonLocalResolverTest >> testFunctionDeclaredAndCalled [ + + | functionDefinition call | + self parseAndResolve: 'def func(): + pass + +func()'. + + functionDefinition := model module statements first. + self assert: functionDefinition localDeclaration equals: functionDefinition. + self assert: functionDefinition localDeclaration name equals: 'func'. + self deny: functionDefinition localDeclaration isNonLocalDeclaration. + self assert: functionDefinition localDeclaration localUses size equals: 2. + self assert: functionDefinition localDeclaration localUses first equals: functionDefinition. + + call := model module statements second callee. + self assert: call localDeclaration equals: functionDefinition. + self assert: call equals: functionDefinition localDeclaration localUses second +] + +{ #category : 'tests - parameters' } +FASTPythonLocalResolverTest >> testFunctionParameter [ + + | declaration usedVariable | + self parseAndResolve: 'def funct(y): + return y'. + + declaration := model module statements first parameters first. + self assert: declaration localDeclaration equals: declaration. + self assert: declaration localDeclaration name equals: 'y'. + self assert: declaration localDeclaration isVariableWriteAccess. + self deny: declaration localDeclaration isNonLocalDeclaration. + self assert: declaration localDeclaration localUses size equals: 2. + self assert: declaration localDeclaration localUses first equals: declaration. + + usedVariable := model module statements first statements first expression. + self assert: usedVariable localDeclaration equals: declaration. + self assert: usedVariable equals: declaration localDeclaration localUses second +] + +{ #category : 'tests - parameters' } +FASTPythonLocalResolverTest >> testFunctionParameterRedefined [ + + | declaration declaration2 usedVariable | + self parseAndResolve: 'def funct(y): + y = 2 + return y'. + + declaration := model module statements first parameters first. + self assert: declaration localDeclaration equals: declaration. + self assert: declaration localDeclaration name equals: 'y'. + self assert: declaration localDeclaration isVariableWriteAccess. + self deny: declaration localDeclaration isNonLocalDeclaration. + self assert: declaration localDeclaration localUses size equals: 3. + self assert: declaration localDeclaration localUses first equals: declaration. + + declaration2 := model module statements first statements first left. + self assert: declaration2 localDeclaration equals: declaration. + self assert: declaration localDeclaration localUses second equals: declaration2. + + usedVariable := model module statements first statements second expression. + self assert: usedVariable localDeclaration equals: declaration. + self assert: usedVariable equals: declaration localDeclaration localUses third +] + +{ #category : 'tests - parameters' } +FASTPythonLocalResolverTest >> testFunctionParameterWithDefaultValue [ + + | declaration usedVariable | + self parseAndResolve: 'def funct(y=3): + return y'. + + declaration := model module statements first parameters first. + self assert: declaration localDeclaration equals: declaration. + self assert: declaration localDeclaration name equals: 'y'. + self assert: declaration localDeclaration isVariableWriteAccess. + self deny: declaration localDeclaration isNonLocalDeclaration. + self assert: declaration localDeclaration localUses size equals: 2. + self assert: declaration localDeclaration localUses first equals: declaration. + + usedVariable := model module statements first statements first expression. + self assert: usedVariable localDeclaration equals: declaration. + self assert: usedVariable equals: declaration localDeclaration localUses second +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testGlobalAndTemporaryOfTheSameNameInFunction [ + + | assignedGlobal usedGlobal assignedTemporary temporaryUsage1 temporaryUsage2 | + self parseAndResolve: 'glob = 1 + +def fun(): + glob = 3 + print(glob) + return glob + +fun() +print(glob)'. + + assignedGlobal := model module statements first left. + self assert: assignedGlobal localDeclaration equals: assignedGlobal. + self assert: assignedGlobal localDeclaration name equals: 'glob'. + self assert: assignedGlobal localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedGlobal localDeclaration isNonLocalDeclaration. + self assert: assignedGlobal localDeclaration localUses size equals: 2. + self assert: assignedGlobal localDeclaration localUses first equals: assignedGlobal. + + usedGlobal := model module statements fourth arguments first. + self assert: usedGlobal localDeclaration equals: assignedGlobal. + self assert: usedGlobal equals: assignedGlobal localDeclaration localUses second. + + assignedTemporary := model module statements second statements first left. + self assert: assignedTemporary localDeclaration equals: assignedTemporary. + self assert: assignedTemporary localDeclaration name equals: 'glob'. + self assert: assignedTemporary localDeclaration variableDeclarator equals: model module statements second statements first. + self deny: assignedTemporary localDeclaration isNonLocalDeclaration. + self assert: assignedTemporary localDeclaration localUses size equals: 3. + self assert: assignedTemporary localDeclaration localUses first equals: assignedTemporary. + + temporaryUsage1 := model module statements second statements second arguments first. + self assert: temporaryUsage1 localDeclaration equals: assignedTemporary. + self assert: temporaryUsage1 equals: assignedTemporary localDeclaration localUses second. + + temporaryUsage2 := model module statements second statements third expression. + self assert: temporaryUsage2 localDeclaration equals: assignedTemporary. + self assert: temporaryUsage2 equals: assignedTemporary localDeclaration localUses third +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testGlobalAsAttributeUsageInCall [ + + | assignedVariable usedVariable attributeReceiver | + self parseAndResolve: 'y.x = 5 + +print(y.x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second. + + attributeReceiver := assignedVariable value. + self assert: attributeReceiver localDeclaration isNonLocalDeclaration. + self assert: attributeReceiver localDeclaration name equals: 'y' +] + +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testGlobalAttributeShadowedByImport [ + "Here we cannot know if the second printing is of a variable." + + | assignedVariable usedVariable import importedEntity usedImportedEntity | + self parseAndResolve: 'x.y = 1 +print(x.y) + +import x.y + +print(x.y)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'y'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second. + + import := model module statements third. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self deny: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first segments last equals: 'y'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + usedImportedEntity := model module statements fourth arguments first. + self assert: usedImportedEntity localDeclaration equals: import. + self assert: usedImportedEntity equals: importedEntity localDeclaration localUses second. + + self assert: assignedVariable localDeclaration shadowedBy equals: import. + self assert: importedEntity localDeclaration shadowing equals: assignedVariable +] + +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testGlobalAttributeShadowedByImportInFunction [ + + | assignedVariable usedVariable1 usedVariable2 | + self parseAndResolve: 'y.x = 3 + +print(y.x) + +def f(): + import y.x + return y.x + +print(y.x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable1 := model module statements second arguments first. + self assert: usedVariable1 localDeclaration equals: assignedVariable. + self assert: usedVariable1 equals: assignedVariable localDeclaration localUses second. + + usedVariable2 := model module statements fourth arguments first. + self assert: usedVariable2 localDeclaration equals: assignedVariable. + self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third +] + +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testGlobalShadowedByFunction [ + + | assignedVariable usedVariable function usedFunction | + self parseAndResolve: 'x = 3 + +print(x) + +def x(): pass + +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second. + + function := model module statements third. + self assert: function localDeclaration equals: function. + self assert: function localDeclaration name equals: 'x'. + self deny: function localDeclaration isNonLocalDeclaration. + self assert: function localDeclaration localUses size equals: 2. + self assert: function localDeclaration localUses first equals: function. + + usedFunction := model module statements fourth arguments first. + self assert: usedFunction localDeclaration equals: function. + self assert: usedFunction equals: function localDeclaration localUses second. + + self assert: assignedVariable localDeclaration shadowedBy equals: function. + self assert: function localDeclaration shadowing equals: assignedVariable +] + +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testGlobalShadowedByImport [ + "Here we cannot know if the second printing is of a variable." + + | assignedVariable usedVariable import importedEntity usedImportedEntity | + self parseAndResolve: 'x = 1 +print(x) + +import x + +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second. + + import := model module statements third. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self deny: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first segments last equals: 'x'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + usedImportedEntity := model module statements fourth arguments first. + self assert: usedImportedEntity localDeclaration equals: import. + self assert: usedImportedEntity equals: importedEntity localDeclaration localUses second. + + self assert: assignedVariable localDeclaration shadowedBy equals: import. + self assert: importedEntity localDeclaration shadowing equals: assignedVariable +] + +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testGlobalShadowedByImportAlias [ + "Here we cannot know if the second printing is of a variable." + + | assignedVariable usedVariable | + self parseAndResolve: 'x = 1 +print(x) + +import a as x + +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second. + + self deny: model module statements fourth arguments first localDeclaration equals: assignedVariable localDeclaration +] + +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testGlobalShadowedByImportInFunction [ + + | assignedVariable usedVariable1 usedVariable2 | + self parseAndResolve: 'matplotlib = 3 + +print(matplotlib) + +def f(): + import matplotlib + return matplotlib + +print(matplotlib)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'matplotlib'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable1 := model module statements second arguments first. + self assert: usedVariable1 localDeclaration equals: assignedVariable. + self assert: usedVariable1 equals: assignedVariable localDeclaration localUses second. + + usedVariable2 := model module statements fourth arguments first. + self assert: usedVariable2 localDeclaration equals: assignedVariable. + self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testGlobalUsageInCall [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x = 1 +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testGlobalUsedInDictionaryValue [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x = 3 + +{x: 2}'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second initializers first key. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testGlobalUsedInFunction [ + + | assignedVariable usedVariable | + self parseAndResolve: 'glob = 1 + +def fun(): + return glob + +print(fun())'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'glob'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second statements first expression. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testGlobalUsedInLambda [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x = 1 + +lambda: x'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second expression. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testGlobalUsedInList [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x = 3 + +[ x ]'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second initializers first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testGlobalUsedInSet [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x = 3 + +{ x }'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second initializers first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testGlobalUsedInTuple [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x = 3 + +(x, 2)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second initializers first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testImportInFunctionDoesNotShadow [ + + | assignedVariable usedVariable import importedEntity | + self parseAndResolve: 'x = 3 + +def f(a): + import x + +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + import := model module statements second statements first. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self deny: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first segments last equals: 'x'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 1. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + usedVariable := model module statements third arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testImportShadowedByImport [ + "Here we cannot know if the second printing is of a variable." + + | import importedEntity1 usedImportedEntity1 importedEntity2 usedImportedEntity2 | + self parseAndResolve: 'import time + +print(time) + +from time import time + +print(time)'. + + import := model module statements first. + importedEntity1 := import importedEntities anyOne. + self assert: importedEntity1 localDeclaration equals: import. + self deny: importedEntity1 localDeclaration importedEntities first hasAlias. + self assert: importedEntity1 localDeclaration importedEntities first segments last equals: 'time'. + self deny: importedEntity1 localDeclaration isNonLocalDeclaration. + self assert: importedEntity1 localDeclaration localUses size equals: 4. + self assert: importedEntity1 localDeclaration localUses first equals: importedEntity1. + + usedImportedEntity1 := model module statements second arguments first. + self assert: usedImportedEntity1 localDeclaration equals: import. + self assert: usedImportedEntity1 equals: importedEntity1 localDeclaration localUses second. + + importedEntity2 := model module statements third importedEntities anyOne. + self assert: importedEntity2 localDeclaration equals: import. + self assert: importedEntity2 localDeclaration localUses third equals: importedEntity2. + + usedImportedEntity2 := model module statements fourth arguments first. + self assert: usedImportedEntity2 localDeclaration equals: import. + self assert: usedImportedEntity2 equals: importedEntity2 localDeclaration localUses fourth +] + +{ #category : 'tests - imports' } +FASTPythonLocalResolverTest >> testImportedEntity [ + + | import importedEntity call | + self parseAndResolve: 'import func + +func()'. + + import := model module statements first. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self deny: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first segments last equals: 'func'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + call := model module statements second callee. + self assert: call localDeclaration equals: import. + self assert: call equals: importedEntity localDeclaration localUses second +] + +{ #category : 'tests - imports' } +FASTPythonLocalResolverTest >> testImportedEntityWithAlias [ + + | import importedEntity call | + self parseAndResolve: 'import functi as func + +func()'. + + import := model module statements first. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self assert: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first alias equals: 'func'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + call := model module statements second callee. + self assert: call localDeclaration equals: import. + self assert: call equals: importedEntity localDeclaration localUses second +] + +{ #category : 'tests - imports' } +FASTPythonLocalResolverTest >> testImportedEntityWithAliasDoesNotShadowVariable [ + + | import importedEntity call assignedVariable usedVariable1 usedVariable2 | + self parseAndResolve: 'x = 1 + +print(x) + +import x as func + +func() + +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable1 := model module statements second arguments first. + self assert: usedVariable1 localDeclaration equals: assignedVariable. + self assert: usedVariable1 equals: assignedVariable localDeclaration localUses second. + + usedVariable2 := model module statements fifth arguments first. + self assert: usedVariable2 localDeclaration equals: assignedVariable. + self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third. + + import := model module statements third. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self assert: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first alias equals: 'func'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + call := model module statements fourth callee. + self assert: call localDeclaration equals: import. + self assert: call equals: importedEntity localDeclaration localUses second +] + +{ #category : 'tests - parameters' } +FASTPythonLocalResolverTest >> testLambdaParameter [ + + | declaration usedVariable | + self parseAndResolve: 'lambda y: y'. + + declaration := model module statements first parameters first. + self assert: declaration localDeclaration equals: declaration. + self assert: declaration localDeclaration name equals: 'y'. + self assert: declaration localDeclaration isVariableWriteAccess. + self deny: declaration localDeclaration isNonLocalDeclaration. + self assert: declaration localDeclaration localUses size equals: 2. + self assert: declaration localDeclaration localUses first equals: declaration. + + usedVariable := model module statements first expression. + self assert: usedVariable localDeclaration equals: declaration. + self assert: usedVariable equals: declaration localDeclaration localUses second +] + +{ #category : 'tests - local variables' } +FASTPythonLocalResolverTest >> testLocalVariableInFunction [ + + | assignedVariable usedVariable | + self parseAndResolve: 'def f(): + x = 1 + return x + +print(f())'. + + assignedVariable := model module statements first statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements first statements second expression. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - local variables' } +FASTPythonLocalResolverTest >> testLocalVariableInFunctionWithTuples [ + + | assignedVariableX assignedVariableY usedVariable | + self parseAndResolve: 'def f(): + x, y = 1, 2 + return x + +print(f())'. + + assignedVariableX := model module statements first statements first left initializers first. + self assert: assignedVariableX localDeclaration equals: assignedVariableX. + self assert: assignedVariableX localDeclaration name equals: 'x'. + self assert: assignedVariableX localDeclaration isVariableWriteAccess. + self assert: assignedVariableX localDeclaration variableDeclarator equals: model module statements first statements first. + self deny: assignedVariableX localDeclaration isNonLocalDeclaration. + self assert: assignedVariableX localDeclaration localUses size equals: 2. + self assert: assignedVariableX localDeclaration localUses first equals: assignedVariableX. + + usedVariable := model module statements first statements second expression. + self assert: usedVariable localDeclaration equals: assignedVariableX. + self assert: usedVariable equals: assignedVariableX localDeclaration localUses second. + + assignedVariableY := model module statements first statements first left initializers second. + self assert: assignedVariableY localDeclaration equals: assignedVariableY. + self assert: assignedVariableY localDeclaration name equals: 'y'. + self assert: assignedVariableY localDeclaration isVariableWriteAccess. + self assert: assignedVariableY localDeclaration variableDeclarator equals: model module statements first statements first. + self deny: assignedVariableY localDeclaration isNonLocalDeclaration. + self assert: assignedVariableY localDeclaration localUses size equals: 1. + self assert: assignedVariableY localDeclaration localUses first equals: assignedVariableY. + +] + +{ #category : 'tests - methods' } +FASTPythonLocalResolverTest >> testMethodRedefined [ + + | declaration1 declaration2 | + self parseAndResolve: 'class C: + def meth(self): + return self + + def meth(self): + return self'. + + declaration1 := model module statements first statements first. + self assert: declaration1 localDeclaration equals: declaration1. + self assert: declaration1 localDeclaration name equals: 'meth'. + self deny: declaration1 localDeclaration isNonLocalDeclaration. + self assert: declaration1 localDeclaration localUses size equals: 2. + self assert: declaration1 localDeclaration localUses first equals: declaration1. + + declaration2 := model module statements first statements second. + self assert: declaration2 localDeclaration equals: declaration1. + self assert: declaration1 localDeclaration localUses second equals: declaration2 +] + +{ #category : 'tests - parameters' } +FASTPythonLocalResolverTest >> testMethodSelfParameter [ + + | declaration usedVariable | + self parseAndResolve: 'class C: + def meth(self): + return self'. + + declaration := model module statements first statements first parameters first. + self assert: declaration localDeclaration equals: declaration. + self assert: declaration localDeclaration name equals: 'self'. + self assert: declaration localDeclaration isVariableWriteAccess. + self deny: declaration localDeclaration isNonLocalDeclaration. + self assert: declaration localDeclaration localUses size equals: 2. + self assert: declaration localDeclaration localUses first equals: declaration. + + usedVariable := model module statements first statements first statements first expression. + self assert: usedVariable localDeclaration equals: declaration. + self assert: usedVariable equals: declaration localDeclaration localUses second +] + +{ #category : 'tests - parameters' } +FASTPythonLocalResolverTest >> testMethodSelfParameterWithDifferentName [ + + | declaration usedVariable | + self parseAndResolve: 'class C: + def meth(this): + return this'. + + declaration := model module statements first statements first parameters first. + self assert: declaration localDeclaration equals: declaration. + self assert: declaration localDeclaration name equals: 'this'. + self assert: declaration localDeclaration isVariableWriteAccess. + self deny: declaration localDeclaration isNonLocalDeclaration. + self assert: declaration localDeclaration localUses size equals: 2. + self assert: declaration localDeclaration localUses first equals: declaration. + + usedVariable := model module statements first statements first statements first expression. + self assert: usedVariable localDeclaration equals: declaration. + self assert: usedVariable equals: declaration localDeclaration localUses second +] + +{ #category : 'tests - if' } +FASTPythonLocalResolverTest >> testNestedIfAssignInner [ + + | assignedOuter assignedInner usedVariable | + self parseAndResolve: 'x = 1 + +if a: + if b: + x = 2 + +print(x)'. + + assignedOuter := model module statements first left. + self assert: assignedOuter localDeclaration equals: assignedOuter. + self assert: assignedOuter localDeclaration name equals: 'x'. + self assert: assignedOuter localDeclaration isVariableWriteAccess. + self deny: assignedOuter localDeclaration isNonLocalDeclaration. + self assert: assignedOuter localDeclaration localUses size equals: 3. + + assignedInner := model module statements second thenClause statements first thenClause statements first left. + self assert: assignedInner localDeclaration equals: assignedOuter. + self assert: assignedInner equals: assignedOuter localDeclaration localUses second. + + usedVariable := model module statements third arguments first. + self assert: usedVariable localDeclaration equals: assignedOuter. + self assert: usedVariable equals: assignedOuter localDeclaration localUses third +] + +{ #category : 'tests - if' } +FASTPythonLocalResolverTest >> testNestedIfBothBranchesAssign [ + + | assignedOuter assignedInnerThen assignedInnerElse usedVariable | + self parseAndResolve: 'x = 1 + +if a: + if b: + x = 2 + else: + x = 3 + +print(x)'. + + assignedOuter := model module statements first left. + self assert: assignedOuter localDeclaration equals: assignedOuter. + self assert: assignedOuter localDeclaration name equals: 'x'. + self assert: assignedOuter localDeclaration isVariableWriteAccess. + self deny: assignedOuter localDeclaration isNonLocalDeclaration. + self assert: assignedOuter localDeclaration localUses size equals: 4. + + assignedInnerThen := model module statements second thenClause statements first thenClause statements first left. + self assert: assignedInnerThen localDeclaration equals: assignedOuter. + self assert: assignedInnerThen equals: assignedOuter localDeclaration localUses second. + + assignedInnerElse := model module statements second thenClause statements first elseClause statements first left. + self assert: assignedInnerElse localDeclaration equals: assignedOuter. + self assert: assignedInnerElse equals: assignedOuter localDeclaration localUses third. + + usedVariable := model module statements third arguments first. + self assert: usedVariable localDeclaration equals: assignedOuter. + self assert: usedVariable equals: assignedOuter localDeclaration localUses fourth +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testNonLocalAttributesAccessesAreLinked [ + + | usedVariable1 usedVariable2 | + self parseAndResolve: 'import x + +a(x.y) +b(x.y)'. + + + usedVariable1 := model module statements second arguments first. + self assert: usedVariable1 localDeclaration isNonLocalDeclaration. + self assert: usedVariable1 localDeclaration localUses size equals: 2. + self assert: usedVariable1 equals: usedVariable1 localDeclaration localUses first. + + usedVariable2 := model module statements third arguments first. + self assert: usedVariable2 localDeclaration equals: usedVariable1 localDeclaration. + self assert: usedVariable2 equals: usedVariable1 localDeclaration localUses second +] + +{ #category : 'tests - non local declarations' } +FASTPythonLocalResolverTest >> testNonLocalMethodAndVariable [ + + | nonLocalCall nonLocalAccess | + self parseAndResolve: 'print(x)'. + + nonLocalCall := model module statements first callee. + self assert: nonLocalCall localDeclaration name equals: 'print'. + self assert: nonLocalCall localDeclaration isNonLocalDeclaration. + self assert: nonLocalCall localDeclaration localUses size equals: 1. + self assert: nonLocalCall localDeclaration localUses first equals: nonLocalCall. + + nonLocalAccess := model module statements first arguments first. + self assert: nonLocalAccess localDeclaration name equals: 'x'. + self assert: nonLocalAccess localDeclaration isNonLocalDeclaration. + self assert: nonLocalAccess localDeclaration localUses size equals: 1. + self assert: nonLocalAccess localDeclaration localUses first equals: nonLocalAccess +] + +{ #category : 'tests - shadowing' } +FASTPythonLocalResolverTest >> testParameterShadowedByAssignement [ + + | parameter usedParameter assignedVariable usedVariable | + self parseAndResolve: 'def func(param): + print(param) + param = 3 + print(param)'. + + parameter := model module statements first parameters first. + self assert: parameter localDeclaration equals: parameter. + self assert: parameter localDeclaration name equals: 'param'. + self deny: parameter localDeclaration isNonLocalDeclaration. + self assert: parameter localDeclaration localUses size equals: 4. + self assert: parameter localDeclaration localUses first equals: parameter. + + usedParameter := model module statements first statements first arguments first. + self assert: usedParameter localDeclaration equals: parameter. + self assert: usedParameter equals: parameter localDeclaration localUses second. + + assignedVariable := model module statements first statements second left. + self assert: assignedVariable localDeclaration equals: parameter. + self assert: assignedVariable localDeclaration localUses third equals: assignedVariable. + + usedVariable := model module statements first statements third arguments first. + self assert: usedVariable localDeclaration equals: parameter. + self assert: usedVariable equals: assignedVariable localDeclaration localUses fourth +] + +{ #category : 'tests - subscripts' } +FASTPythonLocalResolverTest >> testSubscriptUsageInCall [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x[3] = 1 +print(x[3])'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration value name equals: 'x'. + self assert: assignedVariable localDeclaration indices first sourceCode equals: '3'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - globals' } +FASTPythonLocalResolverTest >> testTernaryExpressionAssign [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x = 1 if a else 2 + +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - try' } +FASTPythonLocalResolverTest >> testTryAssign [ + + | assignedVariable usedVariable | + self parseAndResolve: 'try: + x = 1 +except: + function() + +print(x)'. + + assignedVariable := model module statements first statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - try' } +FASTPythonLocalResolverTest >> testTryExceptAssign [ + + | assignedVariable usedVariable | + self parseAndResolve: 'try: + function() +except: + x = 1 + +print(x)'. + + assignedVariable := model module statements first excepts first statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testTwoAssignationsCreateOneDeclaration [ + + | assignedVariable1 assignedVariable2 usedVariable | + self parseAndResolve: 'x = 1 +x = 2 +x'. + + assignedVariable1 := model module statements first left. + self assert: assignedVariable1 localDeclaration equals: assignedVariable1. + self assert: assignedVariable1 localDeclaration name equals: 'x'. + self assert: assignedVariable1 localDeclaration isVariableWriteAccess. + self assert: assignedVariable1 localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable1 localDeclaration isNonLocalDeclaration. + self assert: assignedVariable1 localDeclaration localUses size equals: 3. + self assert: assignedVariable1 localDeclaration localUses first equals: assignedVariable1. + + assignedVariable2 := model module statements second left. + self assert: assignedVariable2 localDeclaration equals: assignedVariable1. + self assert: assignedVariable2 equals: assignedVariable1 localDeclaration localUses second. + + usedVariable := model module statements third. + self assert: usedVariable localDeclaration equals: assignedVariable1. + self assert: usedVariable equals: assignedVariable1 localDeclaration localUses third +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testTwoResolutionsDoNotClash [ + + | assignedVariable usedVariable | + self parseAndResolve: 'x = 1 +print(x)'. + + "Do a second resolution to ensure the first one is cleared" + FASTPythonLocalResolverVisitor resolve: model module. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests - for' } +FASTPythonLocalResolverTest >> testVariableAccessedInForIn [ + + | assignedVariable usedVariable | + self parseAndResolve: 'fruits = ["apple", "banana", "cherry"] +for x in fruits: + pass'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'fruits'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + + usedVariable := model module statements second right. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses second +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testVariableAccessedInIf [ + + | assignedVariable usedVariable1 usedVariable2 | + self parseAndResolve: 'glob = 1 + +if glob < 3: + print(glob)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'glob'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + + usedVariable1 := model module statements second condition operands first. + self assert: usedVariable1 localDeclaration equals: assignedVariable. + self assert: usedVariable1 equals: assignedVariable localDeclaration localUses second. + + usedVariable2 := model module statements second thenClause statements first arguments first. + self assert: usedVariable2 localDeclaration equals: assignedVariable. + self assert: usedVariable2 equals: assignedVariable localDeclaration localUses third +] + +{ #category : 'tests - for' } +FASTPythonLocalResolverTest >> testVariableDeclaredInFor [ + + | declared usedVariable | + self parseAndResolve: 'for x in "banana": + i = 2 + +print(i)'. + + declared := model module statements first statements first left. + self assert: declared localDeclaration equals: declared. + self assert: declared localDeclaration name equals: 'i'. + self assert: declared localDeclaration variableDeclarator equals: model module statements first statements first. + self assert: declared localDeclaration isVariableWriteAccess. + self deny: declared localDeclaration isNonLocalDeclaration. + self assert: declared localDeclaration localUses size equals: 2. + self assert: declared localDeclaration localUses first equals: declared. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: declared. + self assert: usedVariable equals: declared localDeclaration localUses second +] + +{ #category : 'tests - while' } +FASTPythonLocalResolverTest >> testVariableDeclaredInWhile [ + + | declared usedVariable | + self parseAndResolve: 'while False: + i = 2 + +print(i)'. + + declared := model module statements first statements first left. + self assert: declared localDeclaration equals: declared. + self assert: declared localDeclaration name equals: 'i'. + self assert: declared localDeclaration isVariableWriteAccess. + self assert: declared localDeclaration variableDeclarator equals: model module statements first statements first. + self deny: declared localDeclaration isNonLocalDeclaration. + self assert: declared localDeclaration localUses size equals: 2. + self assert: declared localDeclaration localUses first equals: declared. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: declared. + self assert: usedVariable equals: declared localDeclaration localUses second +] + +{ #category : 'tests - comprehensions' } +FASTPythonLocalResolverTest >> testVariableInListComprehensions [ + + | declared usedVariable | + self parseAndResolve: 'fruits = ["apple", "banana", "cherry", "kiwi", "mango"] + +[x for x in fruits]'. + + declared := model module statements second forClauses first left. + self assert: declared localDeclaration equals: declared. + self assert: declared localDeclaration name equals: 'x'. + self assert: declared localDeclaration isVariableWriteAccess. + self assert: declared localDeclaration variableDeclarator equals: model module statements second forClauses first. + self deny: declared localDeclaration isNonLocalDeclaration. + self assert: declared localDeclaration localUses size equals: 2. + self assert: declared localDeclaration localUses first equals: declared. + + usedVariable := model module statements second body. + self assert: usedVariable localDeclaration equals: declared. + self assert: usedVariable equals: declared localDeclaration localUses second +] + +{ #category : 'tests - comprehensions' } +FASTPythonLocalResolverTest >> testVariableInListComprehensionsDoesNotLeak [ + "Here the x of the comprehension should not leek outside of it if we consider we are in Python 3" + + | import importedEntity declared usedVariable usedImportedEntity | + self parseAndResolve: 'import x + +fruits = ["apple", "banana", "cherry", "kiwi", "mango"] + +[x for x in fruits] + +print(x)'. + + import := model module statements first. + importedEntity := import importedEntities anyOne. + self assert: importedEntity localDeclaration equals: import. + self deny: importedEntity localDeclaration importedEntities first hasAlias. + self assert: importedEntity localDeclaration importedEntities first segments last equals: 'x'. + self deny: importedEntity localDeclaration isNonLocalDeclaration. + self assert: importedEntity localDeclaration localUses size equals: 2. + self assert: importedEntity localDeclaration localUses first equals: importedEntity. + + usedImportedEntity := model module statements fourth arguments first. + self assert: usedImportedEntity localDeclaration equals: import. + self assert: usedImportedEntity equals: importedEntity localDeclaration localUses second. + + declared := model module statements third forClauses first left. + self assert: declared localDeclaration equals: declared. + self assert: declared localDeclaration name equals: 'x'. + self assert: declared localDeclaration isVariableWriteAccess. + self assert: declared localDeclaration variableDeclarator equals: model module statements third forClauses first. + self deny: declared localDeclaration isNonLocalDeclaration. + self assert: declared localDeclaration localUses size equals: 2. + self assert: declared localDeclaration localUses first equals: declared. + + usedVariable := model module statements third body. + self assert: usedVariable localDeclaration equals: declared. + self assert: usedVariable equals: declared localDeclaration localUses second +] + +{ #category : 'tests - for' } +FASTPythonLocalResolverTest >> testVariableOfFor [ + + | declared usedVariable | + self parseAndResolve: 'for x in "banana": + print(x)'. + + declared := model module statements first left. + self assert: declared localDeclaration equals: declared. + self assert: declared localDeclaration name equals: 'x'. + self assert: declared localDeclaration variableDeclarator equals: model module statements first. + self assert: declared localDeclaration isVariableWriteAccess. + self deny: declared localDeclaration isNonLocalDeclaration. + self assert: declared localDeclaration localUses size equals: 2. + self assert: declared localDeclaration localUses first equals: declared. + + usedVariable := model module statements first statements first arguments first. + self assert: usedVariable localDeclaration equals: declared. + self assert: usedVariable equals: declared localDeclaration localUses second +] + +{ #category : 'tests - for' } +FASTPythonLocalResolverTest >> testVariableOfForClashingWithOtherVariables [ + + | assignedVariable assignedVariableInFor usedVariable | + self parseAndResolve: 'x = 3 + +for x in range(5): + print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + assignedVariableInFor := model module statements second left. + self assert: assignedVariableInFor localDeclaration equals: assignedVariable. + self assert: assignedVariableInFor equals: assignedVariableInFor localDeclaration localUses second. + + usedVariable := model module statements second statements first arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: usedVariable localDeclaration localUses third +] + +{ #category : 'tests - for' } +FASTPythonLocalResolverTest >> testVariableOfForRedefinedInside [ + + | declared usedVariable | + self parseAndResolve: 'for x in range(5): + x += 1'. + + declared := model module statements first left. + self assert: declared localDeclaration equals: declared. + self assert: declared localDeclaration name equals: 'x'. + self assert: declared localDeclaration variableDeclarator equals: model module statements first. + self assert: declared localDeclaration isVariableWriteAccess. + self deny: declared localDeclaration isNonLocalDeclaration. + self assert: declared localDeclaration localUses size equals: 2. + self assert: declared localDeclaration localUses first equals: declared. + + usedVariable := model module statements first statements first left. + self assert: usedVariable localDeclaration equals: declared. + self assert: usedVariable equals: declared localDeclaration localUses second +] + +{ #category : 'tests - for' } +FASTPythonLocalResolverTest >> testVariableOfForStaysAfterFor [ + + | assignedVariable usedVariable | + self parseAndResolve: 'for x in range(5): + pass + +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 2. + self assert: assignedVariable localDeclaration localUses first equals: assignedVariable. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: usedVariable localDeclaration localUses second +] + +{ #category : 'tests - for' } +FASTPythonLocalResolverTest >> testVariableOfForWithTuple [ + + | declaredA usedVariableA declaredB usedVariableB | + self parseAndResolve: 'for a, b in arg: + print(a, b)'. + + declaredA := model module statements first left initializers first. + self assert: declaredA localDeclaration equals: declaredA. + self assert: declaredA localDeclaration name equals: 'a'. + self assert: declaredA localDeclaration variableDeclarator equals: model module statements first. + self assert: declaredA localDeclaration isVariableWriteAccess. + self deny: declaredA localDeclaration isNonLocalDeclaration. + self assert: declaredA localDeclaration localUses size equals: 2. + self assert: declaredA localDeclaration localUses first equals: declaredA. + + usedVariableA := model module statements first statements first arguments first. + self assert: usedVariableA localDeclaration equals: declaredA. + self assert: usedVariableA equals: declaredA localDeclaration localUses second. + + declaredB := model module statements first left initializers second. + self assert: declaredB localDeclaration equals: declaredB. + self assert: declaredB localDeclaration name equals: 'b'. + self assert: declaredA localDeclaration variableDeclarator equals: model module statements first. + self assert: declaredB localDeclaration isVariableWriteAccess. + self deny: declaredB localDeclaration isNonLocalDeclaration. + self assert: declaredB localDeclaration localUses size equals: 2. + self assert: declaredB localDeclaration localUses first equals: declaredB. + + usedVariableB := model module statements first statements first arguments second. + self assert: usedVariableB localDeclaration equals: declaredB. + self assert: usedVariableB equals: declaredB localDeclaration localUses second +] + +{ #category : 'tests - while' } +FASTPythonLocalResolverTest >> testVariableOfWhileReassignVariable [ + + | assignedVariable reAssignedVariable usedVariable | + self parseAndResolve: 'x = 3 + +while a: + x = 4 + +print(x)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'x'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + + reAssignedVariable := model module statements second statements first left. + self assert: reAssignedVariable localDeclaration equals: assignedVariable. + self assert: reAssignedVariable equals: assignedVariable localDeclaration localUses second. + + usedVariable := model module statements third arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses third +] + +{ #category : 'tests' } +FASTPythonLocalResolverTest >> testVariableRedefinedInIf [ + + | assignedVariable assignedVariable2 usedVariable | + self parseAndResolve: 'glob = 1 + +if True: + glob = 3 + +print(glob)'. + + assignedVariable := model module statements first left. + self assert: assignedVariable localDeclaration equals: assignedVariable. + self assert: assignedVariable localDeclaration name equals: 'glob'. + self assert: assignedVariable localDeclaration isVariableWriteAccess. + self assert: assignedVariable localDeclaration variableDeclarator equals: model module statements first. + self deny: assignedVariable localDeclaration isNonLocalDeclaration. + self assert: assignedVariable localDeclaration localUses size equals: 3. + + assignedVariable2 := model module statements second thenClause statements first left. + self assert: assignedVariable2 localDeclaration equals: assignedVariable. + self assert: assignedVariable2 equals: assignedVariable localDeclaration localUses second. + + usedVariable := model module statements third arguments first. + self assert: usedVariable localDeclaration equals: assignedVariable. + self assert: usedVariable equals: assignedVariable localDeclaration localUses third +] + +{ #category : 'tests - while' } +FASTPythonLocalResolverTest >> testWhileElseAssign [ + + | whileVariable elseVariable usedVariable | + self parseAndResolve: 'while a: + x = 1 +else: + x = 2 + +print(x)'. + + whileVariable := model module statements first statements first left. + self assert: whileVariable localDeclaration equals: whileVariable. + self assert: whileVariable localDeclaration name equals: 'x'. + self assert: whileVariable localDeclaration isVariableWriteAccess. + self deny: whileVariable localDeclaration isNonLocalDeclaration. + self assert: whileVariable localDeclaration localUses size equals: 3. + + elseVariable := model module statements first elseClause statements first left. + self assert: elseVariable localDeclaration equals: whileVariable. + self assert: elseVariable equals: whileVariable localDeclaration localUses second. + + usedVariable := model module statements second arguments first. + self assert: usedVariable localDeclaration equals: whileVariable. + self assert: usedVariable equals: whileVariable localDeclaration localUses third +] diff --git a/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st new file mode 100644 index 0000000..c8d56ec --- /dev/null +++ b/src/FAST-Python-Tools-Tests/FASTPythonSSATest.class.st @@ -0,0 +1,1713 @@ +Class { + #name : 'FASTPythonSSATest', + #superclass : 'FASTPythonAbstractTestCase', + #category : 'FAST-Python-Tools-Tests-Algos', + #package : 'FAST-Python-Tools-Tests', + #tag : 'Algos' +} + +{ #category : 'parsing' } +FASTPythonSSATest >> parseAndResolve: aString [ + + self parse: aString. + FASTPythonSSAVisitor resolve: model module +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testAssignementInAssignment [ + + | assignedVar1 assignedVar2 assignedVar3 usedVar1 usedVar2 usedVar3 usedVar4 | + self parseAndResolve: 'x = y = 3 + +print(x) +print(y) + +x = 5 + +print(x) +print(y)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements first right left. + self assert: assignedVar2 ssaVersion version equals: 1. + self assert: assignedVar2 ssaName equals: 'y_1'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 3. + + usedVar1 := model module statements second arguments first. + self assert: usedVar1 ssaVersion identicalTo: assignedVar1 ssaVersion. + + usedVar2 := model module statements third arguments first. + self assert: usedVar2 ssaVersion identicalTo: assignedVar2 ssaVersion. + + assignedVar3 := model module statements fourth left. + self assert: assignedVar3 ssaVersion version equals: 2. + self assert: assignedVar3 ssaName equals: 'x_2'. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar3 localDeclaration. + self assert: assignedVar3 ssaVersion localUses size equals: 2. + + usedVar3 := model module statements fifth arguments first. + self assert: usedVar3 ssaVersion identicalTo: assignedVar3 ssaVersion. + + usedVar4 := model module statements sixth arguments first. + self assert: usedVar4 ssaVersion identicalTo: assignedVar2 ssaVersion +] + +{ #category : 'tests - if' } +FASTPythonSSATest >> testAssignementInIfInBothBranchesAndUsage [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'if y < 2: + x = 4 +else: + x = 5 + +print(x)'. + + assignedVar1 := model module statements first thenClause statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements first elseClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements second arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] + +{ #category : 'tests - if' } +FASTPythonSSATest >> testAssignementInIfInThenAndUsage [ + + | assignedVar2 usedVar | + self parseAndResolve: 'if y < 2: + x = 4 + +print(x)'. + + assignedVar2 := model module statements first thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 1. + self assert: assignedVar2 ssaName equals: 'x_1'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements second arguments first. + self deny: usedVar ssaVersion isPhi. + self assert: usedVar ssaVersion identicalTo: assignedVar2 ssaVersion +] + +{ #category : 'tests - if' } +FASTPythonSSATest >> testAssignementInIfInThenAndUsage2 [ + + | assignedVar2 usedVar | + self parseAndResolve: 'if y < 2: + x = 4 +else: + function() + +print(x)'. + + assignedVar2 := model module statements first thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 1. + self assert: assignedVar2 ssaName equals: 'x_1'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements second arguments first. + self deny: usedVar ssaVersion isPhi. + self assert: usedVar ssaVersion identicalTo: assignedVar2 ssaVersion +] + +{ #category : 'tests - if' } +FASTPythonSSATest >> testAssignementNotUpdatedInIfAndUsage [ + + | assignedVar usedVar | + self parseAndResolve: 'x = 3 + +if y < 2: + function1() +else: + function2() + +print(x)'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x_1'. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self deny: usedVar ssaVersion isPhi. + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion +] + +{ #category : 'tests - if' } +FASTPythonSSATest >> testAssignementNotUpdatedInIfAndUsage2 [ + + | assignedVar usedVar | + self parseAndResolve: 'x = 3 + +if y < 2: + function1() + +print(x)'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x_1'. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self deny: usedVar ssaVersion isPhi. + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testAssignementOfAttribute [ + + | assignedVar | + self parseAndResolve: 'x.y = 5'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x.y_1'. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 1 +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testAssignementOfAttributeAndUsage [ + + | assignedVar usedVar | + self parseAndResolve: 'x.y = 5 + +print(x.y)'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x.y_1'. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + usedVar := model module statements second arguments first. + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testAssignementOfAttributeDoesNotClashWithIdentifier [ + + | assignedVar1 assignedVar2 assignedVar3 usedVar | + self parseAndResolve: 'x = 5 + +y.x = 6 + +x = 7 + +print(y.x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 1. + + assignedVar2 := model module statements second left. + self assert: assignedVar2 ssaVersion version equals: 1. + self assert: assignedVar2 ssaName equals: 'y.x_1'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + assignedVar3 := model module statements third left. + self assert: assignedVar3 ssaVersion version equals: 2. + self assert: assignedVar3 ssaName equals: 'x_2'. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar3 localDeclaration. + self assert: assignedVar3 ssaVersion localUses size equals: 1. + + usedVar := model module statements fourth arguments first. + self assert: usedVar ssaVersion identicalTo: assignedVar2 ssaVersion +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testAssignementToUnpackingAndUsage [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'a, *b = [1, 2, 3] + +print(a)'. + + assignedVar1 := model module statements first left initializers first. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'a_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements first left initializers second expression. + self assert: assignedVar2 ssaVersion version equals: 1. + self assert: assignedVar2 ssaName equals: 'b_1'. + + usedVar := model module statements second arguments first. + self assert: usedVar ssaVersion identicalTo: assignedVar1 ssaVersion +] + +{ #category : 'tests - if' } +FASTPythonSSATest >> testAssignmentInIfWithMultipleElif [ + + | assignedVar1 assignedVar2 assignedVar3 assignedVar4 usedVar | + self parseAndResolve: 'x = 0 + +if a: + x = 1 +elif b: + x = 2 +elif c: + x = 3 +else: + function() + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + + assignedVar2 := model module statements second thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + + assignedVar3 := model module statements second elifClauses first statements first left. + self assert: assignedVar3 ssaVersion version equals: 3. + self assert: assignedVar3 ssaName equals: 'x_3'. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + + assignedVar4 := model module statements second elifClauses second statements first left. + self assert: assignedVar4 ssaVersion version equals: 4. + self assert: assignedVar4 ssaName equals: 'x_4'. + self assert: assignedVar4 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar2 ssaVersion. + assignedVar3 ssaVersion. + assignedVar3 ssaVersion. + assignedVar4 ssaVersion } +] + +{ #category : 'tests - if' } +FASTPythonSSATest >> testAssignmentInOneElif [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'if a: + x = 1 +elif b: + x = 2 +else: + function() + +print(x)'. + + assignedVar1 := model module statements first thenClause statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements first elifClauses first statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements second arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] + +{ #category : 'tests - ternary' } +FASTPythonSSATest >> testAssignmentInTernaryExpressionAndUsage [ + + | assignedVar1 usedVar assignedVar2 | + self parseAndResolve: 'x = 3 + +(x := 1) if a else 2 + +print(x)'. + self skip. + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second thenExpression. + self assert: assignedVar2 ssaVersion version equals: 1. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] + +{ #category : 'tests - ternary' } +FASTPythonSSATest >> testAssignmentToTernaryExpressionAndUsage [ + + | assignedVar1 usedVar | + self parseAndResolve: 'x = 1 if a else 2 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + self assert: assignedVar1 ssaVersion localUses first equals: assignedVar1. + + usedVar := model module statements second arguments first. + self assert: usedVar ssaVersion identicalTo: assignedVar1 ssaVersion. + self assert: usedVar equals: assignedVar1 ssaVersion localUses second +] + +{ #category : 'tests - augmented assignments' } +FASTPythonSSATest >> testAugmentedAssignAndUsage [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'x = 3 + +x += 1 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 1. + + assignedVar2 := model module statements second left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion identicalTo: assignedVar2 ssaVersion +] + +{ #category : 'tests - augmented assignments' } +FASTPythonSSATest >> testAugmentedAssignInConditional [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'x = 3 + +if a: + x += 1 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] + +{ #category : 'tests - for' } +FASTPythonSSATest >> testForElseAndUsage [ + + | assignedVar usedVar assignedVar2 | + self parseAndResolve: 'for x in range(5): + pass +else: + x = 10 + +print(x)'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x_1'. + self assert: assignedVar ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements first elseClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements second arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar ssaVersion. + assignedVar2 ssaVersion } +] + +{ #category : 'tests - for' } +FASTPythonSSATest >> testForLoopReAssignAndUsage [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'x = 3 + +for i in range(5): + x = i + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] + +{ #category : 'tests - for' } +FASTPythonSSATest >> testForVariableUsed [ + + | assignedVar usedVar | + self parseAndResolve: 'for x in range(5): + print(x)'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x_1'. + self assert: assignedVar ssaVersion localUses size equals: 2. + + usedVar := model module statements first statements first arguments first. + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion +] + +{ #category : 'tests - for' } +FASTPythonSSATest >> testForVariablesInListUsed [ + + | assignedVarA assignedVarB usedVarA usedVarB | + self parseAndResolve: 'for [a, b] in data: + print(a, b)'. + + assignedVarA := model module statements first left initializers first. + self assert: assignedVarA ssaVersion version equals: 1. + self assert: assignedVarA ssaName equals: 'a_1'. + self assert: assignedVarA ssaVersion localUses size equals: 2. + + usedVarA := model module statements first statements first arguments first. + self assert: usedVarA ssaVersion identicalTo: assignedVarA ssaVersion. + + assignedVarB := model module statements first left initializers second. + self assert: assignedVarB ssaVersion version equals: 1. + self assert: assignedVarB ssaName equals: 'b_1'. + self assert: assignedVarB ssaVersion localUses size equals: 2. + + usedVarB := model module statements first statements first arguments second. + self assert: usedVarB ssaVersion identicalTo: assignedVarB ssaVersion +] + +{ #category : 'tests - for' } +FASTPythonSSATest >> testForVariablesInTupleUsed [ + + | assignedVarA assignedVarB usedVarA usedVarB | + self parseAndResolve: 'for a, b in data: + print(a, b)'. + + assignedVarA := model module statements first left initializers first. + self assert: assignedVarA ssaVersion version equals: 1. + self assert: assignedVarA ssaName equals: 'a_1'. + self assert: assignedVarA ssaVersion localUses size equals: 2. + + usedVarA := model module statements first statements first arguments first. + self assert: usedVarA ssaVersion identicalTo: assignedVarA ssaVersion. + + assignedVarB := model module statements first left initializers second. + self assert: assignedVarB ssaVersion version equals: 1. + self assert: assignedVarB ssaName equals: 'b_1'. + self assert: assignedVarB ssaVersion localUses size equals: 2. + + usedVarB := model module statements first statements first arguments second. + self assert: usedVarB ssaVersion identicalTo: assignedVarB ssaVersion +] + +{ #category : 'tests - parameters' } +FASTPythonSSATest >> testFunctionParameterModified [ + + | parameterDeclaration assignedVar parameterUsage | + self parseAndResolve: 'def func(x): + if a: + x = 2 + + print(x)'. + + parameterDeclaration := model module statements first parameters first. + self assert: parameterDeclaration ssaVersion version equals: 1. + self assert: parameterDeclaration ssaName equals: 'x_1'. + self assert: parameterDeclaration ssaVersion localDeclaration equals: parameterDeclaration localDeclaration. + self assert: parameterDeclaration ssaVersion localUses size equals: 2. + + assignedVar := model module statements first statements first thenClause statements first left. + self assert: assignedVar ssaVersion version equals: 2. + self assert: assignedVar ssaName equals: 'x_2'. + self assert: assignedVar ssaVersion localDeclaration equals: parameterDeclaration ssaVersion localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + parameterUsage := model module statements first statements second arguments first. + self assert: parameterUsage ssaVersion isPhi. + self assertCollection: parameterUsage ssaVersion ssaVariables hasSameElements: { + parameterDeclaration ssaVersion. + assignedVar ssaVersion } +] + +{ #category : 'tests - parameters' } +FASTPythonSSATest >> testFunctionParameterUsed [ + + | parameterDeclaration parameterUsage | + self parseAndResolve: 'def func(x): + print(x)'. + + parameterDeclaration := model module statements first parameters first. + self assert: parameterDeclaration ssaVersion version equals: 1. + self assert: parameterDeclaration ssaName equals: 'x_1'. + self assert: parameterDeclaration ssaVersion localUses size equals: 2. + + parameterUsage := model module statements first statements first arguments first. + self assert: parameterUsage ssaVersion identicalTo: parameterDeclaration ssaVersion +] + +{ #category : 'tests - parameters' } +FASTPythonSSATest >> testFunctionWithDictionarySplatParameter [ + + | parameterDeclaration parameterUsage | + self parseAndResolve: 'def sample(**kwargs): + print(kwargs)'. + + parameterDeclaration := model module statements first parameters first. + self assert: parameterDeclaration ssaVersion version equals: 1. + self assert: parameterDeclaration ssaName equals: 'kwargs_1'. + self assert: parameterDeclaration ssaVersion localDeclaration equals: parameterDeclaration localDeclaration. + self assert: parameterDeclaration ssaVersion localUses size equals: 2. + + parameterUsage := model module statements first statements first arguments first. + self deny: parameterUsage ssaVersion isPhi. + self assert: parameterUsage ssaVersion equals: parameterDeclaration ssaVersion +] + +{ #category : 'tests - parameters' } +FASTPythonSSATest >> testFunctionWithListSplatParameter [ + + | parameterDeclaration parameterUsage | + self parseAndResolve: 'def sample(*args): + print(args)'. + + parameterDeclaration := model module statements first parameters first. + self assert: parameterDeclaration ssaVersion version equals: 1. + self assert: parameterDeclaration ssaName equals: 'args_1'. + self assert: parameterDeclaration ssaVersion localDeclaration equals: parameterDeclaration localDeclaration. + self assert: parameterDeclaration ssaVersion localUses size equals: 2. + + parameterUsage := model module statements first statements first arguments first. + self deny: parameterUsage ssaVersion isPhi. + self assert: parameterUsage ssaVersion equals: parameterDeclaration ssaVersion +] + +{ #category : 'tests - parameters' } +FASTPythonSSATest >> testFunctionWithSeparatorsParameters [ + + | parameterDeclaration assignedVar parameterUsage | + self parseAndResolve: 'def func(*, /, x): + if a: + x = 2 + + print(x)'. + + parameterDeclaration := model module statements first parameters third. + self assert: parameterDeclaration ssaVersion version equals: 1. + self assert: parameterDeclaration ssaName equals: 'x_1'. + self assert: parameterDeclaration ssaVersion localDeclaration equals: parameterDeclaration localDeclaration. + self assert: parameterDeclaration ssaVersion localUses size equals: 2. + + assignedVar := model module statements first statements first thenClause statements first left. + self assert: assignedVar ssaVersion version equals: 2. + self assert: assignedVar ssaName equals: 'x_2'. + self assert: assignedVar ssaVersion localDeclaration equals: parameterDeclaration ssaVersion localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + parameterUsage := model module statements first statements second arguments first. + self assert: parameterUsage ssaVersion isPhi. + self assertCollection: parameterUsage ssaVersion ssaVariables hasSameElements: { + parameterDeclaration ssaVersion. + assignedVar ssaVersion } +] + +{ #category : 'tests - parameters' } +FASTPythonSSATest >> testFunctionWithTypedParameters [ + + | parameterDeclaration assignedVar parameterUsage | + self parseAndResolve: 'def func(x: Index): + if a: + x = 2 + + print(x)'. + + parameterDeclaration := model module statements first parameters first. + self assert: parameterDeclaration ssaVersion version equals: 1. + self assert: parameterDeclaration ssaName equals: 'x_1'. + self assert: parameterDeclaration ssaVersion localDeclaration equals: parameterDeclaration localDeclaration. + self assert: parameterDeclaration ssaVersion localUses size equals: 2. + + assignedVar := model module statements first statements first thenClause statements first left. + self assert: assignedVar ssaVersion version equals: 2. + self assert: assignedVar ssaName equals: 'x_2'. + self assert: assignedVar ssaVersion localDeclaration equals: parameterDeclaration ssaVersion localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + parameterUsage := model module statements first statements second arguments first. + self assert: parameterUsage ssaVersion isPhi. + self assertCollection: parameterUsage ssaVersion ssaVariables hasSameElements: { + parameterDeclaration ssaVersion. + assignedVar ssaVersion } +] + +{ #category : 'tests' } +FASTPythonSSATest >> testGlobalReferencedInDefaultParameter [ + + | assignedVar usedVar | + self parseAndResolve: 'x = 5 + +def function(arg = x): + return arg'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x_1'. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + usedVar := model module statements second parameters first defaultValue. + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion +] + +{ #category : 'tests - parameters' } +FASTPythonSSATest >> testLambdaParameterUsed [ + + | parameterDeclaration parameterUsage | + self parseAndResolve: 'l = lambda x: x + 2 + +l(4)'. + + parameterDeclaration := model module statements first right parameters first. + self assert: parameterDeclaration ssaVersion version equals: 1. + self assert: parameterDeclaration ssaName equals: 'x_1'. + self assert: parameterDeclaration ssaVersion localUses size equals: 2. + + parameterUsage := model module statements first right expression leftOperand. + self assert: parameterUsage ssaVersion identicalTo: parameterDeclaration ssaVersion +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testListAssignement [ + + | assignedVarX assignedVarY | + self parseAndResolve: '[x, y] = [5, 6]'. + + assignedVarX := model module statements first left initializers first. + self assert: assignedVarX ssaVersion version equals: 1. + self assert: assignedVarX ssaName equals: 'x_1'. + + assignedVarY := model module statements first left initializers second. + self assert: assignedVarY ssaVersion version equals: 1. + self assert: assignedVarY ssaName equals: 'y_1' +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testListInListAssignement [ + + | assignedVarX assignedVarY assignedVarZ | + self parseAndResolve: '[x, [y, z]] = [5, [6, 7]]'. + + assignedVarX := model module statements first left initializers first. + self assert: assignedVarX ssaVersion version equals: 1. + self assert: assignedVarX ssaName equals: 'x_1'. + + assignedVarY := model module statements first left initializers second initializers first. + self assert: assignedVarY ssaVersion version equals: 1. + self assert: assignedVarY ssaName equals: 'y_1'. + + assignedVarZ := model module statements first left initializers second initializers second. + self assert: assignedVarZ ssaVersion version equals: 1. + self assert: assignedVarZ ssaName equals: 'z_1' +] + +{ #category : 'tests - parameters' } +FASTPythonSSATest >> testMethodParameterUsed [ + + | parameterDeclaration parameterUsage | + self parseAndResolve: 'class C(): + def method(self): + return self'. + + parameterDeclaration := model module statements first statements first parameters first. + self assert: parameterDeclaration ssaVersion version equals: 1. + self assert: parameterDeclaration ssaName equals: 'self_1'. + self assert: parameterDeclaration ssaVersion localUses size equals: 2. + + parameterUsage := model module statements first statements first statements first expression. + self assert: parameterUsage ssaVersion identicalTo: parameterDeclaration ssaVersion +] + +{ #category : 'tests - for' } +FASTPythonSSATest >> testNestedForLoop [ + + | assignedVarX1 assignedVarX2 usedVar | + self parseAndResolve: 'x = 1 + +for i in range(5): + for j in range(5): + x = i + j + +print(x)'. + + assignedVarX1 := model module statements first left. + self assert: assignedVarX1 ssaVersion version equals: 1. + self assert: assignedVarX1 ssaName equals: 'x_1'. + self assert: assignedVarX1 ssaVersion localUses size equals: 2. + + assignedVarX2 := model module statements second statements first statements first left. + self assert: assignedVarX2 ssaVersion version equals: 2. + self assert: assignedVarX2 ssaName equals: 'x_2'. + self assert: assignedVarX2 ssaVersion localDeclaration equals: assignedVarX1 ssaVersion localDeclaration. + self assert: assignedVarX2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVarX1 ssaVersion. + assignedVarX2 ssaVersion } +] + +{ #category : 'tests - for' } +FASTPythonSSATest >> testReAssignedVariableInFor [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'x = 2 +for y in range(5): + x = 5 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] + +{ #category : 'tests - for' } +FASTPythonSSATest >> testReAssignedVariableWithForVariable [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'x = 2 + +for x in range(5): + pass + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testReAssignement [ + + | assignedVar1 assignedVar2 | + self parseAndResolve: 'x = 3 + +x = 4'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 1. + + assignedVar2 := model module statements second left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 1 +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testReAssignementAndUsage [ + + | assignedVar1 assignedVar2 usedVar1 usedVar2 | + self parseAndResolve: 'x = 3 + +print(x) + + x = 4 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + usedVar1 := model module statements second arguments first. + self deny: usedVar1 ssaVersion isPhi. + self assert: usedVar1 ssaVersion identicalTo: assignedVar1 ssaVersion. + + assignedVar2 := model module statements third left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar2 := model module statements fourth arguments first. + self deny: usedVar2 ssaVersion isPhi. + self assert: usedVar2 ssaVersion identicalTo: assignedVar2 ssaVersion +] + +{ #category : 'tests - if' } +FASTPythonSSATest >> testReAssignementInBothBranchesOfNestedIf [ + + | assignedVar1 assignedVar2 assignedVar3 usedVar | + self parseAndResolve: 'x = 1 + +if a: + if b: + x = 2 + else: + x = 3 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second thenClause statements first thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + assignedVar3 := model module statements second thenClause statements first elseClause statements first left. + self assert: assignedVar3 ssaVersion version equals: 3. + self assert: assignedVar3 ssaName equals: 'x_3'. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar3 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion. + assignedVar3 ssaVersion } +] + +{ #category : 'tests - if' } +FASTPythonSSATest >> testReAssignementInIf [ + + | assignedVar1 assignedVar2 | + self parseAndResolve: 'x = 3 + +if y < 2: + x = 4'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 1. + + assignedVar2 := model module statements second thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 1 +] + +{ #category : 'tests - if' } +FASTPythonSSATest >> testReAssignementInIfInBothBranchesAndUsage [ + + | assignedVar1 assignedVar2 assignedVar3 usedVar | + self parseAndResolve: 'x = 3 + +if y < 2: + x = 4 +else: + x = 5 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 1. + + assignedVar2 := model module statements second thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + assignedVar3 := model module statements second elseClause statements first left. + self assert: assignedVar3 ssaVersion version equals: 3. + self assert: assignedVar3 ssaName equals: 'x_3'. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar3 localDeclaration. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar3 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar2 ssaVersion. + assignedVar3 ssaVersion } +] + +{ #category : 'tests - if' } +FASTPythonSSATest >> testReAssignementInIfInThenAndUsage [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'x = 3 + +if y < 2: + x = 4 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] + +{ #category : 'tests - if' } +FASTPythonSSATest >> testReAssignementInIfInThenAndUsage2 [ + + | assignedVar1 assignedVar2 assignedVar3 usedVar | + self parseAndResolve: 'x = 3 + +if y < 2: + x = 4 + x = 6 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 1. + + assignedVar3 := model module statements second thenClause statements second left. + self assert: assignedVar3 ssaVersion version equals: 3. + self assert: assignedVar3 ssaName equals: 'x_3'. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar3 localDeclaration. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar3 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar3 ssaVersion } +] + +{ #category : 'tests - match' } +FASTPythonSSATest >> testReAssignementInMatchAllCasesThenAndUsage [ + + | assignedVar1 assignedVar2 assignedVar3 usedVar | + self parseAndResolve: 'x = 4 +match toto: + case 1: + x = 5 + case 2: + x = 8 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 1. + + assignedVar2 := model module statements second cases first statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + assignedVar3 := model module statements second cases second statements first left. + self assert: assignedVar3 ssaVersion version equals: 3. + self assert: assignedVar3 ssaName equals: 'x_3'. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar3 localDeclaration. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar3 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar2 ssaVersion. + assignedVar3 ssaVersion } +] + +{ #category : 'tests - match' } +FASTPythonSSATest >> testReAssignementInMatchThenAndUsage [ + + | assignedVar1 assignedVar2 assignedVar3 usedVar | + self parseAndResolve: 'x = 4 +match toto: + case 1: + x = 5 + case 2: + x = 8 + case 3: + function1() + case 4: + function2() + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second cases first statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + assignedVar3 := model module statements second cases second statements first left. + self assert: assignedVar3 ssaVersion version equals: 3. + self assert: assignedVar3 ssaName equals: 'x_3'. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar3 localDeclaration. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar3 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion. + assignedVar3 ssaVersion } +] + +{ #category : 'tests - match' } +FASTPythonSSATest >> testReAssignementInMatchWithDefaultThenAndUsage [ + + | assignedVar1 assignedVar2 assignedVar3 usedVar | + self parseAndResolve: 'x = 4 +match toto: + case 1: + x = 5 + case 3: + function1() + case 4: + function2() + case _: + x = 8 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second cases first statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + assignedVar3 := model module statements second cases fourth statements first left. + self assert: assignedVar3 ssaVersion version equals: 3. + self assert: assignedVar3 ssaName equals: 'x_3'. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar3 localDeclaration. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar3 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion. + assignedVar3 ssaVersion } +] + +{ #category : 'tests - if' } +FASTPythonSSATest >> testReAssignementInMultipleIfsAndUsage [ + + | assignedVar1 assignedVar2 assignedVar3 usedVar1 usedVar2 | + self parseAndResolve: 'x = 3 + +if y < 2: + x = 4 + +print(x) + +if y > 2: + x = 5 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 3. + + assignedVar2 := model module statements second thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 3. + + usedVar1 := model module statements third arguments first. + self assert: usedVar1 ssaVersion isPhi. + self assertCollection: usedVar1 ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion }. + + assignedVar3 := model module statements fourth thenClause statements first left. + self assert: assignedVar3 ssaVersion version equals: 3. + self assert: assignedVar3 ssaName equals: 'x_3'. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar3 localDeclaration. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar3 ssaVersion localUses size equals: 2. + + usedVar2 := model module statements fifth arguments first. + self assert: usedVar2 ssaVersion isPhi. + self assertCollection: usedVar2 ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion. + assignedVar3 ssaVersion } +] + +{ #category : 'tests - if' } +FASTPythonSSATest >> testReAssignementInMultipleIfsAndUsage2 [ + + | assignedVar1 assignedVar2 assignedVar3 assignedVar4 assignedVar5 usedVar1 usedVar2 | + self parseAndResolve: 'x = 3 + +if y < 2: + x = 4 +else: + x = 6 + +print(x) + +if y > 2: + x = 5 +else: + x = 7 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 1. + + assignedVar2 := model module statements second thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + assignedVar3 := model module statements second elseClause statements first left. + self assert: assignedVar3 ssaVersion version equals: 3. + self assert: assignedVar3 ssaName equals: 'x_3'. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar3 localDeclaration. + self assert: assignedVar3 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar3 ssaVersion localUses size equals: 2. + + usedVar1 := model module statements third arguments first. + self assert: usedVar1 ssaVersion isPhi. + self assertCollection: usedVar1 ssaVersion ssaVariables hasSameElements: { + assignedVar2 ssaVersion. + assignedVar3 ssaVersion }. + + assignedVar4 := model module statements fourth thenClause statements first left. + self assert: assignedVar4 ssaVersion version equals: 4. + self assert: assignedVar4 ssaName equals: 'x_4'. + self assert: assignedVar4 ssaVersion localDeclaration equals: assignedVar4 localDeclaration. + self assert: assignedVar4 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar4 ssaVersion localUses size equals: 2. + + assignedVar5 := model module statements fourth elseClause statements first left. + self assert: assignedVar5 ssaVersion version equals: 5. + self assert: assignedVar5 ssaName equals: 'x_5'. + self assert: assignedVar5 ssaVersion localDeclaration equals: assignedVar5 localDeclaration. + self assert: assignedVar5 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar5 ssaVersion localUses size equals: 2. + + usedVar2 := model module statements fifth arguments first. + self assert: usedVar2 ssaVersion isPhi. + self assertCollection: usedVar2 ssaVersion ssaVariables hasSameElements: { + assignedVar4 ssaVersion. + assignedVar5 ssaVersion } +] + +{ #category : 'tests - if' } +FASTPythonSSATest >> testReAssignementInNestedIf [ + + | assignedVar1 usedVar assignedVar2 | + self parseAndResolve: 'x = 1 + +if a: + if b: + x = 2 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second thenClause statements first thenClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] + +{ #category : 'tests' } +FASTPythonSSATest >> testSSAVersionFollowPreviouslyShadowedName [ + + | assignedVar1 assignedVar2 usedVar1 usedFunction usedVar2 | + self parseAndResolve: 'x = 3 + +print(x) + +def x(): pass + +print(x) + +x = 4 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + usedVar1 := model module statements second arguments first. + self assert: usedVar1 ssaVersion identicalTo: assignedVar1 ssaVersion. + + usedFunction := model module statements fourth arguments first. + self assert: usedFunction ssaVersion isNil. + + assignedVar2 := model module statements fifth left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar2 localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar2 := model module statements sixth arguments first. + self assert: usedVar2 ssaVersion identicalTo: assignedVar2 ssaVersion +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testSingleAssignement [ + + | assignedVar | + self parseAndResolve: 'x = 5'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x_1'. + + self assert: assignedVar localDeclaration newVersionNumber equals: 2. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 1 +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testSingleAssignementAndUsage [ + + | assignedVar usedVar | + self parseAndResolve: 'x = 5 + +print(x)'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x_1'. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + usedVar := model module statements second arguments first. + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion +] + +{ #category : 'tests - subscripts' } +FASTPythonSSATest >> testSubscriptAssignement [ + + | assignedVar | + self parseAndResolve: 'x[3] = 5'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x[3]_1'. + + self assert: assignedVar localDeclaration newVersionNumber equals: 2. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 1 +] + +{ #category : 'tests - subscripts' } +FASTPythonSSATest >> testSubscriptAssignementAndUsage [ + + | assignedVar usedVar | + self parseAndResolve: 'x[3] = 5 + +print(x[3])'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x[3]_1'. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + usedVar := model module statements second arguments first. + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion +] + +{ #category : 'tests - try' } +FASTPythonSSATest >> testTryAssignAndUsage [ + + | assignedVar usedVar | + self parseAndResolve: 'try: + x = 1 +except: + function() + +print(x)'. + + assignedVar := model module statements first statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x_1'. + self assert: assignedVar ssaVersion localUses size equals: 2. + + usedVar := model module statements second arguments first. + self deny: usedVar ssaVersion isPhi. + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion +] + +{ #category : 'tests - try' } +FASTPythonSSATest >> testTryExceptAssignAndUsage [ + + | assignedVar1 usedVar | + self parseAndResolve: 'try: + function() +except: + x = 1 + +print(x)'. + + assignedVar1 := model module statements first excepts first statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + usedVar := model module statements second arguments first. + self deny: usedVar ssaVersion isPhi. + self assert: usedVar ssaVersion identicalTo: assignedVar1 ssaVersion +] + +{ #category : 'tests - try' } +FASTPythonSSATest >> testTryExceptReAssignAndUsage [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'x = 3 + +try: + function() +except: + x = 1 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 1. + + assignedVar2 := model module statements second excepts first statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self deny: usedVar ssaVersion isPhi. + self assert: usedVar ssaVersion identicalTo: assignedVar2 ssaVersion +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testTupleAssignement [ + + | assignedVarX assignedVarY | + self parseAndResolve: 'x, y = 5, 6'. + + assignedVarX := model module statements first left initializers first. + self assert: assignedVarX ssaVersion version equals: 1. + self assert: assignedVarX ssaName equals: 'x_1'. + + assignedVarY := model module statements first left initializers second. + self assert: assignedVarY ssaVersion version equals: 1. + self assert: assignedVarY ssaName equals: 'y_1' +] + +{ #category : 'tests - assignments' } +FASTPythonSSATest >> testTupleInTupleAssignement [ + + | assignedVarX assignedVarY assignedVarZ | + self parseAndResolve: 'x, (y, z) = 5, (6, 7)'. + + assignedVarX := model module statements first left initializers first. + self assert: assignedVarX ssaVersion version equals: 1. + self assert: assignedVarX ssaName equals: 'x_1'. + + assignedVarY := model module statements first left initializers second initializers first. + self assert: assignedVarY ssaVersion version equals: 1. + self assert: assignedVarY ssaName equals: 'y_1'. + + assignedVarZ := model module statements first left initializers second initializers second. + self assert: assignedVarZ ssaVersion version equals: 1. + self assert: assignedVarZ ssaName equals: 'z_1' +] + +{ #category : 'tests - non local declarations' } +FASTPythonSSATest >> testUndeclaredVariable [ + + | undeclared | + self parseAndResolve: 'print(x)'. + + undeclared := model module statements first arguments first. + self assert: undeclared ssaVersion isNil +] + +{ #category : 'tests - calls' } +FASTPythonSSATest >> testVariableAttributeUsedinACall [ + + | assignedVar usedVar | + self parseAndResolve: 'x.y = z + +x.y()'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x.y_1'. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + usedVar := model module statements second callee. + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion +] + +{ #category : 'tests - calls' } +FASTPythonSSATest >> testVariableSliceUsedinACall [ + + | assignedVar usedVar | + self parseAndResolve: 'x[1] = z + +x[1]()'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x[1]_1'. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + usedVar := model module statements second callee. + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion +] + +{ #category : 'tests - calls' } +FASTPythonSSATest >> testVariableUsedinACall [ + + | assignedVar usedVar | + self parseAndResolve: 'x = z + +x()'. + + assignedVar := model module statements first left. + self assert: assignedVar ssaVersion version equals: 1. + self assert: assignedVar ssaName equals: 'x_1'. + self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration. + self assert: assignedVar ssaVersion localUses size equals: 2. + + usedVar := model module statements second callee. + self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion +] + +{ #category : 'tests - while' } +FASTPythonSSATest >> testWhileElseAndUsage [ + + | assignedVar1 usedVar assignedVar2 | + self parseAndResolve: 'while a: + x = 1 +else: + x = 2 + +print(x)'. + + assignedVar1 := model module statements first statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements first elseClause statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements second arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] + +{ #category : 'tests - while' } +FASTPythonSSATest >> testWhileLoopReAssignAndUsage [ + + | assignedVar1 assignedVar2 usedVar | + self parseAndResolve: 'x = 3 + +while a: + x = 4 + +print(x)'. + + assignedVar1 := model module statements first left. + self assert: assignedVar1 ssaVersion version equals: 1. + self assert: assignedVar1 ssaName equals: 'x_1'. + self assert: assignedVar1 ssaVersion localUses size equals: 2. + + assignedVar2 := model module statements second statements first left. + self assert: assignedVar2 ssaVersion version equals: 2. + self assert: assignedVar2 ssaName equals: 'x_2'. + self assert: assignedVar2 ssaVersion localDeclaration equals: assignedVar1 ssaVersion localDeclaration. + self assert: assignedVar2 ssaVersion localUses size equals: 2. + + usedVar := model module statements third arguments first. + self assert: usedVar ssaVersion isPhi. + self assertCollection: usedVar ssaVersion ssaVariables hasSameElements: { + assignedVar1 ssaVersion. + assignedVar2 ssaVersion } +] diff --git a/src/FAST-Python-Tools-Tests/FASTPythonVariablesAnalysisTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonVariablesAnalysisTest.class.st new file mode 100644 index 0000000..ff0d949 --- /dev/null +++ b/src/FAST-Python-Tools-Tests/FASTPythonVariablesAnalysisTest.class.st @@ -0,0 +1,257 @@ +" +I am a test case to test some analysis on variables in Python. +" +Class { + #name : 'FASTPythonVariablesAnalysisTest', + #superclass : 'FASTPythonAbstractTestCase', + #category : 'FAST-Python-Tools-Tests-Algos', + #package : 'FAST-Python-Tools-Tests', + #tag : 'Algos' +} + +{ #category : 'parsing' } +FASTPythonVariablesAnalysisTest >> parseAndResolve: aString [ + + self parse: aString. + FASTPythonSSAVisitor resolve: model module +] + +{ #category : 'tests' } +FASTPythonVariablesAnalysisTest >> testAllAccessesOfIdentifier [ + + | variable result | + self parseAndResolve: 'x = 1 + +print(x) + +x = 2 + +if y > 3: + x = 3 + +print(x)'. + + variable := model module statements first left. + result := variable allAccesses. + self assert: result size equals: 5. + + self assertCollection: model module statements second arguments first allAccesses hasSameElements: result. + self assertCollection: model module statements third left allAccesses hasSameElements: result. + self assertCollection: model module statements fourth thenClause statements first left allAccesses hasSameElements: result. + self assertCollection: model module statements fifth arguments first allAccesses hasSameElements: result +] + +{ #category : 'tests' } +FASTPythonVariablesAnalysisTest >> testAllReadAccessesOfIdentifier [ + + | variable result | + self parseAndResolve: 'x = 1 + +print(x) + +x = 2 + +if y > 3: + x = 3 + +print(x)'. + + variable := model module statements first left. + result := variable allReadAccesses. + self assert: result size equals: 2. + self assertCollection: result hasSameElements: { + model module statements second arguments first. + model module statements fifth arguments first }. + + self assertCollection: model module statements second arguments first allReadAccesses hasSameElements: result. + self assertCollection: model module statements third left allReadAccesses hasSameElements: result. + self assertCollection: model module statements fourth thenClause statements first left allReadAccesses hasSameElements: result. + self assertCollection: model module statements fifth arguments first allReadAccesses hasSameElements: result +] + +{ #category : 'tests' } +FASTPythonVariablesAnalysisTest >> testAllWriteAccessesOfIdentifier [ + + | variable result | + self parseAndResolve: 'x = 1 + +print(x) + +x = 2 + +if y > 3: + x = 3 + +print(x)'. + + variable := model module statements first left. + result := variable allWriteAccesses. + self assert: result size equals: 3. + self assertCollection: result hasSameElements: { + model module statements first left. + model module statements third left. + model module statements fourth thenClause statements first left }. + + self assertCollection: model module statements second arguments first allWriteAccesses hasSameElements: result. + self assertCollection: model module statements third left allWriteAccesses hasSameElements: result. + self assertCollection: model module statements fourth thenClause statements first left allWriteAccesses hasSameElements: result. + self assertCollection: model module statements fifth arguments first allWriteAccesses hasSameElements: result +] + +{ #category : 'tests' } +FASTPythonVariablesAnalysisTest >> testAssignedExpressionsMap [ + + | writenVariable1 writenVariable2 writenVariable3 map | + self parseAndResolve: 'x = 1 + +print(x) + +x = 2 + +if y > 3: + x = 3 + +print(x)'. + + writenVariable1 := model module statements first left. + writenVariable2 := model module statements third left. + writenVariable3 := model module statements fourth thenClause statements first left. + + map := model module statements second arguments first assignedExpressionsMap. + + self assert: map size equals: 1. + self assertCollection: (map at: writenVariable1) hasSameElements: { model module statements first right }. + + map := map := model module statements fifth arguments first assignedExpressionsMap. + + self assert: map size equals: 2. + self assertCollection: (map at: writenVariable2) hasSameElements: { model module statements third right }. + self assertCollection: (map at: writenVariable3) hasSameElements: { model module statements fourth thenClause statements first right } +] + +{ #category : 'tests' } +FASTPythonVariablesAnalysisTest >> testAssignedExpressionsMapWithLoop [ + + | writenVariable1 writenVariable2 writenVariable3 map | + self parseAndResolve: 'x = 1 + +print(x) + +x = 2 + +for x in coll: + print(x) + +print(x)'. + + writenVariable1 := model module statements first left. + writenVariable2 := model module statements third left. + writenVariable3 := model module statements fourth left. + + map := model module statements second arguments first assignedExpressionsMap. + + self assert: map size equals: 1. + self assertCollection: (map at: writenVariable1) hasSameElements: { model module statements first right }. + + map := map := model module statements fifth arguments first assignedExpressionsMap. + + self assert: map size equals: 2. + self assertCollection: (map at: writenVariable2) hasSameElements: { model module statements third right }. + self assertCollection: (map at: writenVariable3) hasSameElements: { model module statements fourth right } +] + +{ #category : 'tests' } +FASTPythonVariablesAnalysisTest >> testVersionAccessesOfIdentifier [ + + | variableVersion1 variableVersion2 variableVersion3 variablePhi | + self parseAndResolve: 'x = 1 + +print(x) + +x = 2 + +if y > 3: + x = 3 + +print(x)'. + + variableVersion1 := model module statements first left. + self assert: variableVersion1 versionAccesses size equals: 2. + self assertCollection: variableVersion1 versionAccesses hasSameElements: { + variableVersion1. + model module statements second arguments first }. + + variableVersion2 := model module statements third left. + self assertCollection: variableVersion2 versionAccesses hasSameElements: { + variableVersion2. + model module statements fifth arguments first }. + + variableVersion3 := model module statements fourth thenClause statements first left. + self assertCollection: variableVersion3 versionAccesses hasSameElements: { + variableVersion3. + model module statements fifth arguments first }. + + variablePhi := model module statements fifth arguments first. + self assertCollection: variablePhi versionAccesses hasSameElements: { + variableVersion2. + variableVersion3. + model module statements fifth arguments first } +] + +{ #category : 'tests' } +FASTPythonVariablesAnalysisTest >> testVersionReadAccessesOfIdentifier [ + + | variableVersion1 variableVersion2 variableVersion3 variablePhi | + self parseAndResolve: 'x = 1 + +print(x) + +x = 2 + +if y > 3: + x = 3 + +print(x)'. + + variableVersion1 := model module statements first left. + self assertCollection: variableVersion1 versionReadAccesses hasSameElements: { model module statements second arguments first }. + + variableVersion2 := model module statements third left. + self assertCollection: variableVersion2 versionReadAccesses hasSameElements: { model module statements fifth arguments first }. + + variableVersion3 := model module statements fourth thenClause statements first left. + self assertCollection: variableVersion3 versionReadAccesses hasSameElements: { model module statements fifth arguments first }. + + variablePhi := model module statements fifth arguments first. + self assertCollection: variablePhi versionReadAccesses hasSameElements: { model module statements fifth arguments first } +] + +{ #category : 'tests' } +FASTPythonVariablesAnalysisTest >> testVersionWriteAccessesOfIdentifier [ + + | variableVersion1 variableVersion2 variableVersion3 variablePhi | + self parseAndResolve: 'x = 1 + +print(x) + +x = 2 + +if y > 3: + x = 3 + +print(x)'. + + variableVersion1 := model module statements first left. + self assertCollection: variableVersion1 versionWriteAccesses hasSameElements: { variableVersion1 }. + + variableVersion2 := model module statements third left. + self assertCollection: variableVersion2 versionWriteAccesses hasSameElements: { variableVersion2 }. + + variableVersion3 := model module statements fourth thenClause statements first left. + self assertCollection: variableVersion3 versionWriteAccesses hasSameElements: { variableVersion3 }. + + variablePhi := model module statements fifth arguments first. + self assertCollection: variablePhi versionWriteAccesses hasSameElements: { + variableVersion2. + variableVersion3 } +] diff --git a/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st b/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st new file mode 100644 index 0000000..6788be4 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPyAttributeAccess.extension.st @@ -0,0 +1,7 @@ +Extension { #name : 'FASTPyAttributeAccess' } + +{ #category : '*FAST-Python-Tools' } +FASTPyAttributeAccess >> localDeclarationName [ + + ^ self sourceCode +] diff --git a/src/FAST-Python-Tools/FASTPyEntity.extension.st b/src/FAST-Python-Tools/FASTPyEntity.extension.st index d85df03..f8c0f30 100644 --- a/src/FAST-Python-Tools/FASTPyEntity.extension.st +++ b/src/FAST-Python-Tools/FASTPyEntity.extension.st @@ -11,3 +11,53 @@ FASTPyEntity >> fullCfg [ ^ FASTPythonCFGVisitor new buildFullCFGOf: self ] + +{ #category : '*FAST-Python-Tools' } +FASTPyEntity >> lastSSAVersion [ + "Return the last active SSA version if there is one. In Python lots of things can shadow each other, so we check if there was not a variable shadowed previously. + + For example: + + x = 3 + + def x(): pass + + x = 4 + + Here the second assignment follow the first one but was interrupted by the function. But we still need to link them in the SSA." + + | entity | + entity := self localDeclaration. + [ entity isNotNil ] whileTrue: [ + entity activeVersion ifNotNil: [ :version | ^ version ]. + entity := entity shadowing ]. + + ^ nil +] + +{ #category : '*FAST-Python-Tools' } +FASTPyEntity >> localResolverKind [ + "In the local resolver, if we redefine an entity with an entity of the same kind, we keep the same declaration. Else we create a new one. + + I am used to know the kind of entity that is been declared." + + ^ self error: 'This entity cannot be a local declaration or is missing the overriding method.' +] + +{ #category : '*FAST-Python-Tools' } +FASTPyEntity >> selfOrTopmostAssignableCollection [ + "If I am in a tuple, I return the tuple (this applies recursively, if I am in a tuple in a tuple I return the topmost tuple). + If I am in a splat used as assignment target (e.g. `a, *b = ...`), I also go through the splat. + + Else, return myself." + + | node | + "If I am a variable defined in tuples, I should return the node initializing this tuple. Can be recursive (tuple in tuple)" + node := self. + [ node collectionInitializer isNotNil and: [ node collectionInitializer isTuple or: [ node collectionInitializer isList ] ] ] whileTrue: [ + node := node collectionInitializer ]. + + node parentSplat ifNotNil: [ :splat | ^ splat selfOrTopmostAssignableCollection ]. + + ^ node +] diff --git a/src/FAST-Python-Tools/FASTPyFunctionDefinition.extension.st b/src/FAST-Python-Tools/FASTPyFunctionDefinition.extension.st new file mode 100644 index 0000000..6b19c2c --- /dev/null +++ b/src/FAST-Python-Tools/FASTPyFunctionDefinition.extension.st @@ -0,0 +1,7 @@ +Extension { #name : 'FASTPyFunctionDefinition' } + +{ #category : '*FAST-Python-Tools' } +FASTPyFunctionDefinition >> localResolverKind [ + + ^ #function +] diff --git a/src/FAST-Python-Tools/FASTPyIdentifier.extension.st b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st new file mode 100644 index 0000000..95c87cd --- /dev/null +++ b/src/FAST-Python-Tools/FASTPyIdentifier.extension.st @@ -0,0 +1,9 @@ +Extension { #name : 'FASTPyIdentifier' } + +{ #category : '*FAST-Python-Tools' } +FASTPyIdentifier >> localResolverKind [ + + self isVariableWriteAccess ifTrue: [ ^ #variable ]. + + self halt "I don't know if it can be something else." +] diff --git a/src/FAST-Python-Tools/FASTPyImport.extension.st b/src/FAST-Python-Tools/FASTPyImport.extension.st new file mode 100644 index 0000000..2d8f610 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPyImport.extension.st @@ -0,0 +1,7 @@ +Extension { #name : 'FASTPyImport' } + +{ #category : '*FAST-Python-Tools' } +FASTPyImport >> localResolverKind [ + + ^ #import +] diff --git a/src/FAST-Python-Tools/FASTPyMethodDefinition.extension.st b/src/FAST-Python-Tools/FASTPyMethodDefinition.extension.st new file mode 100644 index 0000000..3e8ae44 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPyMethodDefinition.extension.st @@ -0,0 +1,7 @@ +Extension { #name : 'FASTPyMethodDefinition' } + +{ #category : '*FAST-Python-Tools' } +FASTPyMethodDefinition >> localResolverKind [ + + ^ #method +] diff --git a/src/FAST-Python-Tools/FASTPyParameter.extension.st b/src/FAST-Python-Tools/FASTPyParameter.extension.st new file mode 100644 index 0000000..e367ebd --- /dev/null +++ b/src/FAST-Python-Tools/FASTPyParameter.extension.st @@ -0,0 +1,8 @@ +Extension { #name : 'FASTPyParameter' } + +{ #category : '*FAST-Python-Tools' } +FASTPyParameter >> localResolverKind [ + "It was parameter at first, but parameters can be assigned so they act as variables." + + ^ #variable +] diff --git a/src/FAST-Python-Tools/FASTPySubscript.extension.st b/src/FAST-Python-Tools/FASTPySubscript.extension.st new file mode 100644 index 0000000..28abb18 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPySubscript.extension.st @@ -0,0 +1,7 @@ +Extension { #name : 'FASTPySubscript' } + +{ #category : '*FAST-Python-Tools' } +FASTPySubscript >> localDeclarationName [ + + ^ self sourceCode +] diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 9608efa..599b8dc 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -35,9 +35,9 @@ Class { 'started', 'cfgs' ], - #category : 'FAST-Python-Tools-CFG/DataFlow', + #category : 'FAST-Python-Tools-CFG/LocalResolver/SSA', #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' + #tag : 'CFG/LocalResolver/SSA' } { #category : 'running' } @@ -151,15 +151,14 @@ FASTPythonCFGVisitor >> visitFASTPyFinallyClause: aFinallyClause [ FASTPythonCFGVisitor >> visitFASTPyForStatement: aForStatement [ self buildBlockIfNeeded. - - self addStatement: aForStatement left. self addStatement: aForStatement right. self buildAndUseLoopDuring: [ + self addStatement: aForStatement left. "The variable does not go in the conditional block because if the collection is empty, we never assign the variable." self visitFASTTStatementBlock: aForStatement. "We add the loops after finishing the first statement block, so the else can be managed in this block to be in the right context." - self visitFASTPyTWithElseClause: aForStatement ] + self visitFASTPyTWithElseClause: aForStatement ] ] { #category : 'visiting - entry points' } @@ -185,7 +184,7 @@ FASTPythonCFGVisitor >> visitFASTPyLambda: aLambda [ started ifTrue: [ - self visitFASTTStatement: aLambda. + self visitFASTPyExpression: aLambda. cfgs ifNotNil: [ "In this case, we also need to build the CFG of node and store it" cfgs at: aLambda put: aLambda cfg ] ] ifFalse: [ started := true. diff --git a/src/FAST-Python-Tools/FASTPythonImporter.class.st b/src/FAST-Python-Tools/FASTPythonImporter.class.st index a3bb245..c95ab63 100644 --- a/src/FAST-Python-Tools/FASTPythonImporter.class.st +++ b/src/FAST-Python-Tools/FASTPythonImporter.class.st @@ -90,6 +90,28 @@ FASTPythonImporter class >> devParseFiles: aCollection [ result inspect ] +{ #category : 'parsing' } +FASTPythonImporter class >> parseAndResolve: aString [ + + | model | + model := self parse: aString. + + FASTPythonSSAVisitor resolve: model module. + + ^ model +] + +{ #category : 'parsing' } +FASTPythonImporter class >> parseFileAndResolve: aFileReference [ + + | model | + model := self parseFile: aFileReference. + + FASTPythonSSAVisitor resolve: model module. + + ^ model +] + { #category : 'accessing' } FASTPythonImporter >> tsLanguage [ diff --git a/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st new file mode 100644 index 0000000..0c4f902 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPythonLocalResolverVisitor.class.st @@ -0,0 +1,213 @@ +" +I am a visitor used to link entities usages to their declaration. + +You can run me like this: + +```st +FASTPythonLocalResolverVisitor resolve: aModule ""could be any behavioral entity of a FASTPython model."" +``` + +Once I ran, all entities will be able to get their declaration via `#localDeclaration`. Also, a local declaration knows its `#localUses`. + +The declaration can be various things: +- First variable assignement +- Function definition +- Variable declared in a loop structure (like in the left side of a for each) +- An imported entity +... +" +Class { + #name : 'FASTPythonLocalResolverVisitor', + #superclass : 'FASTPythonVisitor', + #instVars : [ + 'namesContext' + ], + #category : 'FAST-Python-Tools-CFG/LocalResolver/SSA', + #package : 'FAST-Python-Tools', + #tag : 'CFG/LocalResolver/SSA' +} + +{ #category : 'instance creation' } +FASTPythonLocalResolverVisitor class >> resolve: aPythonEntity [ + + ^ self new resolve: aPythonEntity +] + +{ #category : 'declarations' } +FASTPythonLocalResolverVisitor >> bind: aFASTNode toDeclarationNamed: aName [ + + | declaration | + declaration := (self declarationNamed: aName) ifNil: [ "If it is undeclared, we create an undeclared in the lowest scope in the stack." + self + ensureDeclarationOf: aName + declaration: (FASTNonLocalDeclaration new + name: aName; + yourself) + in: namesContext first ]. + + aFASTNode localDeclaration: declaration. + declaration addLocalUse: aFASTNode +] + +{ #category : 'declarations' } +FASTPythonLocalResolverVisitor >> declarationNamed: aName [ + + namesContext do: [ :scope | scope at: aName ifPresent: [ :declaration | ^ declaration ] ]. + + ^ nil +] + +{ #category : 'declarations' } +FASTPythonLocalResolverVisitor >> ensureDeclarationOf: aName declaration: aFASTNode in: scope [ + "If it is already present we do nothing. Else we create the local declaration. + + I just `ensure` that the local uses are initialized instead of reseting them as we do in other languages because in Python I have multiple variables that can be declared in the same assignment because of the tuples." + + ^ scope + at: aName + ifPresent: [ :declaration | + declaration localResolverKind = aFASTNode localResolverKind + ifTrue: [ ^ declaration ] + ifFalse: [ + declaration shadowedBy: aFASTNode. + + "If the kind is different, we save a new declaration." + aFASTNode ensureLocalUses. + scope at: aName put: aFASTNode ] ] + ifAbsentPut: [ + aFASTNode + ensureLocalUses; + yourself ] +] + +{ #category : 'declarations' } +FASTPythonLocalResolverVisitor >> ensureDeclarationOf: anEntity named: aName declaration: aFASTNode [ + + self ensureDeclarationOf: aName declaration: aFASTNode in: namesContext top. + self bind: anEntity toDeclarationNamed: aName +] + +{ #category : 'initialization' } +FASTPythonLocalResolverVisitor >> initialize [ + + super initialize. + namesContext := Stack new +] + +{ #category : 'initialization' } +FASTPythonLocalResolverVisitor >> resolve: aFASTBehaviouralEntity [ + + self useNewScopeDuring: [ + "We flush the attributes in case this is not the fist resolution" + aFASTBehaviouralEntity withAllContainedEntities do: [ :entity | entity resetLocalResolution ]. + + aFASTBehaviouralEntity accept: self ]. + + self assert: namesContext isEmpty +] + +{ #category : 'declarations' } +FASTPythonLocalResolverVisitor >> useNewScopeDuring: aBlock [ + + namesContext push: Dictionary new. + + [ aBlock value ] ensure: [ namesContext pop ] +] + +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyComprehension: aComprehension [ + "Reordering the visit of children to ensure for clauses are visited before the body and conditions since they can refer to it." + + "In Python 3, the comprehension has its own scope. In the future we should also manage python 2 that had no scope and could leek its variables." + + self useNewScopeDuring: [ + self visitFASTPyTSplatExpression: aComprehension. + self visitFASTPyExpression: aComprehension. + + self visitCollection: aComprehension forClauses. + self visitCollection: aComprehension conditions. + self visitEntity: aComprehension body ] +] + +{ #category : 'visiting - reordering' } +FASTPythonLocalResolverVisitor >> visitFASTPyForStatement: aForStatement [ + "Reorginizing the order" + + self visitEntity: aForStatement left. + self visitEntity: aForStatement right. + + self visitFASTPyTWithElseClause: aForStatement. + self visitFASTTStatementBlock: aForStatement. + self visitFASTPyStatement: aForStatement +] + +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyFunctionDefinition: aFunctionDefinition [ + + self ensureDeclarationOf: aFunctionDefinition named: aFunctionDefinition name declaration: aFunctionDefinition. + self useNewScopeDuring: [ "Cannot use super because the super method does not visit parameters before the block statement so we miss the parameters declerations before their usage." + self visitFASTTWithParameters: aFunctionDefinition. + self visitFASTPyTWithTypeParameters: aFunctionDefinition. + self visitFASTPyStatement: aFunctionDefinition. + self visitEntity: aFunctionDefinition returnType. + self visitFASTPyTDefinition: aFunctionDefinition ] +] + +{ #category : 'visiting - reordering' } +FASTPythonLocalResolverVisitor >> visitFASTPyIfStatement: anIfStatement [ + "Visit then - elif(s) -> else " + + self visitFASTTConditionalStatement: anIfStatement. + self visitFASTPyStatement: anIfStatement. + + self visitEntity: anIfStatement thenClause. + self visitCollection: anIfStatement elifClauses. + self visitFASTPyTWithElseClause: anIfStatement +] + +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyImport: anImport [ + + anImport importedEntities do: [ :entity | + entity hasAlias + ifTrue: [ self ensureDeclarationOf: entity named: entity alias declaration: anImport ] + ifFalse: [ self ensureDeclarationOf: entity named: entity sourceCode declaration: anImport ] ]. + + super visitFASTPyImport: anImport +] + +{ #category : 'visiting - reordering' } +FASTPythonLocalResolverVisitor >> visitFASTPyMethodDefinition: aMethodDefinition [ + "We resolve in the same way as functions." + + self visitFASTPyFunctionDefinition: aMethodDefinition +] + +{ #category : 'visiting' } +FASTPythonLocalResolverVisitor >> visitFASTPyTCanBeVariable: aTCanBeVariable [ + "This has some limits. For example, + + x.y.z = 3 + v = x.y + print(v.z) + + Here v.z should be linked to the z variable but it will not. This case will not be managed for now but we might need it in the future. + + Or also subscripts are linked if their source code is identical only." + + aTCanBeVariable isVariableWriteAccess + ifTrue: [ self ensureDeclarationOf: aTCanBeVariable named: aTCanBeVariable localDeclarationName declaration: aTCanBeVariable ] + ifFalse: [ self bind: aTCanBeVariable toDeclarationNamed: aTCanBeVariable localDeclarationName ]. + + super visitFASTPyTCanBeVariable: aTCanBeVariable +] + +{ #category : 'visiting - reordering' } +FASTPythonLocalResolverVisitor >> visitFASTPyWhileStatement: aWhileStatement [ + + "Else block should be visited after the other ones." + self visitFASTTConditionalStatement: aWhileStatement. + self visitFASTTStatementBlock: aWhileStatement. + self visitFASTPyStatement: aWhileStatement. + self visitFASTPyTWithElseClause: aWhileStatement +] diff --git a/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st new file mode 100644 index 0000000..e0ef531 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPythonSSAVisitor.class.st @@ -0,0 +1,173 @@ +Class { + #name : 'FASTPythonSSAVisitor', + #superclass : 'FASTPythonVisitor', + #traits : 'FASTCFGTVisitor', + #classTraits : 'FASTCFGTVisitor classTrait', + #instVars : [ + 'newVariablesMap', + 'localDeclarations' + ], + #category : 'FAST-Python-Tools-CFG/LocalResolver/SSA', + #package : 'FAST-Python-Tools', + #tag : 'CFG/LocalResolver/SSA' +} + +{ #category : 'resolving' } +FASTPythonSSAVisitor class >> resolve: aPythonEntity [ + + ^ self new resolve: aPythonEntity +] + +{ #category : 'visiting' } +FASTPythonSSAVisitor >> createPhiVersionFor: localDeclaration versions: allVersions [ + "No need to add it to the versions since it was already added by the previous versions." + + | phiVersion | + allVersions size < 2 ifTrue: [ ^ self ]. "No need to create a phi version if we don't have at least 2 versions" + + phiVersion := FASTVariablePhiVersionSSA for: allVersions. + localDeclaration activeVersion: phiVersion. + ^ phiVersion +] + +{ #category : 'actions' } +FASTPythonSSAVisitor >> createVariableVersionFor: aFASTEntity [ + + | newSSA | + newSSA := FASTVariableVersionSSA for: aFASTEntity. + aFASTEntity lastSSAVersion ifNotNil: [ :lastSSA | newSSA version: lastSSA version ]. + + aFASTEntity localDeclaration activeVersion: newSSA. + + localDeclarations add: aFASTEntity localDeclaration. + + ^ newSSA +] + +{ #category : 'accessing' } +FASTPythonSSAVisitor >> currentActiveVersions [ + + ^ localDeclarations collect: #activeVersion +] + +{ #category : 'actions' } +FASTPythonSSAVisitor >> handleNewAssignemntTo: aFASTEntity [ + + aFASTEntity ssaVersion: ((self createVariableVersionFor: aFASTEntity) + newVersionNumber; + yourself) +] + +{ #category : 'initialization' } +FASTPythonSSAVisitor >> initialize [ + + super initialize. + localDeclarations := IdentitySet new. + newVariablesMap := IdentityDictionary new +] + +{ #category : 'hooks' } +FASTPythonSSAVisitor >> postConditonalsBranchVisitOf: firstBranchBlock conditional: aConditionalBlock [ + "Once we visited a conditional branch, we save the current active versions for this branch." + + | mapForConditional | + mapForConditional := newVariablesMap at: aConditionalBlock. + mapForConditional at: firstBranchBlock put: (self currentActiveVersions difference: (mapForConditional at: #previousVariables)) +] + +{ #category : 'hooks' } +FASTPythonSSAVisitor >> postConditonalsBranchesVisitOf: aConditionalBlock [ + "Once we're done visiting a conditional block we can clean the map and to build the Phi variables." + + | mapForConditional previousVariables | + mapForConditional := newVariablesMap at: aConditionalBlock. + previousVariables := mapForConditional at: #previousVariables. + mapForConditional removeKey: #previousVariables. + self producePhiVersionBasedOnPreviousVariables: previousVariables andNewVariableMap: mapForConditional. + newVariablesMap removeKey: aConditionalBlock +] + +{ #category : 'hooks' } +FASTPythonSSAVisitor >> preConditonalsBranchesVisitOf: aConditionalBlock [ + "When we start to visit the branches of a conditional, we start by creating an entri for this conditional in the new variables map and we save the actives versions present before visiting the childrem." + + newVariablesMap at: aConditionalBlock put: (IdentityDictionary with: #previousVariables -> self currentActiveVersions) +] + +{ #category : 'visiting' } +FASTPythonSSAVisitor >> producePhiVersionBasedOnPreviousVariables: previousVariables andNewVariableMap: newVariablesMap [ + + | declarationsToMerge | + declarationsToMerge := newVariablesMap values flatten collectAsSet: #localDeclaration. + + declarationsToMerge do: [ :localDeclaration | + | allVersions | + "First we collect all the versions to use to produce a new Phi version for the current local declaration. " + allVersions := Set new. + newVariablesMap valuesDo: [ :variables | + variables + detect: [ :variable | variable localDeclaration = localDeclaration ] + ifFound: [ :variable | allVersions add: variable ] ]. + + "If not all branches are creating a new version, we need to add the previous version also to the list of variables for the Phi variable. Note that it is possible it did not exist before." + allVersions size = newVariablesMap size ifFalse: [ + previousVariables + detect: [ :variable | variable localDeclaration = localDeclaration ] + ifFound: [ :variable | allVersions add: variable ] ]. + + self createPhiVersionFor: localDeclaration versions: allVersions ] +] + +{ #category : 'actions' } +FASTPythonSSAVisitor >> resolve: aFASTBehaviouralEntity [ + + | cfg | + "First we do a local resolution so that each entity are linked to their local declaration" + FASTPythonLocalResolverVisitor resolve: aFASTBehaviouralEntity. + + "Then we build the CFG to know the different paths on the entity" + cfg := aFASTBehaviouralEntity cfg. + + "And lastly, I can build the SSA now that I have the CFG and Local declarations." + self visit: cfg +] + +{ #category : 'visiting - reordering' } +FASTPythonSSAVisitor >> visitFASTPyFunctionDefinition: aFunctionDefinition [ + "Reordering for parameters to be visited before the statements in order to have all declarations" + + self visitFASTTWithParameters: aFunctionDefinition. + self visitEntity: aFunctionDefinition returnType. + self visitFASTPyTDefinition: aFunctionDefinition. + self visitFASTPyTWithTypeParameters: aFunctionDefinition. + self visitFASTPyStatement: aFunctionDefinition +] + +{ #category : 'visiting - reordering' } +FASTPythonSSAVisitor >> visitFASTPyMethodDefinition: aMethodDefinition [ + "We resolve in the same way as functions." + + self visitFASTPyFunctionDefinition: aMethodDefinition +] + +{ #category : 'visiting' } +FASTPythonSSAVisitor >> visitFASTPyTCanBeVariable: aTCanBeVariable [ + + aTCanBeVariable isVariableWriteAccess + ifTrue: [ self handleNewAssignemntTo: aTCanBeVariable ] + ifFalse: [ aTCanBeVariable localDeclaration isNonLocalDeclaration ifFalse: [ aTCanBeVariable ssaVersion: aTCanBeVariable localDeclaration activeVersion ] ]. + + super visitFASTPyTCanBeVariable: aTCanBeVariable +] + +{ #category : 'visiting' } +FASTPythonSSAVisitor >> visitFASTPyTDefinition: aTDefinition [ + "We need to redo the CFG for definitions" + + | cfg | + self visitFASTTNamedEntity: aTDefinition. + self visitCollection: aTDefinition decorators. + + cfg := aTDefinition cfg. + self visit: cfg +] diff --git a/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st b/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st index d77ae30..1660d42 100644 --- a/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st @@ -59,11 +59,15 @@ FASTPythonTreeSitterVisitor >> initialize [ FASTPythonTreeSitterVisitor >> isIdentifierAVariableInTheCurrentContext [ "I am sure that an identifier is a variable in some cases: - It is directly in the left side of an assignation + - It is in a splat used as assignment target (e.g. extended unpacking `a, *b = ...`) - It's in a global statement - It's in a non local statement" (context top field = #left and: [ context top isOfFASTType: FASTPyAssignment ]) ifTrue: [ ^ true ]. + ((context top isOfFASTType: FASTPySplat) and: [ context anySatisfy: [ :entry | entry field = #left and: [ entry isOfFASTType: FASTPyAssignment ] ] ]) ifTrue: [ + ^ true ]. + ^ (context top isOfFASTType: FASTPyGlobalStatement) or: [ context top isOfFASTType: FASTPyNonlocalStatement ] ] @@ -619,21 +623,26 @@ FASTPythonTreeSitterVisitor >> visitGlobalStatement: aTSNode [ { #category : 'visiting' } FASTPythonTreeSitterVisitor >> visitIdentifier: aNode [ - (self isInParameter: aNode) ifTrue: [ ^ self handleParameterNode: aNode name: (self sourceCodeOf: aNode) ]. + | name | + name := self sourceCodeOf: aNode. + + (self isInParameter: aNode) ifTrue: [ ^ self handleParameterNode: aNode name: name ]. "If we are in a field `name` then we are probably in a definition of an entity and we set my content as a name." - self shouldIdentifierSetNameProperty ifTrue: [ ^ self topFastEntity name: (self sourceCodeOf: aNode) ]. + self shouldIdentifierSetNameProperty ifTrue: [ ^ self topFastEntity name: name ]. self isIdentifierAVariableInTheCurrentContext ifTrue: [ | variable | variable := self handleNode: aNode kind: FASTPyVariable. - variable name: (self sourceCodeOf: aNode). + variable name: name. ^ variable ]. "In case we are in an alias, we edit the property alias of the last imported entity" - aNode parent type = #aliased_import ifTrue: [ ^ self topFastEntity importedEntities last alias: (self sourceCodeOf: aNode) ]. + aNode parent type = #aliased_import ifTrue: [ ^ self topFastEntity importedEntities last alias: name ]. - ^ self handleNode: aNode + ^ (self handleNode: aNode) + name: name; + yourself ] { #category : 'visiting - skip' } @@ -771,7 +780,8 @@ FASTPythonTreeSitterVisitor >> visitListSplat: aTSNode [ { #category : 'visiting - alias' } FASTPythonTreeSitterVisitor >> visitListSplatPattern: aTSNode [ - "In case we are a parameter we skip the children because it always is an identifier" + "In case we are a parameter we skip the children because it always is an identifier. + In any other pattern context (e.g. the left side of an assignment) we visit the node as a classic splat." (self isInParameter: aTSNode) ifTrue: [ | fastEntity | @@ -780,7 +790,7 @@ FASTPythonTreeSitterVisitor >> visitListSplatPattern: aTSNode [ fastEntity name: (self sourceCodeOf: aTSNode collectNamedChild anyOne). ^ fastEntity ]. - ^ self handleNode: aTSNode + ^ self visitListSplat: aTSNode ] { #category : 'visiting' } diff --git a/src/FAST-Python-Tools/FASTTEntity.extension.st b/src/FAST-Python-Tools/FASTTEntity.extension.st new file mode 100644 index 0000000..622a8a4 --- /dev/null +++ b/src/FAST-Python-Tools/FASTTEntity.extension.st @@ -0,0 +1,14 @@ +Extension { #name : 'FASTTEntity' } + +{ #category : '*FAST-Python-Tools' } +FASTTEntity >> ensureLocalUses [ + + self attributeAt: #localUses ifAbsentPut: OrderedCollection new +] + +{ #category : '*FAST-Python-Tools' } +FASTTEntity >> resetLocalResolution [ + + self removeAttribute: #localDeclaration. + self removeAttribute: #localUses +] diff --git a/src/FAST-Python-Tools/ManifestFASTPythonTools.class.st b/src/FAST-Python-Tools/ManifestFASTPythonTools.class.st new file mode 100644 index 0000000..775889d --- /dev/null +++ b/src/FAST-Python-Tools/ManifestFASTPythonTools.class.st @@ -0,0 +1,17 @@ +" +Please describe the package using the class comment of the included manifest class. The manifest class also includes other additional metadata for the package. These meta data are used by other tools such as the SmalllintManifestChecker and the critics Browser +" +Class { + #name : 'ManifestFASTPythonTools', + #superclass : 'PackageManifest', + #category : 'FAST-Python-Tools-Manifest', + #package : 'FAST-Python-Tools', + #tag : 'Manifest' +} + +{ #category : 'code-critics' } +ManifestFASTPythonTools class >> ruleInconsistentMethodClassificationRuleV1FalsePositive [ + + + ^ #(#(#(#RGClassDefinition #(#FASTPythonLocalResolverVisitor)) #'2026-07-30T14:41:37.271103+02:00') ) +]