#DOCUMENTATION by cg
authorClaus Gittinger <cg@exept.de>
Fri, 11 May 2018 13:09:47 +0200
changeset 4087 d9336080778d
parent 4086 de7c2d6148e1
child 4088 bbf9b58f99c8
#DOCUMENTATION by cg class: MIMETypes class changed: #commentStringsForFilename:
MIMETypes.st
--- a/MIMETypes.st	Thu May 10 21:06:20 2018 +0200
+++ b/MIMETypes.st	Fri May 11 13:09:47 2018 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1997 by eXept Software AG 
 	      All Rights Reserved
@@ -1451,16 +1453,17 @@
 
 !MIMETypes class methodsFor:'queries-language syntax'!
 
-commentStringsForFilename:aFilename
+commentStringsForFilename:aFilenameOrString
     "return a useful comment definition; heuristics for now.
      The returned value is an array of 2 elements;
      the first is the end-of-line comment string (or nil);
      the second an array of opening/closing delimiters (or an array of nils)"
 
-     |mime|
+     |filename mime|
 
-     mime := MIMETypes mimeTypeForFilename:aFilename.
-     ^ self commentStringsForMimeType:mime suffix:(aFilename asFilename suffix)
+     filename := aFilenameOrString asFilename.
+     mime := MIMETypes mimeTypeForFilename:filename.
+     ^ self commentStringsForMimeType:mime suffix:(filename suffix)
 
     "
      MIMETypes commentStringsForFilename:'Makefile'.