Skip to content

The Tcl lexer contains mistakes and isn't up-to-date with Tcl 9 #2159

@mark-summerfield

Description

@mark-summerfield

Tcl

The lexer only applies to '*.tcl' but should also apply to '*.tm' (Tcl module files).

It looks like the BUILTINS have been copy/pasted from the docs and so include things that aren't builtin at all. For example, re_syntax isn't a Tcl command it is simply a page that describes the Tcl regexp and regsub commands' syntax.

When I highlight Tcl/Tk 9 I use the following.

== Commands

after append array bgerror binary break buildinfo callback cd chan
classvariable clock close concat configure const continue cookiejar
coroinject coroprobe dde dict encoding env eof error errorCode errorInfo eval exec exit expr fblocked fconfigure fcopy file fileevent flush for foreach foreachLine format fpclassify gets glob global history http incr info interp join lappend lassign ledit lindex link linsert list llength lmap load lpop lrange lremove lrepeat lreplace lreverse lsearch lseq lset lsort mathfunc memory msgcat namespace next nextto open package parray pid pkg::create pkg_mkIndex platform platform::shell property puts pwd read readFile refchan regexp registry regsub rename safe scan seek self set socket source split string subst tcl::idna tcl::prefix tcl::process tcltest tell time timerate tm trace transchan unknown unload unset update uplevel upvar variable vwait while writeFile zipfs zlib

== Special Commands

apply coroutine proc return tailcall yield yieldto

== Conditional Commands

if then else elseif switch catch try throw raise finally default while for
foreach break continue

== Object Oriented Commands

classmethod constructor destructor export forward initialize initialise
method private self my superclass unexport myclass mymethod oo::Slot oo::abstract oo::class oo::configurable oo::copy oo::define oo::objdefine oo::object oo::singleton

== Global Variables

argc argv argv0 auto_execok auto_import auto_load auto_mkindex auto_path auto_qualify auto_reset tcl_endOfWord tcl_findLibrary tcl_interactive tcl_library tcl_nonwordchars tcl_patchLevel tcl_pkgPath tcl_platform tcl_rcFileName tcl_startOfNextWord tcl_startOfPreviousWord tcl_traceCompile tcl_traceExec tcl_version tcl_wordBreakAfter tcl_wordBreakBefore tcl_wordchars tcltest

== Booleans

true false on off yes no

== Tk Commands

lower raise print selection send

== Tk Widget Commands

bell bind bindtags bitmap busy button canvas checkbutton clipboard console destroy entry event focus font fontchooser frame geometry grab grid image label labelframe listbox menu menubutton message option pack panedwindow photo place radiobutton safe::loadTk scale scrollbar spinbox sysnotify systray text tk tk::scalingPct tk::svgFmt tk_bisque tk_chooseColor tk_chooseDirectory tk_dialog tk_focusFollowsMouse tk_focusNext tk_focusPrev tk_getOpenFile tk_getSaveFile tk_library tk_menuSetFocus tk_messageBox
tk_optionMenu tk_patchLevel tk_popup tk_setPalette tk_strictMotif
tk_textCopy tk_textCut tk_textPaste tk_version tkerror tkwait toplevel
ttk::button ttk::checkbutton ttk::combobox ttk::entry ttk::frame ttk::label ttk::labelframe ttk::menubutton ttk::notebook ttk::panedwindow ttk::progressbar ttk::radiobutton ttk::scale ttk::scrollbar ttk::separator ttk::sizegrip ttk::spinbox ttk::style ttk::treeview ttk::widget ttk_image winfo wm

== Tk Flags

-text -command -yscrollcommand -xscrollcommand -background -foreground -fg -bg -highlightbackground -y -x -highlightcolor -relief -width -height -wrap -font -fill -side -outline -style -insertwidth -textvariable -activebackground -activeforeground -insertbackground -anchor -orient -troughcolor -nonewline -expand -type -message -title -offset -in -after -yscroll -xscroll -forward -regexp -count -exact -padx -ipadx -filetypes -all -from -to -label -value -variable -regexp -backwards -forwards -bd -pady -ipady -state -row -column -cursor -highlightcolors -linemap -menu -tearoff -displayof -cursor -underline -tags -tag

(Personally, I also highlight uppercase SQL within Tcl.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfix-requestA request for a bugfix to be developed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions