Skip to content

Commit 9eb0be3

Browse files
committed
html,refactor: rename constants for clarity
1 parent c52a7a5 commit 9eb0be3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

parsers/html.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ typedef enum {
158158
TOKEN_NAME, /* tag and attribute names */
159159
TOKEN_STRING, /* single- or double-quoted attribute value */
160160
TOKEN_TEXT,
161-
TOKEN_TAG_START, /* < */
162-
TOKEN_TAG_START2, /* </ */
161+
TOKEN_OPEN_TAG_START, /* < */
162+
TOKEN_CLOSE_TAG_START, /* </ */
163163
TOKEN_TAG_END, /* > */
164164
TOKEN_TAG_END2, /* /> */
165165
TOKEN_EQUAL,
@@ -289,11 +289,11 @@ static void readToken (tokenInfo *const token, bool skipComments)
289289
else if (d == '?')
290290
token->type = TOKEN_OTHER;
291291
else if (d == '/')
292-
token->type = TOKEN_TAG_START2;
292+
token->type = TOKEN_CLOSE_TAG_START;
293293
else
294294
{
295295
ungetcToInputFile (d);
296-
token->type = TOKEN_TAG_START;
296+
token->type = TOKEN_OPEN_TAG_START;
297297
}
298298
break;
299299
}
@@ -378,19 +378,19 @@ static bool readTagContent (tokenInfo *token, vString *text, long *line, long *l
378378
*lineOffset = getInputLineOffset ();
379379
readToken (token, false);
380380
type = token->type;
381-
if (type == TOKEN_TAG_START)
381+
if (type == TOKEN_OPEN_TAG_START)
382382
readTag (token, text, depth + 1);
383-
if (type == TOKEN_COMMENT || type == TOKEN_TAG_START)
383+
if (type == TOKEN_COMMENT || type == TOKEN_OPEN_TAG_START)
384384
{
385385
readTokenText (token, text != NULL);
386386
appendText (text, token->string);
387387
}
388388
}
389-
while (type == TOKEN_COMMENT || type == TOKEN_TAG_START);
389+
while (type == TOKEN_COMMENT || type == TOKEN_OPEN_TAG_START);
390390

391391
TRACE_LEAVE_TEXT("is_close_tag? %d", type == TOKEN_CLOSE_TAG_START);
392392

393-
return type == TOKEN_TAG_START2;
393+
return type == TOKEN_CLOSE_TAG_START;
394394
}
395395

396396
static bool skipScriptContent (tokenInfo *token, long *line, long *lineOffset)
@@ -413,7 +413,7 @@ static bool skipScriptContent (tokenInfo *token, long *line, long *lineOffset)
413413
readToken (token, false);
414414
type = token->type;
415415

416-
if (type == TOKEN_TAG_START2)
416+
if (type == TOKEN_CLOSE_TAG_START)
417417
{
418418
found_start = true;
419419
line_tmp[1] = line_tmp[0];
@@ -657,7 +657,7 @@ static void findHtmlTags (void)
657657
do
658658
{
659659
readToken (&token, true);
660-
if (token.type == TOKEN_TAG_START)
660+
if (token.type == TOKEN_OPEN_TAG_START)
661661
readTag (&token, NULL, 0);
662662
}
663663
while (token.type != TOKEN_EOF);

0 commit comments

Comments
 (0)