-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
9 changes: 9 additions & 0 deletions
9
src/TruffleSqueak-Utilities.package/CallTargetBrowserPython.class/class/callTargetFor.of..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
helpers | ||
callTargetFor: aMethodName of: aModuleName | ||
| vmObject | | ||
vmObject := (self methodFor: aMethodName of: aModuleName) vmObject. | ||
^ (vmObject respondsTo: #function) | ||
ifTrue: [ (vmObject function respondsTo: #callTarget) | ||
ifTrue: [ vmObject function callTarget ] | ||
ifFalse: nil ] | ||
ifFalse: nil |
5 changes: 5 additions & 0 deletions
5
src/TruffleSqueak-Utilities.package/CallTargetBrowserPython.class/class/methodGetter.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
helpers | ||
methodGetter | ||
"MethodGetter := nil" | ||
^ MethodGetter ifNil: [ MethodGetter := Polyglot eval: #python string: | ||
'import sys; lambda mod_name, meth_name : getattr(sys.modules[str(mod_name)], str(meth_name))' ] |
5 changes: 5 additions & 0 deletions
5
src/TruffleSqueak-Utilities.package/CallTargetBrowserPython.class/class/methodListGetter.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
helpers | ||
methodListGetter | ||
"MethodListGetter := nil" | ||
^ MethodListGetter ifNil: [ MethodListGetter := Polyglot eval: #python string: | ||
'import sys; lambda mod_name : [x for x in dir(sys.modules[str(mod_name)]) if x[0].islower()]' ] |
7 changes: 7 additions & 0 deletions
7
src/TruffleSqueak-Utilities.package/CallTargetBrowserPython.class/instance/labelString.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
toolbuilder | ||
labelString | ||
| label | | ||
label := 'CallTargetBrowser for GraalPython'. | ||
self selectedModuleName | ||
ifNotNil: [ :name | label := label, ': ', name ]. | ||
^ label |
4 changes: 4 additions & 0 deletions
4
...ffleSqueak-Utilities.package/CallTargetBrowserPython.class/instance/moduleAndClassList.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
toolbuilder | ||
moduleAndClassList | ||
^ ((Polyglot eval: #python string: 'import sys; list(sys.modules.keys())') | ||
asCollection collect: [ :ea | ea asString ]) sorted |
8 changes: 8 additions & 0 deletions
8
src/TruffleSqueak-Utilities.package/CallTargetBrowserPython.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"class" : { | ||
"callTargetFor:of:" : "fn 10/1/2021 13:15", | ||
"methodGetter" : "fn 10/1/2021 13:00", | ||
"methodListGetter" : "fn 10/1/2021 13:16" }, | ||
"instance" : { | ||
"labelString" : "fn 10/1/2021 13:04", | ||
"moduleAndClassList" : "fn 10/1/2021 13:05" } } |
14 changes: 14 additions & 0 deletions
14
src/TruffleSqueak-Utilities.package/CallTargetBrowserPython.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"category" : "TruffleSqueak-Utilities", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
], | ||
"name" : "CallTargetBrowserPython", | ||
"pools" : [ | ||
], | ||
"super" : "CallTargetBrowserRuby", | ||
"type" : "normal" } |