The Trunk: ShoutCore-ar.8.mcz

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

The Trunk: ShoutCore-ar.8.mcz

commits-2
Andreas Raab uploaded a new version of ShoutCore to project The Trunk:
http://source.squeak.org/trunk/ShoutCore-ar.8.mcz

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

Name: ShoutCore-ar.8
Author: ar
Time: 19 February 2010, 5:06:21.526 pm
UUID: 4db9b039-f2d2-ba40-98b0-d23668f8239c
Ancestors: ShoutCore-nice.7

Allow shout to dynamically switch parsers when necessary (for example during debugging). Provide a hook that behaviors can implement to use an alternative shout parser class.

=============== Diff against ShoutCore-nice.7 ===============

Item was changed:
  ----- Method: SHTextStylerST80>>rangesIn:setWorkspace: (in category 'private') -----
  rangesIn: aText setWorkspace: aBoolean
  "Answer a collection of SHRanges by parsing aText.
  When formatting it is not necessary to set the workspace, and this can make the parse take less time, so aBoolean specifies whether the parser should be given the workspace"
 
+ | shoutParserClass |
+ "Switch parsers if we have to"
+ shoutParserClass := (classOrMetaClass ifNil:[Object]) shoutParserClass.
+ parser class = shoutParserClass ifFalse:[parser := shoutParserClass new].
+
- parser ifNil: [parser := SHParserST80 new].
  ^parser
  rangesIn: aText asString
  classOrMetaClass: classOrMetaClass
  workspace: (aBoolean ifTrue:[workspace])  
  environment: environment
  !

Item was added:
+ ----- Method: Behavior>>shoutParserClass (in category '*ShoutCore-Parsing') -----
+ shoutParserClass
+ "Answer the parser class"
+ ^SHParserST80!