We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2a4832c commit a0cbf94Copy full SHA for a0cbf94
1 file changed
repository/Grease-Core.package/GRPlatform.class/instance/asMethodReturningString.named..st
@@ -0,0 +1,21 @@
1
+file library
2
+asMethodReturningString: aByteArrayOrString named: aSymbol
3
+ "Generates the source of a method named aSymbol that returns aByteArrayOrString as a String.
4
+
5
+ This implementation answers a String formatted like so
6
7
+ aSymbol
8
+ ^ aByteArrayOrString
9
10
+ Subclasses need to override this method if the dialect needs changes to support Unicode string literals"
11
+ ^ String streamContents: [ :stream |
12
+ stream
13
+ nextPutAll: aSymbol;
14
+ nextPut: Character cr.
15
16
+ tab;
17
+ nextPutAll: '^ '''.
18
+ aByteArrayOrString greaseString do: [ :each |
19
+ each = $' ifTrue: [ stream nextPut: $' ].
20
+ stream nextPut: each ].
21
+ stream nextPut: $' ]
0 commit comments