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

Falconpl updates #8

Closed
wants to merge 12 commits into from
62 changes: 30 additions & 32 deletions MAINTAINERS
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
The following individuals are registered as developers for the maintenance of
Exuberant Ctags. They are listed by their SourgeForge username and by the
To send email to any one of them, send it to <[email protected]>.

Ctags SourgeForge Full
Parser username Name
---------- ----------- -----
Ant dfishburn David Fishburn
AWK jkoshy Joseph Koshy
Basic elias Elias Pschernig
C# elliotth Elliott Hughes
DosBatch dfishburn David Fishburn
Flex dfishburn David Fishburn
Java elliotth Elliott Hughes
JavaScript dfishburn David Fishburn
MATlAB dfishburn David Fishburn
Objective-C aeruder Andrew Ruder
OCaml vberthoux Vincent Berthoux
Perl perlguy0 Dmitri Tikhonov
PHP jafl John Lindal
Python elias Elias Pschernig
Ruby elliotth Elliott Hughes
SML jkoshy Joseph Koshy
SQL dfishburn David Fishburn
TeX dfishburn David Fishburn
Vim dfishburn David Fishburn
All else dhiebert Darren Hiebert
Exuberant Ctags. They are listed by their Github username.

Ctags Github Full
Parser username Name
---------- ----------- -----
Ant David Fishburn
AWK Joseph Koshy
Basic elias-pschernig Elias Pschernig
C# Elliott Hughes
DosBatch David Fishburn
Falcon steveno Steven Oliver
Flex David Fishburn
Java Elliott Hughes
JavaScript David Fishburn
MATlAB David Fishburn
Objective-C Andrew Ruder
OCaml Vincent Berthoux
Perl Dmitri Tikhonov
PHP John Lindal
Python elias-pschernig Elias Pschernig
Ruby Elliott Hughes
SML Joseph Koshy
SQL David Fishburn
TeX David Fishburn
Vim David Fishburn
All else Darren Hiebert

How To Build & Test Like A Maintainer
=====================================
Expand All @@ -41,9 +41,9 @@ Prerequisites
Install the Xcode developer tools, available here:
http://developer.apple.com/tools/download/

RedHat:
Fedora:

up2date --nosig subversion autoheader autoconf
yum install subversion autoheader autoconf

Windows:

Expand All @@ -54,9 +54,7 @@ Building

First time:

svn co https://ctags.svn.sourceforget.net/svnroot/ctags/trunk ctags
# Miss off the "/trunk" above if you want access to old releases or the
# web site.
git clone git://github.com/fishman/ctags.git
cd ctags
autoheader
autoconf
Expand All @@ -66,7 +64,7 @@ Building
Later:

cd ctags
svn update
git pull
make -j

Testing
Expand Down
2 changes: 2 additions & 0 deletions Test/simple.fal
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* COMMENT
*/

import from socket

const CONSTANT = "1"

test = "
Expand Down
57 changes: 44 additions & 13 deletions falcon.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* $Id$
*
* Copyright (c) 2011 Steven Oliver <[email protected]>
* Copyright (c) 2011, 2012 Steven Oliver <[email protected]>
*
* This source code is released for free distribution under the terms of the
* GNU General Public License.
Expand All @@ -19,7 +19,6 @@
#include <string.h>
#include <ctype.h>

#include "parse.h"
#include "read.h"

/*
Expand All @@ -44,6 +43,24 @@ static kindOption FalconKinds [] = {
/*
* Function Definitions
*/

static boolean isIdentifierChar (int c)
{
return (boolean) (isalnum (c));
}

static const char *skipSpace (const char *cp)
{
while (isspace ((int) *cp))
++cp;

return cp;
}

/*
* Main parsing function
*/

static void findFalconTags (void)
{
vString *name = vStringNew ();
Expand All @@ -53,15 +70,17 @@ static void findFalconTags (void)
{
const unsigned char *cp = line;

// Skip lines starting with # which in falcon
// would only be the "crunch bang" statement
if (*cp == '#')
continue;

if (strncmp ((const char*) cp, "function", (size_t) 8) == 0)
{
cp += 8;
while (isspace ((int) *cp))
++cp;
while (isalnum ((int) *cp) || *cp == '_')
cp = skipSpace (cp);

while (isIdentifierChar ((int) *cp))
{
vStringPut (name, (int) *cp);
++cp;
Expand All @@ -73,9 +92,9 @@ static void findFalconTags (void)
else if (strncmp ((const char*) cp, "class", (size_t) 5) == 0)
{
cp += 5;
while (isspace ((int) *cp))
++cp;
while (isalnum ((int) *cp) || *cp == '_')
cp = skipSpace (cp);

while (isIdentifierChar ((int) *cp))
{
vStringPut (name, (int) *cp);
++cp;
Expand All @@ -87,9 +106,23 @@ static void findFalconTags (void)
else if (strncmp ((const char*) cp, "load", (size_t) 4) == 0)
{
cp += 4;
while (isspace ((int) *cp))
cp = skipSpace (cp);

while (isIdentifierChar ((int) *cp))
{
vStringPut (name, (int) *cp);
++cp;
while (isalnum ((int) *cp) || *cp == '_')
}
vStringTerminate (name);
makeSimpleTag (name, FalconKinds, K_NAMESPACE);
vStringClear (name);
}
else if (strncmp ((const char*) cp, "import from", (size_t) 11) == 0)
{
cp += 12;
cp = skipSpace (cp);

while (isIdentifierChar ((int) *cp))
{
vStringPut (name, (int) *cp);
++cp;
Expand All @@ -107,13 +140,11 @@ static void findFalconTags (void)
*/
extern parserDefinition* FalconParser (void)
{
static const char *const extensions [] = { "fal", NULL };
static const char *const extensions [] = { "fal", "ftd", NULL };
parserDefinition *def = parserNew ("Falcon");
def->kinds = FalconKinds;
def->kindCount = KIND_COUNT (FalconKinds);
def->extensions = extensions;
def->parser = findFalconTags;
return def;
}

/* vi:set tabstop=4 shiftwidth=4: */