smalltalk
/
osmo-st-all
Archived
1
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
osmo-st-all/petitparser/Extension.st

37 lines
672 B
Smalltalk

String extend [
beginsWith: aString [
<category: '*petitparser-core-converting-gst'>
| res |
res := self indexOf: aString matchCase: false startingAt: 1.
res ifNil: [^false].
^ res first = 1
]
includesSubString: subString [
<category: '*petitparser-core-converting-gst'>
| res |
res := self indexOf: subString matchCase: false startingAt: 1.
res ifNil: [^false].
^ res first >= 1
]
]
Symbol extend [
value: anObject [
<category: '*petitparser-core-converting-gst'>
^anObject perform: self
]
]
Character extend [
sameAs: aChar [
<category: '*petitparser-core-converting-gst'>
^self asLowercase = aChar asLowercase.
]
]