Added support for highlighting of a statement list
optionally with temporary declaratio - `| temp1 temp2 |`
--- a/SyntaxHighlighter2.st Mon Feb 22 20:17:18 2016 +0000
+++ b/SyntaxHighlighter2.st Mon Feb 22 21:15:53 2016 +0000
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
"
COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
All Rights Reserved
@@ -258,20 +256,22 @@
"Modified: / 28-05-2013 / 22:45:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
-formatStatementList:aString in:aClass elementsInto: elements
+formatStatements:aString in:aClass elementsInto: elements
"format (recolor) a statement list in a given class.
Return the text containing font changes and color information."
^ self
- format:aString parsingWith:[:parser | parser statementList]
+ format:aString parsingWith:[:parser | parser parseMethodBody]
in:aClass elementsInto:elements
"
self
- formatStatementList:'(1 + 2) max:5. 1 + 2'
+ formatStatements:'(1 + 2) max:5. 1 + 2'
in:UndefinedObject
elementsInto:(OrderedCollection new).
"
+
+ "Created: / 22-02-2016 / 21:09:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!SyntaxHighlighter2 methodsFor:'accessing'!
@@ -1088,6 +1088,11 @@
^ '$Header$'
!
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+!
+
version_SVN
^ '$Id$'
! !
--- a/Tools__CodeHighlightingService.st Mon Feb 22 20:17:18 2016 +0000
+++ b/Tools__CodeHighlightingService.st Mon Feb 22 21:15:53 2016 +0000
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
"
COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
All Rights Reserved
@@ -256,7 +254,11 @@
] ifFalse:[
codeAspect == (SyntaxHighlighter codeAspectClassDefinition) ifTrue:[
highlighterClasses do:[:e|newCode := e formatClassDefinition:newCode string in:cls elementsInto: elements].
- ]
+ ] ifFalse:[
+ codeAspect == (SyntaxHighlighter codeAspectStatements) ifTrue:[
+ highlighterClasses do:[:e|newCode := e formatStatements:newCode string in:cls elementsInto: elements].
+ ]
+ ].
].
].
"/ ]
@@ -292,9 +294,9 @@
]
]
- "Modified: / 22-08-2011 / 14:17:47 / cg"
"Created: / 24-01-2012 / 12:21:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 22-07-2013 / 13:33:40 / cg"
+ "Modified: / 22-02-2016 / 21:00:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
setHighlightedCode:newCode elements: elements
@@ -408,6 +410,11 @@
^ '$Header$'
!
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+!
+
version_SVN
^ '$Id$'
! !
--- a/extensions.st Mon Feb 22 20:17:18 2016 +0000
+++ b/extensions.st Mon Feb 22 21:15:53 2016 +0000
@@ -19,6 +19,16 @@
"Created: / 25-07-2010 / 08:58:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
+!AbstractSyntaxHighlighter class methodsFor:'api highlighting'!
+
+formatStatements:aString in:aClass elementsInto: aCollection
+ "Format (recolor) a list of statements with optional temporaries in a given class.
+ Return the text containing font changes and color information."
+ ^ self formatStatements:aString in:aClass
+
+ "Created: / 22-02-2016 / 20:59:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
!AbstractTime class methodsFor:'misc ui support'!
iconInBrowserSymbol