The Inbox: ShoutCore-mt.79.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: ShoutCore-mt.79.mcz

commits-2
A new version of ShoutCore was added to project The Inbox:
http://source.squeak.org/inbox/ShoutCore-mt.79.mcz

==================== Summary ====================

Name: ShoutCore-mt.79
Author: mt
Time: 13 June 2020, 10:34:17.329351 am
UUID: 20850ea4-bd6b-9642-9333-ed6b4ce1e81d
Ancestors: ShoutCore-mt.78

Tweaks performance of method lookup for pragma parsing. See http://forum.world.st/The-Inbox-ShoutCore-mt-78-mcz-td5118289.html

=============== Diff against ShoutCore-mt.78 ===============

Item was changed:
  ----- Method: SHParserST80>>parsePragmaStatement (in category 'parse pragma') -----
  parsePragmaStatement
 
+ | parserSelector |
+ (currentToken last == $:
+ and: [(parserSelector := Symbol lookup: currentToken allButLast) notNil])
+ ifFalse: ["Quick exit to not break one-word pragmas such as <primitive> and <foobar>; also avoid interning new symbols for made-up pragmas such as for <my: 1 new: 2 pragma: 3> not interning #my."
+ ^ self parsePragmaStatementKeywords].
- | parserSelector parserMethod |
- currentToken last == $: ifFalse: [
- "Quick exit to not break one-word pragmas such as <primitive> or <foobar>."
- ^ self parsePragmaStatementKeywords].
 
+ self class methodDict
+ at: parserSelector
+ ifPresent: [:parserMethod |
+ (parserMethod pragmas
+ anySatisfy: [:pragma | pragma keyword == #pragmaParser])
+ ifTrue: [^ self executeMethod: parserMethod]].
- (self class includesSelector: (parserSelector := currentToken asSimpleGetter)) ifTrue: [
- ((parserMethod := self class compiledMethodAt: parserSelector) pragmas
- anySatisfy: [:pragma | pragma keyword == #pragmaParser])
- ifTrue: [^ self executeMethod: parserMethod]].
 
  ^ self parsePragmaStatementKeywords!