scratch0-5 / utils /VMMakerJS.package /JSMethod.class /instance /inlineCodeOrNilForStatement.in..st
soiz1's picture
Upload folder using huggingface_hub
8f3f8db verified
raw
history blame contribute delete
761 Bytes
inlining
inlineCodeOrNilForStatement: aNode in: aCodeGen
"If the given statement node can be inlined, answer the statements that replace it. Otherwise, answer nil."
| stmts |
aNode isReturn ifTrue: [
(self inlineableSend: aNode expression in: aCodeGen) ifTrue: [
stmts := self inlineSend: aNode expression
directReturn: true exitVar: nil in: aCodeGen.
^stmts
].
].
aNode isAssignment ifTrue: [
(self inlineableSend: aNode expression in: aCodeGen) ifTrue: [
^self inlineSend: aNode expression
directReturn: false exitVar: aNode variable name in: aCodeGen
].
].
aNode isSend ifTrue: [
(self inlineableSend: aNode in: aCodeGen) ifTrue: [
^self inlineSend: aNode
directReturn: false exitVar: nil in: aCodeGen
].
].
^nil