Skip to content

Commit

Permalink
[PreSmalltalks] Allow lowercase classnames
Browse files Browse the repository at this point in the history
  • Loading branch information
shingarov authored and janvrany committed Oct 12, 2023
1 parent 747705a commit 84768e7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions PreSmalltalks-Pharo/String.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Extension { #name : #String }

{ #category : #'*PreSmalltalks-Pharo' }
String >> isValidGlobalName [

self ifEmpty: [ ^ false ].

"reserverd default names"
self = 'NameOfSubclass' ifTrue: [ ^ false ].
self = 'TNameOfTrait' ifTrue: [ ^ false ].

^ self first isLetter
and: [ self allSatisfy: [:character |
character isAlphaNumeric or: [ character = $_ ]]]
]

0 comments on commit 84768e7

Please sign in to comment.