VM Maker: VMMaker.oscog-eem.2793.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

VM Maker: VMMaker.oscog-eem.2793.mcz

commits-2
 
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2793.mcz

==================== Summary ====================

Name: VMMaker.oscog-eem.2793
Author: eem
Time: 24 August 2020, 7:47:53.984785 pm
UUID: 87cb649c-1079-4e58-9e4c-cbf9d4f6669d
Ancestors: VMMaker.oscog-eem.2792

SmartSyntaxPlugins:
methodReturnFoo's are too useful an ideom not to support properly.  Ensure that SmartSyntaxPluginCodeGenerator is smart enough not to require the use of an explicit return for a trailing methodReturnFoo.  And yes, this bit me.

=============== Diff against VMMaker.oscog-eem.2792 ===============

Item was added:
+ ----- Method: SmartSyntaxPluginTMethod>>endsWithMethodReturnExpression (in category 'testing') -----
+ endsWithMethodReturnExpression
+ | operativeReturn |
+ operativeReturn := (parseTree statements last isReturn
+ and: [parseTree statements last expression isLeaf])
+ ifTrue: [(parseTree statements last: 2) first]
+ ifFalse: [parseTree statements last].
+ ^operativeReturn isSend
+ and: [#(methodReturnReceiver
+ methodReturnFloat:
+ methodReturnValue:
+ methodReturnInteger:
+ methodReturnBool:
+ methodReturnString:
+ methodReturnStringOrNil:) includes: operativeReturn selector]!

Item was changed:
  ----- Method: SmartSyntaxPluginTMethod>>fixUpReturns (in category 'transforming') -----
  fixUpReturns
  "Replace each return statement in this method with (a) the given postlog, (b) code to pop the receiver and the given number of arguments, and (c) code to push the integer result and return."
+ self endsWithMethodReturnExpression ifTrue:
+ [parseTree statements last isSend ifFalse:
+ [parseTree setStatements: parseTree statements allButLast]].
+ parseTree nodesDo:
+ [:node |
+ node isStmtList ifTrue:
+ [node setStatements: (Array streamContents:
-
- parseTree nodesDo: [:node |
- node isStmtList ifTrue: [
- node setStatements: (Array streamContents:
  [:sStream |
  node statements do:
  [:stmt | self fixUpReturnOneStmt: stmt on: sStream]])]]!