David T. Lewis uploaded a new version of EToys to project The Inbox:
http://source.squeak.org/inbox/EToys-dtl.314.mcz ==================== Summary ==================== Name: EToys-dtl.314 Author: dtl Time: 25 November 2017, 12:18:54.339694 pm UUID: 5d8ae2a6-a8d1-4c96-acc8-69ef66a4aa81 Ancestors: EToys-dtl.313 Remove references to global World from SyntaxMorph. Note: #asMorphicSyntaxIn: is required for SyntaxMorph but not implemented in the ParseNode hierarchy. Presumably this should be harvested from an Etoys image. =============== Diff against EToys-dtl.313 =============== Item was changed: ----- Method: SyntaxMorph>>offerTilesMenuFor:in: (in category 'menus') ----- offerTilesMenuFor: aReceiver in: aLexiconModel "Offer a menu of tiles for assignment and constants" | menu | menu := MenuMorph new addTitle: 'Hand me a tile for...'. menu addLine. menu add: '(accept method now)' target: aLexiconModel selector: #acceptTiles. menu submorphs last color: Color red darker. menu addLine. menu add: 'me, by name' target: self selector: #attachTileForCode:nodeType: argumentList: {'<me by name>'. aReceiver}. menu add: 'self' target: self selector: #attachTileForCode:nodeType: argumentList: {'self'. VariableNode}. menu add: '_ (assignment)' target: self selector: #attachTileForCode:nodeType: argumentList: {'<assignment>'. nil}. menu add: '"a Comment"' target: self selector: #attachTileForCode:nodeType: argumentList: {'"a comment"\' withCRs. CommentNode}. menu submorphs last color: Color blue. menu add: 'a Number' target: self selector: #attachTileForCode:nodeType: argumentList: {'5'. LiteralNode}. menu add: 'a Character' target: self selector: #attachTileForCode:nodeType: argumentList: {'$z'. LiteralNode}. menu add: '''abc''' target: self selector: #attachTileForCode:nodeType: argumentList: {'''abc'''. LiteralNode}. menu add: 'a Symbol constant' target: self selector: #attachTileForCode:nodeType: argumentList: {'#next'. LiteralNode}. menu add: 'true' target: self selector: #attachTileForCode:nodeType: argumentList: {'true'. VariableNode}. menu add: 'a Test' target: self selector: #attachTileForCode:nodeType: argumentList: {'true ifTrue: [self] ifFalse: [self]'. MessageNode}. menu add: 'a Loop' target: self selector: #attachTileForCode:nodeType: argumentList: {'1 to: 10 do: [:index | self]'. MessageNode}. menu add: 'a Block' target: self selector: #attachTileForCode:nodeType: argumentList: {'[self]'. BlockNode}. menu add: 'a Class or Global' target: self selector: #attachTileForCode:nodeType: argumentList: {'Character'. LiteralVariableNode}. menu add: 'a Reply' target: self selector: #attachTileForCode:nodeType: argumentList: {'| temp | temp'. ReturnNode}. + menu popUpAt: ActiveHand position forHand: ActiveHand in: self world. - menu popUpAt: ActiveHand position forHand: ActiveHand in: World. ! Item was changed: ----- Method: SyntaxMorph>>offerVarsMenuFor:in: (in category 'menus') ----- offerVarsMenuFor: aReceiver in: aLexiconModel "Offer a menu of tiles for assignment and constants" | menu instVarList cls | menu := MenuMorph new addTitle: 'Hand me a tile for...'. menu addLine. menu add: '(accept method now)' target: aLexiconModel selector: #acceptTiles. menu submorphs last color: Color red darker. menu addLine. menu add: 'new temp variable' target: self selector: #attachTileForCode:nodeType: argumentList: {'| temp | temp'. TempVariableNode}. instVarList := OrderedCollection new. cls := aReceiver class. [instVarList addAllFirst: cls instVarNames. cls == aLexiconModel limitClass] whileFalse: [cls := cls superclass]. instVarList do: [:nn | menu add: nn target: self selector: #instVarTile: argument: nn]. + menu popUpAt: ActiveHand position forHand: ActiveHand in: self world. - menu popUpAt: ActiveHand position forHand: ActiveHand in: World. ! Item was changed: ----- Method: SyntaxMorph>>showMenu: (in category 'menus') ----- showMenu: evt | menu | menu := MenuMorph new. self rootTile isMethodNode ifTrue: [menu add: 'accept method' target: self selector: #accept. menu addLine. menu add: 'new temp variable' target: self selector: #attachTileForCode:nodeType: argumentList: {'| temp | temp'. TempVariableNode}. menu addLine. self parsedInClass allInstVarNames do: [:nn | menu add: nn,' tile' target: self selector: #instVarTile: argument: nn]. menu addLine. menu add: 'show code' target: self selector: #showCode. menu add: 'try out' target: self selector: #try. + menu popUpAt: evt hand position forHand: evt hand in: self world]. - menu popUpAt: evt hand position forHand: evt hand in: World]. ! |
Free forum by Nabble | Edit this page |