Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding FORTH ctags #3377

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 4 additions & 8 deletions ctags/parsers/forth.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
* Copyright (c) 2023, Eric Forgeot
*
* Based on work by Jon Strait
* from
* https://sourceforge.net/p/geany/git/ci/master/tree/ctags/parsers/markdown.c
*
* This source code is released for free distribution under the terms of the
* GNU General Public License version 2 or (at your opinion) any later version.
*
* This module contains functions for generating tags for Forth files
* https://www.forth.com/starting-forth/1-forth-stacks-dictionary/
*/

/*
Expand All @@ -28,7 +31,6 @@
*/

typedef enum {
// K_SECTION,
K_FUNCTION,
} ForthKind;

Expand All @@ -48,23 +50,17 @@ static void findForthTags (void)
while ((line = readLineFromInputFile()) != NULL)
{
if (line[0] == ':') {
vStringCatS(name, " ");
vStringCatS(name, (const char *) line);
// makeSimpleTag(name, K_SECTION);
makeSimpleTag(name, K_FUNCTION);
}
else {
vStringClear (name);
if (! isspace(*line))
vStringCatS(name, (const char*) line);
}
}
vStringDelete (name);
}

extern parserDefinition* ForthParser (void)
{
static const char *const patterns [] = { "*.f", NULL };
static const char *const patterns [] = { "*.fth", NULL };
static const char *const extensions [] = { "forth", NULL };
parserDefinition* const def = parserNew ("Forth");

Expand Down