#DOCUMENTATION by cg
authorClaus Gittinger <cg@exept.de>
Fri, 11 May 2018 13:09:47 +0200
changeset 4087d9336080778d
parent 4086 de7c2d6148e1
child 4088 bbf9b58f99c8
#DOCUMENTATION by cg
class: MIMETypes class
changed: #commentStringsForFilename:
MIMETypes.st
     1.1 --- a/MIMETypes.st	Thu May 10 21:06:20 2018 +0200
     1.2 +++ b/MIMETypes.st	Fri May 11 13:09:47 2018 +0200
     1.3 @@ -1,3 +1,5 @@
     1.4 +"{ Encoding: utf8 }"
     1.5 +
     1.6  "
     1.7   COPYRIGHT (c) 1997 by eXept Software AG 
     1.8  	      All Rights Reserved
     1.9 @@ -1451,16 +1453,17 @@
    1.10  
    1.11  !MIMETypes class methodsFor:'queries-language syntax'!
    1.12  
    1.13 -commentStringsForFilename:aFilename
    1.14 +commentStringsForFilename:aFilenameOrString
    1.15      "return a useful comment definition; heuristics for now.
    1.16       The returned value is an array of 2 elements;
    1.17       the first is the end-of-line comment string (or nil);
    1.18       the second an array of opening/closing delimiters (or an array of nils)"
    1.19  
    1.20 -     |mime|
    1.21 +     |filename mime|
    1.22  
    1.23 -     mime := MIMETypes mimeTypeForFilename:aFilename.
    1.24 -     ^ self commentStringsForMimeType:mime suffix:(aFilename asFilename suffix)
    1.25 +     filename := aFilenameOrString asFilename.
    1.26 +     mime := MIMETypes mimeTypeForFilename:filename.
    1.27 +     ^ self commentStringsForMimeType:mime suffix:(filename suffix)
    1.28  
    1.29      "
    1.30       MIMETypes commentStringsForFilename:'Makefile'.