Highlighter cleanup, addes support for Groovy.
--- a/GroovyLanguage.st Thu Oct 03 20:07:05 2013 +0100
+++ b/GroovyLanguage.st Fri Oct 04 08:59:25 2013 +0100
@@ -118,9 +118,9 @@
It is OK to return nil, which means that the code is shown as-is"
"return nil by default"
- ^JavaSourceHighlighter
+ ^GroovySourceHighlighter
- "Modified: / 30-08-2013 / 01:11:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 03-10-2013 / 20:28:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!GroovyLanguage methodsFor:'queries'!
--- a/Make.proto Thu Oct 03 20:07:05 2013 +0100
+++ b/Make.proto Fri Oct 04 08:59:25 2013 +0100
@@ -21,7 +21,7 @@
INCLUDE_TOP=$(TOP)/..
# subdirectories where targets are to be made:
-SUBDIRS= examples experiments tools
+SUBDIRS= tools experiments
# subdirectories where Makefiles are to be made:
@@ -34,7 +34,7 @@
# add the path(es) here:,
# ********** OPTIONAL: MODIFY the next lines ***
# LOCALINCLUDES=-Ifoo -Ibar
-LOCALINCLUDES=-I$(ZLIB_DIR) -Isupport/fdlibm -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libbasic3 -I$(INCLUDE_TOP)/stx/libbasic2 -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libview
+LOCALINCLUDES=-I$(ZLIB_DIR) -Isupport/fdlibm -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libbasic3 -I$(INCLUDE_TOP)/stx/libbasic2 -I$(INCLUDE_TOP)/stx/libview
# if you need any additional defines for embedded C code,
@@ -144,8 +144,6 @@
cd ../libbasic2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
cd ../libbasic3 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
cd ../libview && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
- cd ../libview2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
- cd ../goodies/sunit && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
--- a/bc.mak Thu Oct 03 20:07:05 2013 +0100
+++ b/bc.mak Fri Oct 04 08:59:25 2013 +0100
@@ -34,7 +34,7 @@
-LOCALINCLUDES=-I$(ZLIB_DIR) -Isupport\fdlibm -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libbasic3 -I$(INCLUDE_TOP)\stx\libbasic2 -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\libview
+LOCALINCLUDES=-I$(ZLIB_DIR) -Isupport\fdlibm -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libbasic3 -I$(INCLUDE_TOP)\stx\libbasic2 -I$(INCLUDE_TOP)\stx\libview
LOCALDEFINES=
STCLOCALOPT=-package=$(PACKAGE) -I. $(LOCALINCLUDES) -headerDir=. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES) -varPrefix=$(LIBNAME)
@@ -54,8 +54,6 @@
pushd ..\libbasic2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\libbasic3 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\libview & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
- pushd ..\libview2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
- pushd ..\goodies\sunit & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
--- a/bmake.bat Thu Oct 03 20:07:05 2013 +0100
+++ b/bmake.bat Fri Oct 04 08:59:25 2013 +0100
@@ -10,13 +10,6 @@
make.exe -N -f bc.mak %DEFINES% %*
@echo "***********************************"
-@echo "Buildung stx/libjava/examples
-@echo "***********************************"
-@cd examples
-@call bmake %1 %2
-@cd ..
-
-@echo "***********************************"
@echo "Buildung stx/libjava/tools
@echo "***********************************"
@cd tools
--- a/lccmake.bat Thu Oct 03 20:07:05 2013 +0100
+++ b/lccmake.bat Fri Oct 04 08:59:25 2013 +0100
@@ -6,20 +6,6 @@
make.exe -N -f bc.mak -DUSELCC=1 %*
@echo "***********************************"
-@echo "Buildung stx/libjava/examples/jabber
-@echo "***********************************"
-@cd examples\jabber
-@call lccmake %1 %2
-@cd ..\..
-
-@echo "***********************************"
-@echo "Buildung stx/libjava/examples
-@echo "***********************************"
-@cd examples
-@call lccmake %1 %2
-@cd ..
-
-@echo "***********************************"
@echo "Buildung stx/libjava/tools
@echo "***********************************"
@cd tools
--- a/libjava.rc Thu Oct 03 20:07:05 2013 +0100
+++ b/libjava.rc Fri Oct 04 08:59:25 2013 +0100
@@ -25,7 +25,7 @@
VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011\nCopyright Jan Vrany, Jan Kurs and Marcel Hlopko\n SWING Research Group, Czech Technical University In Prague\0"
VALUE "ProductName", "Smalltalk/X\0"
VALUE "ProductVersion", "6.2.3.0\0"
- VALUE "ProductDate", "Fri, 20 Sep 2013 01:02:02 GMT\0"
+ VALUE "ProductDate", "Fri, 04 Oct 2013 07:52:49 GMT\0"
END
END
--- a/mingwmake.bat Thu Oct 03 20:07:05 2013 +0100
+++ b/mingwmake.bat Fri Oct 04 08:59:25 2013 +0100
@@ -14,20 +14,6 @@
make.exe -N -f bc.mak %DEFINES% %USEMINGW_ARG% %*
@echo "***********************************"
-@echo "Buildung stx/libjava/examples/jabber
-@echo "***********************************"
-@cd examples\jabber
-@call mingwmake %1 %2
-@cd ..\..
-
-@echo "***********************************"
-@echo "Buildung stx/libjava/examples
-@echo "***********************************"
-@cd examples
-@call mingwmake %1 %2
-@cd ..
-
-@echo "***********************************"
@echo "Buildung stx/libjava/tools
@echo "***********************************"
@cd tools
--- a/stx_libjava.st Thu Oct 03 20:07:05 2013 +0100
+++ b/stx_libjava.st Fri Oct 04 08:59:25 2013 +0100
@@ -160,7 +160,6 @@
(the browser has a menu function for that)"
^ #(
- #'stx:goodies/sunit' "TestAsserter - superclass of JavaByteCodeProcessorTests "
#'stx:libbasic' "AbstractNumberVector - extended "
#'stx:libbasic2' "BitArray - extended "
#'stx:libbasic3' "WrappedMethod - extended "
@@ -177,6 +176,7 @@
exclude individual packages in the #excludedFromPreRequisites method."
^ #(
+ #'stx:goodies/sunit' "TestSuite - referenced by JavaTestsLoader class>>buildSuiteFrom: "
#'stx:libcomp' "BlockNode - referenced by JavaNativeMethod>>numberOfArgs: "
#'stx:libhtml' "URL - referenced by JavaEmbeddedFrameView>>setupAppletFrameIn:initializeJava: "
#'stx:libtool' "DebugView - referenced by Java class>>flushClasses "
@@ -193,9 +193,8 @@
for those, redefine requiredPrerequisites"
^ #(
- #'stx:libjava/examples'
+ #'stx:libjava/tools'
#'stx:libjava/experiments'
- #'stx:libjava/tools'
)
! !
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/GroovySourceHighlighter.st Fri Oct 04 08:59:25 2013 +0100
@@ -0,0 +1,718 @@
+"
+ COPYRIGHT (c) 1996-2011 by Claus Gittinger
+
+ New code and modifications done at SWING Research Group [1]:
+
+ COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
+ SWING Research Group, Czech Technical University in Prague
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice. This software may not
+ be provided or otherwise made available to, or used by, any
+ other person. No title to or ownership of the software is
+ hereby transferred.
+
+ [1] Code written at SWING Research Group contains a signature
+ of one of the above copright owners. For exact set of such code,
+ see the differences between this version and version stx:libjava
+ as of 1.9.2010
+"
+"{ Package: 'stx:libjava/tools' }"
+
+Object subclass:#GroovySourceHighlighter
+ instanceVariableNames:'preferences cachedStringEmphasis cachedStringColor sourceText
+ sourceIndex'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'Languages-Groovy-Tools-Source'
+!
+
+JavaScanner subclass:#Scanner
+ instanceVariableNames:'buffer bufferFirst bufferLast highlighter'
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:GroovySourceHighlighter
+!
+
+!GroovySourceHighlighter class methodsFor:'documentation'!
+
+copyright
+"
+ COPYRIGHT (c) 1996-2011 by Claus Gittinger
+
+ New code and modifications done at SWING Research Group [1]:
+
+ COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
+ SWING Research Group, Czech Technical University in Prague
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice. This software may not
+ be provided or otherwise made available to, or used by, any
+ other person. No title to or ownership of the software is
+ hereby transferred.
+
+ [1] Code written at SWING Research Group contains a signature
+ of one of the above copright owners. For exact set of such code,
+ see the differences between this version and version stx:libjava
+ as of 1.9.2010
+
+"
+!
+
+documentation
+"
+ A syntax highligter for Groovy. This highlighter is SmallSense-aware and
+ supports incremental highlighting, however, it does only lexical highlighting.
+
+ [author:]
+ Jan Vrany <jan.vrany@fit.cvut.cz>
+
+ [instance variables:]
+
+ [class variables:]
+
+ [see also:]
+
+"
+! !
+
+!GroovySourceHighlighter class methodsFor:'formatting'!
+
+formatClass: javaClass
+
+ ^self new formatClassDefinition: javaClass source in: javaClass
+
+ "Created: / 15-12-2011 / 21:54:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatClassDefinition:source in:class
+
+ ^self new formatClassDefinition:source in:class
+
+ "Created: / 04-08-2011 / 23:44:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatClassDefinition:source in:class elementsInto: elements
+
+ ^self new formatClassDefinition:source in:class elementsInto: elements
+
+ "Created: / 04-08-2011 / 23:44:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatExpression:source in:class
+
+ ^self new formatExpression:source in:class
+
+ "Created: / 04-08-2011 / 23:45:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatExpression:source in:class elementsInto: elements
+
+ ^self new formatExpression:source in:class elementsInto: elements
+
+ "Created: / 04-08-2011 / 23:43:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatMethod:source in:class
+
+ ^self formatMethod: nil source: source in: class using: UserPreferences current
+
+ "Created: / 02-10-2013 / 14:37:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatMethod:source in:class using: preferences
+
+ ^self new formatMethod:nil source:source in:class using: preferences
+
+ "Created: / 02-10-2013 / 14:37:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatMethod:mth source:source in:class
+
+ ^self formatMethod: mth source: source in: class using: UserPreferences current
+
+ "Created: / 11-02-2012 / 18:18:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatMethod:mth source:source in:class using: preferences
+
+ ^self new formatMethod:mth source:source in:class using: preferences
+
+ "Created: / 04-08-2011 / 23:45:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatMethod:mth source:source in:class using: preferences elementsInto: elements
+
+ ^self new formatMethod:mth source:source in:class using: preferences elementsInto: elements
+
+ "Created: / 04-08-2011 / 23:42:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!GroovySourceHighlighter methodsFor:'formatting'!
+
+formatClassDefinition:source in:class
+ preferences isNil ifTrue:[
+ preferences := UserPreferences current.
+ ].
+ ^ self format: source
+
+ "Created: / 04-08-2011 / 23:44:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (format): / 02-10-2013 / 14:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatClassDefinition:source in:class elementsInto: els
+
+ sourceIndex := els.
+ ^self formatClassDefinition:source in:class
+
+ "Created: / 04-08-2011 / 23:44:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatExpression:source in:class
+
+ preferences isNil ifTrue:[
+ preferences := UserPreferences current.
+ ].
+ ^ self format: source
+
+ "Created: / 04-08-2011 / 23:45:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 02-10-2013 / 14:41:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatExpression:source in:class elementsInto: els
+
+ sourceIndex := els.
+ ^self formatExpression:source in:class
+
+ "Created: / 04-08-2011 / 23:43:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatMethod:mth source:source in:class using: prefs
+ preferences := prefs.
+ preferences isNil ifTrue:[
+ preferences := UserPreferences current.
+ ].
+ ^ self format: source
+
+ "Created: / 04-08-2011 / 23:45:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 02-10-2013 / 14:41:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatMethod:mth source:source in:class using: prefs elementsInto: els
+
+ preferences := prefs.
+ sourceIndex := els.
+ ^self formatMethod:mth source:source in:class using: prefs
+
+ "Created: / 04-08-2011 / 23:42:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+formatMethod:mthd source:newCode line: line number: lnr in:cls using:syntaxPreferences
+ | scanner |
+
+ line isEmptyOrNil ifTrue:[ ^ nil ].
+
+ sourceText := line asText.
+ preferences := syntaxPreferences.
+ preferences isNil ifTrue:[
+ preferences := UserPreferences current.
+ ].
+ scanner := Scanner for: line asString.
+ scanner highlighter: self.
+ [
+ [ scanner nextToken ~~ #EOF ] whileTrue.
+ ] on: Error do:[
+
+ ].
+ ^ sourceText
+
+ "Created: / 04-08-2013 / 00:26:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!GroovySourceHighlighter methodsFor:'formatting-private'!
+
+format: source
+ "Simple formatting based on lexical structure only"
+
+ | scanner token lastToken0 lastToken1 lastValue0 lastValue1 lastPosition0 lastPosition1 |
+ sourceText := source asText.
+ scanner := Scanner for: source string.
+ scanner highlighter: self.
+ [
+ [ (token := scanner nextToken) ~~ #EOF ] whileTrue:[
+ "/ Here, try to guess what's selector...
+ token == $( ifTrue:[
+ lastPosition0 == #Identifier ifTrue:[
+ self markSelectorFrom: lastPosition0 to: lastPosition0 + lastValue0 size - 1.
+ ].
+ ].
+
+ lastToken1 := lastToken0.
+ lastValue1 := lastValue0.
+ lastPosition1 := lastPosition0.
+
+ lastToken0 := token.
+ lastValue0 := scanner tokenValue.
+ lastPosition0 := scanner tokenStartPosition.
+ ].
+ ] on: Error do:[:ex|
+ ].
+ ^ 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>"
+! !
+
+!GroovySourceHighlighter methodsFor:'queries'!
+
+doLexicalHighlightingOnly
+ ^ true
+
+ "Created: / 09-09-2013 / 02:25:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 02-10-2013 / 14:28:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!GroovySourceHighlighter methodsFor:'syntax detection'!
+
+markArgumentIdentifierFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences argumentIdentifierEmphasis) color:(preferences argumentIdentifierColor)
+!
+
+markBadIdentifierFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences badIdentifierEmphasis)
+ color:(preferences badIdentifierColor)
+!
+
+markClassVariableIdentifierFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences classVariableIdentifierEmphasis) color:(preferences classVariableIdentifierColor)
+
+ "Modified: / 31.3.1998 / 18:02:14 / cg"
+!
+
+markCommentFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences commentEmphasis) color:(preferences commentColor)
+!
+
+markConstantFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences constantEmphasis) color:(preferences constantColor)
+!
+
+markFrom:pos1 to:pos2 withEmphasis:fontEmp color:clrIn
+ |e p2 clr|
+
+ clr := clrIn onDevice:Screen current.
+
+ clr = Color black ifTrue:[
+ e := fontEmp
+ ] ifFalse:[
+ fontEmp isNil ifTrue:[
+ e := (#color->clr)
+ ] ifFalse:[
+ e := Text addEmphasis:fontEmp to:(#color->clr).
+ ]
+ ].
+ (p2 := pos2) isNil ifTrue:[
+ p2 := sourceText size
+ ] ifFalse:[
+ p2 := p2 min:sourceText size
+ ].
+ sourceText emphasizeFrom:pos1 to:p2 with:e
+
+ "Created: / 31.3.1998 / 13:26:53 / cg"
+ "Modified: / 1.4.1998 / 12:51:56 / cg"
+!
+
+markFunctionNameFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences methodSelectorEmphasis) color:(preferences methodSelectorColor)
+!
+
+markGlobalClassIdentifierFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences globalClassIdentifierEmphasis) color:(preferences globalClassIdentifierColor)
+
+ "Modified: / 31.3.1998 / 18:02:14 / cg"
+ "Created: / 4.3.1999 / 12:53:02 / cg"
+!
+
+markGlobalIdentifierFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences globalIdentifierEmphasis) color:(preferences globalIdentifierColor)
+
+ "Modified: / 31.3.1998 / 18:02:14 / cg"
+!
+
+markIdentifierFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences identifierEmphasis) color:(preferences identifierColor)
+!
+
+markInstVarIdentifierFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences instVarIdentifierEmphasis) color:(preferences instVarIdentifierColor)
+
+ "Created: / 16.4.1998 / 18:35:40 / cg"
+ "Modified: / 16.4.1998 / 18:37:30 / cg"
+!
+
+markKeyword:kw from:pos1 to:pos2
+ |em clr|
+
+ ( #( 'if' 'else'
+ 'while'
+ 'for'
+ 'do'
+ 'return'
+ 'continue'
+ 'break'
+ ) includes:kw) ifTrue:[
+ em := preferences controlFlowSelectorEmphasis.
+ clr := preferences controlFlowSelectorColor.
+ ] ifFalse:[
+ em := preferences jsKeywordEmphasis.
+ clr := preferences jsKeywordColor.
+ ].
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:em color:clr
+
+ "Modified: / 19-05-2010 / 15:07:59 / cg"
+ "Modified: / 07-08-2013 / 00:28:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+markKeywordFlowFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:preferences controlFlowSelectorEmphasis
+ color:preferences controlFlowSelectorColor
+
+ "Created: / 05-09-2013 / 03:09:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+markKeywordFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:preferences jsKeywordEmphasis
+ color:preferences jsKeywordColor
+
+ "Created: / 05-09-2013 / 03:09:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+markLocalIdentifierFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences localIdentifierEmphasis) color:(preferences localIdentifierColor)
+!
+
+markProblem: problem from:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences badIdentifierEmphasis)
+ color:(preferences badIdentifierColor)
+
+ "Created: / 15-04-2013 / 22:23:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+markSelector:selectorString from:pos1 to:pos2
+ | fg em |
+
+ fg := preferences selectorColor.
+ em := preferences selectorEmphasis.
+
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:em color:fg
+
+ "Modified: / 04-10-2011 / 19:48:48 / cg"
+ "Modified: / 17-03-2012 / 13:26:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Created: / 17-03-2012 / 19:12:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+markSelector:selectorString from:pos1 to:pos2 receiverNode:aReceiverNodeOrNil numArgs:numArgs
+ |fg selectorSymbol check ok rec em currentEnvironment currentSuperclasses currentSubclasses classToCompileFor fullSelectorCheck|
+
+ fg := preferences selectorColor.
+ em := preferences selectorEmphasis.
+
+"/ (currentEnvironment notNil
+"/ and:[ (((currentEnvironment _localVariables ? #()) contains:[:local | local name = selectorString])
+"/ or:[((currentEnvironment _argVariables ? #()) contains:[:local | local name = selectorString])])
+"/ ])
+"/ ifTrue:[
+"/ "/ a local call
+"/ ] ifFalse:[
+"/ selectorSymbol := (self translatedSmalltalkSelectorFor:selectorString numArgs:numArgs) asSymbolIfInterned.
+"/ selectorSymbol isNil ifTrue:[
+"/ fg := Color red.
+"/ ] ifFalse:[
+"/ fullSelectorCheck == true ifTrue:[
+"/ aReceiverNodeOrNil notNil ifTrue:[
+"/ check := [:cls | (cls includesSelector:selectorSymbol)
+"/ or:[cls class includesSelector:selectorSymbol]].
+"/
+"/ ok := false.
+"/
+"/ "/ limit search if possible
+"/ (classToCompileFor notNil
+"/ and:[aReceiverNodeOrNil isSelf or:[aReceiverNodeOrNil isSuper]]) ifTrue:[
+"/ currentSuperclasses isNil ifTrue:[
+"/ currentSuperclasses := classToCompileFor withAllSuperclasses.
+"/ ].
+"/ ok := currentSuperclasses contains:check.
+"/ (ok not and:[aReceiverNodeOrNil isSelf]) ifTrue:[
+"/ currentSubclasses isNil ifTrue:[
+"/ currentSubclasses := classToCompileFor allSubclasses.
+"/ ].
+"/ ok := currentSubclasses contains:check.
+"/ ].
+"/ ] ifFalse:[
+"/ aReceiverNodeOrNil isConstant ifTrue:[
+"/ ok := aReceiverNodeOrNil evaluate class withAllSuperclasses contains:check.
+"/ ] ifFalse:[
+"/ (aReceiverNodeOrNil isGlobal
+"/ and:[(rec := aReceiverNodeOrNil evaluate) isBehavior]) ifTrue:[
+"/ ok := rec class withAllSuperclasses contains:check.
+"/ ] ifFalse:[
+"/ ok := Smalltalk allClasses contains:check
+"/ ]
+"/ ]
+"/ ].
+"/
+"/ ok ifFalse:[
+"/ em := preferences unimplementedSelectorEmphasis.
+"/ fg := preferences unimplementedSelectorColor.
+"/ ]
+"/ ]
+"/ ]
+"/ ].
+"/ ].
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:em color:fg
+
+ "Modified: / 04-10-2011 / 19:48:48 / cg"
+ "Modified: / 17-03-2012 / 13:26:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+markSelectorFrom:pos1 to:pos2
+ | fg em |
+
+ fg := preferences selectorColor.
+ em := preferences selectorEmphasis.
+
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:em color:fg
+
+ "Created: / 11-09-2013 / 05:01:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+markSelfFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences selfEmphasis) color:(preferences selfColor)
+!
+
+markStringFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences stringEmphasis) color:(preferences stringColor)
+!
+
+markUnknownIdentifierFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:(preferences unknownIdentifierEmphasis) color:(preferences unknownIdentifierColor)
+!
+
+markVariable:v from:pos to:endPos
+ "support for syntaxColoring"
+
+ |type globalValue nameSym|
+
+ type := v type.
+ (type == #BlockArg
+ or:[type == #MethodArg]) ifTrue:[
+ self markArgumentIdentifierFrom:pos to:endPos.
+ ^ self
+ ].
+ (type == #BlockVariable
+ or:[type == #MethodVariable]) ifTrue:[
+ self markLocalIdentifierFrom:pos to:endPos.
+ ^ self
+ ].
+ (type == #GlobalVariable) ifTrue:[
+ nameSym := v name asSymbolIfInterned.
+ (nameSym isNil
+ or:[(Smalltalk includesKey:nameSym) not]) ifTrue:[
+ self markUnknownIdentifierFrom:pos to:endPos.
+ ^ self
+ ].
+ globalValue := Smalltalk at:nameSym ifAbsent:nil.
+ globalValue isBehavior ifTrue:[
+ self markGlobalClassIdentifierFrom:pos to:endPos.
+ ] ifFalse:[
+ self markGlobalIdentifierFrom:pos to:endPos.
+ ].
+ ^ self
+ ].
+ (type == #ClassVariable) ifTrue:[
+ self markClassVariableIdentifierFrom:pos to:endPos.
+ ^ self
+ ].
+ (type == #InstanceVariable) ifTrue:[
+ self markInstVarIdentifierFrom:pos to:endPos.
+ ^ self
+ ].
+
+ self markIdentifierFrom:pos to:endPos.
+
+ "Created: / 16.4.1998 / 18:49:34 / cg"
+ "Modified: / 4.3.1999 / 12:56:13 / cg"
+! !
+
+!GroovySourceHighlighter::Scanner methodsFor:'accessing'!
+
+highlighter
+ ^ highlighter
+!
+
+highlighter:aGroovySyntaxHighlighter
+ highlighter := aGroovySyntaxHighlighter.
+! !
+
+!GroovySourceHighlighter::Scanner methodsFor:'error handling'!
+
+syntaxError:aMessage position:position to:endPos
+ "a syntax error happened"
+
+ endPos notNil ifTrue:[
+ highlighter markBadIdentifierFrom:position to: endPos.
+ ]
+
+ "Created: / 13-04-2012 / 18:31:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!GroovySourceHighlighter::Scanner methodsFor:'initialization'!
+
+initialize
+ "initialize the scanner"
+
+ super initialize.
+ saveComments := true.
+ buffer := Array new: 3.
+ bufferFirst := 1.
+ bufferLast := 0.
+
+ "Created: / 17-03-2012 / 00:02:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 01-09-2013 / 18:51:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!GroovySourceHighlighter::Scanner methodsFor:'private'!
+
+checkForKeyword:string
+ | isKW |
+
+ isKW := super checkForKeyword:string.
+ isKW ifTrue:[
+ highlighter markKeyword:string from:tokenStartPosition + 1 to:tokenStartPosition + string size.
+ ^ true.
+ ].
+
+ (#( "/ Extra groovy keywords
+ 'def'
+ ) includes: string) ifTrue:[
+ highlighter markKeyword:string from:tokenStartPosition + 1 to:tokenStartPosition + string size.
+ ^ true.
+ ].
+ ^ false
+
+ "Created: / 17-03-2012 / 00:15:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 02-10-2013 / 14:44:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!GroovySourceHighlighter::Scanner methodsFor:'reading next token'!
+
+nextToken
+ | t |
+
+ t := super nextToken.
+ t == #String ifTrue:[
+ highlighter markStringFrom:tokenStartPosition + 1 to: tokenEndPosition + 1.
+ ] ifFalse:[
+ t == #Integer ifTrue:[
+ highlighter markConstantFrom:tokenStartPosition + 1 to: tokenEndPosition + 1.
+ ]].
+ bufferLast := (bufferLast \\ buffer size) + 1.
+ bufferLast == bufferFirst ifTrue:[
+ bufferFirst := (bufferFirst \\ buffer size) + 1.
+ ].
+ buffer at: bufferLast put: self token.
+ "/ Now, do a quick check for some common token sequences...not a full parsing,
+ "/ but helps a bit
+ ((bufferLast - bufferFirst) \\ 10) > 2 ifTrue:[
+ "/ Quick check for method call sequence...
+"/ t == $( ifTrue:[
+"/
+"/ ((buffer at:(bufferLast - 1) \\ buffer size) type == #Identifier
+"/ and:[(buffer at:(bufferLast - 2) \\ buffer size) type == $.
+"/ and:[(buffer at:(bufferLast - 1) \\ buffer size) value first isLowercase]])
+"/ ifTrue:[
+"/ | nameToken |
+"/
+"/ nameToken := (buffer at:(bufferLast - 1) \\ buffer size).
+"/ highlighter markSelector: nameToken value from: nameToken startPosition to: nameToken endPosition.
+"/ ^ t
+"/ ].
+"/ ].
+ "/ Add more patterns here
+ ].
+
+ ^ t
+
+ "Created: / 14-05-1998 / 15:48:04 / cg"
+ "Modified: / 16-05-1998 / 19:12:29 / cg"
+ "Created: / 17-03-2012 / 19:15:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 02-09-2013 / 00:04:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+skipComment
+ super skipComment.
+ highlighter markCommentFrom:((tokenStartPosition + 1) max: 1) to: source position.
+ ^nil
+
+ "Created: / 17-03-2012 / 00:04:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+skipEOLComment
+ super skipEOLComment.
+ highlighter markCommentFrom:((tokenStartPosition - 1) max: 1) to: source position.
+ ^nil
+
+ "Created: / 17-03-2012 / 00:05:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!GroovySourceHighlighter class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+
--- a/tools/JavaSourceHighlighter.st Thu Oct 03 20:07:05 2013 +0100
+++ b/tools/JavaSourceHighlighter.st Fri Oct 04 08:59:25 2013 +0100
@@ -211,9 +211,74 @@
formatClassDefinition:source in:class
- ^ self format: source kind: #start in: class
+
+ | marker cacheIt document sourceUnit parser tree |
+
+ "Optimization - if full class source is to be formatted,
+ consult cache - when browsing the code or debugging, very
+ often same same source is to be highlighted"
+
+ preferences isNil ifTrue:[
+ preferences := UserPreferences current.
+ ].
+ cacheIt := class notNil and:[class isJavaClass].
+ cacheIt ifTrue:[
+ document := JavaSourceDocument cachedDocumentFor: class theNonMetaclass.
+ document notNil ifTrue:[
+ (document sourceText notNil and:[document sourceText string = source]) ifTrue:[
+ (sourceIndex notNil and:[document sourceTreeIndex notNil]) ifTrue:[
+ sourceIndex addAll: document sourceTreeIndex.
+ ].
+ ^ document sourceText copy.
+ ].
+ ] ifFalse:[
+ document := JavaSourceDocument for: class theNonMetaclass.
+ (sourceIndex isNil and:[SmallSense::ParseTreeIndex notNil]) ifTrue:[
+ sourceIndex := SmallSense::ParseTreeIndex new.
+ ].
+ JavaSourceDocument cachedDocumentFor: class theNonMetaclass put: document.
+ ].
+ ].
+ marker := Marker new.
+ marker highlighter: self.
+
+ sourceText := source isText
+ ifTrue:[source copy]
+ ifFalse:[source asText].
+
+ self doLexicalHighlightingOnly ifTrue:[
+ sourceText := self format: source string.
+ ] ifFalse:[
+ sourceUnit := (Java classForName:'stx.libjava.tools.Source') new.
+ sourceUnit setContents: source string.
+ JavaCompiler synchronized:[
+ parser := (Java classForName:'stx.libjava.tools.text.Highlighter') new.
+ ].
+ parser setMarker: marker.
+ (sourceIndex notNil and:[sourceIndex isKindOf: SmallSense::ParseTreeIndex]) ifTrue:[
+ | indexer |
+
+ indexer := Indexer new.
+ indexer index: sourceIndex.
+ parser setIndexer: indexer.
+
+ ].
+ tree := parser parse: sourceUnit diet: false resolve: true.
+ (sourceIndex notNil and:[sourceIndex isKindOf: SmallSense::ParseTreeIndex]) ifTrue:[
+ sourceIndex tree: tree.
+ ]
+ ].
+
+ ^ cacheIt ifTrue:[
+ document sourceText: sourceText.
+ document sourceTreeIndex: sourceIndex.
+ sourceText copy
+ ] ifFalse:[
+ sourceText
+ ]
"Created: / 04-08-2011 / 23:44:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 03-10-2013 / 20:12:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
formatClassDefinition:source in:class elementsInto: els
@@ -225,12 +290,10 @@
!
formatExpression:source in:class
-
-"/ self breakPoint:#jv.
- ^source.
- ^ self format: source kind: #'K_EXPRESSION' in: class
+ ^ self format: source
"Created: / 04-08-2011 / 23:45:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 03-10-2013 / 20:19:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
formatExpression:source in:class elementsInto: els
@@ -242,8 +305,6 @@
!
formatMethod:mth source:source in:class using: prefs
- | scanner |
-
preferences := prefs.
preferences isNil ifTrue:[
preferences := UserPreferences current.
@@ -256,13 +317,7 @@
sourceText := source asText.
self doLexicalHighlightingOnly ifTrue:[
- scanner := Scanner for: source string.
- scanner highlighter: self.
- [
- [ scanner nextToken ~~ #EOF ] whileTrue.
- ] on: Error do:[:ex|
- ex
- ].
+ sourceText := self format: source
] ifFalse:[
| document type parser marker nodes debug |
@@ -291,7 +346,7 @@
^ sourceText
"Created: / 04-08-2011 / 23:45:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 25-09-2013 / 22:32:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (format): / 03-10-2013 / 20:20:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
formatMethod:mth source:source in:class using: prefs elementsInto: els
@@ -325,86 +380,37 @@
"Created: / 04-08-2013 / 00:26:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
-!JavaSourceHighlighter methodsFor:'formatting - private'!
-
-format: source kind: kind in: class
-
- | scanner marker cacheIt document sourceUnit parser tree |
-
- "Optimization - if full class source is to be formatted,
- consult cache - when browsing the code or debugging, very
- often same same source is to be highlighted"
+!JavaSourceHighlighter methodsFor:'formatting-private'!
- preferences isNil ifTrue:[
- preferences := UserPreferences current.
- ].
- cacheIt := kind == #start and: [class notNil and:[class isJavaClass]].
- cacheIt ifTrue:[
- document := JavaSourceDocument cachedDocumentFor: class theNonMetaclass.
- document notNil ifTrue:[
- (document sourceText notNil and:[document sourceText string = source]) ifTrue:[
- (sourceIndex notNil and:[document sourceTreeIndex notNil]) ifTrue:[
- sourceIndex addAll: document sourceTreeIndex.
- ].
- ^ document sourceText copy.
- ].
- ] ifFalse:[
- document := JavaSourceDocument for: class theNonMetaclass.
- (sourceIndex isNil and:[SmallSense::ParseTreeIndex notNil]) ifTrue:[
- sourceIndex := SmallSense::ParseTreeIndex new.
- ].
- JavaSourceDocument cachedDocumentFor: class theNonMetaclass put: document.
- ].
- ].
- marker := Marker new.
- marker highlighter: self.
-
- sourceText := source isText
- ifTrue:[source copy]
- ifFalse:[source asText].
+format: source
+ "Simple formatting based on lexical structure only"
- self doLexicalHighlightingOnly ifTrue:[
- scanner := Scanner for: source string.
- scanner highlighter: self.
- [
- [ scanner nextToken ~~ #EOF ] whileTrue.
- ] on: Error do:[:ex|
- ].
- ] ifFalse:[
- sourceUnit := (Java classForName:'stx.libjava.tools.Source') new.
- sourceUnit setContents: source string.
- JavaCompiler synchronized:[
- parser := (Java classForName:'stx.libjava.tools.text.Highlighter') new.
- ].
- parser setMarker: marker.
- (sourceIndex notNil and:[sourceIndex isKindOf: SmallSense::ParseTreeIndex]) ifTrue:[
- | indexer |
-
- indexer := Indexer new.
- indexer index: sourceIndex.
- parser setIndexer: indexer.
+ | scanner token lastToken0 lastToken1 lastValue0 lastValue1 lastPosition0 lastPosition1 |
+ sourceText := source asText.
+ scanner := Scanner for: source string.
+ scanner highlighter: self.
+ [
+ [ (token := scanner nextToken) ~~ #EOF ] whileTrue:[
+ "/ Here, try to guess what's selector...
+ token == $( ifTrue:[
+ lastPosition0 == #Identifier ifTrue:[
+ self markSelectorFrom: lastPosition0 to: lastPosition0 + lastValue0 size - 1.
+ ].
+ ].
- ].
- tree := parser parse: sourceUnit diet: false resolve: true.
- (sourceIndex notNil and:[sourceIndex isKindOf: SmallSense::ParseTreeIndex]) ifTrue:[
- sourceIndex tree: tree.
- ]
- ].
-
-
-
-
+ lastToken1 := lastToken0.
+ lastValue1 := lastValue0.
+ lastPosition1 := lastPosition0.
- ^ cacheIt ifTrue:[
- document sourceText: sourceText.
- document sourceTreeIndex: sourceIndex.
- sourceText copy
- ] ifFalse:[
- sourceText
- ]
+ lastToken0 := token.
+ lastValue0 := scanner tokenValue.
+ lastPosition0 := scanner tokenStartPosition.
+ ].
+ ] on: Error do:[:ex|
+ ].
+ ^ sourceText
- "Created: / 17-03-2012 / 14:02:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 03-10-2013 / 18:36:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Created: / 03-10-2013 / 20:19:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!JavaSourceHighlighter methodsFor:'queries'!
@@ -1024,15 +1030,15 @@
t == #Integer ifTrue:[
highlighter markConstantFrom:tokenStartPosition + 1 to: tokenEndPosition + 1.
]].
- bufferLast := (bufferLast \\ buffer size) + 1.
- bufferLast == bufferFirst ifTrue:[
- bufferFirst := (bufferFirst \\ buffer size) + 1.
- ].
- buffer at: bufferLast put: self token.
- "/ Now, do a quick check for some common token sequences...not a full parsing,
- "/ but helps a bit
- ((bufferLast - bufferFirst) \\ 10) > 2 ifTrue:[
- "/ Quick check for method call sequence...
+"/ bufferLast := (bufferLast \\ buffer size) + 1.
+"/ bufferLast == bufferFirst ifTrue:[
+"/ bufferFirst := (bufferFirst \\ buffer size) + 1.
+"/ ].
+"/ buffer at: bufferLast put: self token.
+"/ "/ Now, do a quick check for some common token sequences...not a full parsing,
+"/ "/ but helps a bit
+"/ ((bufferLast - bufferFirst) \\ 10) > 2 ifTrue:[
+"/ "/ Quick check for method call sequence...
"/ t == $( ifTrue:[
"/
"/ ((buffer at:(bufferLast - 1) \\ buffer size) type == #Identifier
@@ -1046,15 +1052,15 @@
"/ ^ t
"/ ].
"/ ].
- "/ Add more patterns here
- ].
+"/ "/ Add more patterns here
+"/ ].
^ t
"Created: / 14-05-1998 / 15:48:04 / cg"
"Modified: / 16-05-1998 / 19:12:29 / cg"
"Created: / 17-03-2012 / 19:15:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 02-09-2013 / 00:04:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 03-10-2013 / 20:25:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
skipComment
--- a/tools/Make.proto Thu Oct 03 20:07:05 2013 +0100
+++ b/tools/Make.proto Fri Oct 04 08:59:25 2013 +0100
@@ -194,6 +194,7 @@
$(OUTDIR)JavaParserII.$(O) JavaParserII.$(H): JavaParserII.st $(INCLUDE_TOP)/stx/libjava/tools/JavaParserI.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPCompositeParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPDelegateParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPParser.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)JavaScanner.$(O) JavaScanner.$(H): JavaScanner.st $(INCLUDE_TOP)/stx/libjava/tools/JavaScannerBase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)JavaSourceFile.$(O) JavaSourceFile.$(H): JavaSourceFile.st $(INCLUDE_TOP)/stx/libjava/tools/JavaParseNode.$(H) $(INCLUDE_TOP)/stx/libcomp/ParseNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)GroovySourceHighlighter.$(O) GroovySourceHighlighter.$(H): GroovySourceHighlighter.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaScanner.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaScannerBase.$(H) $(STCHDR)
$(OUTDIR)JavaMethodLikeDeclarationNode.$(O) JavaMethodLikeDeclarationNode.$(H): JavaMethodLikeDeclarationNode.st $(INCLUDE_TOP)/stx/libjava/tools/JavaDeclarationNode.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaParseNode.$(H) $(INCLUDE_TOP)/stx/libcomp/ParseNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)JavaParser.$(O) JavaParser.$(H): JavaParser.st $(INCLUDE_TOP)/stx/libjava/tools/JavaParserII.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaParserI.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPCompositeParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPDelegateParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPParser.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)JavaSourceHighlighter.$(O) JavaSourceHighlighter.$(H): JavaSourceHighlighter.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaScanner.$(H) $(INCLUDE_TOP)/stx/libjava/tools/JavaScannerBase.$(H) $(STCHDR)
--- a/tools/Make.spec Thu Oct 03 20:07:05 2013 +0100
+++ b/tools/Make.spec Fri Oct 04 08:59:25 2013 +0100
@@ -78,6 +78,7 @@
JavaParserII \
JavaScanner \
JavaSourceFile \
+ GroovySourceHighlighter \
JavaMethodLikeDeclarationNode \
JavaParser \
JavaSourceHighlighter \
@@ -122,6 +123,7 @@
$(OUTDIR_SLASH)JavaParserII.$(O) \
$(OUTDIR_SLASH)JavaScanner.$(O) \
$(OUTDIR_SLASH)JavaSourceFile.$(O) \
+ $(OUTDIR_SLASH)GroovySourceHighlighter.$(O) \
$(OUTDIR_SLASH)JavaMethodLikeDeclarationNode.$(O) \
$(OUTDIR_SLASH)JavaParser.$(O) \
$(OUTDIR_SLASH)JavaSourceHighlighter.$(O) \
--- a/tools/abbrev.stc Thu Oct 03 20:07:05 2013 +0100
+++ b/tools/abbrev.stc Fri Oct 04 08:59:25 2013 +0100
@@ -35,6 +35,7 @@
JavaParserII JavaParserII stx:libjava/tools 'Languages-Java-Parser' 0
JavaScanner JavaScanner stx:libjava/tools 'Languages-Java-Parser' 3
JavaSourceFile JavaSourceFile stx:libjava/tools 'Languages-Java-Parser-AST' 0
+GroovySourceHighlighter GroovySourceHighlighter stx:libjava/tools 'Languages-Groovy-Tools-Source' 0
JavaMethodLikeDeclarationNode JavaMethodLikeDeclarationNode stx:libjava/tools 'Languages-Java-Parser-AST' 0
JavaParser JavaParser stx:libjava/tools 'Languages-Java-Parser' 0
JavaSourceHighlighter JavaSourceHighlighter stx:libjava/tools 'Languages-Java-Tools-Source' 0
--- a/tools/bc.mak Thu Oct 03 20:07:05 2013 +0100
+++ b/tools/bc.mak Fri Oct 04 08:59:25 2013 +0100
@@ -118,6 +118,7 @@
$(OUTDIR)JavaParserII.$(O) JavaParserII.$(H): JavaParserII.st $(INCLUDE_TOP)\stx\libjava\tools\JavaParserI.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPCompositeParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPDelegateParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPParser.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)JavaScanner.$(O) JavaScanner.$(H): JavaScanner.st $(INCLUDE_TOP)\stx\libjava\tools\JavaScannerBase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)JavaSourceFile.$(O) JavaSourceFile.$(H): JavaSourceFile.st $(INCLUDE_TOP)\stx\libjava\tools\JavaParseNode.$(H) $(INCLUDE_TOP)\stx\libcomp\ParseNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)GroovySourceHighlighter.$(O) GroovySourceHighlighter.$(H): GroovySourceHighlighter.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaScanner.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaScannerBase.$(H) $(STCHDR)
$(OUTDIR)JavaMethodLikeDeclarationNode.$(O) JavaMethodLikeDeclarationNode.$(H): JavaMethodLikeDeclarationNode.st $(INCLUDE_TOP)\stx\libjava\tools\JavaDeclarationNode.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaParseNode.$(H) $(INCLUDE_TOP)\stx\libcomp\ParseNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)JavaParser.$(O) JavaParser.$(H): JavaParser.st $(INCLUDE_TOP)\stx\libjava\tools\JavaParserII.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaParserI.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPCompositeParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPDelegateParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPParser.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)JavaSourceHighlighter.$(O) JavaSourceHighlighter.$(H): JavaSourceHighlighter.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaScanner.$(H) $(INCLUDE_TOP)\stx\libjava\tools\JavaScannerBase.$(H) $(STCHDR)
--- a/tools/libInit.cc Thu Oct 03 20:07:05 2013 +0100
+++ b/tools/libInit.cc Fri Oct 04 08:59:25 2013 +0100
@@ -55,6 +55,7 @@
_JavaParserII_Init(pass,__pRT__,snd);
_JavaScanner_Init(pass,__pRT__,snd);
_JavaSourceFile_Init(pass,__pRT__,snd);
+_GroovySourceHighlighter_Init(pass,__pRT__,snd);
_JavaMethodLikeDeclarationNode_Init(pass,__pRT__,snd);
_JavaParser_Init(pass,__pRT__,snd);
_JavaSourceHighlighter_Init(pass,__pRT__,snd);
--- a/tools/stx_libjava_tools.st Thu Oct 03 20:07:05 2013 +0100
+++ b/tools/stx_libjava_tools.st Fri Oct 04 08:59:25 2013 +0100
@@ -70,7 +70,7 @@
exclude individual packages in the #excludedFromPreRequisites method."
^ #(
- #'jv:smallsense' "SmallSense::ParseTreeIndex - referenced by JavaSourceHighlighter>>format:kind:in: "
+ #'jv:smallsense' "SmallSense::ParseTreeIndex - referenced by JavaSourceHighlighter>>formatClassDefinition:in: "
#'stx:libbasic2' "BackgroundQueueProcessingJob - referenced by JavaSourceDocument class>>initialize "
)
!
@@ -178,6 +178,7 @@
JavaParserII
JavaScanner
JavaSourceFile
+ GroovySourceHighlighter
JavaMethodLikeDeclarationNode
JavaParser
JavaSourceHighlighter
--- a/tools/tools.rc Thu Oct 03 20:07:05 2013 +0100
+++ b/tools/tools.rc Fri Oct 04 08:59:25 2013 +0100
@@ -3,7 +3,7 @@
// automagically generated from the projectDefinition: stx_libjava_tools.
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 6,2,18408,18408
+ FILEVERSION 6,2,32767,32767
PRODUCTVERSION 6,2,3,0
#if (__BORLANDC__)
FILEFLAGSMASK VS_FF_DEBUG | VS_FF_PRERELEASE
@@ -20,12 +20,12 @@
BEGIN
VALUE "CompanyName", "eXept Software AG\0"
VALUE "FileDescription", "Smalltalk/X Class library (LIB)\0"
- VALUE "FileVersion", "6.2.18408.18408\0"
+ VALUE "FileVersion", "6.2.32767.32767\0"
VALUE "InternalName", "stx:libjava/tools\0"
VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011\0"
VALUE "ProductName", "Smalltalk/X\0"
VALUE "ProductVersion", "6.2.3.0\0"
- VALUE "ProductDate", "Tue, 01 Oct 2013 22:35:38 GMT\0"
+ VALUE "ProductDate", "Fri, 04 Oct 2013 07:34:50 GMT\0"
END
END
--- a/vcmake.bat Thu Oct 03 20:07:05 2013 +0100
+++ b/vcmake.bat Fri Oct 04 08:59:25 2013 +0100
@@ -18,20 +18,6 @@
@echo "***********************************"
-@echo "Buildung stx/libjava/examples/jabber
-@echo "***********************************"
-@cd examples\jabber
-@call vcmake %1 %2
-@cd ..\..
-
-@echo "***********************************"
-@echo "Buildung stx/libjava/examples
-@echo "***********************************"
-@cd examples
-@call vcmake %1 %2
-@cd ..
-
-@echo "***********************************"
@echo "Buildung stx/libjava/tools
@echo "***********************************"
@cd tools