SystemBrowser.st
changeset 16600 2c71384ebdc4
parent 16597 fb8d01e7020f
child 16617 69e7de1ef22f
child 16691 9998797358f3
equal deleted inserted replaced
16598:fd83a3c02725 16600:2c71384ebdc4
  5496                 allSelectorsInLiteralArray := sentMessages isEmptyOrNil or:[ literalsInMethod includesAll:sentMessages ].
  5496                 allSelectorsInLiteralArray := sentMessages isEmptyOrNil or:[ literalsInMethod includesAll:sentMessages ].
  5497                 allSelectorsInLiteralArray ifTrue:[
  5497                 allSelectorsInLiteralArray ifTrue:[
  5498                     "/ and used symbols/globals first...
  5498                     "/ and used symbols/globals first...
  5499                     allUsedSymbolsInLiteralArray := usedSymbols isEmptyOrNil or:[ literalsInMethod includesAll:usedSymbols ].
  5499                     allUsedSymbolsInLiteralArray := usedSymbols isEmptyOrNil or:[ literalsInMethod includesAll:usedSymbols ].
  5500                     allUsedSymbolsInLiteralArray ifTrue:[
  5500                     allUsedSymbolsInLiteralArray ifTrue:[
  5501                         "/ not true, but I am lazy: if ANY string is in match, ANY string must be in method
  5501                         "/ if ANY string is in match, ANY string must be in method (not true, but I am lazy)
  5502                         "/ that does not work for stc compiled code, because it does not put strings into the literal array
  5502                         "/ that does not work for stc compiled code, because it does not put strings into the literal array
  5503                         isSTCCompiled := m byteCode isNil.
  5503                         isSTCCompiled := m byteCode isNil.
  5504                         isSTCCompiled ifTrue:[
  5504                         isSTCCompiled ifTrue:[
  5505                             allStringsInLiteralArray := true.   "/ stc-compiled: don't know    
  5505                             allStringsInLiteralArray := true.   "/ stc-compiled: don't know    
  5506                         ] ifFalse:[
  5506                         ] ifFalse:[
  5508                                                         or:[ literalsInMethod includesAll:usedStrings "literalsInMethod contains:[:lit | lit isString]" ].
  5508                                                         or:[ literalsInMethod includesAll:usedStrings "literalsInMethod contains:[:lit | lit isString]" ].
  5509                         ].
  5509                         ].
  5510                         allStringsInLiteralArray ifTrue:[
  5510                         allStringsInLiteralArray ifTrue:[
  5511                             allGlobalsReferenced := globalVariablesUsed conform:[:varNames | varNames contains:[:varName | m referencesGlobal:varName]].
  5511                             allGlobalsReferenced := globalVariablesUsed conform:[:varNames | varNames contains:[:varName | m referencesGlobal:varName]].
  5512                             allGlobalsReferenced ifTrue:[
  5512                             allGlobalsReferenced ifTrue:[
  5513                                 allMessagesSent := sentMessages isEmptyOrNil or:[ m messages includesAll:sentMessages ].
  5513                                 allMessagesSent := sentMessages isEmptyOrNil 
       
  5514                                                    or:[ m messagesSent includesAll:sentMessages ].
  5514                                 allMessagesSent ifTrue:[
  5515                                 allMessagesSent ifTrue:[
  5515                                     allSent := sentMessages conform:[:sel | (m sends:sel)].
  5516                                     src := m source.
  5516                                     allSent ifTrue:[
  5517                                     src isNil ifTrue:[
  5517                                         src := m source.
  5518                                         ('Browser [info]: no source for ' , m printString) infoPrintCR.
  5518                                         src isNil ifTrue:[
  5519                                     ] ifFalse:[
  5519                                             ('Browser [info]: no source for ' , m printString) infoPrintCR.
  5520                                         isSTCCompiled ifTrue:[
  5520                                         ] ifFalse:[
  5521                                             usedStrings notEmptyOrNil ifTrue:[
  5521                                             isSTCCompiled ifTrue:[
  5522                                                 "/ now that we have the source, scan the source for the literal strings,
  5522                                                 usedStrings notEmptyOrNil ifTrue:[
  5523                                                 "/ before doing a slow parse
  5523                                                     "/ now that we have the source, scan the source for the literal strings,
  5524                                                 allStringsInLiteralArray := usedStrings conform:[:eachString | src includesString:eachString].
  5524                                                     "/ before doing a slow parse
  5525                                             ]
  5525                                                     allStringsInLiteralArray := usedStrings conform:[:eachString | src includesString:eachString].
  5526                                         ].
  5526                                                 ]
  5527                                         allStringsInLiteralArray ifTrue:[
  5527                                             ].
  5528                                             (searcher canQuicklyReject:src) ifTrue:[
  5528                                             allStringsInLiteralArray ifTrue:[
  5529                                                 "/ Transcript show:'qReject: '; showCR:m whoString.
  5529                                                 (searcher canQuicklyReject:src) ifTrue:[
  5530                                             ] ifFalse:[
  5530                                                     "/ Transcript show:'qReject: '; showCR:m whoString.
  5531                                                 "/ the rest is done by the slower RB-match process...
  5531                                                 ] ifFalse:[
  5532                                                 parseTree := 
  5532                                                     "/ the rest is done by the slower RB-match process...
  5533                                                     RBParser 
  5533                                                     parseTree := 
  5534                                                         parseSearchMethod:src 
  5534                                                         RBParser 
  5535                                                         onError: [:str :pos | 
  5535                                                             parseSearchMethod:src 
  5536                                                             "/ self halt.
  5536                                                             onError: [:str :pos | 
  5537                                                             Transcript show:'Error during search in '; showCR:m. 
  5537                                                                 "/ self halt.
  5538                                                             Transcript showCR:str. 
  5538                                                                 Transcript show:'Error during search in '; showCR:m. 
  5539                                                             Transcript showCR:pos. 
  5539                                                                 Transcript showCR:str. 
  5540                                                             nil
  5540                                                                 Transcript showCR:pos. 
  5541                                                         ].
  5541                                                                 nil
  5542 
  5542                                                             ].
  5543                                                 parseTree notNil ifTrue:[
  5543 
  5544                                                     searcher executeTree:parseTree.
  5544                                                     parseTree notNil ifTrue:[
  5545                                                     "/ notice: searcher sets foundMatch !!
  5545                                                         searcher executeTree:parseTree.
       
  5546                                                         "/ notice: searcher sets foundMatch !!
       
  5547                                                     ].
       
  5548                                                 ].
  5546                                                 ].
  5549                                             ].
  5547                                             ].
  5550                                         ]
  5548                                         ].
  5551                                     ]
  5549                                     ]
  5552                                 ]
  5550                                 ]
  5553                             ]
  5551                             ]
  5554                         ]
  5552                         ]
  5555                     ]
  5553                     ]