Changeset 8d687fe in tol
- Timestamp:
- Feb 13, 2012, 5:41:00 PM (15 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 1053ab7
- Parents:
- ab6d232
- Location:
- tolbase/lib/toltk
- Files:
-
- 2 edited
-
bystext.tcl (modified) (1 diff)
-
editor.tcl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tolbase/lib/toltk/bystext.tcl
rab6d232 r8d687fe 795 795 796 796 #///////////////////////////////////////////////////////////////////////////// 797 proc ::BayesText::TolSyntaxCheck { editor} {797 proc ::BayesText::TolSyntaxCheck { editor {dir ""} } { 798 798 #///////////////////////////////////////////////////////////////////////////// 799 799 global toltk_script_path 800 # guardamos el archivo en un temporal 801 set path [file join $::env(HOME) __check__.tol] 802 set texto [GetSelectionOrAll $editor] 803 set ok [::BayesText::SaveTxt $texto $path] 804 if {$ok} { 805 # evaluamos el archivo 806 set check [TolFileSyntaxCheck $path] 807 if {[lindex $check 0]} { 808 tk_messageBox -type ok -icon info -title [mc "Syntax Check"] -parent $editor \ 809 -message [mc "Syntax check done successfully"] 810 } else { 811 # hay errores 812 #puts "TolSyntaxCheck (hay errores)" 813 ShowSyntaxErrors $editor [lindex $check 1] 814 } 815 # borrar el archivo 816 catch "file delete $path" error 817 } else { 818 tk_messageBox -type ok -icon warning -title [mc Editor] -parent $editor \ 819 -message [mc "Syntax check cannot be done"] 820 } 800 801 set buffer [ GetSelectionOrAll $editor ] 802 if { $dir ne "" } { 803 set cwd [ pwd ] 804 cd $dir 805 } 806 807 if { [ catch { tol::checksyntax $buffer } check ] } { 808 Tolcon_Trace "within ::BayesText::TolSyntaxCheck($editor,$dir): $check" 809 return 0 810 } 811 set check [ string trim $check ] 812 if { $check eq "" } { 813 tk_messageBox -type ok -icon info -title [mc "Syntax Check"] \ 814 -parent $editor -message [mc "Syntax check done successfully"] 815 } else { 816 ShowSyntaxErrors $editor $check 817 } 818 return 1 821 819 } 822 820 -
tolbase/lib/toltk/editor.tcl
rab6d232 r8d687fe 1571 1571 #///////////////////////////////////////////////////////////////////////////// 1572 1572 upvar \#0 ${this}::data data 1573 ::BayesText::TolSyntaxCheck $data(txt) 1573 ::BayesText::TolSyntaxCheck $data(txt) [ file dir $data(nameFile) ] 1574 1574 } 1575 1575
Note: See TracChangeset
for help on using the changeset viewer.
