ctags.rb 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +2 -0
- data/Rakefile +23 -0
- data/ctags.rb.gemspec +23 -0
- data/ext/.gitignore +3 -0
- data/ext/extconf.rb +15 -0
- data/ext/vendor/exuberant-ctags/.gitignore +6 -0
- data/ext/vendor/exuberant-ctags/.indent.pro +31 -0
- data/ext/vendor/exuberant-ctags/COPYING +340 -0
- data/ext/vendor/exuberant-ctags/EXTENDING.html +386 -0
- data/ext/vendor/exuberant-ctags/FAQ +371 -0
- data/ext/vendor/exuberant-ctags/INSTALL +215 -0
- data/ext/vendor/exuberant-ctags/INSTALL.oth +73 -0
- data/ext/vendor/exuberant-ctags/MAINTAINERS +88 -0
- data/ext/vendor/exuberant-ctags/Makefile.in +222 -0
- data/ext/vendor/exuberant-ctags/NEWS +871 -0
- data/ext/vendor/exuberant-ctags/README +73 -0
- data/ext/vendor/exuberant-ctags/ant.c +42 -0
- data/ext/vendor/exuberant-ctags/argproc.c +505 -0
- data/ext/vendor/exuberant-ctags/args.c +274 -0
- data/ext/vendor/exuberant-ctags/args.h +63 -0
- data/ext/vendor/exuberant-ctags/asm.c +387 -0
- data/ext/vendor/exuberant-ctags/asp.c +328 -0
- data/ext/vendor/exuberant-ctags/awk.c +81 -0
- data/ext/vendor/exuberant-ctags/basic.c +203 -0
- data/ext/vendor/exuberant-ctags/beta.c +321 -0
- data/ext/vendor/exuberant-ctags/c.c +2932 -0
- data/ext/vendor/exuberant-ctags/cobol.c +50 -0
- data/ext/vendor/exuberant-ctags/config.h.in +277 -0
- data/ext/vendor/exuberant-ctags/configure +7704 -0
- data/ext/vendor/exuberant-ctags/configure.ac +532 -0
- data/ext/vendor/exuberant-ctags/ctags.1 +1186 -0
- data/ext/vendor/exuberant-ctags/ctags.h +28 -0
- data/ext/vendor/exuberant-ctags/ctags.html +2087 -0
- data/ext/vendor/exuberant-ctags/ctags.spec +40 -0
- data/ext/vendor/exuberant-ctags/debug.c +113 -0
- data/ext/vendor/exuberant-ctags/debug.h +70 -0
- data/ext/vendor/exuberant-ctags/descrip.mms +68 -0
- data/ext/vendor/exuberant-ctags/dosbatch.c +42 -0
- data/ext/vendor/exuberant-ctags/e_amiga.h +24 -0
- data/ext/vendor/exuberant-ctags/e_djgpp.h +47 -0
- data/ext/vendor/exuberant-ctags/e_mac.h +143 -0
- data/ext/vendor/exuberant-ctags/e_msoft.h +76 -0
- data/ext/vendor/exuberant-ctags/e_os2.h +37 -0
- data/ext/vendor/exuberant-ctags/e_qdos.h +34 -0
- data/ext/vendor/exuberant-ctags/e_riscos.h +58 -0
- data/ext/vendor/exuberant-ctags/e_vms.h +31 -0
- data/ext/vendor/exuberant-ctags/eiffel.c +1352 -0
- data/ext/vendor/exuberant-ctags/entry.c +847 -0
- data/ext/vendor/exuberant-ctags/entry.h +103 -0
- data/ext/vendor/exuberant-ctags/erlang.c +189 -0
- data/ext/vendor/exuberant-ctags/flex.c +2243 -0
- data/ext/vendor/exuberant-ctags/fortran.c +2197 -0
- data/ext/vendor/exuberant-ctags/general.h +127 -0
- data/ext/vendor/exuberant-ctags/get.c +669 -0
- data/ext/vendor/exuberant-ctags/get.h +50 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/.svn/all-wcprops +47 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/.svn/entries +112 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/README.txt.svn-base +5 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regcomp.c.svn-base +3818 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regex.c.svn-base +74 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regex.h.svn-base +575 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regex_internal.c.svn-base +1713 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regex_internal.h.svn-base +773 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regexec.c.svn-base +4338 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/README.txt +5 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/regcomp.c +3818 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/regex.c +74 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/regex.h +575 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/regex_internal.c +1713 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/regex_internal.h +773 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/regexec.c +4338 -0
- data/ext/vendor/exuberant-ctags/html.c +49 -0
- data/ext/vendor/exuberant-ctags/jscript.c +1572 -0
- data/ext/vendor/exuberant-ctags/keyword.c +258 -0
- data/ext/vendor/exuberant-ctags/keyword.h +34 -0
- data/ext/vendor/exuberant-ctags/lisp.c +139 -0
- data/ext/vendor/exuberant-ctags/lregex.c +704 -0
- data/ext/vendor/exuberant-ctags/lua.c +133 -0
- data/ext/vendor/exuberant-ctags/mac.c +273 -0
- data/ext/vendor/exuberant-ctags/magic.diff +21 -0
- data/ext/vendor/exuberant-ctags/main.c +584 -0
- data/ext/vendor/exuberant-ctags/main.h +32 -0
- data/ext/vendor/exuberant-ctags/maintainer.mak +476 -0
- data/ext/vendor/exuberant-ctags/make.c +217 -0
- data/ext/vendor/exuberant-ctags/matlab.c +44 -0
- data/ext/vendor/exuberant-ctags/mk_bc3.mak +46 -0
- data/ext/vendor/exuberant-ctags/mk_bc5.mak +49 -0
- data/ext/vendor/exuberant-ctags/mk_djg.mak +18 -0
- data/ext/vendor/exuberant-ctags/mk_manx.mak +65 -0
- data/ext/vendor/exuberant-ctags/mk_mingw.mak +31 -0
- data/ext/vendor/exuberant-ctags/mk_mpw.mak +130 -0
- data/ext/vendor/exuberant-ctags/mk_mvc.mak +40 -0
- data/ext/vendor/exuberant-ctags/mk_os2.mak +104 -0
- data/ext/vendor/exuberant-ctags/mk_qdos.mak +100 -0
- data/ext/vendor/exuberant-ctags/mk_sas.mak +63 -0
- data/ext/vendor/exuberant-ctags/mkinstalldirs +40 -0
- data/ext/vendor/exuberant-ctags/ocaml.c +1842 -0
- data/ext/vendor/exuberant-ctags/options.c +1842 -0
- data/ext/vendor/exuberant-ctags/options.h +155 -0
- data/ext/vendor/exuberant-ctags/parse.c +677 -0
- data/ext/vendor/exuberant-ctags/parse.h +129 -0
- data/ext/vendor/exuberant-ctags/parsers.h +63 -0
- data/ext/vendor/exuberant-ctags/pascal.c +267 -0
- data/ext/vendor/exuberant-ctags/perl.c +382 -0
- data/ext/vendor/exuberant-ctags/php.c +237 -0
- data/ext/vendor/exuberant-ctags/python.c +771 -0
- data/ext/vendor/exuberant-ctags/qdos.c +106 -0
- data/ext/vendor/exuberant-ctags/read.c +569 -0
- data/ext/vendor/exuberant-ctags/read.h +116 -0
- data/ext/vendor/exuberant-ctags/readtags.c +959 -0
- data/ext/vendor/exuberant-ctags/readtags.h +252 -0
- data/ext/vendor/exuberant-ctags/rexx.c +39 -0
- data/ext/vendor/exuberant-ctags/routines.c +891 -0
- data/ext/vendor/exuberant-ctags/routines.h +134 -0
- data/ext/vendor/exuberant-ctags/ruby.c +408 -0
- data/ext/vendor/exuberant-ctags/scheme.c +111 -0
- data/ext/vendor/exuberant-ctags/sh.c +115 -0
- data/ext/vendor/exuberant-ctags/slang.c +41 -0
- data/ext/vendor/exuberant-ctags/sml.c +212 -0
- data/ext/vendor/exuberant-ctags/sort.c +230 -0
- data/ext/vendor/exuberant-ctags/sort.h +32 -0
- data/ext/vendor/exuberant-ctags/source.mak +122 -0
- data/ext/vendor/exuberant-ctags/sql.c +2112 -0
- data/ext/vendor/exuberant-ctags/strlist.c +281 -0
- data/ext/vendor/exuberant-ctags/strlist.h +54 -0
- data/ext/vendor/exuberant-ctags/tcl.c +116 -0
- data/ext/vendor/exuberant-ctags/tex.c +524 -0
- data/ext/vendor/exuberant-ctags/verilog.c +340 -0
- data/ext/vendor/exuberant-ctags/vhdl.c +835 -0
- data/ext/vendor/exuberant-ctags/vim.c +636 -0
- data/ext/vendor/exuberant-ctags/vstring.c +232 -0
- data/ext/vendor/exuberant-ctags/vstring.h +85 -0
- data/ext/vendor/exuberant-ctags/yacc.c +40 -0
- data/lib/ctags/exuberant.rb +45 -0
- data/lib/ctags/version.rb +3 -0
- data/lib/ctags.rb +6 -0
- data/test/test_ctags.rb +24 -0
- metadata +233 -0
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* $Id: beta.c 536 2007-06-02 06:09:00Z elliotth $
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 1999-2000, Mj�lner Informatics
|
|
5
|
+
*
|
|
6
|
+
* Written by Erik Corry <corry@mjolner.dk>
|
|
7
|
+
*
|
|
8
|
+
* This source code is released for free distribution under the terms of the
|
|
9
|
+
* GNU General Public License.
|
|
10
|
+
*
|
|
11
|
+
* This module contains functions for generating tags for BETA language
|
|
12
|
+
* files.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/*
|
|
16
|
+
* INCLUDE FILES
|
|
17
|
+
*/
|
|
18
|
+
#include "general.h" /* must always come first */
|
|
19
|
+
|
|
20
|
+
#include <string.h>
|
|
21
|
+
|
|
22
|
+
#include "entry.h"
|
|
23
|
+
#include "parse.h"
|
|
24
|
+
#include "read.h"
|
|
25
|
+
#include "routines.h"
|
|
26
|
+
#include "vstring.h"
|
|
27
|
+
|
|
28
|
+
/*
|
|
29
|
+
* MACROS
|
|
30
|
+
*/
|
|
31
|
+
#define isbident(c) (identarray [(unsigned char) (c)])
|
|
32
|
+
|
|
33
|
+
/*
|
|
34
|
+
* DATA DEFINITIONS
|
|
35
|
+
*/
|
|
36
|
+
typedef enum {
|
|
37
|
+
K_FRAGMENT, K_PATTERN, K_SLOT, K_VIRTUAL
|
|
38
|
+
} betaKind;
|
|
39
|
+
|
|
40
|
+
static kindOption BetaKinds [] = {
|
|
41
|
+
{ TRUE, 'f', "fragment", "fragment definitions"},
|
|
42
|
+
{ FALSE, 'p', "pattern", "all patterns"},
|
|
43
|
+
{ TRUE, 's', "slot", "slots (fragment uses)"},
|
|
44
|
+
{ TRUE, 'v', "virtual", "patterns (virtual or rebound)"}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/* [A-Z_a-z0-9] */
|
|
48
|
+
static const char identarray [256] = {
|
|
49
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0-15 */
|
|
50
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 16-31 */
|
|
51
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 32-47 !"#$%&'()*+'-./ */
|
|
52
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, /* 48-63 0123456789:;<=>? */
|
|
53
|
+
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 64-79 @ABCDEFGHIJKLMNO */
|
|
54
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /* 80-95 PQRSTUVWXYZ [\]^_ */
|
|
55
|
+
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 96-111 `abcdefghijklmno */
|
|
56
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 112-127 pqrstuvwxyz{|}~ */
|
|
57
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 128- */
|
|
58
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
59
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
60
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
61
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
62
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
63
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
64
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* -255 */
|
|
65
|
+
|
|
66
|
+
/*
|
|
67
|
+
* FUNCTION DEFINITIONS
|
|
68
|
+
*/
|
|
69
|
+
|
|
70
|
+
static void makeBetaTag (const char* const name, const betaKind kind)
|
|
71
|
+
{
|
|
72
|
+
if (BetaKinds [kind].enabled)
|
|
73
|
+
{
|
|
74
|
+
tagEntryInfo e;
|
|
75
|
+
initTagEntry (&e, name);
|
|
76
|
+
e.kindName = BetaKinds [kind].name;
|
|
77
|
+
e.kind = BetaKinds [kind].letter;
|
|
78
|
+
makeTagEntry (&e);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
static void findBetaTags (void)
|
|
83
|
+
{
|
|
84
|
+
vString *line = vStringNew ();
|
|
85
|
+
boolean incomment = FALSE;
|
|
86
|
+
boolean inquote = FALSE;
|
|
87
|
+
boolean dovirtuals = BetaKinds [K_VIRTUAL].enabled;
|
|
88
|
+
boolean dopatterns = BetaKinds [K_PATTERN].enabled;
|
|
89
|
+
|
|
90
|
+
do
|
|
91
|
+
{
|
|
92
|
+
boolean foundfragmenthere = FALSE;
|
|
93
|
+
/* find fragment definition (line that starts and ends with --) */
|
|
94
|
+
int last;
|
|
95
|
+
int first;
|
|
96
|
+
int c;
|
|
97
|
+
|
|
98
|
+
vStringClear (line);
|
|
99
|
+
|
|
100
|
+
while ((c = fileGetc ()) != EOF && c != '\n' && c != '\r')
|
|
101
|
+
vStringPut (line, c);
|
|
102
|
+
|
|
103
|
+
vStringTerminate (line);
|
|
104
|
+
|
|
105
|
+
last = vStringLength (line) - 1;
|
|
106
|
+
first = 0;
|
|
107
|
+
/* skip white space at start and end of line */
|
|
108
|
+
while (last && isspace ((int) vStringChar (line, last))) last--;
|
|
109
|
+
while (first < last && isspace ((int) vStringChar (line, first))) first++;
|
|
110
|
+
/* if line still has a reasonable length and ... */
|
|
111
|
+
if (last - first > 4 &&
|
|
112
|
+
(vStringChar (line, first) == '-' &&
|
|
113
|
+
vStringChar (line, first + 1) == '-' &&
|
|
114
|
+
vStringChar (line, last) == '-' &&
|
|
115
|
+
vStringChar (line, last - 1) == '-'))
|
|
116
|
+
{
|
|
117
|
+
if (!incomment && !inquote)
|
|
118
|
+
{
|
|
119
|
+
foundfragmenthere = TRUE;
|
|
120
|
+
/* skip past -- and whitespace. Also skip back past 'dopart'
|
|
121
|
+
or 'attributes' to the :. We have to do this because there
|
|
122
|
+
is no sensible way to include whitespace in a ctags token
|
|
123
|
+
so the conventional space after the ':' would mess us up */
|
|
124
|
+
last -= 2;
|
|
125
|
+
first += 2;
|
|
126
|
+
while (last && vStringChar (line, last) != ':') last--;
|
|
127
|
+
while (last && (isspace ((int) vStringChar (line, last-1)))) last--;
|
|
128
|
+
while (first < last &&
|
|
129
|
+
(isspace ((int) vStringChar (line, first)) ||
|
|
130
|
+
vStringChar (line, first) == '-'))
|
|
131
|
+
first++;
|
|
132
|
+
/* If there's anything left it is a fragment title */
|
|
133
|
+
if (first < last - 1)
|
|
134
|
+
{
|
|
135
|
+
vStringChar (line, last) = 0;
|
|
136
|
+
if (strcasecmp ("LIB", vStringValue (line) + first) &&
|
|
137
|
+
strcasecmp ("PROGRAM", vStringValue (line) + first))
|
|
138
|
+
{
|
|
139
|
+
makeBetaTag (vStringValue (line) + first, K_FRAGMENT);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
} else {
|
|
144
|
+
int pos = 0;
|
|
145
|
+
int len = vStringLength (line);
|
|
146
|
+
if (inquote) goto stringtext;
|
|
147
|
+
if (incomment) goto commenttext;
|
|
148
|
+
programtext:
|
|
149
|
+
for ( ; pos < len; pos++)
|
|
150
|
+
{
|
|
151
|
+
if (vStringChar (line, pos) == '\'')
|
|
152
|
+
{
|
|
153
|
+
pos++;
|
|
154
|
+
inquote = TRUE;
|
|
155
|
+
goto stringtext;
|
|
156
|
+
}
|
|
157
|
+
if (vStringChar (line, pos) == '{')
|
|
158
|
+
{
|
|
159
|
+
pos++;
|
|
160
|
+
incomment = TRUE;
|
|
161
|
+
goto commenttext;
|
|
162
|
+
}
|
|
163
|
+
if (vStringChar (line, pos) == '(' && pos < len - 1 &&
|
|
164
|
+
vStringChar (line, pos+1) == '*')
|
|
165
|
+
{
|
|
166
|
+
pos +=2;
|
|
167
|
+
incomment = TRUE;
|
|
168
|
+
goto commenttext;
|
|
169
|
+
}
|
|
170
|
+
/*
|
|
171
|
+
* SLOT definition looks like this:
|
|
172
|
+
* <<SLOT nameofslot: dopart>>
|
|
173
|
+
* or
|
|
174
|
+
* <<SLOT nameofslot: descriptor>>
|
|
175
|
+
*/
|
|
176
|
+
if (!foundfragmenthere &&
|
|
177
|
+
vStringChar (line, pos) == '<' &&
|
|
178
|
+
pos+1 < len &&
|
|
179
|
+
vStringChar (line, pos+1) == '<' &&
|
|
180
|
+
strstr (vStringValue (line) + pos, ">>"))
|
|
181
|
+
{
|
|
182
|
+
/* Found slot name, get start and end */
|
|
183
|
+
int eoname;
|
|
184
|
+
char c2;
|
|
185
|
+
pos += 2; /* skip past << */
|
|
186
|
+
/* skip past space before SLOT */
|
|
187
|
+
while (pos < len && isspace ((int) vStringChar (line, pos)))
|
|
188
|
+
pos++;
|
|
189
|
+
/* skip past SLOT */
|
|
190
|
+
if (pos+4 <= len &&
|
|
191
|
+
!strncasecmp (vStringValue(line) + pos, "SLOT", (size_t)4))
|
|
192
|
+
pos += 4;
|
|
193
|
+
/* skip past space after SLOT */
|
|
194
|
+
while (pos < len && isspace ((int) vStringChar (line, pos)))
|
|
195
|
+
pos++;
|
|
196
|
+
eoname = pos;
|
|
197
|
+
/* skip to end of name */
|
|
198
|
+
while (eoname < len &&
|
|
199
|
+
(c2 = vStringChar (line, eoname)) != '>' &&
|
|
200
|
+
c2 != ':' &&
|
|
201
|
+
!isspace ((int) c2))
|
|
202
|
+
eoname++;
|
|
203
|
+
if (eoname < len)
|
|
204
|
+
{
|
|
205
|
+
vStringChar (line, eoname) = 0;
|
|
206
|
+
if (strcasecmp ("LIB", vStringValue (line) + pos) &&
|
|
207
|
+
strcasecmp ("PROGRAM", vStringValue (line) + pos) &&
|
|
208
|
+
strcasecmp ("SLOT", vStringValue (line) + pos))
|
|
209
|
+
{
|
|
210
|
+
makeBetaTag (vStringValue (line) + pos, K_SLOT);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (eoname+1 < len) {
|
|
214
|
+
pos = eoname + 1;
|
|
215
|
+
} else {
|
|
216
|
+
pos = len;
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
/* Only patterns that are virtual, extensions of virtuals or
|
|
221
|
+
* final bindings are normally included so as not to overload
|
|
222
|
+
* totally.
|
|
223
|
+
* That means one of the forms name:: name:< or name::<
|
|
224
|
+
*/
|
|
225
|
+
if (!foundfragmenthere &&
|
|
226
|
+
vStringChar (line, pos) == ':' &&
|
|
227
|
+
(dopatterns ||
|
|
228
|
+
(dovirtuals &&
|
|
229
|
+
(vStringChar (line, pos+1) == ':' ||
|
|
230
|
+
vStringChar (line, pos+1) == '<')
|
|
231
|
+
)
|
|
232
|
+
)
|
|
233
|
+
)
|
|
234
|
+
{
|
|
235
|
+
/* Found pattern name, get start and end */
|
|
236
|
+
int eoname = pos;
|
|
237
|
+
int soname;
|
|
238
|
+
while (eoname && isspace ((int) vStringChar (line, eoname-1)))
|
|
239
|
+
eoname--;
|
|
240
|
+
foundanothername:
|
|
241
|
+
/* terminate right after name */
|
|
242
|
+
vStringChar (line, eoname) = 0;
|
|
243
|
+
soname = eoname;
|
|
244
|
+
while (soname &&
|
|
245
|
+
isbident (vStringChar (line, soname-1)))
|
|
246
|
+
{
|
|
247
|
+
soname--;
|
|
248
|
+
}
|
|
249
|
+
if (soname != eoname)
|
|
250
|
+
{
|
|
251
|
+
makeBetaTag (vStringValue (line) + soname, K_PATTERN);
|
|
252
|
+
/* scan back past white space */
|
|
253
|
+
while (soname &&
|
|
254
|
+
isspace ((int) vStringChar (line, soname-1)))
|
|
255
|
+
soname--;
|
|
256
|
+
if (soname && vStringChar (line, soname-1) == ',')
|
|
257
|
+
{
|
|
258
|
+
/* we found a new pattern name before comma */
|
|
259
|
+
eoname = soname;
|
|
260
|
+
goto foundanothername;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
goto endofline;
|
|
266
|
+
commenttext:
|
|
267
|
+
for ( ; pos < len; pos++)
|
|
268
|
+
{
|
|
269
|
+
if (vStringChar (line, pos) == '*' && pos < len - 1 &&
|
|
270
|
+
vStringChar (line, pos+1) == ')')
|
|
271
|
+
{
|
|
272
|
+
pos += 2;
|
|
273
|
+
incomment = FALSE;
|
|
274
|
+
goto programtext;
|
|
275
|
+
}
|
|
276
|
+
if (vStringChar (line, pos) == '}')
|
|
277
|
+
{
|
|
278
|
+
pos++;
|
|
279
|
+
incomment = FALSE;
|
|
280
|
+
goto programtext;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
goto endofline;
|
|
284
|
+
stringtext:
|
|
285
|
+
for ( ; pos < len; pos++)
|
|
286
|
+
{
|
|
287
|
+
if (vStringChar (line, pos) == '\\')
|
|
288
|
+
{
|
|
289
|
+
if (pos < len - 1) pos++;
|
|
290
|
+
}
|
|
291
|
+
else if (vStringChar (line, pos) == '\'')
|
|
292
|
+
{
|
|
293
|
+
pos++;
|
|
294
|
+
/* support obsolete '' syntax */
|
|
295
|
+
if (pos < len && vStringChar (line, pos) == '\'')
|
|
296
|
+
{
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
inquote = FALSE;
|
|
300
|
+
goto programtext;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
endofline:
|
|
305
|
+
inquote = FALSE; /* This shouldn't really make a difference */
|
|
306
|
+
} while (!feof (File.fp));
|
|
307
|
+
vStringDelete (line);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
extern parserDefinition* BetaParser (void)
|
|
311
|
+
{
|
|
312
|
+
static const char *const extensions [] = { "bet", NULL };
|
|
313
|
+
parserDefinition* def = parserNew ("BETA");
|
|
314
|
+
def->kinds = BetaKinds;
|
|
315
|
+
def->kindCount = KIND_COUNT (BetaKinds);
|
|
316
|
+
def->extensions = extensions;
|
|
317
|
+
def->parser = findBetaTags;
|
|
318
|
+
return def;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/* vi:set tabstop=4 shiftwidth=4: */
|