Initial release

This commit is contained in:
unknown
2015-10-19 14:27:31 +04:00
commit 32f28094bf
644 changed files with 94529 additions and 0 deletions

219
highlight/caml.tcl Normal file
View File

@@ -0,0 +1,219 @@
###########################################################
# Tcl/Tk Project Manager #
# version 0.0.1 #
# TCL highlight file #
# Copyright (c) "CONERO lab", 2001, http://conero.lrn.ru #
# Author: Sergey Kalinin (aka BanZaj) banzaj@lrn.ru #
###########################################################
set beginQuote "0.0"
set endQuote "2.0"
set endQuotePrev "0.0"
proc HighLightML {text line lineNumber node} {
global fontNormal fontBold editorFontBold tree imgDir noteBook
global editor color
global beginQuote endQuote endQuotePrev
set startIndex 0
$text tag configure bold -font $editor(fontBold)
$text tag configure className -font $editor(fontBold) -foreground $color(procName)
$text tag configure keyWord -foreground $color(keyWord)
$text tag configure comments -foreground $color(comments)
$text tag configure variable -foreground $color(var)
$text tag configure string -foreground $color(string)
$text tag configure braceHighLight -font $editor(fontBold)\
-foreground $color(braceBG) -background $color(braceFG)
$text tag configure brace -foreground $color(brace)
$text tag configure percent -foreground $color(percent)
$text tag configure bindKey -foreground $color(bindKey)
$text tag configure sql -font $editor(fontBold) -foreground $color(sql)
set keyWord [info commands]
# for OOP extention
foreach n {let match compile load exception function bol begin end then type done with class method attribute constructor destructor invariant attribute binding new delete extends final finally implements import interface native new private protected public static super this throw synchronized throws transient try volatile void else} {lappend keyWord $n}
set dataType {list abstract boolean byte char double float int long short}
set sqlOperators {select from where and or count sum in order cast as by}
set a ""
set startPos 0
set endPos 0
set length 0
set workLine $line
set className ""
while {$workLine != ""} {
if {[regexp "(^|\t| )\[a-zA-Z\\_:\]+" $workLine word]} {
set length [string length $word]
set startPos [string first [string trim $word] $line]
set endPos [expr $startPos + $length]
set workLine [string range $workLine $length end]
if {[lsearch $keyWord [string trim $word]] != -1} {
$text tag add keyWord $lineNumber.$startPos $lineNumber.$endPos
}
if {[lsearch $dataType [string trim $word]] != -1} {
$text tag add bold $lineNumber.$startPos $lineNumber.$endPos
}
if {[lsearch $sqlOperators [string trim $word]] != -1} {
$text tag add sql $lineNumber.$startPos $lineNumber.$endPos
}
if {[string trim $word]=="let" || [string trim $word]=="extends" || [string trim $word]=="implements"} {
$text tag add className $lineNumber.[expr $startPos + $length] $lineNumber.[string wordend $line [expr $startPos + $length +2]]
}
set startPos [expr $endPos + 1]
} else {
break
}
}
# key binding highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "<.*?>" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bindKey $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# variable highlight #
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\\$\[a-zA-Z\\_:\]+" $workLine a]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
if {$a != ""} {
$text tag add variable $lineNumber.$start $lineNumber.$end
}
set startPos $end
} else {
break
}
}
# string " " highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\".*?\"" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add string $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# persent % highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
# if {[regexp "\%.*? " $workLine a b]}
if {[regexp "\%" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add percent $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
## COMENTS ##
set workLine [$text get $lineNumber.0 $lineNumber.end]
if {[regexp -indices {(^|\t|;| )\(\*} $workLine begin]} {
set p [lindex $begin 0]
$text tag add comments $lineNumber.[expr $p - 0] $lineNumber.end
} elseif {[regexp -indices {(^|\t|;| )\*} $workLine beginIndex]} {
set beginQuote "$lineNumber.[lindex $beginIndex 0]"
set endQuote [$text search -forward -regexp -- {\*\)} $beginQuote end]
if {$endQuote != ""} {
$text tag add comments $beginQuote "$endQuote + 2 chars"
} else {
$text tag add comments $beginQuote end
}
set endQuotePrev [$text search -backward -regexp -- {\*\)} [expr $lineNumber - 1].end 0.0]
if {$endQuotePrev != ""} {
$text tag remove comments "$endQuotePrev + 2 chars" $beginQuote
}
} elseif {[regexp -indices {\*\)} $workLine endIndex]} {
set endQuote "$lineNumber.[lindex $endIndex 1]"
set beginQuote [$text search -backward -regexp -- {\(\*} $endQuote 0.0]
if {$beginQuote != ""} {
$text tag add comments $beginQuote "$endQuote + 1 chars"
} else {
$text tag add comments 0.0 "$endQuote + 1 chars"
}
set beginQuoteNext [$text search -forward -regexp -- {\(\*} $endQuote end]
if {$beginQuoteNext != ""} {
$text tag remove comments "$endQuote + 2 chars" $beginQuoteNext
}
} else {
if {[lindex [split $beginQuote "."] 0] <= $lineNumber && [lindex [split $endQuote "."] 0] >= $lineNumber} {
#$text tag add comments $lineNumber.0 $lineNumber.end
} else {
$text tag remove comments $lineNumber.0 $lineNumber.end
}
}
# DEDERER
# hightlight [, {, }, ], ( , )
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp {\(|\[|{|}|\]|\)} $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bold $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# parameter for command hightlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp -- {\s-\w+(?=\s)} $workLine a b]} {
set start [expr [string first $a $workLine] + 1]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bindKey $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
}

220
highlight/erlang.tcl Normal file
View File

@@ -0,0 +1,220 @@
###########################################################
# Tcl/Tk Project Manager #
# version 0.0.1 #
# TCL highlight file #
# Copyright (c) "CONERO lab", 2001, http://conero.lrn.ru #
# Author: Sergey Kalinin (aka BanZaj) banzaj@lrn.ru #
###########################################################
set beginQuote "0.0"
set endQuote "2.0"
set endQuotePrev "0.0"
proc HighLightErl {text line lineNumber node} {
global fontNormal fontBold editorFontBold tree imgDir noteBook
global editor color
global beginQuote endQuote endQuotePrev
set startIndex 0
$text tag configure bold -font $editor(fontBold)
$text tag configure className -font $editor(fontBold) -foreground $color(procName)
$text tag configure keyWord -foreground $color(keyWord)
$text tag configure comments -foreground $color(comments)
$text tag configure variable -foreground $color(var)
$text tag configure string -foreground $color(string)
$text tag configure braceHighLight -font $editor(fontBold)\
-foreground $color(braceBG) -background $color(braceFG)
$text tag configure brace -foreground $color(brace)
$text tag configure percent -foreground $color(percent)
$text tag configure bindKey -foreground $color(bindKey)
$text tag configure sql -font $editor(fontBold) -foreground $color(sql)
set keyWord [info commands]
# for OOP extention
foreach n {let match compile load exception function bol begin end then type done with class method attribute constructor destructor invariant attribute binding new delete extends final finally implements import interface native new private protected public static super this throw synchronized throws transient try volatile void else} {lappend keyWord $n}
set dataType {list abstract boolean byte char double float int long short}
set sqlOperators {select from where and or count sum in order cast as by}
set a ""
set startPos 0
set endPos 0
set length 0
set workLine $line
set className ""
while {$workLine != ""} {
if {[regexp "(^|\t| )\[a-zA-Z\\_:\]+" $workLine word]} {
set length [string length $word]
set startPos [string first [string trim $word] $line]
set endPos [expr $startPos + $length]
set workLine [string range $workLine $length end]
if {[lsearch $keyWord [string trim $word]] != -1} {
$text tag add keyWord $lineNumber.$startPos $lineNumber.$endPos
}
if {[lsearch $dataType [string trim $word]] != -1} {
$text tag add bold $lineNumber.$startPos $lineNumber.$endPos
}
if {[lsearch $sqlOperators [string trim $word]] != -1} {
$text tag add sql $lineNumber.$startPos $lineNumber.$endPos
}
if {[string trim $word]=="let" || [string trim $word]=="extends" || [string trim $word]=="implements"} {
$text tag add className $lineNumber.[expr $startPos + $length] $lineNumber.[string wordend $line [expr $startPos + $length +2]]
}
set startPos [expr $endPos + 1]
} else {
break
}
}
# key binding highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "<.*?>" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bindKey $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# variable highlight #
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\\$\[a-zA-Z\\_:\]+" $workLine a]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
if {$a != ""} {
$text tag add variable $lineNumber.$start $lineNumber.$end
}
set startPos $end
} else {
break
}
}
# string " " highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\".*?\"" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add string $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# persent % highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
# if {[regexp "\%.*? " $workLine a b]}
if {[regexp "\%" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add percent $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
## COMENTS ##
set workLine [$text get $lineNumber.0 $lineNumber.end]
if {[regexp -indices {(^|\t|;| )\(\*} $workLine begin]} {
set p [lindex $begin 0]
$text tag add comments $lineNumber.[expr $p - 0] $lineNumber.end
} elseif {[regexp -indices {(^|\t|;| )\*} $workLine beginIndex]} {
set beginQuote "$lineNumber.[lindex $beginIndex 0]"
set endQuote [$text search -forward -regexp -- {\*\)} $beginQuote end]
if {$endQuote != ""} {
$text tag add comments $beginQuote "$endQuote + 2 chars"
} else {
$text tag add comments $beginQuote end
}
set endQuotePrev [$text search -backward -regexp -- {\*\)} [expr $lineNumber - 1].end 0.0]
if {$endQuotePrev != ""} {
$text tag remove comments "$endQuotePrev + 2 chars" $beginQuote
}
} elseif {[regexp -indices {\*\)} $workLine endIndex]} {
set endQuote "$lineNumber.[lindex $endIndex 1]"
set beginQuote [$text search -backward -regexp -- {\(\*} $endQuote 0.0]
if {$beginQuote != ""} {
$text tag add comments $beginQuote "$endQuote + 1 chars"
} else {
$text tag add comments 0.0 "$endQuote + 1 chars"
}
set beginQuoteNext [$text search -forward -regexp -- {\(\*} $endQuote end]
if {$beginQuoteNext != ""} {
$text tag remove comments "$endQuote + 2 chars" $beginQuoteNext
}
} else {
if {[lindex [split $beginQuote "."] 0] <= $lineNumber && [lindex [split $endQuote "."] 0] >= $lineNumber} {
#$text tag add comments $lineNumber.0 $lineNumber.end
} else {
$text tag remove comments $lineNumber.0 $lineNumber.end
}
}
# DEDERER
# hightlight [, {, }, ], ( , )
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp {\(|\[|{|}|\]|\)} $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bold $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# parameter for command hightlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp -- {\s-\w+(?=\s)} $workLine a b]} {
set start [expr [string first $a $workLine] + 1]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bindKey $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
}

214
highlight/fortran.tcl Normal file
View File

@@ -0,0 +1,214 @@
###########################################################
# Tcl/Tk Project Manager #
# version 0.0.1 #
# TCL highlight file #
# Copyright (c) "CONERO lab", 2001, http://conero.lrn.ru #
# Author: Sergey Kalinin (aka BanZaj) banzaj@lrn.ru #
###########################################################
set beginQuote "0.0"
set endQuote "2.0"
set endQuotePrev "0.0"
proc HighLightFORTRAN {text line lineNumber node} {
global fontNormal fontBold editorFontBold tree imgDir noteBook
global editor color
global beginQuote endQuote endQuotePrev
set startIndex 0
$text tag configure bold -font $editor(fontBold)
$text tag configure className -font $editor(fontBold) -foreground $color(procName)
$text tag configure keyWord -foreground $color(keyWord)
$text tag configure comments -foreground $color(comments) ;#-background $editor(bg)
$text tag configure variable -foreground $color(var)
$text tag configure string -foreground $color(string)
$text tag configure braceHighLight -font $editor(fontBold)\
-foreground $color(braceBG) -background $color(braceFG)
$text tag configure brace -foreground $color(brace)
$text tag configure percent -foreground $color(percent)
$text tag configure bindKey -foreground $color(bindKey)
$text tag configure label -background $color(label)
$text tag configure six -foreground $color(sixFG) -background $color(sixBG)
$text tag configure operator -background $editor(bg)
set keyWord [info commands]
# for OOP extention
foreach n {program function subroutine entry block data implicit integer real double precision complex\
logical character dimension common equivalence parameter external intrinsic save data goto assign if then\
else elseif endif end do while enddo continue stop pause end open close read write print\
inquire rewind backspace endfile format call return include} {lappend keyWord $n}
#set dataType {list abstract boolean byte char double float int long short}
set dataType ""
set a ""
set startPos 0
set endPos 0
set length 0
set workLine $line
set className ""
while {$workLine != ""} {
if {[regexp "(^|\t| )\[a-zA-Z\\_:\]+" $workLine word]} {
set length [string length $word]
set startPos [string first [string trim $word] $line]
set endPos [expr $startPos + $length]
set workLine [string range $workLine $length end]
if {[lsearch $keyWord [string trim $word]] != -1} {
$text tag add keyWord $lineNumber.$startPos $lineNumber.$endPos
}
if {[lsearch $dataType [string trim $word]] != -1} {
$text tag add bold $lineNumber.$startPos $lineNumber.$endPos
}
if {[string trim $word]=="class" || [string trim $word]=="extends" || [string trim $word]=="implements"} {
$text tag add className $lineNumber.[expr $startPos + $length] $lineNumber.[string wordend $line [expr $startPos + $length +2]]
}
set startPos [expr $endPos + 1]
} else {
break
}
}
# key binding highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "<.*?>" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bindKey $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# variable highlight #
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\\$\[a-zA-Z\\_:\]+" $workLine a]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
if {$a != ""} {
$text tag add variable $lineNumber.$start $lineNumber.$end
}
set startPos $end
} else {
break
}
}
# string " " highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\".*?\"" $workLine a b] || [regexp "\'.*?\'" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add string $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# persent % highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
# if {[regexp "\%.*? " $workLine a b]}
if {[regexp "\%" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add percent $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
$text tag remove label $lineNumber.0 $lineNumber.end
$text tag add label $lineNumber.0 $lineNumber.5
$text tag remove six $lineNumber.0 $lineNumber.5
$text tag remove six $lineNumber.6 $lineNumber.end
$text tag add six $lineNumber.5 $lineNumber.6
$text tag remove operator $lineNumber.6 $lineNumber.end
$text tag add operator $lineNumber.7 $lineNumber.71
$text tag remove comments $lineNumber.72 $lineNumber.end
$text tag add comments $lineNumber.72 $lineNumber.end
## COMENTS ##
set workLine [$text get $lineNumber.0 $lineNumber.end]
#if {[regexp -indices -nocase {^(c|\*)} $workLine word]}
if {[regexp -indices -nocase {^(c|\*)} $workLine word]} {
set p [lindex $word 1]
#puts "$p $lineNumber -- $workLine"
$text tag remove label $lineNumber.0 $lineNumber.end
$text tag remove operator $lineNumber.0 $lineNumber.end
$text tag add comments $lineNumber.$p $lineNumber.end
$text tag remove six $lineNumber.5 $lineNumber.6
#puts [$text dump -tag $lineNumber.0 $lineNumber.end]
#$text tag raise comments
#puts [$text tag ranges comments]
} else {
$text tag remove comments $lineNumber.0 $lineNumber.end
}
set workLine [$text get $lineNumber.0 $lineNumber.end]
if {[regexp -indices -nocase {\!} $workLine word]} {
set p [lindex $word 1]
if {([string index $workLine [expr $p + 1]] == "\'") || ([string index $workLine [expr $p + 1]] == "\"")} {
} else {
#$text tag add comments $lineNumber.$p $lineNumber.end
}
} else {
#$text tag remove comments $lineNumber.0 $lineNumber.end
}
# DEDERER
# hightlight [, {, }, ], ( , )
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp {\(|\[|{|}|\]|\)} $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bold $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# parameter for command hightlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp -- {\s-\w+(?=\s)} $workLine a b]} {
set start [expr [string first $a $workLine] + 1]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bindKey $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
}

106
highlight/html.tcl Normal file
View File

@@ -0,0 +1,106 @@
###########################################################
# Tcl/Tk Project Manager #
# version 0.0.1 #
# TCL highlight file #
# Copyright (c) "CONERO lab", 2001, http://conero.lrn.ru #
# Author: Sergey Kalinin (aka BanZaj) banzaj@lrn.ru #
###########################################################
proc HighLightHTML {text line lineNumber node} {
global fontNormal editorFontBold tree imgDir fontBold
global editor color
set startIndex 0
# bind text tags for highlightning #
$text tag configure bold -font $editor(fontBold)
$text tag configure procName -font $editor(fontBold) -foreground $color(procName)
$text tag configure keyWord -foreground $color(keyWord)
$text tag configure comments -foreground $color(comments)
$text tag configure variable -foreground $color(var)
$text tag configure string -foreground $color(string)
$text tag configure braceHighLight -font $editor(fontBold)\
-foreground $color(braceBG) -background $color(braceFG)
$text tag configure brace -foreground $color(brace)
$text tag configure percent -foreground $color(percent)
$text tag configure bindKey -foreground $color(bindKey)
# incr lineNumber
set keyWord [info commands]
# for OOP extention
foreach n {class method attribute constructor destructor invariant attribute binding new delete} {
lappend keyWord $n
}
# add comment #
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "<\!--.+-->" $workLine a]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add coments $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# get keywords
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "(</?\[a-zA-Z0-9\]+\[> \t\])|>" $workLine a]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add keyWord $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# get variables
set workLine $line
set startPos 0
while {$workLine != ""} {
if {[regexp "\[a-zA-Z0-9\]+=" $workLine a]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add variable $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# get strings
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\".+\"" $workLine a]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add string $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
}

215
highlight/java.tcl Normal file
View File

@@ -0,0 +1,215 @@
###########################################################
# Tcl/Tk Project Manager #
# version 0.0.1 #
# TCL highlight file #
# Copyright (c) "CONERO lab", 2001, http://conero.lrn.ru #
# Author: Sergey Kalinin (aka BanZaj) banzaj@lrn.ru #
###########################################################
set beginQuote "0.0"
set endQuote "2.0"
set endQuotePrev "0.0"
proc HighLightJAVA {text line lineNumber node} {
global fontNormal fontBold editorFontBold tree imgDir noteBook
global editor color
global beginQuote endQuote endQuotePrev
set startIndex 0
$text tag configure bold -font $editor(fontBold)
$text tag configure className -font $editor(fontBold) -foreground $color(procName)
$text tag configure keyWord -foreground $color(keyWord)
$text tag configure comments -foreground $color(comments)
$text tag configure variable -foreground $color(var)
$text tag configure string -foreground $color(string)
$text tag configure braceHighLight -font $editor(fontBold)\
-foreground $color(braceBG) -background $color(braceFG)
$text tag configure brace -foreground $color(brace)
$text tag configure percent -foreground $color(percent)
$text tag configure bindKey -foreground $color(bindKey)
$text tag configure sql -font $editor(fontBold) -foreground $color(sql)
set keyWord [info commands]
# for OOP extention
foreach n {class method attribute constructor destructor invariant attribute binding new delete extends final finally implements import interface native new private protected public static super this throw synchronized throws transient try volatile void else} {lappend keyWord $n}
set dataType {list abstract boolean byte char double float int long short}
set sqlOperators {select from where and or count sum in order cast as by}
set a ""
set startPos 0
set endPos 0
set length 0
set workLine $line
set className ""
while {$workLine != ""} {
if {[regexp "(^|\t| )\[a-zA-Z\\_:\]+" $workLine word]} {
set length [string length $word]
set startPos [string first [string trim $word] $line]
set endPos [expr $startPos + $length]
set workLine [string range $workLine $length end]
if {[lsearch $keyWord [string trim $word]] != -1} {
$text tag add keyWord $lineNumber.$startPos $lineNumber.$endPos
}
if {[lsearch $dataType [string trim $word]] != -1} {
$text tag add bold $lineNumber.$startPos $lineNumber.$endPos
}
if {[lsearch $sqlOperators [string trim $word]] != -1} {
$text tag add sql $lineNumber.$startPos $lineNumber.$endPos
}
if {[string trim $word]=="class" || [string trim $word]=="extends" || [string trim $word]=="implements"} {
$text tag add className $lineNumber.[expr $startPos + $length] $lineNumber.[string wordend $line [expr $startPos + $length +2]]
}
set startPos [expr $endPos + 1]
} else {
break
}
}
# key binding highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "<.*?>" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bindKey $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# variable highlight #
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\\$\[a-zA-Z\\_:\]+" $workLine a]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
if {$a != ""} {
$text tag add variable $lineNumber.$start $lineNumber.$end
}
set startPos $end
} else {
break
}
}
# string " " highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\".*?\"" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add string $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# persent % highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
# if {[regexp "\%.*? " $workLine a b]}
if {[regexp "\%" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add percent $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
## COMENTS ##
set workLine [$text get $lineNumber.0 $lineNumber.end]
if {[regexp -indices "(^|\t|;| )//" $workLine begin]} {
set p [lindex $begin 0]
$text tag add comments $lineNumber.[expr $p - 0] $lineNumber.end
} elseif {[regexp -indices {(^|\t|;| )/\*} $workLine beginIndex]} {
set beginQuote "$lineNumber.[lindex $beginIndex 0]"
set endQuote [$text search -forward -regexp -- {\*/} $beginQuote end]
if {$endQuote != ""} {
$text tag add comments $beginQuote "$endQuote + 2 chars"
} else {
$text tag add comments $beginQuote end
}
set endQuotePrev [$text search -backward -regexp -- {\*/} [expr $lineNumber - 1].end 0.0]
if {$endQuotePrev != ""} {
$text tag remove comments "$endQuotePrev + 2 chars" $beginQuote
}
} elseif {[regexp -indices {\*/} $workLine endIndex]} {
set endQuote "$lineNumber.[lindex $endIndex 1]"
set beginQuote [$text search -backward -regexp -- {/\*} $endQuote 0.0]
if {$beginQuote != ""} {
$text tag add comments $beginQuote "$endQuote + 1 chars"
} else {
$text tag add comments 0.0 "$endQuote + 1 chars"
}
set beginQuoteNext [$text search -forward -regexp -- {/\*} $endQuote end]
if {$beginQuoteNext != ""} {
$text tag remove comments "$endQuote + 2 chars" $beginQuoteNext
}
} else {
if {[lindex [split $beginQuote "."] 0] <= $lineNumber && [lindex [split $endQuote "."] 0] >= $lineNumber} {
#$text tag add comments $lineNumber.0 $lineNumber.end
} else {
$text tag remove comments $lineNumber.0 $lineNumber.end
}
}
# DEDERER
# hightlight [, {, }, ], ( , )
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp {\(|\[|{|}|\]|\)} $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bold $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# parameter for command hightlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp -- {\s-\w+(?=\s)} $workLine a b]} {
set start [expr [string first $a $workLine] + 1]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bindKey $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
}

204
highlight/perl.tcl Normal file
View File

@@ -0,0 +1,204 @@
###########################################################
# Tcl/Tk Project Manager #
# version 0.0.1 #
# TCL highlight file #
# Copyright (c) "CONERO lab", 2001, http://conero.lrn.ru #
# Author: Sergey Kalinin (aka BanZaj) banzaj@lrn.ru #
###########################################################
set beginQuote "0.0"
set endQuote "2.0"
set endQuotePrev "0.0"
proc HighLightPERL {text line lineNumber node} {
global fontNormal fontBold editorFontBold tree imgDir noteBook
global editor color
global beginQuote endQuote endQuotePrev
set startIndex 0
$text tag configure bold -font $editor(fontBold)
$text tag configure className -font $editor(fontBold) -foreground $color(procName)
$text tag configure keyWord -foreground $color(keyWord)
$text tag configure comments -foreground $color(comments)
$text tag configure variable -foreground $color(var)
$text tag configure string -foreground $color(string)
$text tag configure braceHighLight -font $editor(fontBold)\
-foreground $color(braceBG) -background $color(braceFG)
$text tag configure brace -foreground $color(brace)
$text tag configure percent -foreground $color(percent)
$text tag configure bindKey -foreground $color(bindKey)
$text tag configure sql -font $editor(fontBold) -foreground $color(sql)
set keyWord [info commands]
# for OOP extention
foreach n {print my use sub printf substr ord class method attribute constructor destructor invariant attribute binding new delete extends final finally implements import interface native new private protected public static super this throw synchronized throws transient try volatile void else } {lappend keyWord $n}
set dataType {list abstract boolean byte char double float int long short}
set sqlOperators {select from where and or count sum in order cast as by}
set a ""
set startPos 0
set endPos 0
set length 0
set workLine $line
set className ""
while {$workLine != ""} {
if {[regexp "(^|\t| )\[a-zA-Z\\_:\]+" $workLine word]} {
set length [string length $word]
set startPos [string first [string trim $word] $line]
set endPos [expr $startPos + $length]
set workLine [string range $workLine $length end]
if {[lsearch $keyWord [string trim $word]] != -1} {
$text tag add keyWord $lineNumber.$startPos $lineNumber.$endPos
}
if {[lsearch $dataType [string trim $word]] != -1} {
$text tag add bold $lineNumber.$startPos $lineNumber.$endPos
}
if {[lsearch $sqlOperators [string trim $word]] != -1} {
$text tag add sql $lineNumber.$startPos $lineNumber.$endPos
}
if {[string trim $word]=="class" || [string trim $word]=="extends" || [string trim $word]=="implements" || [string trim $word]=="use"} {
$text tag add className $lineNumber.[expr $startPos + $length] $lineNumber.[string wordend $line [expr $startPos + $length +2]]
}
set startPos [expr $endPos + 1]
} else {
break
}
}
# key binding highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "<.*?>" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bindKey $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# variable highlight #
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\\$\[a-zA-Z\\_:\]+" $workLine a]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
if {$a != ""} {
$text tag add variable $lineNumber.$start $lineNumber.$end
}
set startPos $end
} else {
break
}
}
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\\@\[a-zA-Z\\_:\]+" $workLine a]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
if {$a != ""} {
$text tag add variable $lineNumber.$start $lineNumber.$end
}
set startPos $end
} else {
break
}
}
# string " " highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\".*?\"" $workLine a b] || [regexp "\'.*?\'" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add string $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# persent % highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
# if {[regexp "\%.*? " $workLine a b]}
if {[regexp "\%" $workLine a b] || [regexp "(\-\>)" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add percent $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
## COMENTS ##
set workLine [$text get $lineNumber.0 $lineNumber.end]
if {[regexp -indices "(^|\t|;| )#" $workLine word]} {
set p [lindex $word 1]
$text tag add comments $lineNumber.$p $lineNumber.end
} else {
$text tag remove comments $lineNumber.0 $lineNumber.end
}
# DEDERER
# hightlight [, {, }, ], ( , )
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp {\(|\[|{|}|\]|\)} $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bold $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# parameter for command hightlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp -- {\s-\w+(?=\s)} $workLine a b]} {
set start [expr [string first $a $workLine] + 1]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bindKey $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
}

270
highlight/php.tcl Normal file
View File

@@ -0,0 +1,270 @@
###########################################################
# Tcl/Tk Project Manager #
# version 0.0.1 #
# TCL highlight file #
# Copyright (c) "CONERO lab", 2001, http://conero.lrn.ru #
# Author: Sergey Kalinin (aka BanZaj) banzaj@lrn.ru #
###########################################################
proc HighLightPHP {text line lineNumber node} {
global fontNormal fontBold editorFontBold tree imgDir noteBook
global editor color
global beginQuote endQuote endQuotePrev
# set pos [$text index insert]
# set lineNumber [lindex [split $pos "."] 0]
set startIndex 0
# bind text tags for highlightning #
$text tag configure bold -font $editor(fontBold)
$text tag configure procName -font $editor(fontBold) -foreground $color(procName)
$text tag configure keyWord -foreground $color(keyWord)
$text tag configure comments -foreground $color(comments)
$text tag configure variable -foreground $color(var)
$text tag configure string -foreground $color(string)
$text tag configure braceHighLight -font $editor(fontBold)\
-foreground $color(braceBG) -background $color(braceFG)
$text tag configure brace -foreground $color(brace)
$text tag configure percent -foreground $color(percent)
$text tag configure bindKey -foreground $color(bindKey)
$text tag configure rivet -foreground $color(bindKey) -font $editor(fontBold) -foreground "#ff8800" ;#-background "#c6c6c6"
$text tag configure sql -font $editor(fontBold) -foreground $color(sql)
# incr lineNumber
set keyWord [info commands]
# for OOP extention
foreach n {class method attribute constructor destructor invariant attribute binding new delete \
mcset mc mclocale mcpreferences mcload mcunknown configure match else elseif} {
lappend keyWord $n
}
foreach n {var include_once include function case echo select from where in order by and or} {
lappend keyWord $n
}
set dataType {true false}
set sqlOperators {select from where and or count sum in order cast as by}
set a ""
set startPos 0
set endPos 0
set length 0
set workLine $line
while {$workLine != ""} {
if {[regexp "(^|\t| )\[a-zA-Z\\_:\]+" $workLine word]} {
set length [string length $word]
set startPos [string first [string trim $word] $line]
set endPos [expr $startPos + $length]
set workLine [string range $workLine $length end]
if {[lsearch $keyWord [string trim $word]] != -1} {
$text tag add keyWord $lineNumber.$startPos $lineNumber.$endPos
}
if {[lsearch $dataType [string trim $word]] != -1} {
$text tag add bold $lineNumber.$startPos $lineNumber.$endPos
}
if {[lsearch $sqlOperators [string trim $word]] != -1} {
$text tag add sql $lineNumber.$startPos $lineNumber.$endPos
}
if {[string trim $word]=="proc"} {
$text tag add procName $lineNumber.[expr $startPos + $length] $lineNumber.[string wordend $line [expr $startPos + $length +2]]
}
set startPos [expr $endPos + 1]
} else {
break
}
}
set workLine $line
while {$workLine != ""} {
if {[regexp {(\{|\[)[a-zA-Z\\_:]+} $workLine word v]} {
set word [string trim $word $v]
set length [string length $word]
set startPos [string first [string trim $word] $line]
set endPos [expr $startPos + $length]
set workLine [string range $workLine $length end]
if {[lsearch $keyWord [string trim $word]] != -1} {
$text tag add keyWord $lineNumber.$startPos $lineNumber.$endPos
}
if {[string trim $word]=="proc"} {
$text tag add procName $lineNumber.[expr $startPos + $length] $lineNumber.[string wordend $line [expr $startPos + $length +2]]
}
set startPos [expr $endPos + 1]
} else {
break
}
}
# key binding highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "(</?\[a-zA-Z0-9\]+\[> \t\])|>" $workLine a]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add keyWord $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# variable highlight #
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\\$\[a-zA-Z\\_:\]+" $workLine a]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
if {$a != ""} {
$text tag add variable $lineNumber.$start $lineNumber.$end
}
set startPos $end
} else {
break
}
}
# persent % highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\%" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add percent $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# DEDERER
# hightlight [, {, }, ]
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp {\(|\[|{|}|\]|\)} $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bold $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp {\<\?|\?>} $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add rivet $lineNumber.$start $lineNumber.end
set startPos $end
} else {
break
}
}
# string " " highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\".*?\"" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add string $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# parameter for command hightlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp -- {\s-\w+(?=\s)} $workLine a b]} {
set start [expr [string first $a $workLine] + 1]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bindKey $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "<!.+>" $workLine a]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add coments $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# add comment #
set workLine [$text get $lineNumber.0 $lineNumber.end]
if {[regexp -indices "(^|\t|;| )//" $workLine begin]} {
set p [lindex $begin 0]
$text tag add comments $lineNumber.[expr $p - 0] $lineNumber.end
} elseif {[regexp -indices {(^|\t|;| )/\*} $workLine beginIndex]} {
set beginQuote "$lineNumber.[lindex $beginIndex 0]"
set endQuote [$text search -forward -regexp -- {\*/} $beginQuote end]
if {$endQuote != ""} {
$text tag add comments $beginQuote "$endQuote + 2 chars"
} else {
$text tag add comments $beginQuote end
}
set endQuotePrev [$text search -backward -regexp -- {\*/} [expr $lineNumber - 1].end 0.0]
if {$endQuotePrev != ""} {
$text tag remove comments "$endQuotePrev + 2 chars" $beginQuote
}
} elseif {[regexp -indices {\*/} $workLine endIndex]} {
set endQuote "$lineNumber.[lindex $endIndex 1]"
set beginQuote [$text search -backward -regexp -- {/\*} $endQuote 0.0]
if {$beginQuote != ""} {
$text tag add comments $beginQuote "$endQuote + 1 chars"
} else {
$text tag add comments 0.0 "$endQuote + 1 chars"
}
set beginQuoteNext [$text search -forward -regexp -- {/\*} $endQuote end]
if {$beginQuoteNext != ""} {
$text tag remove comments "$endQuote + 2 chars" $beginQuoteNext
}
} else {
if {[lindex [split $beginQuote "."] 0] <= $lineNumber && [lindex [split $endQuote "."] 0] >= $lineNumber} {
#$text tag add comments $lineNumber.0 $lineNumber.end
} else {
$text tag remove comments $lineNumber.0 $lineNumber.end
}
}
}

249
highlight/rivet.tcl Normal file
View File

@@ -0,0 +1,249 @@
###########################################################
# Tcl/Tk Project Manager #
# version 0.0.1 #
# TCL highlight file #
# Copyright (c) "CONERO lab", 2001, http://conero.lrn.ru #
# Author: Sergey Kalinin (aka BanZaj) banzaj@lrn.ru #
###########################################################
proc HighLightRIVET {text line lineNumber node} {
global fontNormal fontBold editorFontBold tree imgDir noteBook
global editor color
# set pos [$text index insert]
# set lineNumber [lindex [split $pos "."] 0]
set startIndex 0
# bind text tags for highlightning #
$text tag configure bold -font $editor(fontBold)
$text tag configure sql -font $editor(fontBold) -foreground $color(sql)
$text tag configure procName -font $editor(fontBold) -foreground $color(procName)
$text tag configure keyWord -foreground $color(keyWord)
$text tag configure comments -foreground $color(comments)
$text tag configure variable -foreground $color(var)
$text tag configure string -foreground $color(string)
$text tag configure braceHighLight -font $editor(fontBold)\
-foreground $color(braceBG) -background $color(braceFG)
$text tag configure brace -foreground $color(brace)
$text tag configure percent -foreground $color(percent)
$text tag configure bindKey -foreground $color(bindKey)
$text tag configure rivet -foreground $color(bindKey) -font $editor(fontBold) -foreground "#ff8800" ;#-background "#c6c6c6"
# incr lineNumber
set keyWord [info commands]
# for OOP extention
foreach n {class method attribute constructor destructor invariant attribute binding new delete \
mcset mc mclocale mcpreferences mcload mcunknown configure match else elseif} {
lappend keyWord $n
}
set dataType {true false}
set sqlOperators {select from where and or count sum in order cast as by}
set a ""
set startPos 0
set endPos 0
set length 0
set workLine $line
while {$workLine != ""} {
if {[regexp "(^|\t| )\[a-zA-Z\\_:\]+" $workLine word]} {
set length [string length $word]
set startPos [string first [string trim $word] $line]
set endPos [expr $startPos + $length]
set workLine [string range $workLine $length end]
if {[lsearch $keyWord [string trim $word]] != -1} {
$text tag add keyWord $lineNumber.$startPos $lineNumber.$endPos
}
if {[lsearch $dataType [string trim $word]] != -1} {
$text tag add bold $lineNumber.$startPos $lineNumber.$endPos
}
if {[lsearch $sqlOperators [string tolower [string trim $word]]] != -1} {
$text tag add sql $lineNumber.$startPos $lineNumber.[expr $endPos - 1]
}
if {[string trim $word]=="proc"} {
$text tag add procName $lineNumber.[expr $startPos + $length] $lineNumber.[string wordend $line [expr $startPos + $length +2]]
}
set startPos [expr $endPos + 1]
} else {
break
}
}
set workLine $line
while {$workLine != ""} {
if {[regexp {(\{|\[)[a-zA-Z\\_:]+} $workLine word v]} {
set word [string trim $word $v]
set length [string length $word]
set startPos [string first [string trim $word] $line]
set endPos [expr $startPos + $length]
set workLine [string range $workLine $length end]
if {[lsearch $keyWord [string trim $word]] != -1} {
$text tag add keyWord $lineNumber.$startPos $lineNumber.$endPos
}
if {[string trim $word]=="proc"} {
$text tag add procName $lineNumber.[expr $startPos + $length] $lineNumber.[string wordend $line [expr $startPos + $length +2]]
}
set startPos [expr $endPos + 1]
} else {
break
}
}
# key binding highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "(</?\[a-zA-Z0-9\]+\[> \t\])|>" $workLine a]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add keyWord $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# variable highlight #
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\\$\[a-zA-Z\\_:\]+" $workLine a]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
if {$a != ""} {
$text tag add variable $lineNumber.$start $lineNumber.$end
}
set startPos $end
} else {
break
}
}
# string " " highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\".*?\"" $workLine a b] || [regexp "\'.*?\'" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add string $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# persent % highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\%" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add percent $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# add comment #
set workLine [$text get $lineNumber.0 $lineNumber.end]
if {[regexp -indices "(^|\t|;| )#" $workLine word]} {
set p [lindex $word 1]
$text tag add comments $lineNumber.$p $lineNumber.end
} else {
$text tag remove comments $lineNumber.0 $lineNumber.end
}
# DEDERER
# hightlight [, {, }, ]
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp {\(|\[|{|}|\]|\)} $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bold $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp {\<\?|\?>} $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add rivet $lineNumber.$start $lineNumber.end
set startPos $end
} else {
break
}
}
# parameter for command hightlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp -- {\s-\w+(?=\s)} $workLine a b]} {
set start [expr [string first $a $workLine] + 1]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bindKey $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "<!.+>" $workLine a]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add coments $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
}

189
highlight/ruby.tcl Normal file
View File

@@ -0,0 +1,189 @@
###########################################################
# Tcl/Tk Project Manager #
# version 0.0.1 #
# TCL highlight file #
# Copyright (c) "CONERO lab", 2001, http://conero.lrn.ru #
# Author: Sergey Kalinin (aka BanZaj) banzaj@lrn.ru #
###########################################################
set beginQuote "0.0"
set endQuote "2.0"
set endQuotePrev "0.0"
proc HighLightRUBY {text line lineNumber node} {
global fontNormal fontBold editorFontBold tree imgDir noteBook
global editor color
global beginQuote endQuote endQuotePrev
set startIndex 0
$text tag configure bold -font $editor(fontBold)
$text tag configure procName -font $editor(fontBold) -foreground $color(procName)
$text tag configure keyWord -foreground $color(keyWord)
$text tag configure comments -foreground $color(comments)
$text tag configure variable -foreground $color(var)
$text tag configure string -foreground $color(string)
$text tag configure braceHighLight -font $editor(fontBold)\
-foreground $color(braceBG) -background $color(braceFG)
$text tag configure brace -foreground $color(brace)
$text tag configure percent -foreground $color(percent)
$text tag configure bindKey -foreground $color(bindKey)
$text tag configure sql -font $editor(fontBold) -foreground $color(sql)
set keyWord [info commands]
# for OOP extention
foreach n {class method attribute constructor destructor invariant attribute binding new delete extends final finally implements import interface native new private protected public static super this throw synchronized throws transient try volatile void else def end slots require} {lappend keyWord $n}
set dataType {list abstract boolean byte char double float int long short}
set sqlOperators {select from where and or count sum in order cast as by}
set a ""
set startPos 0
set endPos 0
set length 0
set workLine $line
set className ""
while {$workLine != ""} {
if {[regexp "(^|\t| )\[a-zA-Z\\_:\]+" $workLine word]} {
set length [string length $word]
set startPos [string first [string trim $word] $line]
set endPos [expr $startPos + $length]
set workLine [string range $workLine $length end]
if {[lsearch $keyWord [string trim $word]] != -1} {
$text tag add keyWord $lineNumber.$startPos $lineNumber.$endPos
}
if {[lsearch $dataType [string trim $word]] != -1} {
$text tag add bold $lineNumber.$startPos $lineNumber.$endPos
}
if {[string trim $word]=="class"} {
$text tag add procName $lineNumber.[expr $startPos + $length] $lineNumber.[string wordend $line [expr $startPos + $length +2]]
puts "$text tag add procName $lineNumber.[expr $startPos + $length] $lineNumber.[string wordend $line [expr $startPos + $length +2]]"
}
set startPos [expr $endPos + 1]
} else {
break
}
}
# key binding highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "<.*?>" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bindKey $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# variable highlight #
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\\@\[a-zA-Z\\_:\]+" $workLine a]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
if {$a != ""} {
$text tag add variable $lineNumber.$start $lineNumber.$end
}
set startPos $end
} else {
break
}
}
# string " " highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\".*?\"" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add string $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# persent % highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
# if {[regexp "\%.*? " $workLine a b]}
if {[regexp "\%" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add percent $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
## COMENTS ##
# add comment #
set workLine [$text get $lineNumber.0 $lineNumber.end]
if {[regexp -indices "(^|\t|;| )#" $workLine word]} {
set p [lindex $word 1]
$text tag add comments $lineNumber.$p $lineNumber.end
} else {
$text tag remove comments $lineNumber.0 $lineNumber.end
}
# DEDERER
# hightlight [, {, }, ], ( , )
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp {\(|\[|{|}|\]|\)} $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bold $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# parameter for command hightlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp -- {\s-\w+(?=\s)} $workLine a b]} {
set start [expr [string first $a $workLine] + 1]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bindKey $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
}

136
highlight/spec.tcl Normal file
View File

@@ -0,0 +1,136 @@
###########################################################
# Tcl/Tk Project Manager #
# version 0.0.1 #
# SPEC highlight file #
# Copyright (c) "CONERO lab", 2001, http://conero.lrn.ru #
# Author: Sergey Kalinin (aka BanZaj) banzaj@lrn.ru #
###########################################################
proc HighLightSPEC {text line lineNumber node} {
global fontNormal editorFontBold fontBold tree imgDir noteBook
global editor color
# set pos [$text index insert]
# set lineNumber [lindex [split $pos "."] 0]
set startIndex 0
# bind text tags for highlightning #
# foreach tag {bold procName comments string number variable} {
# $text tag remove $tag $lineNumber.0 $lineNumber.end
# }
$text tag configure bold -font $editor(fontBold)
$text tag configure procName -font $editor(fontBold) -foreground $color(procName)
$text tag configure keyWord -foreground $color(keyWord)
$text tag configure comments -foreground $color(comments)
$text tag configure variable -foreground $color(var)
$text tag configure string -foreground $color(string)
$text tag configure braceHighLight -font $editor(fontBold)\
-foreground $color(braceBG) -background $color(braceFG)
$text tag configure brace -foreground $color(brace)
$text tag configure percent -foreground $color(percent)
$text tag configure bindKey -foreground $color(bindKey)
# $text tag configure bold -font $fontBold
# $text tag configure procName -font $editorFontBold -foreground blue
# $text tag configure keyWord -foreground #0000a8
# $text tag configure comments -foreground #9b9b9b
# $text tag configure variable -foreground #e50000
# $text tag configure string -foreground #168400
# $text tag configure braceHighLight -font $editorFontBold -foreground green -background black
# $text tag configure brace -foreground brown
# $text tag configure percent -foreground #a500c6
foreach n {define name version release description prep setup build install post postun clean files defattr changelog doc} {
lappend keyWord $n
}
# add comment #
if {[string range [string trim $line] 0 0] == "#"} {
$text tag add comments $lineNumber.0 $lineNumber.end
return 0
}
set a ""
regexp "^( |\t|\%)*(\[a-z\]|\[A-Z\]|\[0-9\]|_|:|~|\\.|/)+" $line a
if {$a != ""} {
# gets name
set b ""
regexp "^( |\t|\%)*" $line b
set nameStart [string length $b]
set nameEnd [string length $a]
set name [string range $a [string length $b] end]
# is it keyword?
if {[lsearch $keyWord $name] != -1} {
incr nameStart $startIndex
incr nameEnd $startIndex
$text tag add keyWord $lineNumber.$nameStart $lineNumber.$nameEnd
}
}
# variable highlight #
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\\$\[a-zA-Z\\_:\]+" $workLine a]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
if {$a != ""} {
$text tag add variable $lineNumber.$start $lineNumber.$end
}
set startPos $end
} else {
break
}
}
# string { } highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\{.*?\}" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add string $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# persent % highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
# if {[regexp "\%.*? " $workLine a b]}
if {[regexp "\%" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add percent $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
#find [
# set i [string first "\[" $line]
# if {$i != -1} {
# incr i
# set line [string range $line $i end]
# incr i $startIndex
# set l [HighLight $text $line $i $node]
# eval lappend res $l
# }
# return $res
}

227
highlight/tcl.tcl Normal file
View File

@@ -0,0 +1,227 @@
###########################################################
# Tcl/Tk Project Manager #
# version 0.0.1 #
# TCL highlight file #
# Copyright (c) "CONERO lab", 2001, http://conero.lrn.ru #
# Author: Sergey Kalinin (aka BanZaj) banzaj@lrn.ru #
###########################################################
proc HighLightTCL {text line lineNumber node} {
global fontNormal fontBold editorFontBold tree imgDir noteBook
global editor color
# set pos [$text index insert]
# set lineNumber [lindex [split $pos "."] 0]
set startIndex 0
# bind text tags for highlightning #
$text tag configure bold -font $editor(fontBold)
$text tag configure procName -font $editor(fontBold) -foreground $color(procName)
$text tag configure keyWord -foreground $color(keyWord)
$text tag configure comments -foreground $color(comments)
$text tag configure variable -foreground $color(var)
$text tag configure string -foreground $color(string)
$text tag configure braceHighLight -font $editor(fontBold)\
-foreground $color(braceBG) -background $color(braceFG)
$text tag configure brace -foreground $color(brace)
$text tag configure bracequad -foreground $color(bracequad)
$text tag configure percent -foreground $color(percent)
$text tag configure bindKey -foreground $color(bindKey)
# incr lineNumber
set keyWord [info commands]
# for OOP extention
foreach n {class method attribute constructor destructor invariant attribute binding new delete \
mcset mc mclocale mcpreferences mcload mcunknown configure match else elseif} {
lappend keyWord $n
}
set dataType {true false}
set a ""
set startPos 0
set endPos 0
set length 0
set workLine $line
while {$workLine != ""} {
if {[regexp "(^|\t| )\[a-zA-Z\\_:\]+" $workLine word]} {
set length [string length $word]
set startPos [string first [string trim $word] $line]
set endPos [expr $startPos + $length]
set workLine [string range $workLine $length end]
if {[lsearch $keyWord [string trim $word]] != -1} {
$text tag add keyWord $lineNumber.$startPos $lineNumber.$endPos
}
if {[lsearch $dataType [string trim $word]] != -1} {
$text tag add bold $lineNumber.$startPos $lineNumber.$endPos
}
if {[string trim $word]=="proc"} {
$text tag add procName $lineNumber.[expr $startPos + $length] $lineNumber.[string wordend $line [expr $startPos + $length +2]]
}
set startPos [expr $endPos + 1]
} else {
break
}
}
set workLine $line
while {$workLine != ""} {
if {[regexp {(\{|\[)[a-zA-Z\\_:]+} $workLine word v]} {
set word [string trim $word $v]
set length [string length $word]
set startPos [string first [string trim $word] $line]
set endPos [expr $startPos + $length]
set workLine [string range $workLine $length end]
if {[lsearch $keyWord [string trim $word]] != -1} {
$text tag add keyWord $lineNumber.$startPos $lineNumber.$endPos
}
if {[string trim $word]=="proc"} {
$text tag add procName $lineNumber.[expr $startPos + $length] $lineNumber.[string wordend $line [expr $startPos + $length +2]]
}
set startPos [expr $endPos + 1]
} else {
break
}
}
# key binding highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "<.*?>" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bindKey $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# variable highlight #
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\\$\[a-zA-Z\\_:\]+" $workLine a]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
if {$a != ""} {
$text tag add variable $lineNumber.$start $lineNumber.$end
}
set startPos $end
} else {
break
}
}
# string " " highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\".*?\"" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add string $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# persent % highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\%" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add percent $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\{|\}" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add brace $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# add comment #
set workLine [$text get $lineNumber.0 $lineNumber.end]
if {[regexp -indices "(^|\t|;| )#" $workLine word]} {
set p [lindex $word 1]
$text tag add comments $lineNumber.$p $lineNumber.end
} else {
$text tag remove comments $lineNumber.0 $lineNumber.end
}
# DEDERER
# hightlight [, {, }, ]
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp {\(|\[|\]|\)} $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bracequad $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# parameter for command hightlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp -- {\s-\w+(?=\s)} $workLine a b]} {
set start [expr [string first $a $workLine] + 1]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add bindKey $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
}

114
highlight/tex.tcl Normal file
View File

@@ -0,0 +1,114 @@
###########################################################
# Tcl/Tk Project Manager #
# version 0.0.1 #
# TCL highlight file #
# Copyright (c) "CONERO lab", 2001, http://conero.lrn.ru #
# Author: Sergey Kalinin (aka BanZaj) banzaj@lrn.ru #
###########################################################
proc HighLightTEX {text line lineNumber node} {
global tree color noteBook
global editor
$text tag configure bold -font $editor(fontBold)
$text tag configure procName -font $editor(fontBold) -foreground $color(procName)
$text tag configure param -foreground $color(param)
$text tag configure subParam -foreground $color(subParam)
$text tag configure keyWord -foreground $color(keyWord)
$text tag configure comments -foreground $color(comments)
$text tag configure variable -foreground $color(var)
$text tag configure string -foreground $color(string)
$text tag configure brace -foreground $color(brace)
$text tag configure percent -foreground $color(percent)
$text tag configure bindKey -foreground $color(bindKey)
$text tag configure lightBracket -background $color(braceBG) -foreground $color(braceFG)
set startIndex 0
set keyWord [info commands]
# for OOP extention
foreach n {class method attribute constructor destructor invariant attribute binding new delete} {
lappend keyWord $n
}
set startPos 0
set workLine $line
regexp -nocase -all -- {(\\)([a-zA-Z])*} string match v1 v2
while {$workLine != ""} {
if {[regexp -nocase -all {(\\)([a-zA-Z])*} $workLine a b c]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add keyWord $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# string " " highlight
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp "\".*?\"" $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start $startPos
incr end $startPos
$text tag add string $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp {\{.*?\}} $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start [expr $startPos +1]
incr end [expr $startPos - 1]
$text tag add param $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
set startPos 0
set workLine $line
while {$workLine != ""} {
if {[regexp {\[.*?\]} $workLine a b]} {
set start [string first $a $workLine]
set end $start
incr end [string length $a]
set workLine [string range $workLine $end end]
incr start [expr $startPos + 1]
incr end [expr $startPos - 1]
$text tag add subParam $lineNumber.$start $lineNumber.$end
set startPos $end
} else {
break
}
}
# add comment #
if [regexp -nocase -all -indices -- {%} $line pos] {
set cur [lindex $pos 1]
$text tag add comments $lineNumber.$cur $lineNumber.end
return 0
}
}