scide: GenericCodeEditor - accept drag/drop of text/plain
[supercollider.git] / SCClassLibrary / JITLib / Patterns / extPostAsCode.sc
blob49337739e2db54adcd3427f0f541fa91b631fdb8
1 + PatternProxy {
2                 // like asCompileString, but with full source etc.
3         asCode {
4                 var mykey = this.key.asCompileString;
5                 var str;  str = "" ++ this.class.name ++ "(";
6                 
7                 if(source.isNil or: { source == this.class.default }) {
8                         str = str ++ mykey;
9                 } {
10                         str = str ++ this.repositoryArgs.asCompileString.drop(1).drop(-1);
11                 };
12                 str = str ++ ")";
13                 
14                 if(this.envir.notNil and: { this.envir.notEmpty }) {
15                         str = str ++ ".set(" ++
16                         this.envir.asKeyValuePairs.asCompileString.drop(1).drop(-1) ++ ")"
17                 };
18                 str = str ++ ";"
19                 ^str
20         }       
23 + Tdef {
24         printOn { |stream|
25                 ^this.storeOn(stream);
26         }
28 + Pdef {
29         printOn { |stream|
30                 ^this.storeOn(stream);
31         }
33 + Pdefn {
34         printOn { |stream|
35                 ^this.storeOn(stream);
36         }