Skip to content

Commit

Permalink
main, refactor: reuse makeFileTag in read.c
Browse files Browse the repository at this point in the history
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
  • Loading branch information
masatake committed Aug 6, 2015
1 parent d0690f0 commit 97e10dd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
2 changes: 1 addition & 1 deletion main/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ extern void printLanguageList (void)
* File parsing
*/

static void makeFileTag (const char *const fileName)
extern void makeFileTag (const char *const fileName)
{
if (Option.include.fileNames)
{
Expand Down
1 change: 1 addition & 0 deletions main/parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ extern parserDefinitionFunc PARSER_LIST;

/* Language processing and parsing */
extern void makeSimpleTag (const vString* const name, kindOption* const kinds, const int kind);
extern void makeFileTag (const char *const fileName);
extern parserDefinition* parserNew (const char* name);
extern const char *getLanguageName (const langType language);
extern char getLanguageFileKind (const langType language);
Expand Down
15 changes: 2 additions & 13 deletions main/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,20 +229,9 @@ static boolean parseLineDirective (void)
lineStr, lNum, vStringValue (fileName)); )
}

if (Option.include.fileNames && vStringLength (fileName) > 0 &&
if (vStringLength (fileName) > 0 &&
lNum == 1)
{
tagEntryInfo tag;
initTagEntry (&tag, baseFilename (vStringValue (fileName)));

tag.isFileEntry = TRUE;
tag.lineNumberEntry = TRUE;
tag.lineNumber = 1;
tag.kindName = KIND_FILE_DEFAULT_LONG;
tag.kind = getSourceLanguageFileKind();

makeTagEntry (&tag);
}
makeFileTag (vStringValue (fileName));
vStringDelete (fileName);
result = TRUE;
}
Expand Down

0 comments on commit 97e10dd

Please sign in to comment.