Skip to content

Commit

Permalink
Merge pull request #2954 from masatake/berndf--bibtex--colon-in-id
Browse files Browse the repository at this point in the history
BibTeX: accept ':' as a part of a name
  • Loading branch information
masatake authored Apr 13, 2021
2 parents 6eda384 + a5ce885 commit 23870d6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions Units/parser-bibtex.r/bib-simple.d/expected.tags
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ doe+rocket input.bib /^@Book{doe+rocket,$/;" b
doe_mastersth input.bib /^@mastersthesis{doe_mastersth,$/;" M
doe_mastersth_data input.bib /^@misc{doe_mastersth_data,$/;" n
doe_phd input.bib /^@phdthesis{doe_phd,$/;" p
hicks:2001 input.bib /^@Book{hicks:2001,$/;" b
john_doe input.bib /^@string{john_doe = "Prof. Dr. John Doe"}$/;" s
man_loc_splits input.bib /^@manual{man_loc_splits,$/;" m
tiny_collect input.bib /^@booklet{tiny_collect,$/;" B
Expand Down
12 changes: 12 additions & 0 deletions Units/parser-bibtex.r/bib-simple.d/input.bib
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,15 @@ @unpublished{xx_thoughts
title = "Thoughts on the future of splits",
note = "Heavily thought about"
}

@Comment Taken from https://ja.wikipedia.org/wiki/BibTeX
@Book{hicks:2001,
author = "von Hicks, III, Michael",
title = "Design of a Carbon Fiber Composite Grid Structure for the GLAST
Spacecraft Using a Novel Manufacturing Technique",
publisher = "Stanford Press",
year = 2001,
address = "Palo Alto",
edition = "1st,",
isbn = "0-69-697269-4"
}
5 changes: 2 additions & 3 deletions parsers/bibtex.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#define isType(token,t) (bool) ((token)->type == (t))
#define isKeyword(token,k) (bool) ((token)->keyword == (k))
#define isIdentChar(c) \
(isalpha (c) || isdigit (c) || (c) == '_' || (c) == '-' || (c) == '+')
(isalpha (c) || isdigit (c) || (c) == '_' || (c) == '-' || (c) == '+' || (c) == ':')

/*
* DATA DECLARATIONS
Expand Down Expand Up @@ -140,7 +140,7 @@ static const keywordTable BibKeywordTable [] = {
{ "techreport", KEYWORD_techreport },
{ "unpublished", KEYWORD_unpublished }
};

/*
* FUNCTION DEFINITIONS
*/
Expand Down Expand Up @@ -323,7 +323,6 @@ static bool parseTag (tokenInfo *const token, bibKind kind)
goto out;
}
}


out:
deleteToken (name);
Expand Down

0 comments on commit 23870d6

Please sign in to comment.