-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
65 changed files
with
532 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
repository.sql | ||
test.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
repo/IDEPersistence/classes/IDE..ClassDescription/Instance/instproc.tcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
repo/IDEPersistence/classes/IDE..CompFileExporter/Instance/getFileName.tcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
IDE::CompFileExporter instproc getFileName name { | ||
string map {:: ..} $name | ||
repobs::asFileName $name | ||
} |
2 changes: 1 addition & 1 deletion
2
repo/IDEPersistence/classes/IDE..CompFileExporter/Instance/writeFileData.tcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
repo/IDEPersistence/classes/IDE..ObjectDescription/Instance/proc.tcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
repo/IDERegexpBrowser/classes/IDE..RegexpBrowser/Instance/history%3Aadd.meta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
category history |
38 changes: 38 additions & 0 deletions
38
repo/IDERegexpBrowser/classes/IDE..RegexpBrowser/Instance/history%3Aadd.tcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
IDE::RegexpBrowser instproc history:add {} { | ||
my instvar data winRegexp w_history last counter inReplay | ||
|
||
if {$inReplay} { | ||
set inReplay 0 | ||
return | ||
} | ||
|
||
set exp [$winRegexp get 1.0 end-1char] | ||
if {$exp != "" && $exp != $last} { | ||
# memorize position | ||
set start [$w_history index insert] | ||
# add text | ||
$w_history insert end "$exp\n" | ||
set end [$w_history index insert] | ||
$w_history insert end "\n" {spacing} | ||
set last $exp | ||
$w_history yview moveto 1.0 | ||
# do the binding | ||
set tag "t$counter" | ||
incr counter | ||
$w_history tag bind $tag <Any-Enter> "$w_history tag configure $tag -background lightblue" | ||
$w_history tag bind $tag <Any-Leave> "$w_history tag configure $tag -background {}" | ||
$w_history tag bind $tag <1> [list [self] history:replay [list $exp]] | ||
$w_history tag add $tag $start $end | ||
|
||
# colorize the expression in history | ||
scan $start "%d.%d" sl sc | ||
incr sl -1 | ||
foreach tag {e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 lookahead noreport} { | ||
foreach {start end} [$data(w:regexp) tag ranges $tag] { | ||
set start [$w_history index "$start + $sc chars + $sl lines"] | ||
set end [$w_history index "$end + $sc chars + $sl lines"] | ||
$w_history tag add $tag $start $end | ||
} | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
repo/IDERegexpBrowser/classes/IDE..RegexpBrowser/Instance/history%3Ainit.meta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
category history |
39 changes: 39 additions & 0 deletions
39
repo/IDERegexpBrowser/classes/IDE..RegexpBrowser/Instance/history%3Ainit.tcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
IDE::RegexpBrowser instproc history:init {} { | ||
my instvar data w_history historyWin | ||
IDE::RegexpBrowser instvar font | ||
set w [toplevel [Object autoname .history]] | ||
set historyWin $w | ||
|
||
wm title $w "Visual REGEXP [IDE::RegexpBrowser set version] -- REGEXP History" | ||
wm geometry $w 640x480 | ||
wm protocol $w WM_DELETE_WINDOW "[self] set v_history 0; wm withdraw $w" | ||
|
||
# text zone | ||
set tf [frame $w.t] | ||
pack $tf -side top -expand true -fill both | ||
set t [text $tf.t -xscrollcommand "$tf.x set" -yscrollcommand "$tf.y set" -bg white -font [IDE::RegexpBrowser set font_regexp] -width 5 -height 1 -selectbackground lightblue -selectborderwidth 0] | ||
|
||
set w_history $t | ||
set data(w:history) $t | ||
|
||
$t tag configure spacing -font {Helvetica 6} | ||
set tx [scrollbar $tf.x -bd 1 -orient horizontal -command "$t xview"] | ||
set ty [scrollbar $tf.y -bd 1 -orient vertical -command "$t yview"] | ||
bindtags $t "$t all" | ||
grid $t $ty -sticky news | ||
grid $tx x -sticky news | ||
grid columnconfigure $tf {0} -weight 1 | ||
grid columnconfigure $tf {1} -weight 0 | ||
grid rowconfigure $tf {0} -weight 1 | ||
grid rowconfigure $tf {1} -weight 0 | ||
|
||
# buttons | ||
set bf [frame $w.f] | ||
pack $bf -side bottom -padx 5 -pady 5 | ||
|
||
set b1 [button $bf.1 -bd 1 -text "Hide" -command "wm withdraw $w; [self] set v_history 0"] | ||
set b2 [button $bf.2 -bd 1 -text "Save ..." -command [list [self] history:save]] | ||
pack $b2 $b1 -side left -anchor c | ||
|
||
wm withdraw $w | ||
} |
1 change: 1 addition & 0 deletions
1
repo/IDERegexpBrowser/classes/IDE..RegexpBrowser/Instance/history%3Areplay.meta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
category history |
5 changes: 5 additions & 0 deletions
5
repo/IDERegexpBrowser/classes/IDE..RegexpBrowser/Instance/history%3Areplay.tcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
IDE::RegexpBrowser instproc history:replay text { | ||
my set inReplay 1 | ||
my regexp:set $text | ||
my go | ||
} |
1 change: 1 addition & 0 deletions
1
repo/IDERegexpBrowser/classes/IDE..RegexpBrowser/Instance/history%3Asave.meta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
category history |
9 changes: 9 additions & 0 deletions
9
repo/IDERegexpBrowser/classes/IDE..RegexpBrowser/Instance/history%3Asave.tcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
IDE::RegexpBrowser instproc history:save {} { | ||
my instvar w_history | ||
set file [tk_getSaveFile -defaultextension .txt] | ||
if {$file != ""} { | ||
set out [open $file "w"] | ||
puts -nonewline $out [$w_history get 1.0 end] | ||
close $out | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
repo/IDERegexpBrowser/classes/IDE..RegexpBrowser/Instance/make-regexp%3Acompute.meta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
category make-regexp |
7 changes: 7 additions & 0 deletions
7
repo/IDERegexpBrowser/classes/IDE..RegexpBrowser/Instance/make-regexp%3Acompute.tcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
IDE::RegexpBrowser instproc make-regexp:compute {} { | ||
my instvar data | ||
|
||
set words [$data(w:make:list) get 1.0 end-1c] | ||
$data(w:make:output) delete 1.0 end | ||
$data(w:make:output) insert 1.0 [make-regexp::make-regexp $words] | ||
} |
1 change: 1 addition & 0 deletions
1
repo/IDERegexpBrowser/classes/IDE..RegexpBrowser/Instance/make-regexp%3Aok.meta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
category make-regexp |
8 changes: 8 additions & 0 deletions
8
repo/IDERegexpBrowser/classes/IDE..RegexpBrowser/Instance/make-regexp%3Aok.tcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
IDE::RegexpBrowser instproc make-regexp:ok w { | ||
my instvar data | ||
|
||
set words [$data(w:make:list) get 1.0 end-1c] | ||
|
||
$data(w:regexp) insert insert "([make-regexp::make-regexp $words])" | ||
destroy $w | ||
} |
28 changes: 28 additions & 0 deletions
28
repo/IDERegexpBrowser/classes/IDE..RegexpBrowser/Instance/pattern%3Aload.tcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
IDE::RegexpBrowser instproc pattern:load {{file {}}} { | ||
my instvar data | ||
IDE::RegexpBrowser instvar regexp_db | ||
|
||
# get filename | ||
if {$file == ""} { | ||
set types [list [list "All" *]] | ||
set file [tk_getOpenFile -filetypes $types -parent .] | ||
if {$file == ""} { | ||
return | ||
} | ||
} | ||
# do it | ||
set in [open $file "r"] | ||
$data(w:menu) delete [expr 4+[llength $regexp_db]/2] end | ||
while {![eof $in]} { | ||
set name [gets $in] | ||
while {$name == ""} { | ||
set name [gets $in] | ||
} | ||
set pattern [gets $in] | ||
while {$pattern == ""} { | ||
set pattern [gets $in] | ||
} | ||
$data(w:menu) add command -label $name -command [list [self] regexp:insert [list $pattern]] | ||
} | ||
close $in | ||
} |
1 change: 1 addition & 0 deletions
1
repo/IDERegexpBrowser/classes/IDE..RegexpBrowser/Instance/regexp%3Acolorize.meta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
category regexp |
66 changes: 66 additions & 0 deletions
66
repo/IDERegexpBrowser/classes/IDE..RegexpBrowser/Instance/regexp%3Acolorize.tcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
IDE::RegexpBrowser instproc regexp:colorize {} { | ||
my instvar data | ||
|
||
set exp [$data(w:regexp) get 1.0 end-1char] | ||
set max [string length $exp] | ||
set stack {} | ||
# list format : min max min max ... | ||
set indices [list "report" 0 [string length $exp]] | ||
# search the groups in the regexp | ||
set data(v:nblevels) 1 | ||
for {set i 0} {$i < $max} {incr i} { | ||
set c [string index $exp $i] | ||
if {$c == "\\"} { | ||
incr i | ||
continue | ||
} elseif {$c == "("} { | ||
set c [string index $exp [expr $i+1]] | ||
set what [string index $exp [expr $i+2]] | ||
# test for escape with (?...) | ||
if {$c == "?"} { | ||
if {$what != ":"} { | ||
lappend indices "lookahead" | ||
} else { | ||
lappend indices "noreport" | ||
} | ||
} else { | ||
lappend indices "report" | ||
incr data(v:nblevels) | ||
} | ||
lappend indices $i | ||
set stack "[llength $indices] $stack" | ||
lappend indices 0 | ||
|
||
} elseif {$c == ")"} { | ||
set idx [lindex $stack 0] | ||
if {$idx == ""} { | ||
continue | ||
} | ||
set stack [lrange $stack 1 end] | ||
set indices [lreplace $indices $idx $idx $i] | ||
} | ||
} | ||
|
||
# remove old colors | ||
foreach level $data(v:levels) { | ||
$data(w:regexp) tag remove $level 1.0 end | ||
} | ||
$data(w:regexp) tag remove "lookahead" 1.0 end | ||
$data(w:regexp) tag remove "noreport" 1.0 end | ||
# colorize the regexp | ||
set i 0 | ||
foreach {type min max} $indices { | ||
if {$type != "report"} { | ||
continue | ||
} | ||
$data(w:regexp) tag add [lindex $data(v:levels) $i] [$data(w:regexp) index "1.0+${min}chars"] [$data(w:regexp) index "1.0+[expr $max+1]chars"] | ||
incr i | ||
} | ||
# apply special item | ||
foreach {type min max} $indices { | ||
if {$type == "report"} { | ||
continue | ||
} | ||
$data(w:regexp) tag add $type [$data(w:regexp) index "1.0+${min}chars"] [$data(w:regexp) index "1.0+[expr $max+1]chars"] | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
repo/IDERegexpBrowser/classes/IDE..RegexpBrowser/Instance/regexp%3Ahelp%3Atoggle.meta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
category regexp |
8 changes: 8 additions & 0 deletions
8
repo/IDERegexpBrowser/classes/IDE..RegexpBrowser/Instance/regexp%3Ahelp%3Atoggle.tcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
IDE::RegexpBrowser instproc regexp:help:toggle {} { | ||
my instvar v_help data | ||
if {$v_help == 0} { | ||
pack forget $data(w:help) | ||
} else { | ||
pack $data(w:help) -before $data(w:regexp) -fill x -padx 5 | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
repo/IDERegexpBrowser/classes/IDE..RegexpBrowser/Instance/regexp%3Ainsert.meta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
category regexp |
12 changes: 12 additions & 0 deletions
12
repo/IDERegexpBrowser/classes/IDE..RegexpBrowser/Instance/regexp%3Ainsert.tcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
IDE::RegexpBrowser instproc regexp:insert what { | ||
my instvar data | ||
|
||
set w $data(w:regexp) | ||
# prepare undo/redo | ||
set data(v:undo:r$data(v:undo:index)) [list [$w index insert] [$w get 1.0 end-1char]] | ||
set data(v:undo:index) [expr ($data(v:undo:index)+1) % 100] | ||
# do it | ||
$w insert insert $what | ||
# prepare undo/redo | ||
set data(v:undo:r$data(v:undo:index)) [list [$w index insert] [$w get 1.0 end-1char]] | ||
} |
1 change: 1 addition & 0 deletions
1
repo/IDERegexpBrowser/classes/IDE..RegexpBrowser/Instance/regexp%3Aload.meta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
category regexp |
Oops, something went wrong.