~ubuntu-branches/ubuntu/jaunty/geany/jaunty

« back to all changes in this revision

Viewing changes to tagmanager/basic.c

  • Committer: Bazaar Package Importer
  • Author(s): Gauvain Pocentek
  • Date: 2008-05-09 20:40:06 UTC
  • mfrom: (1.1.7 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080509204006-9fu737rfvapfj7pn
Tags: 0.14-1ubuntu1
* Merge from debian unstable, remaining changes:
  - patches/20_add_debdiff_as_diff_type.dpatch:
    Also recognize .dpatch files as diff's
  - debian/geany.xpm:
    Replace icon with a .xpm of the new one
  - Modify Maintainer value to match the DebianMaintainerField
    specification.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 *   $Id: basic.c 2135 2007-12-30 15:20:22Z eht16 $
 
2
 *   $Id: basic.c 2287 2008-02-27 13:17:29Z eht16 $
3
3
 *
4
4
 *   Copyright (c) 2000-2006, Darren Hiebert, Elias Pschernig
5
5
 *
50
50
};
51
51
 
52
52
static KeyWord freebasic_keywords[] = {
53
 
        {"dim", K_VARIABLE}, // must always be the first
54
 
        {"common", K_VARIABLE}, // must always be the second
55
 
        {"const", K_CONST}, // must always be the third
 
53
        {"dim", K_VARIABLE}, /* must always be the first */
 
54
        {"common", K_VARIABLE}, /* must always be the second */
 
55
        {"const", K_CONST}, /* must always be the third */
56
56
        {"function", K_FUNCTION},
57
57
        {"sub", K_FUNCTION},
58
58
        {"private sub", K_FUNCTION},
77
77
        vStringClear (name);
78
78
 
79
79
        if (strncasecmp (pos, "shared", 6) == 0)
80
 
                pos += 6; // skip keyword "shared"
 
80
                pos += 6; /* skip keyword "shared" */
81
81
 
82
82
        while (isspace (*pos))
83
83
                pos++;
84
84
 
85
 
        // capture "dim as String str"
 
85
        /* capture "dim as String str" */
86
86
        if (strncasecmp (pos, "as", 2) == 0)
87
87
        {
88
 
                        pos += 2; // skip keyword "as"
 
88
                        pos += 2; /* skip keyword "as" */
89
89
 
90
90
                while (isspace (*pos))
91
91
                        pos++;
92
 
                while (!isspace (*pos)) // skip next part which is a type
 
92
                while (!isspace (*pos)) /* skip next part which is a type */
93
93
                        pos++;
94
94
                while (isspace (*pos))
95
95
                        pos++;
96
 
                // now we are at the name
 
96
                /* now we are at the name */
97
97
        }
98
98
 
99
 
        // capture "dim as foo ptr bar"
 
99
        /* capture "dim as foo ptr bar" */
100
100
        if (strncasecmp (pos, "ptr", 3) == 0)
101
101
        {
102
 
                pos += 3; // skip keyword "ptr"
 
102
                pos += 3; /* skip keyword "ptr" */
103
103
 
104
104
                while (isspace (*pos))
105
105
                        pos++;
110
110
        vStringTerminate (name);
111
111
        makeSimpleTag (name, BasicKinds, kind);
112
112
 
113
 
        // if the line contains a ',', we have multiple declarations
 
113
        /* if the line contains a ',', we have multiple declarations */
114
114
        while (*pos && strchr (pos, ','))
115
115
        {
116
 
                // skip all we don't need(e.g. "..., new_array(5), " we skip "(5)")
 
116
                /* skip all we don't need(e.g. "..., new_array(5), " we skip "(5)") */
117
117
                while (*pos != ',' && *pos != '\'')
118
118
                        pos++;
119
119
 
120
120
                if (*pos == '\'')
121
 
                        return 0; // break if we are in a comment
 
121
                        return 0; /* break if we are in a comment */
122
122
 
123
123
                while (isspace (*pos) || *pos == ',')
124
124
                        pos++;
125
125
 
126
126
                if (*pos == '\'')
127
 
                        return 0; // break if we are in a comment
 
127
                        return 0; /* break if we are in a comment */
128
128
 
129
129
                vStringClear (name);
130
130
                for (; *pos && !isspace (*pos) && *pos != '(' && *pos != ',' && *pos != '='; pos++)
165
165
        if (kw == &freebasic_keywords[0] ||
166
166
                kw == &freebasic_keywords[1] ||
167
167
                kw == &freebasic_keywords[2])
168
 
                return extract_dim (p, name, kw->kind); // extract_dim adds the found tag(s)
 
168
                return extract_dim (p, name, kw->kind); /* extract_dim adds the found tag(s) */
169
169
 
170
170
        for (j = 0; j < 1; j++)
171
171
        {