Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/BaselineOfFASTPython/BaselineOfFASTPython.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ BaselineOfFASTPython >> treeSitter: spec [

spec baseline: 'TreeSitter' with: [
spec
repository: 'github://Evref-BL/Pharo-Tree-Sitter:v.2.1.2/src';
repository: 'github://Evref-BL/Pharo-Tree-Sitter:v3.3.1/src';
loads: #( 'moose' 'python' ) ]
]
17 changes: 17 additions & 0 deletions src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -27387,6 +27387,13 @@ FASTPythonImporterTest >> testGlobalStatementMultiple [
self assert: self topEntity name equals: 'z'
]

{ #category : 'tests - importer API' }
FASTPythonImporterTest >> testHandlesPythonFiles [

self assert: (FASTPythonImporter handlesFile: '/folder/module.py' asFileReference).
self deny: (FASTPythonImporter handlesFile: '/folder/module.pyc' asFileReference)
]

{ #category : 'tests - advanced statements' }
FASTPythonImporterTest >> testIf [
<generated>
Expand Down Expand Up @@ -40855,6 +40862,16 @@ FASTPythonImporterTest >> testParameter [
self assert: (self topEntity isOfType: FASTPyPassStatement)
]

{ #category : 'tests - model reuse' }
FASTPythonImporterTest >> testParseIntoAnExistingModelAddsTheNewSourceToIt [

| model |
model := self importer parse: 'x = 1'.
self assert: (self importer parse: 'y = 2' into: model) identicalTo: model.
self assert: (model allWithType: FASTPyModule) size equals: 2.
self assert: (model allWithType: FASTPyAssignment) size equals: 2
]

{ #category : 'tests - statements' }
FASTPythonImporterTest >> testPassStatement [
<generated>
Expand Down
7 changes: 7 additions & 0 deletions src/FAST-Python-Tools/FASTPythonImporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ FASTPythonImporter class >> devParseFiles: aCollection [
result inspect
]

{ #category : 'accessing' }
FASTPythonImporter class >> extensions [
"File extensions without the dot that the importer handles"

^ #( 'py' )
]

{ #category : 'parsing' }
FASTPythonImporter class >> parseAndResolve: aString [

Expand Down
Loading