scratch0-5 / utils /VMMakerJS.package /JSCodeGenerator.class /instance /fileHeaderVersionStampForSourceClass..st
soiz1's picture
Upload folder using huggingface_hub
8f3f8db verified
raw
history blame contribute delete
732 Bytes
JS code generator
fileHeaderVersionStampForSourceClass: sourceClass
"Answer a suitable version stamp to include in the header."
| slangDescription sourceDescription |
slangDescription := self class monticelloDescriptionFor: self class.
sourceClass ifNotNil:
[sourceDescription := [sourceClass monticelloDescription]
on: MessageNotUnderstood
do: [:ex| self class monticelloDescriptionFor: sourceClass]].
^String streamContents:
[:s|
s nextPutAll: '/* Automatically generated by\ ' withCRs.
s nextPutAll: slangDescription.
sourceDescription ifNotNil:
[s nextPutAll: '\ from\ ' withCRs; nextPutAll: (sourceDescription copyReplaceAll: '\' withCRs with: '\ ' withCRs)].
s cr; nextPutAll: ' */'; cr]