Skip to content

Commit d0368a8

Browse files
authored
Merge pull request #4245 from masatake/misc-fix
Some minor fixes
2 parents 3c08796 + ee4246a commit d0368a8

File tree

6 files changed

+17
-18
lines changed

6 files changed

+17
-18
lines changed

docs/man/ctags.1.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,6 @@ Listing Options
10981098
How this field can be accessed from optscript code.
10991099
This field is for Universal Ctags developers.
11001100

1101-
11021101
DESCRIPTION
11031102
Human readable description for the field.
11041103

man/ctags.1.rst.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,6 @@ Listing Options
10981098
How this field can be accessed from optscript code.
10991099
This field is for Universal Ctags developers.
11001100

1101-
11021101
DESCRIPTION
11031102
Human readable description for the field.
11041103

optlib/man.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ static void initializeManParser (const langType language)
225225
extern parserDefinition* ManParser (void)
226226
{
227227
static const char *const extensions [] = {
228+
"man",
228229
"1",
229230
"2",
230231
"3",

optlib/man.ctags

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#
2323
#
2424
--langdef=Man
25+
--map-Man=+.man
2526
--map-Man=+.1
2627
--map-Man=+.2
2728
--map-Man=+.3

parsers/v.c

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,6 @@ static roleDefinition VUnknownRoles [COUNT_UNKNOWN_ROLE] = {
310310
};
311311

312312
typedef enum {
313-
KIND_NONE = -1,
314313
KIND_FUNCTION,
315314
KIND_MODULE,
316315
KIND_VARIABLE,
@@ -1538,7 +1537,7 @@ static void parseFunction (tokenInfo *const token, int scope,
15381537
vString *const access, kindType kind)
15391538
{
15401539
Assert (kind == KIND_FUNCTION || kind == KIND_METHOD ||
1541-
kind == KIND_ALIAS || kind == KIND_NONE);
1540+
kind == KIND_ALIAS || kind == KIND_GHOST_INDEX);
15421541
Assert (kind == KIND_METHOD || isKeyword (token, KEYWORD_fn));
15431542
PARSER_PROLOGUE (kind == KIND_FUNCTION? "fndef" :
15441543
(kind == KIND_METHOD? "method" :
@@ -1590,7 +1589,7 @@ static void parseFunction (tokenInfo *const token, int scope,
15901589
skipToToken (TOKEN_CLOSE_PAREN, NULL);
15911590
}
15921591
// name
1593-
if ((kind == KIND_NONE && (
1592+
if ((kind == KIND_GHOST_INDEX && (
15941593
isToken (token, TOKEN_IDENT, TOKEN_TYPE) ||
15951594
isKeyword (token, KEYWORD_TYPE))) ||
15961595
(kind == KIND_FUNCTION && (
@@ -1611,7 +1610,7 @@ static void parseFunction (tokenInfo *const token, int scope,
16111610
readToken (token);
16121611
}
16131612
// closure args
1614-
if (kind == KIND_NONE && name == NULL &&
1613+
if (kind == KIND_GHOST_INDEX && name == NULL &&
16151614
isToken (token, TOKEN_OPEN_SQUARE))
16161615
{
16171616
vStringPut (argList, '[');
@@ -1621,7 +1620,7 @@ static void parseFunction (tokenInfo *const token, int scope,
16211620
}
16221621
// template args
16231622
if ((kind == KIND_FUNCTION ||
1624-
(kind == KIND_NONE && name == NULL)) &&
1623+
(kind == KIND_GHOST_INDEX && name == NULL)) &&
16251624
isToken (token, TOKEN_OPEN_SQUARE))
16261625
{
16271626
vStringPut (argList, '[');
@@ -1666,7 +1665,7 @@ static void parseFunction (tokenInfo *const token, int scope,
16661665
int newScope = CORK_NIL;
16671666
if (name || kind == KIND_METHOD)
16681667
{
1669-
kindType realKind = kind == KIND_NONE? KIND_FUNCTION : kind;
1668+
kindType realKind = kind == KIND_GHOST_INDEX? KIND_FUNCTION : kind;
16701669
int realScope = name?
16711670
lookupQualifiedName (fnToken, name, scope, NULL) : scope;
16721671
newScope = makeFnTag (fnToken, name, realKind, realScope,
@@ -1677,15 +1676,15 @@ static void parseFunction (tokenInfo *const token, int scope,
16771676
makeTag (rxToken, NULL, KIND_RECEIVER, newScope);
16781677
}
16791678
// block
1680-
if ((kind == KIND_NONE && expectToken (token, TOKEN_OPEN_CURLY)) ||
1679+
if ((kind == KIND_GHOST_INDEX && expectToken (token, TOKEN_OPEN_CURLY)) ||
16811680
(kind == KIND_FUNCTION && isToken (token, TOKEN_OPEN_CURLY)))
16821681
{
16831682
int lineNumber = parseBlock (token, newScope, false);
16841683
tagEntryInfo *entry = getEntryInCorkQueue (newScope);
16851684
if (entry)
16861685
setTagEndLine (entry, lineNumber);
16871686
// fncall
1688-
if (kind == KIND_NONE)
1687+
if (kind == KIND_GHOST_INDEX)
16891688
{
16901689
readToken (token);
16911690
if (isToken (token, TOKEN_OPEN_PAREN))
@@ -1944,7 +1943,7 @@ static void parseStruct (tokenInfo *const token, vString *const access,
19441943
(kind == KIND_STRUCT && isKeyword (token, KEYWORD_struct)) ||
19451944
(kind == KIND_INTERFACE && isKeyword (token, KEYWORD_interface)) ||
19461945
(kind == KIND_UNION && isKeyword (token, KEYWORD_union)) ||
1947-
(kind == KIND_NONE && isKeyword (token, KEYWORD_struct, KEYWORD_union)));
1946+
(kind == KIND_GHOST_INDEX && isKeyword (token, KEYWORD_struct, KEYWORD_union)));
19481947
PARSER_PROLOGUE (kind == KIND_INTERFACE? "iface" :
19491948
(kind == KIND_UNION? "union" :
19501949
(kind == KIND_STRUCT? "struct" : "anon")));
@@ -1956,14 +1955,14 @@ static void parseStruct (tokenInfo *const token, vString *const access,
19561955
if ((kind == KIND_STRUCT || kind == KIND_INTERFACE) && PS->isBuiltin &&
19571956
scope == CORK_NIL && isKeyword (token, KEYWORD_TYPE, KEYWORD_map))
19581957
readToken (token);
1959-
else if ((kind != KIND_NONE && expectToken (token, TOKEN_TYPE)) ||
1960-
(kind == KIND_NONE && isToken (token, TOKEN_TYPE)))
1958+
else if ((kind != KIND_GHOST_INDEX && expectToken (token, TOKEN_TYPE)) ||
1959+
(kind == KIND_GHOST_INDEX && isToken (token, TOKEN_TYPE)))
19611960
{
19621961
parseFullyQualified (token, true);
19631962
if (expectToken (token, TOKEN_TYPE, TOKEN_EXTERN))
19641963
{
19651964
scope = lookupQualifiedName (token, NULL, scope, false);
1966-
kindType realKind = kind == KIND_NONE? KIND_STRUCT : kind;
1965+
kindType realKind = kind == KIND_GHOST_INDEX? KIND_STRUCT : kind;
19671966
newScope = makeTagEx (token, NULL, realKind, scope, access);
19681967
makeForeignDeclTagMaybe (token, NULL, realKind, scope);
19691968
registerEntry (newScope);
@@ -2093,7 +2092,7 @@ static void parseStruct (tokenInfo *const token, vString *const access,
20932092
vStringDelete (fieldAccess);
20942093
}
20952094

2096-
if (kind != KIND_NONE)
2095+
if (kind != KIND_GHOST_INDEX)
20972096
{
20982097
tagEntryInfo *entry = getEntryInCorkQueue (newScope);
20992098
if (entry)
@@ -2264,7 +2263,7 @@ static bool parseVType (tokenInfo *const token, vString *const capture,
22642263
}
22652264
else if (isKeyword (token, KEYWORD_struct, KEYWORD_union))
22662265
{
2267-
parseStruct (token, NULL, scope, KIND_NONE);
2266+
parseStruct (token, NULL, scope, KIND_GHOST_INDEX);
22682267
canInit = true;
22692268
}
22702269
else if (isKeyword (token, KEYWORD_fn) && !token->onNewline)
@@ -2663,7 +2662,7 @@ static bool parseExpression (tokenInfo *const token, int scope,
26632662
else if (isKeyword (token, KEYWORD_sql))
26642663
parseSql (token, scope);
26652664
else if (isKeyword (token, KEYWORD_fn))
2666-
parseFunction (token, scope, NULL, KIND_NONE);
2665+
parseFunction (token, scope, NULL, KIND_GHOST_INDEX);
26672666
else if (isKeyword (token, KEYWORD_if, KEYWORD_Sif))
26682667
parseIf (token, scope);
26692668
else if (isKeyword (token, KEYWORD_match))

peg/toml.peg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ false <- '\u0066' '\u0061' '\u006C' '\u0073' '\u0065'
191191
dateTime <- offsetDateTime / localDateTime / localDate / localTime
192192

193193
dateFullyear <- DIGIT DIGIT DIGIT DIGIT
194-
dateMonth <- DIGIT DIGIT DIGIT DIGIT
194+
dateMonth <- DIGIT DIGIT
195195
dateMday <- DIGIT DIGIT
196196
timeDelim <- [tT] / '\u0020'
197197
timeHour <- DIGIT DIGIT

0 commit comments

Comments
 (0)