Kaydet (Commit) df1b9fd0 authored tarafından Enrico Tröger's avatar Enrico Tröger

new filetype Tcl/Tk, renamed tex.c

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@335 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 78eb7280
# For complete documentation of this file; please see Geany's main documentation
[styling]
# foreground;background;bold;italic
default=0x000000;0xffffff;false;false
comment=0x0000ff;0xffffff;false;false
commentline=0x0000ff;0xffffff;false;false
number=0x007f00;0xffffff;false;false
operator=0x101030;0xffffff;false;false
identifier=0x0000a2;0xffffff;false;false
wordinquote=0x7f007f;0xffffff;false;false
inquote=0x7f007f;0xffffff;false;false
substitution=0x991111;0xffffff;false;false
modifier=0x7f007f;0xffffff;false;false
expand=0x100000;0xffffff;false;false
wordtcl=0x991111;0xffffff;true;false
wordtk=0x00007f;0xffffff;true;false
worditcl=0x991111;0xffffff;true;false
wordtkcmds=0x00007f;0xffffff;true;false
wordexpand=0x00007f;0xffffff;true;false
[keywords]
# all items must be in one line
tcl=after append array auto_execok auto_import auto_load auto_load_index auto_qualify beep bgerror binary break case catch cd clock close concat continue dde default echo else elseif encoding eof error eval exec exit expr fblocked fconfigure fcopy file fileevent flush for foreach format gets glob global history http if incr info interp join lappend lindex linsert list llength load loadTk lrange lreplace lsearch lset lsort memory msgcat namespace open package pid pkg::create pkg_mkIndex Platform-specific proc puts pwd re_syntax read regexp registry regsub rename resource return scan seek set socket source split string subst switch tclLog tclMacPkgSearch tclPkgSetup tclPkgUnknown tell time trace unknown unset update uplevel upvar variable vwait while
tk=bell bind bindtags bitmap button canvas checkbutton clipboard colors console cursors destroy entry event focus font frame grab grid image Inter-client keysyms label labelframe listbox lower menu menubutton message option options pack panedwindow photo place radiobutton raise scale scrollbar selection send spinbox text tk tk_chooseColor tk_chooseDirectory tk_dialog tk_focusNext tk_getOpenFile tk_messageBox tk_optionMenu tk_popup tk_setPalette tkerror tkvars tkwait toplevel winfo wish wm
itcl=@scope body class code common component configbody constructor define destructor hull import inherit itcl itk itk_component itk_initialize itk_interior itk_option iwidgets keep method private protected public
tkcommands=tk_bisque tk_chooseColor tk_dialog tk_focusFollowsMouse tk_focusNext tk_focusPrev tk_getOpenFile tk_getSaveFile tk_messageBox tk_optionMenu tk_popup tk_setPalette tk_textCopy tk_textCut tk_textPaste tkButtonAutoInvoke tkButtonDown tkButtonEnter tkButtonInvoke tkButtonLeave tkButtonUp tkCancelRepeat tkCheckRadioDown tkCheckRadioEnter tkCheckRadioInvoke tkColorDialog tkColorDialog_BuildDialog tkColorDialog_CancelCmd tkColorDialog_Config tkColorDialog_CreateSelector tkColorDialog_DrawColorScale tkColorDialog_EnterColorBar tkColorDialog_HandleRGBEntry tkColorDialog_HandleSelEntry tkColorDialog_InitValues tkColorDialog_LeaveColorBar tkColorDialog_MoveSelector tkColorDialog_OkCmd tkColorDialog_RedrawColorBars tkColorDialog_RedrawFinalColor tkColorDialog_ReleaseMouse tkColorDialog_ResizeColorBars tkColorDialog_RgbToX tkColorDialog_SetRGBValue tkColorDialog_StartMove tkColorDialog_XToRgb tkConsoleAbout tkConsoleBind tkConsoleExit tkConsoleHistory tkConsoleInit tkConsoleInsert tkConsoleInvoke tkConsoleOutput tkConsolePrompt tkConsoleSource tkDarken tkEntryAutoScan tkEntryBackspace tkEntryButton1 tkEntryClosestGap tkEntryGetSelection tkEntryInsert tkEntryKeySelect tkEntryMouseSelect tkEntryNextWord tkEntryPaste tkEntryPreviousWord tkEntrySeeInsert tkEntrySetCursor tkEntryTranspose tkEventMotifBindings tkFDGetFileTypes tkFirstMenu tkFocusGroup_BindIn tkFocusGroup_BindOut tkFocusGroup_Create tkFocusGroup_Destroy tkFocusGroup_In tkFocusGroup_Out tkFocusOK tkGenerateMenuSelect tkIconList tkIconList_Add tkIconList_Arrange tkIconList_AutoScan tkIconList_Btn1 tkIconList_Config tkIconList_Create tkIconList_CtrlBtn1 tkIconList_Curselection tkIconList_DeleteAll tkIconList_Double1 tkIconList_DrawSelection tkIconList_FocusIn tkIconList_FocusOut tkIconList_Get tkIconList_Goto tkIconList_Index tkIconList_Invoke tkIconList_KeyPress tkIconList_Leave1 tkIconList_LeftRight tkIconList_Motion1 tkIconList_Reset tkIconList_ReturnKey tkIconList_See tkIconList_Select tkIconList_Selection tkIconList_ShiftBtn1 tkIconList_UpDown tkListbox tkListboxAutoScan tkListboxBeginExtend tkListboxBeginSelect tkListboxBeginToggle tkListboxCancel tkListboxDataExtend tkListboxExtendUpDown tkListboxKeyAccel_Goto tkListboxKeyAccel_Key tkListboxKeyAccel_Reset tkListboxKeyAccel_Set tkListboxKeyAccel_Unset tkListboxMotion tkListboxSelectAll tkListboxUpDown tkMbButtonUp tkMbEnter tkMbLeave tkMbMotion tkMbPost tkMenuButtonDown tkMenuDownArrow tkMenuDup tkMenuEscape tkMenuFind tkMenuFindName tkMenuFirstEntry tkMenuInvoke tkMenuLeave tkMenuLeftArrow tkMenuMotion tkMenuNextEntry tkMenuNextMenu tkMenuRightArrow tkMenuUnpost tkMenuUpArrow tkMessageBox tkMotifFDialog tkMotifFDialog_ActivateDList tkMotifFDialog_ActivateFEnt tkMotifFDialog_ActivateFList tkMotifFDialog_ActivateSEnt tkMotifFDialog_BrowseDList tkMotifFDialog_BrowseFList tkMotifFDialog_BuildUI tkMotifFDialog_CancelCmd tkMotifFDialog_Config tkMotifFDialog_Create tkMotifFDialog_FileTypes tkMotifFDialog_FilterCmd tkMotifFDialog_InterpFilter tkMotifFDialog_LoadFiles tkMotifFDialog_MakeSList tkMotifFDialog_OkCmd tkMotifFDialog_SetFilter tkMotifFDialog_SetListMode tkMotifFDialog_Update tkPostOverPoint tkRecolorTree tkRestoreOldGrab tkSaveGrabInfo tkScaleActivate tkScaleButton2Down tkScaleButtonDown tkScaleControlPress tkScaleDrag tkScaleEndDrag tkScaleIncrement tkScreenChanged tkScrollButton2Down tkScrollButtonDown tkScrollButtonDrag tkScrollButtonUp tkScrollByPages tkScrollByUnits tkScrollDrag tkScrollEndDrag tkScrollSelect tkScrollStartDrag tkScrollTopBottom tkScrollToPos tkTabToWindow tkTearOffMenu tkTextAutoScan tkTextButton1 tkTextClosestGap tkTextInsert tkTextKeyExtend tkTextKeySelect tkTextNextPara tkTextNextPos tkTextNextWord tkTextPaste tkTextPrevPara tkTextPrevPos tkTextPrevWord tkTextResetAnchor tkTextScrollPages tkTextSelectTo tkTextSetCursor tkTextTranspose tkTextUpDownLine tkTraverseToMenu tkTraverseWithinMenu
expand=
[settings]
# the following characters are these which a "word" can contains, see documentation
wordchars=_#&abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
# if only single comment char is supported like # in this file, leave comment_close blank
comment_open=#
comment_close=
# set to false if a comment character/string should start a column 0 of a line, true uses any
# indention of the line, e.g. setting to true causes the following on pressing CTRL+d
#command_example();
# setting to false would generate this
# command_example();
# This setting works only for single line comments
comment_use_indent=true
[build_settings]
# %f will be replaced by the complete filename
# %e will be replaced by the filename without extension
# (use only one of it at one time)
compiler=tclsh8.4 "%f"
run_cmd=tclsh8.4 "%f"
...@@ -163,6 +163,7 @@ int Scintilla_LinkLexers() { ...@@ -163,6 +163,7 @@ int Scintilla_LinkLexers() {
LINK_LEXER(lmPerl); LINK_LEXER(lmPerl);
LINK_LEXER(lmRuby); LINK_LEXER(lmRuby);
LINK_LEXER(lmSQL); LINK_LEXER(lmSQL);
LINK_LEXER(lmTCL);
//--Autogenerated -- end of automatically generated section //--Autogenerated -- end of automatically generated section
......
This diff is collapsed.
...@@ -6,7 +6,6 @@ noinst_LIBRARIES=libscintilla.a ...@@ -6,7 +6,6 @@ noinst_LIBRARIES=libscintilla.a
CC=g++ CC=g++
AM_CXXFLAGS = -DGTK -DGTK2 -DSCI_LEXER -DG_THREADS_IMPL_NONE AM_CXXFLAGS = -DGTK -DGTK2 -DSCI_LEXER -DG_THREADS_IMPL_NONE
#AM_CXXFLAGS = -DGTK -DGTK2 -DSCI_LEXER
LEXER_SRCS= \ LEXER_SRCS= \
LexAsm.cxx \ LexAsm.cxx \
...@@ -23,7 +22,8 @@ LexPascal.cxx \ ...@@ -23,7 +22,8 @@ LexPascal.cxx \
LexPerl.cxx \ LexPerl.cxx \
LexPython.cxx \ LexPython.cxx \
LexRuby.cxx \ LexRuby.cxx \
LexSQL.cxx LexSQL.cxx \
LexTCL.cxx
SRCS= \ SRCS= \
CallTip.cxx \ CallTip.cxx \
......
...@@ -389,6 +389,24 @@ void filetypes_init_types(void) ...@@ -389,6 +389,24 @@ void filetypes_init_types(void)
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_RUBY]->title, filetypes[GEANY_FILETYPES_RUBY]); filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_RUBY]->title, filetypes[GEANY_FILETYPES_RUBY]);
filetypes_create_newmenu_item(template_menu, filetypes[GEANY_FILETYPES_RUBY]->title, filetypes[GEANY_FILETYPES_RUBY]); filetypes_create_newmenu_item(template_menu, filetypes[GEANY_FILETYPES_RUBY]->title, filetypes[GEANY_FILETYPES_RUBY]);
#define TCL
filetypes[GEANY_FILETYPES_TCL] = g_new0(filetype, 1);
filetypes[GEANY_FILETYPES_TCL]->id = GEANY_FILETYPES_TCL;
filetypes[GEANY_FILETYPES_TCL]->name = g_strdup("Tcl");
filetypes[GEANY_FILETYPES_TCL]->has_tags = TRUE;
filetypes[GEANY_FILETYPES_TCL]->title = g_strdup(_("Tcl source file"));
filetypes[GEANY_FILETYPES_TCL]->extension = g_strdup("tcl");
filetypes[GEANY_FILETYPES_TCL]->pattern = g_new0(gchar*, 4);
filetypes[GEANY_FILETYPES_TCL]->pattern[0] = g_strdup("*.tcl");
filetypes[GEANY_FILETYPES_TCL]->pattern[1] = g_strdup("*.tk");
filetypes[GEANY_FILETYPES_TCL]->pattern[2] = g_strdup("*.wish");
filetypes[GEANY_FILETYPES_TCL]->pattern[3] = NULL;
filetypes[GEANY_FILETYPES_TCL]->style_func_ptr = styleset_tcl;
filetypes[GEANY_FILETYPES_TCL]->comment_open = g_strdup("#");
filetypes[GEANY_FILETYPES_TCL]->comment_close = NULL;
filetypes_init_build_programs(filetypes[GEANY_FILETYPES_TCL]);
filetypes_create_menu_item(filetype_menu, filetypes[GEANY_FILETYPES_TCL]->title, filetypes[GEANY_FILETYPES_TCL]);
#define ALL #define ALL
filetypes[GEANY_FILETYPES_ALL] = g_new0(filetype, 1); filetypes[GEANY_FILETYPES_ALL] = g_new0(filetype, 1);
filetypes[GEANY_FILETYPES_ALL]->id = GEANY_FILETYPES_ALL; filetypes[GEANY_FILETYPES_ALL]->id = GEANY_FILETYPES_ALL;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $Id$ * $Id$
*/ */
...@@ -46,8 +46,9 @@ enum ...@@ -46,8 +46,9 @@ enum
GEANY_FILETYPES_CAML, // 16 GEANY_FILETYPES_CAML, // 16
GEANY_FILETYPES_OMS, // 17 GEANY_FILETYPES_OMS, // 17
GEANY_FILETYPES_RUBY, // 18 GEANY_FILETYPES_RUBY, // 18
GEANY_FILETYPES_ALL, // 19 GEANY_FILETYPES_TCL, // 19
GEANY_MAX_FILE_TYPES // 20 GEANY_FILETYPES_ALL, // 20
GEANY_MAX_FILE_TYPES // 21
}; };
struct build_menu_items struct build_menu_items
......
...@@ -1337,6 +1337,7 @@ void styleset_python(ScintillaObject *sci) ...@@ -1337,6 +1337,7 @@ void styleset_python(ScintillaObject *sci)
styleset_set_style(sci, SCE_P_STRINGEOL, GEANY_FILETYPES_PYTHON, 13); styleset_set_style(sci, SCE_P_STRINGEOL, GEANY_FILETYPES_PYTHON, 13);
SSM(sci, SCI_SETPROPERTY, (sptr_t) "fold.comment.python", (sptr_t) "1"); SSM(sci, SCI_SETPROPERTY, (sptr_t) "fold.comment.python", (sptr_t) "1");
SSM(sci, SCI_SETPROPERTY, (sptr_t) "fold.quotes.python", (sptr_t) "1");
} }
...@@ -2114,5 +2115,88 @@ void styleset_oms(ScintillaObject *sci) ...@@ -2114,5 +2115,88 @@ void styleset_oms(ScintillaObject *sci)
} }
static void styleset_tcl_init(void)
{
GKeyFile *config = g_key_file_new();
GKeyFile *config_home = g_key_file_new();
gchar *f = g_strconcat(app->configdir, G_DIR_SEPARATOR_S SUBDIR G_DIR_SEPARATOR_S, "filetypes.tcl", NULL);
styleset_load_file(config, GEANY_DATA_DIR G_DIR_SEPARATOR_S "filetypes.tcl", G_KEY_FILE_KEEP_COMMENTS, NULL);
g_key_file_load_from_file(config_home, f, G_KEY_FILE_KEEP_COMMENTS, NULL);
types[GEANY_FILETYPES_TCL] = g_new(style_set, 1);
styleset_get_hex(config, config_home, "styling", "default", "0x000000", "0xffffff", "false", types[GEANY_FILETYPES_TCL]->styling[0]);
styleset_get_hex(config, config_home, "styling", "comment", "0x0000ff", "0xffffff", "false", types[GEANY_FILETYPES_TCL]->styling[1]);
styleset_get_hex(config, config_home, "styling", "commentline", "0x0000ff", "0xffffff", "false", types[GEANY_FILETYPES_TCL]->styling[2]);
styleset_get_hex(config, config_home, "styling", "number", "0x007f00", "0xffffff", "false", types[GEANY_FILETYPES_TCL]->styling[3]);
styleset_get_hex(config, config_home, "styling", "operator", "0x101030", "0xffffff", "false", types[GEANY_FILETYPES_TCL]->styling[4]);
styleset_get_hex(config, config_home, "styling", "identifier", "0x0000a2", "0xffffff", "false", types[GEANY_FILETYPES_TCL]->styling[5]);
styleset_get_hex(config, config_home, "styling", "wordinquote", "0x7f007f", "0xffffff", "false", types[GEANY_FILETYPES_TCL]->styling[6]);
styleset_get_hex(config, config_home, "styling", "inquote", "0x7f007f", "0xffffff", "false", types[GEANY_FILETYPES_TCL]->styling[7]);
styleset_get_hex(config, config_home, "styling", "substitution", "0x991111", "0xffffff", "false", types[GEANY_FILETYPES_TCL]->styling[8]);
styleset_get_hex(config, config_home, "styling", "modifier", "0x7f007f", "0xffffff", "false", types[GEANY_FILETYPES_TCL]->styling[9]);
styleset_get_hex(config, config_home, "styling", "expand", "0x100000", "0xffffff", "false", types[GEANY_FILETYPES_TCL]->styling[10]);
styleset_get_hex(config, config_home, "styling", "wordtcl", "0x991111", "0xffffff", "true", types[GEANY_FILETYPES_TCL]->styling[11]);
styleset_get_hex(config, config_home, "styling", "wordtk", "0x00007f", "0xffffff", "true", types[GEANY_FILETYPES_TCL]->styling[12]);
styleset_get_hex(config, config_home, "styling", "worditcl", "0x991111", "0xffffff", "true", types[GEANY_FILETYPES_TCL]->styling[13]);
styleset_get_hex(config, config_home, "styling", "wordtkcmds", "0x00007f", "0xffffff", "true", types[GEANY_FILETYPES_TCL]->styling[14]);
styleset_get_hex(config, config_home, "styling", "wordexpand", "0x00007f", "0xffffff", "true", types[GEANY_FILETYPES_TCL]->styling[15]);
types[GEANY_FILETYPES_TCL]->keywords = g_new(gchar*, 6);
styleset_get_keywords(config, config_home, "keywords", "tcl", GEANY_FILETYPES_TCL, 0, "");
styleset_get_keywords(config, config_home, "keywords", "tk", GEANY_FILETYPES_TCL, 1, "");
styleset_get_keywords(config, config_home, "keywords", "itcl", GEANY_FILETYPES_TCL, 2, "");
styleset_get_keywords(config, config_home, "keywords", "tkcommands", GEANY_FILETYPES_TCL, 3, "");
styleset_get_keywords(config, config_home, "keywords", "expand", GEANY_FILETYPES_TCL, 4, "");
types[GEANY_FILETYPES_TCL]->keywords[5] = NULL;
styleset_get_wordchars(config, config_home, GEANY_FILETYPES_TCL, GEANY_WORDCHARS);
filetypes_get_config(config, config_home, GEANY_FILETYPES_TCL);
g_key_file_free(config);
g_key_file_free(config_home);
g_free(f);
}
void styleset_tcl(ScintillaObject *sci)
{
if (types[GEANY_FILETYPES_TCL] == NULL) styleset_tcl_init();
styleset_common(sci, 5);
SSM(sci, SCI_SETWORDCHARS, 0, (sptr_t) types[GEANY_FILETYPES_TCL]->wordchars);
SSM(sci, SCI_AUTOCSETMAXHEIGHT, 8, 0);
SSM(sci, SCI_SETLEXER, SCLEX_TCL, 0);
SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) types[GEANY_FILETYPES_TCL]->keywords[0]);
SSM(sci, SCI_SETKEYWORDS, 1, (sptr_t) types[GEANY_FILETYPES_TCL]->keywords[1]);
SSM(sci, SCI_SETKEYWORDS, 2, (sptr_t) types[GEANY_FILETYPES_TCL]->keywords[2]);
SSM(sci, SCI_SETKEYWORDS, 3, (sptr_t) types[GEANY_FILETYPES_TCL]->keywords[3]);
SSM(sci, SCI_SETKEYWORDS, 4, (sptr_t) types[GEANY_FILETYPES_TCL]->keywords[4]);
styleset_set_style(sci, SCE_TCL_DEFAULT, GEANY_FILETYPES_TCL, 0);
styleset_set_style(sci, SCE_TCL_COMMENT, GEANY_FILETYPES_TCL, 1);
styleset_set_style(sci, SCE_TCL_COMMENTLINE, GEANY_FILETYPES_TCL, 2);
styleset_set_style(sci, SCE_TCL_NUMBER, GEANY_FILETYPES_TCL, 3);
styleset_set_style(sci, SCE_TCL_OPERATOR, GEANY_FILETYPES_TCL, 4);
styleset_set_style(sci, SCE_TCL_IDENTIFIER, GEANY_FILETYPES_TCL, 5);
styleset_set_style(sci, SCE_TCL_WORD_IN_QUOTE, GEANY_FILETYPES_TCL, 6);
styleset_set_style(sci, SCE_TCL_IN_QUOTE, GEANY_FILETYPES_TCL, 7);
styleset_set_style(sci, SCE_TCL_SUBSTITUTION, GEANY_FILETYPES_TCL, 8);
styleset_set_style(sci, SCE_TCL_MODIFIER, GEANY_FILETYPES_TCL, 9);
styleset_set_style(sci, SCE_TCL_EXPAND, GEANY_FILETYPES_TCL, 10);
styleset_set_style(sci, SCE_TCL_WORD, GEANY_FILETYPES_TCL, 11);
styleset_set_style(sci, SCE_TCL_WORD2, GEANY_FILETYPES_TCL, 12);
styleset_set_style(sci, SCE_TCL_WORD3, GEANY_FILETYPES_TCL, 13);
styleset_set_style(sci, SCE_TCL_WORD4, GEANY_FILETYPES_TCL, 14);
styleset_set_style(sci, SCE_TCL_WORD5, GEANY_FILETYPES_TCL, 15);
SSM(sci, SCI_SETWHITESPACEFORE, 1, 0xc0c0c0);
}
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $Id$ * $Id$
*/ */
...@@ -79,4 +79,6 @@ void styleset_caml(ScintillaObject *sci); ...@@ -79,4 +79,6 @@ void styleset_caml(ScintillaObject *sci);
void styleset_oms(ScintillaObject *sci); void styleset_oms(ScintillaObject *sci);
void styleset_tcl(ScintillaObject *sci);
#endif #endif
...@@ -2217,6 +2217,7 @@ void utils_parse_compiler_error_line(const gchar *string) ...@@ -2217,6 +2217,7 @@ void utils_parse_compiler_error_line(const gchar *string)
// the error output of python, perl and php -l on errors euals in "line xx", so they are "compatible" // the error output of python, perl and php -l on errors euals in "line xx", so they are "compatible"
case GEANY_FILETYPES_PHP: case GEANY_FILETYPES_PHP:
case GEANY_FILETYPES_PERL: case GEANY_FILETYPES_PERL:
case GEANY_FILETYPES_TCL:
case GEANY_FILETYPES_PYTHON: case GEANY_FILETYPES_PYTHON:
{ // File "HyperArch.py", line 37, in ? { // File "HyperArch.py", line 37, in ?
gchar *space = strchr(string, ' '); gchar *space = strchr(string, ' ');
......
...@@ -32,7 +32,7 @@ libtagmanager_a_SOURCES =\ ...@@ -32,7 +32,7 @@ libtagmanager_a_SOURCES =\
docbook.c\ docbook.c\
make.c\ make.c\
asm.c\ asm.c\
tex.c\ latex.c\
pascal.c\ pascal.c\
perl.c\ perl.c\
ruby.c\ ruby.c\
...@@ -40,6 +40,7 @@ libtagmanager_a_SOURCES =\ ...@@ -40,6 +40,7 @@ libtagmanager_a_SOURCES =\
php.c\ php.c\
python.c\ python.c\
regex.c\ regex.c\
tcl.c\
sh.c\ sh.c\
ctags.c\ ctags.c\
entry.c\ entry.c\
......
/* /*
* $Id$ * $Id: tex.c 283 2006-04-27 22:52:09Z eht16 $
* *
* Copyright (c) 2000-2001, Jérôme Plût * Copyright (c) 2000-2001, Jérôme Plût
* Copyright (c) 2006, Enrico Tröger * Copyright (c) 2006, Enrico Tröger
...@@ -217,7 +217,7 @@ static void findTeXTags(void) ...@@ -217,7 +217,7 @@ static void findTeXTags(void)
} }
} }
extern parserDefinition* TexParser (void) extern parserDefinition* LaTeXParser (void)
{ {
static const char *const extensions [] = { "tex", "sty", "idx", NULL }; static const char *const extensions [] = { "tex", "sty", "idx", NULL };
parserDefinition * def = parserNew ("LaTeX"); parserDefinition * def = parserNew ("LaTeX");
......
...@@ -23,13 +23,14 @@ ...@@ -23,13 +23,14 @@
PerlParser, \ PerlParser, \
PhpParser, \ PhpParser, \
PythonParser, \ PythonParser, \
TexParser, \ LaTeXParser, \
AsmParser, \ AsmParser, \
ConfParser, \ ConfParser, \
SqlParser, \ SqlParser, \
DocBookParser, \ DocBookParser, \
CssParser, \ CssParser, \
RubyParser, \ RubyParser, \
TclParser, \
ShParser ShParser
#endif /* _PARSERS_H */ #endif /* _PARSERS_H */
......
/*
*
* Copyright (c) 2000-2001, Darren Hiebert
*
* This source code is released for free distribution under the terms of the
* GNU General Public License.
*
* This module contains functions for generating tags for TCL scripts.
*/
/*
* INCLUDE FILES
*/
#include "general.h" /* must always come first */
#include <string.h>
#include "parse.h"
#include "read.h"
#include "vstring.h"
/*
* DATA DEFINITIONS
*/
typedef enum {
K_PROCEDURE
} tclKind;
static kindOption TclKinds [] = {
{ TRUE, 'f', "function", "procedures" }
};
/*
* FUNCTION DEFINITIONS
*/
static void findTclTags (void)
{
vString *name = vStringNew ();
const unsigned char *line;
while ((line = fileReadLine ()) != NULL)
{
int i;
if (line [0] == '\0' || line [0] == '#')
continue;
/* read first word */
for (i = 0 ; line [i] != '\0' && ! isspace (line [i]) ; ++i)
;
if (strncmp ((const char*) line, "proc", (size_t) 4) == 0)
{
const unsigned char *cp = line + i;
while (isspace ((int) *cp))
++cp;
while (line [i] != '\0' && ! isspace ((int) *cp))
{
vStringPut (name, (int) *cp);
++cp;
}
vStringTerminate (name);
makeSimpleTag (name, TclKinds, K_PROCEDURE);
vStringClear (name);
}
}
vStringDelete (name);
}
extern parserDefinition* TclParser (void)
{
static const char *const extensions [] = { "tcl", "tk", "wish", NULL };
parserDefinition* def = parserNew ("Tcl");
def->kinds = TclKinds;
def->kindCount = KIND_COUNT (TclKinds);
def->extensions = extensions;
def->parser = findTclTags;
return def;
}
/* vi:set tabstop=8 shiftwidth=4: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment