'From Pharo6.0 of 13 May 2016 [Latest update: #60231] on 20 September 2016 at 10:31:13.740364 pm'! IconStyler subclass: #ExampleIconStyler instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Reflectivity-Tools-Breakpoints'! !BIConfigurableFormatter methodsFor: 'private-formatting' stamp: 'NicolaiHess 9/20/2016 12:51'! formatBlock: aBlockNode codeStream nextPutAll: self stringInsideBlocks. self formatBlockArgumentsFor: aBlockNode. self formatBlockCommentFor: aBlockNode. aBlockNode pragmaNodes do:[:pnode | self visitNode: pnode; newLine]. self visitNode: aBlockNode body. (self lineUpBlockBrackets and: [ self willBeMultiline: aBlockNode body ]) ifTrue: [ self newLine ] ifFalse: [ codeStream nextPutAll: self stringInsideBlocks ]! ! !ExampleIconStyler methodsFor: 'defaults' stamp: 'NicolaiHess 9/20/2016 14:54'! iconBlock: aNode ^ [ (Smalltalk compiler class evaluate: aNode formattedCode) value inspect ]! ! !ExampleIconStyler methodsFor: 'defaults' stamp: 'NicolaiHess 9/20/2016 14:54'! iconFor: aNode ^ self iconProvider iconNamed: #flag! ! !ExampleIconStyler methodsFor: 'defaults' stamp: 'NicolaiHess 9/20/2016 13:07'! highlightColor ^ Smalltalk ui theme backgroundColor darker! ! !ExampleIconStyler methodsFor: 'defaults' stamp: 'NicolaiHess 9/20/2016 15:06'! iconLabel: aNode ^ 'inspect it'! ! !ExampleIconStyler methodsFor: 'testing' stamp: 'NicolaiHess 9/20/2016 14:54'! shouldStyleNode: aNode ^ aNode isBlock and: [ aNode hasExampleTag ]! ! !RBParser methodsFor: 'private-parsing' stamp: 'NicolaiHess 9/20/2016 12:48'! parsePragmaInto: aNode | start pragma | start := currentToken start. self step. pragma := self basicParsePragma. (currentToken isBinary and: [ currentToken value == #> ]) ifFalse: [ ^ self parserError: '''>'' expected' ]. pragma left: start; right: currentToken start. aNode addPragma: pragma.! ! !RBParser methodsFor: 'private-parsing' stamp: 'NicolaiHess 9/20/2016 22:30'! parseBlock | position node | position := currentToken start. self step. node := self blockNodeClass new. "self parsePragmasInto: node." self parseBlockArgsInto: node. self addCommentsTo: node. node left: position. node body: self sequenceNodeClass new. (self parseStatements: false into: node body). (currentToken isSpecial and: [currentToken value = $]]) ifFalse: [ self addParserError: ''']'' expected' to: node body. ^ node]. node right: currentToken start. self step. ^node! ! !RBParser methodsFor: 'private-parsing' stamp: 'NicolaiHess 9/20/2016 12:47'! parsePragmasInto: aNode [ currentToken isBinary and: [ currentToken value = #< ] ] whileTrue: [ self parsePragmaInto: aNode. self step ]! ! !RBProgramNode methodsFor: 'iterating' stamp: 'NicolaiHess 9/20/2016 12:58'! exampleNodes ^ self allChildren select:[:k | k isBlock and:[ k hasProperty:#pragmas]].! ! !RBBlockNode methodsFor: 'visiting' stamp: 'NicolaiHess 9/20/2016 12:47'! addPragma: aPragmaNode (self hasProperty: #pragmas) ifFalse: [ self propertyAt: #pragmas put: OrderedCollection new ]. (self propertyAt: #pragmas) addLast: aPragmaNode! ! !RBBlockNode methodsFor: 'visiting' stamp: 'NicolaiHess 9/20/2016 12:50'! pragmaNodes ^ (self hasProperty: #pragmas) ifFalse: [ #() ] ifTrue: [ self propertyAt: #pragmas ]! ! !RBBlockNode methodsFor: 'testing' stamp: 'NicolaiHess 9/20/2016 13:00'! hasExampleTag ^ self hasProperty:#pragmas! ! !SHRBTextStyler methodsFor: 'visiting rb nodes' stamp: 'NicolaiHess 9/20/2016 16:52'! visitBlockNode: aBlockNode aBlockNode comments do: [ :comment | self addStyle: #comment from: comment start to: comment stop ]. aBlockNode arguments do: [ :argument | self addStyle: #blockPatternArg forNode: argument ]. self styleOpenBracket: aBlockNode. aBlockNode hasExampleTag ifTrue:[ (aBlockNode propertyAt:#pragmas) do:[:pnode | self visitNode: pnode]]. self visitNode: aBlockNode body. self styleCloseBracket: aBlockNode! !