#FEATURE by cg
class: GroovySourceHighlighter
added: #formatFileContents:elementsInto:using:
changed: #format:
class: GroovySourceHighlighter class
added: #formatFileContents:elementsInto:
--- a/tools/GroovySourceHighlighter.st Fri May 18 04:23:04 2018 +0200
+++ b/tools/GroovySourceHighlighter.st Fri May 25 13:13:33 2018 +0200
@@ -122,6 +122,12 @@
"Created: / 04-08-2011 / 23:43:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
+formatFileContents:code elementsInto:elements
+ ^ self new formatFileContents:code elementsInto:elements using: UserPreferences current
+
+ "Created: / 25-05-2018 / 12:53:07 / Claus Gittinger"
+!
+
formatMethod:source in:class
^self formatMethod: nil source: source in: class using: UserPreferences current
@@ -210,6 +216,16 @@
"Created: / 04-08-2011 / 23:43:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
+formatFileContents:source elementsInto:elements using:prefs
+ preferences := prefs.
+ preferences isNil ifTrue:[
+ preferences := UserPreferences current.
+ ].
+ ^ self format: source
+
+ "Created: / 25-05-2018 / 12:54:17 / Claus Gittinger"
+!
+
formatMethod:mth source:source in:class using: prefs
preferences := prefs.
preferences isNil ifTrue:[
@@ -280,11 +296,13 @@
lastPosition0 := scanner tokenStartPosition.
].
] on: Error do:[:ex|
+ Transcript showCR:'GroovyHighlighter: ',ex description
].
^ sourceText
"Created: / 02-10-2013 / 14:40:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 03-10-2013 / 20:27:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 25-05-2018 / 12:54:42 / Claus Gittinger"
! !
!GroovySourceHighlighter methodsFor:'queries'!