Explainer.st
changeset 4287 66641d57216d
parent 4273 08a8c063cc93
child 4357 1f18f1094e72
equal deleted inserted replaced
4286:700de9dd13d5 4287:66641d57216d
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 1993 by Claus Gittinger
     4  COPYRIGHT (c) 1993 by Claus Gittinger
     3               All Rights Reserved
     5               All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
   269         |clsName action1 action2|
   271         |clsName action1 action2|
   270 
   272 
   271         implMethod := implClass compiledMethodAt:selector.
   273         implMethod := implClass compiledMethodAt:selector.
   272         clsName := implClass name.
   274         clsName := implClass name.
   273         clsName := self asLink:clsName to:(self actionToBrowseClass:implClass selector:selector).
   275         clsName := self asLink:clsName to:(self actionToBrowseClass:implClass selector:selector).
   274         info := '%1 » %2' bindWith:clsName "allBold" with:selectorString.
   276         info := '%1 » %2' bindWith:clsName "allBold" with:selectorString.
   275         info := self asLink:info to:(action1 := self actionToBrowseClass:implClass selector:selector info:nil).
   277         info := self asLink:info to:(action1 := self actionToBrowseClass:implClass selector:selector info:nil).
   276         
   278         
   277         redefiningClasses size > 0 ifTrue:[
   279         redefiningClasses size > 0 ifTrue:[
   278             redefiningClasses size == 1 ifTrue:[
   280             redefiningClasses size == 1 ifTrue:[
   279                 |redefiner|
   281                 |redefiner|
  2004 !
  2006 !
  2005 
  2007 
  2006 valueStringFor:aValue
  2008 valueStringFor:aValue
  2007     |valString|
  2009     |valString|
  2008 
  2010 
       
  2011     aValue isProtoObject ifTrue:[
       
  2012         ^ aValue printString
       
  2013     ].
       
  2014     
  2009     "/ only show the value, if it is really short...
  2015     "/ only show the value, if it is really short...
  2010     (aValue isBoolean
  2016     (aValue isBoolean
  2011         or:[aValue isNil
  2017         or:[aValue isNil
  2012         or:[aValue isString
  2018         or:[aValue isString
  2013         or:[aValue isNumber
  2019         or:[aValue isNumber
  2033     ].
  2039     ].
  2034 
  2040 
  2035     ^ valString
  2041     ^ valString
  2036 
  2042 
  2037     "Modified: / 14-10-2010 / 11:57:52 / cg"
  2043     "Modified: / 14-10-2010 / 11:57:52 / cg"
       
  2044     "Modified: / 24-07-2018 / 12:08:55 / Claus Gittinger"
  2038 ! !
  2045 ! !
  2039 
  2046 
  2040 !Explainer class methodsFor:'naive type inferer'!
  2047 !Explainer class methodsFor:'naive type inferer'!
  2041 
  2048 
  2042 addTypeOfExpressionNode:expr forAssignmentTo:varName to:setOfTypes
  2049 addTypeOfExpressionNode:expr forAssignmentTo:varName to:setOfTypes
  2697                         asLink:selectorString "allBold" 
  2704                         asLink:selectorString "allBold" 
  2698                         info:('Browse all implementors of %1' bindWith:selectorString)
  2705                         info:('Browse all implementors of %1' bindWith:selectorString)
  2699                         to:(self actionToOpenMethodFinderFor:sel)) 
  2706                         to:(self actionToOpenMethodFinderFor:sel)) 
  2700             with:(self 
  2707             with:(self 
  2701                     asLink:inheritedClass name "allBold" 
  2708                     asLink:inheritedClass name "allBold" 
  2702                     info:('Browse %1 » %2' bindWith:inheritedClass name with:sel)
  2709                     info:('Browse %1 » %2' bindWith:inheritedClass name with:sel)
  2703                     to:(self actionToBrowseClass:inheritedClass selector:sel)).
  2710                     to:(self actionToBrowseClass:inheritedClass selector:sel)).
  2704     ].
  2711     ].
  2705 
  2712 
  2706     ^ msg
  2713     ^ msg
  2707 
  2714