1
0
ソースを参照

QuasiSendNode

Herbert Vojčík 9 年 前
コミット
9d6611b0d1
2 ファイル変更61 行追加0 行削除
  1. 43 0
      src/Compiler-AST.js
  2. 18 0
      src/Compiler-AST.st

+ 43 - 0
src/Compiler-AST.js

@@ -1951,6 +1951,49 @@ $globals.MethodNode);
 
 
 
+$core.addClass('QuasiSendNode', $globals.Node, ['receiver'], 'Compiler-AST');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.QuasiSendNode.comment="I am a node that has a receiver.\x0a\x0aMy subclasses are `SendNode`, `CascadeNode` and `BranchSendNode`.";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "receiver",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+return self["@receiver"];
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "receiver\x0a\x09^ receiver",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.QuasiSendNode);
+
+$core.addMethod(
+$core.method({
+selector: "receiver:",
+protocol: 'accessing',
+fn: function (anObject){
+var self=this;
+self["@receiver"]=anObject;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anObject"],
+source: "receiver: anObject\x0a\x09receiver := anObject",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.QuasiSendNode);
+
+
+
 $core.addClass('ReturnNode', $globals.Node, ['scope'], 'Compiler-AST');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 $globals.ReturnNode.comment="I represent an return node. At the AST level, there is not difference between a local return or non-local return.";

+ 18 - 0
src/Compiler-AST.st

@@ -456,6 +456,24 @@ accept: aVisitor
 	^ aVisitor visitMethodNode: self
 ! !
 
+Node subclass: #QuasiSendNode
+	instanceVariableNames: 'receiver'
+	package: 'Compiler-AST'!
+!QuasiSendNode commentStamp!
+I am a node that has a receiver.
+
+My subclasses are `SendNode`, `CascadeNode` and `BranchSendNode`.!
+
+!QuasiSendNode methodsFor: 'accessing'!
+
+receiver
+	^ receiver
+!
+
+receiver: anObject
+	receiver := anObject
+! !
+
 Node subclass: #ReturnNode
 	instanceVariableNames: 'scope'
 	package: 'Compiler-AST'!