There's a tutorial on how to do it here
http://blog.slickedit.com/2008/05/tutorial-adding-language-support-to-slickedit/but see this too
http://community.slickedit.com/index.php/topic,9794.0.htmlIn the tutorial, it describes what to do for logo support. In step six (tagging support) it explains you have to write a function logo_proc_search (rust_proc_search in your case). In logo, a function definition starts with the keyword "to" e.g.
to square
repeat 4 [forward 50 right 90]
end
and a variable declaration starts with the keyword "make" (I think), so the slick c file logo.e has this code
// search for the next line that has either a "to" or a "make"
int status = search("^(:b|)(to:b|make:b[\"])"fn,"@rih>Xcs");
if (status) {
return status;
}
// grab the line and parse out the keyword and function name
get_line(line);
parse strip(line) with kw proc_name args;
switch (lowcase(kw)) {
case "to":
proc_name = tag_tree_compose_tag(proc_name,"","proc",0,args);
break;
case "make":
proc_name = substr(proc_name,2) :+ "(gvar)";
break;
}
Now here's where it gets a bit tricky. tag_tree_compose_tag is a function that generates a function signature e.g. for the square function above, the statement
parse strip(line) with kw proc_name args
results in kw value is "to", proc_name value is "square" and args is ""
so tag_tree_compose_tag generates a string which is the function signature for the square function. The third argument to tag_tree_compose_tag is "proc" - this identifies "square" has having a tagging type of "procedure".
Type fp tag_tree_compose_tag on the slick c command line to see more about it.
In the case of the "make" keyword which declares a variable e.g. in logo
MAKE "X 100
creates a variable called X and gives it value 100
so substr(proc_name,2) strips off the leading " character resulting in proc_name becoming the string X(gvar) - gvar identifies the tag name as a global variable. The :+ operator concatenates strings.
Slick C is very close to "C with dynamic types". If you search the slickedit installation macros folder for _proc_search you'll see other proc_search functions. e.g. in modula.e (modula2/modula3) you'll see the code below. The function doesn't call tag_tree_compose_tag at all - which might be because modula2 doesn't support overloaded functions. The fifth line does this
status=search('^[ \t]*'_keywords':b:v[ \t]*[(;:]','@rhe');
This code is using "auto concatenation" of strings - _keywords is a string variable and '^[ \t]*' is a string so slick c lets you run them together. The second argument to the search function is the string '@rhe'. "help" for the slick c "search" function says that '@' means "no error message"; 'r' means interpret the search string as a regular expression using "slickedit" type regular expression; 'h' - search hidden lines; 'e' - case insensitive.
_str mod_proc_search(var proc_name,boolean find_first,_str extension)
{
int status=0;
_str _keywords='(PROCEDURE)';
if ( find_first ) {
if ( proc_name:=='' ) {
status=search('^[ \t]*'_keywords':b:v[ \t]*[(;:]','@rhe');
} else {
word_chars := _clex_identifier_chars();
status=search(proc_name,'@he>w=['word_chars']');
}
} else {
status=repeat_search();
}