From 8a7eaae2f056161924218bca1bd58fee89748c82 Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Mon, 18 Sep 2023 23:31:30 +0900 Subject: [PATCH] BibTeX: accept "." and "/" as parts of a bib entry Close #3823. Signed-off-by: Masatake YAMATO --- Units/parser-bibtex.r/bib-simple.d/expected.tags | 1 + Units/parser-bibtex.r/bib-simple.d/input.bib | 7 +++++++ parsers/bibtex.c | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Units/parser-bibtex.r/bib-simple.d/expected.tags b/Units/parser-bibtex.r/bib-simple.d/expected.tags index 12e4333aa4..a7a276250c 100644 --- a/Units/parser-bibtex.r/bib-simple.d/expected.tags +++ b/Units/parser-bibtex.r/bib-simple.d/expected.tags @@ -15,3 +15,4 @@ john_doe input.bib /^@string{john_doe = "Prof. Dr. John Doe"}$/;" s language:Bib xx_thoughts input.bib /^@unpublished{xx_thoughts,$/;" u language:BibTeX hicks:2001 input.bib /^@Book{hicks:2001,$/;" b language:BibTeX knuthwebsite input.bib /^@online{knuthwebsite,$/;" V language:BibLaTeX +10.1145/605432.605407 input.bib /^@Article{10.1145\/605432.605407,$/;" a language:BibTeX diff --git a/Units/parser-bibtex.r/bib-simple.d/input.bib b/Units/parser-bibtex.r/bib-simple.d/input.bib index 6b746fb625..ea2610b3fc 100644 --- a/Units/parser-bibtex.r/bib-simple.d/input.bib +++ b/Units/parser-bibtex.r/bib-simple.d/input.bib @@ -117,3 +117,10 @@ @online{knuthwebsite url = "http://www-cs-faculty.stanford.edu/~uno/abcde.html", keywords = "latex,knuth" } + +@Comment Taken from https://github.com/universal-ctags/ctags/issues/3802#issuecomment-1723511773 +@Comment submitted by @andregpss (André Silva) +@Article{10.1145/605432.605407, +author = {Levis, Philip and Culler, David}, +title = {Mat'{e}: A Tiny Virtual Machine for Sensor Networks}, +year = {2002} } diff --git a/parsers/bibtex.c b/parsers/bibtex.c index a5b836d266..1892d4d491 100644 --- a/parsers/bibtex.c +++ b/parsers/bibtex.c @@ -34,7 +34,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) == '+' || (c) == ':') + (isalpha (c) || isdigit (c) || (c) == '_' || (c) == '-' || (c) == '+' || (c) == ':' || (c) == '.' || (c) == '/') /* * DATA DECLARATIONS