MethodFinderWindow.st
changeset 3839 b37f9731ec27
parent 3816 70c345c11145
child 3854 47c6372ef98e
equal deleted inserted replaced
3838:403172bbe664 3839:b37f9731ec27
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  Copyright (C) Original Authors (Kaehler, Scott Wallace and Dan Ingalls)
     4  Copyright (C) Original Authors (Kaehler, Scott Wallace and Dan Ingalls)
     3  Copyright (C) 2001 eXept Software AG
     5  Copyright (C) 2001 eXept Software AG
     4 
     6 
     5  Permission is hereby granted, free of charge, to any 
     7  Permission is hereby granted, free of charge, to any 
  1157 search2Levels
  1159 search2Levels
  1158     "Do an exhaustive search.
  1160     "Do an exhaustive search.
  1159      Given the original message,
  1161      Given the original message,
  1160      try applying all unary messages first to the receiver,
  1162      try applying all unary messages first to the receiver,
  1161      then to each argument.
  1163      then to each argument.
  1162      This takes O(N²) time - so be prepared"
  1164      This takes O(N²) time - so be prepared"
  1163 
  1165 
  1164     |tempReceiver tempAnswer tempArguments numArgs
  1166     |tempReceiver tempAnswer tempArguments numArgs
  1165      anArray resultArray receiverWithArgument mf|
  1167      anArray resultArray receiverWithArgument mf|
  1166 
  1168 
  1167     tempArguments := self argumentEditorsContents.
  1169     tempArguments := self argumentEditorsContents.
  1852         tree := Parser parseExpression:aString.
  1854         tree := Parser parseExpression:aString.
  1853         ^ tree isMessage
  1855         ^ tree isMessage
  1854     ].
  1856     ].
  1855 
  1857 
  1856     "/ cg: this is naive - why not ask the parser, if it is a literal?
  1858     "/ cg: this is naive - why not ask the parser, if it is a literal?
  1857     (aString includesSubString:': ') ifTrue:[
  1859     (aString includesString:': ') ifTrue:[
  1858         ^ true
  1860         ^ true
  1859     ].
  1861     ].
  1860     (aString includes:$+) ifTrue:[
  1862     (aString includes:$+) ifTrue:[
  1861         ^ true
  1863         ^ true
  1862     ].
  1864     ].
  1873         ^ true
  1875         ^ true
  1874     ].
  1876     ].
  1875     (aString includes:$<) ifTrue:[
  1877     (aString includes:$<) ifTrue:[
  1876         ^ true
  1878         ^ true
  1877     ].
  1879     ].
  1878     (aString includesSubString:' new') ifTrue:[
  1880     (aString includesString:' new') ifTrue:[
  1879         ^ true
  1881         ^ true
  1880     ].
  1882     ].
  1881     (aString includes:$[) 
  1883     (aString includes:$[) 
  1882         & (aString includes:$]) 
  1884         & (aString includes:$]) 
  1883         & (aString includes:$.) ifTrue:[ ^ false ].
  1885         & (aString includes:$.) ifTrue:[ ^ false ].