Revision: 3900 http://geany.svn.sourceforge.net/geany/?rev=3900&view=rev Author: eht16 Date: 2009-06-28 10:42:34 +0000 (Sun, 28 Jun 2009)
Log Message: ----------- Improve parsing of Tcl files (parsing new Tcl8.6 style classes, methods and namespaces). Patch by Witek Mozga, thanks.
Modified Paths: -------------- trunk/ChangeLog trunk/src/symbols.c trunk/tagmanager/tcl.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-06-25 17:29:37 UTC (rev 3899) +++ trunk/ChangeLog 2009-06-28 10:42:34 UTC (rev 3900) @@ -1,3 +1,11 @@ +2009-06-28 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> + + * tagmanager/tcl.c, src/symbol.c: + Improve parsing of Tcl files (parsing new Tcl8.6 style classes, + methods and namespaces). + Patch by Witek Mozga, thanks. + + 2009-06-25 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* data/ui_toolbar.xml, doc/geany.txt, doc/geany.html, src/ui_utils.c,
Modified: trunk/src/symbols.c =================================================================== --- trunk/src/symbols.c 2009-06-25 17:29:37 UTC (rev 3899) +++ trunk/src/symbols.c 2009-06-28 10:42:34 UTC (rev 3900) @@ -717,6 +717,15 @@ break; } case GEANY_FILETYPES_TCL: + { + tag_list_add_groups(tag_store, + &(tv_iters.tag_namespace), _("Namespaces"), "classviewer-namespace", + &(tv_iters.tag_class), _("Classes"), "classviewer-class", + &(tv_iters.tag_member), _("Methods"), "classviewer-method", + &(tv_iters.tag_function), _("Procedures"), "classviewer-method", + NULL); + break; + } case GEANY_FILETYPES_PYTHON: { tag_list_add_groups(tag_store,
Modified: trunk/tagmanager/tcl.c =================================================================== --- trunk/tagmanager/tcl.c 2009-06-25 17:29:37 UTC (rev 3899) +++ trunk/tagmanager/tcl.c 2009-06-28 10:42:34 UTC (rev 3900) @@ -24,13 +24,14 @@ * DATA DEFINITIONS */ typedef enum { - K_CLASS, K_METHOD, K_PROCEDURE + K_CLASS, K_METHOD, K_PROCEDURE, K_MODULE } tclKind;
static kindOption TclKinds [] = { { TRUE, 'c', "class", "classes" }, - { TRUE, 'm', "member", "methods" }, - { TRUE, 'p', "function", "procedures" } + { TRUE, 'f', "member", "methods" }, + { TRUE, 'p', "function", "procedures" }, + { TRUE, 'm', "namespace", "modules" } };
/* @@ -107,6 +108,29 @@ cp = makeTclTag (cp, name, K_METHOD); } } + else if (match (line, "method")) + { + cp = makeTclTag (cp, name, K_METHOD); + } + else if (match (line, "oo::class") ) { + if (match (cp, "create")) + { + cp += 6; + while (isspace ((int) *cp)) + ++cp; + cp = makeTclTag (cp, name, K_CLASS); + } + } + else if (match (line, "namespace") ) { + if (match (cp, "eval")) + { + cp += 4; + while (isspace ((int) *cp)) + ++cp; + cp = makeTclTag (cp, name, K_MODULE); + } + } + } vStringDelete (name); }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.