Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from timfel/patch-2
Support non-standard selectors with colons Conflicts: repository/MonticelloFileTree-Core.package/MCFileTreeStCypressWriter.class/class/fileNameForSelector..st
- Loading branch information
1 parent
436095b
commit bb6f211
Showing
2 changed files
with
27 additions
and
24 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
...icelloFileTree-Core.package/MCFileTreeStCypressWriter.class/class/fileNameForSelector..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
accessing | ||
fileNameForSelector: selector | ||
^ (selector includes: $:) | ||
ifTrue: [ | ||
selector | ||
collect: [ :each | | ||
each = $: | ||
ifTrue: [ $. ] | ||
ifFalse: [ each ] ] ] | ||
ifFalse: [ | ||
(self specials includes: selector first) | ||
ifFalse: [ selector ] | ||
ifTrue: [ | ||
| output specials | | ||
specials := self specials. | ||
output := String new writeStream. | ||
output nextPut: $^. | ||
selector | ||
do: [ :each | | ||
output | ||
nextPutAll: | ||
((specials includes: each) | ||
ifTrue: [ specials at: each ] | ||
ifFalse: [ each asString ]) ] | ||
separatedBy: [ output nextPut: $. ]. | ||
output contents ] ] |
25 changes: 1 addition & 24 deletions
25
...lloFileTree-Core.package/MCFileTreeStCypressWriter.class/instance/fileNameForSelector..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,3 @@ | ||
private | ||
fileNameForSelector: selector | ||
^ selector last = $: | ||
ifTrue: [ | ||
selector | ||
collect: [ :each | | ||
each = $: | ||
ifTrue: [ $. ] | ||
ifFalse: [ each ] ] ] | ||
ifFalse: [ | ||
(self class specials includes: selector first) | ||
ifFalse: [ selector ] | ||
ifTrue: [ | ||
| output specials | | ||
specials := self class specials. | ||
output := String new writeStream. | ||
output nextPut: $^. | ||
selector | ||
do: [ :each | | ||
output | ||
nextPutAll: | ||
((specials includes: each) | ||
ifTrue: [ specials at: each ] | ||
ifFalse: [ each asString ]) ] | ||
separatedBy: [ output nextPut: $. ]. | ||
output contents ] ] | ||
^ self class fileNameForSelector: selector |