Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed Jul 29, 2024
1 parent df2ae43 commit 84400b2
Show file tree
Hide file tree
Showing 13 changed files with 9 additions and 22 deletions.
3 changes: 3 additions & 0 deletions citeproc/citeproc-bibtex2csl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,9 @@ end

function bibtex2csl._parse_edtf_date(str)
local date_range = util.split(str, "/")
if str == "" then
return nil
end
if #date_range == 1 then
date_range = util.split(str, util.unicode["en dash"])
end
Expand Down
3 changes: 2 additions & 1 deletion citeproc/citeproc-latex-parser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ local latex_parser = {}

local bibtex_parser
local latex_data
local markup
local markup
local util
if kpse then
latex_data = require("citeproc-latex-data")
Expand Down Expand Up @@ -365,6 +365,7 @@ function latex_parser.convert_cs_to_inlines(tokens, i, strict, case_protection)
return inlines, i
end

-- TODO: raise a warning for unrecognized LaTeX command like `\switchargs`
function latex_parser.convert_group_to_inlines(token, strict, case_protection, force_add_braces)
if case_protection then
local first_token = token.contents[1]
Expand Down
3 changes: 0 additions & 3 deletions tests/bibtex/xampl.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,6 @@
}
],
"collection-title": "Four volumes",
"issued": {
"literal": ""
},
"note": "Seven volumes planned (this is a cross-referenced set of BOOKs)",
"publisher": "Addison-Wesley",
"title": "The art of computer programming"
Expand Down
1 change: 0 additions & 1 deletion tests/latex/luatex-1/error-bib-unavailable.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ TEST 1: Citation
> \l__csl_citation_info_tl=citationID={ITEM-1@1},citationItems={{id={ITEM-1}}},properties={noteIndex={0}}.
<recently read> }
l. ...}
Module citeproc Warning: Didn't find a database entry for 'ITEM-1' on input line ...
> \l__csl_citation_tl=(\cslundefinedcite {ITEM-1}).
<recently read> }
l. ...}
Expand Down
5 changes: 0 additions & 5 deletions tests/latex/luatex-1/error-item-unavailable.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ TEST 1: Entry not available
> \l__csl_citation_info_tl=citationID={ITEM-UNAVAILABLE@1},citationItems={{id={ITEM-UNAVAILABLE}}},properties={noteIndex={0}}.
<recently read> }
l. ...}
Module citeproc Warning: Didn't find a database entry for 'ITEM-UNAVAILABLE' on input line ...
> \l__csl_citation_tl=(\cslundefinedcite {ITEM-UNAVAILABLE}).
<recently read> }
l. ...}
Expand All @@ -36,8 +35,6 @@ TEST 2: Multiple enties
> \l__csl_citation_info_tl=citationID={ITEM-UNAVAILABLE,ANOTHER-ITEM@1},citationItems={{id={ITEM-UNAVAILABLE}},{id={ANOTHER-ITEM}}},properties={noteIndex={0}}.
<recently read> }
l. ...}
Module citeproc Warning: Didn't find a database entry for 'ITEM-UNAVAILABLE' on input line ...
Module citeproc Warning: Didn't find a database entry for 'ANOTHER-ITEM' on input line ...
> \l__csl_citation_tl=(\cslundefinedcite {ITEM-UNAVAILABLE}, \cslundefinedcite {ANOTHER-ITEM}).
<recently read> }
l. ...}
Expand All @@ -50,8 +47,6 @@ TEST 3: Mixture
> \l__csl_citation_info_tl=citationID={ITEM-UNAVAILABLE,ITEM-1,ANOTHER-ITEM@1},citationItems={{id={ITEM-UNAVAILABLE}},{id={ITEM-1}},{id={ANOTHER-ITEM}}},properties={noteIndex={0}}.
<recently read> }
l. ...}
Module citeproc Warning: Didn't find a database entry for 'ITEM-UNAVAILABLE' on input line ...
Module citeproc Warning: Didn't find a database entry for 'ANOTHER-ITEM' on input line ...
> \l__csl_citation_tl=(D’Arcus, 2005; \cslundefinedcite {ITEM-UNAVAILABLE}, \cslundefinedcite {ANOTHER-ITEM}).
<recently read> }
l. ...}
Expand Down
1 change: 0 additions & 1 deletion tests/latex/luatex-1/error-json-decode.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ TEST 1: Citation
> \l__csl_citation_info_tl=citationID={ITEM-3@1},citationItems={{id={ITEM-3}}},properties={noteIndex={0}}.
<recently read> }
l. ...}
Module citeproc Warning: Didn't find a database entry for 'ITEM-3' on input line ...
> \l__csl_citation_tl=(\cslundefinedcite {ITEM-3}).
<recently read> }
l. ...}
Expand Down
1 change: 1 addition & 0 deletions tests/latex/luatex-1/error-style-unavailable.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line ....
LaTeX Font Info: ... okay on input line ....
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line ....
LaTeX Font Info: ... okay on input line ....
Package citation-style-language Warning: Empty bibliographic resources. Use \addbibresource.
! Module citeproc Error: Style "style-unavailable.csl" not found.
\lua_now:e #1->\__lua_now:n {#1}
l. ...\begin{document}
Expand Down
2 changes: 0 additions & 2 deletions tests/latex/luatex-2/error-bib-unavailable.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@ LaTeX Font Info: ... okay on input line ....
! Module citeproc Error: Database file "bib-unavailable.bib" not found.
\lua_now:e #1->\__lua_now:n {#1}
l. ...\begin{document}
Module citeproc Warning: Didn't find a database entry for 'ITEM-1' on input line ...
============================================================
TEST 1: Citation
============================================================
> \l__csl_citation_info_tl=citationID={ITEM-1@1},citationItems={{id={ITEM-1}}},properties={noteIndex={0}}.
<recently read> }
l. ...}
Module citeproc Warning: Didn't find a database entry for 'ITEM-1' on input line ...
> \l__csl_citation_tl=(\cslundefinedcite {ITEM-1}).
<recently read> }
l. ...}
Expand Down
7 changes: 0 additions & 7 deletions tests/latex/luatex-2/error-item-unavailable.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line ....
LaTeX Font Info: ... okay on input line ....
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line ....
LaTeX Font Info: ... okay on input line ....
Module citeproc Warning: Didn't find a database entry for 'ITEM-UNAVAILABLE' on input line ...
Module citeproc Warning: Didn't find a database entry for 'ANOTHER-ITEM' on input line ...
============================================================
TEST 1: Entry not available
============================================================
> \l__csl_citation_info_tl=citationID={ITEM-UNAVAILABLE@1},citationItems={{id={ITEM-UNAVAILABLE}}},properties={noteIndex={0}}.
<recently read> }
l. ...}
Module citeproc Warning: Didn't find a database entry for 'ITEM-UNAVAILABLE' on input line ...
> \l__csl_citation_tl=(\cslundefinedcite {ITEM-UNAVAILABLE}).
<recently read> }
l. ...}
Expand All @@ -38,8 +35,6 @@ TEST 2: Multiple enties
> \l__csl_citation_info_tl=citationID={ITEM-UNAVAILABLE,ANOTHER-ITEM@1},citationItems={{id={ITEM-UNAVAILABLE}},{id={ANOTHER-ITEM}}},properties={noteIndex={0}}.
<recently read> }
l. ...}
Module citeproc Warning: Didn't find a database entry for 'ITEM-UNAVAILABLE' on input line ...
Module citeproc Warning: Didn't find a database entry for 'ANOTHER-ITEM' on input line ...
> \l__csl_citation_tl=(\cslundefinedcite {ITEM-UNAVAILABLE}, \cslundefinedcite {ANOTHER-ITEM}).
<recently read> }
l. ...}
Expand All @@ -52,8 +47,6 @@ TEST 3: Mixture
> \l__csl_citation_info_tl=citationID={ITEM-UNAVAILABLE,ITEM-1,ANOTHER-ITEM@1},citationItems={{id={ITEM-UNAVAILABLE}},{id={ITEM-1}},{id={ANOTHER-ITEM}}},properties={noteIndex={0}}.
<recently read> }
l. ...}
Module citeproc Warning: Didn't find a database entry for 'ITEM-UNAVAILABLE' on input line ...
Module citeproc Warning: Didn't find a database entry for 'ANOTHER-ITEM' on input line ...
> \l__csl_citation_tl=(D’Arcus, 2005; \cslundefinedcite {ITEM-UNAVAILABLE}, \cslundefinedcite {ANOTHER-ITEM}).
<recently read> }
l. ...}
Expand Down
2 changes: 0 additions & 2 deletions tests/latex/luatex-2/error-json-decode.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@ LaTeX Font Info: ... okay on input line ....
! Module citeproc Error: JSON decode error in file "error-json-decode.json"..
\lua_now:e #1->\__lua_now:n {#1}
l. ...\begin{document}
Module citeproc Warning: Didn't find a database entry for 'ITEM-3' on input line ...
============================================================
TEST 1: Citation
============================================================
> \l__csl_citation_info_tl=citationID={ITEM-3@1},citationItems={{id={ITEM-3}}},properties={noteIndex={0}}.
<recently read> }
l. ...}
Module citeproc Warning: Didn't find a database entry for 'ITEM-3' on input line ...
> \l__csl_citation_tl=(\cslundefinedcite {ITEM-3}).
<recently read> }
l. ...}
Expand Down
1 change: 1 addition & 0 deletions tests/latex/luatex-2/error-style-unavailable.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line ....
LaTeX Font Info: ... okay on input line ....
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line ....
LaTeX Font Info: ... okay on input line ....
Package citation-style-language Warning: Empty bibliographic resources. Use \addbibresource.
! Module citeproc Error: Style "style-unavailable.csl" not found.
\lua_now:e #1->\__lua_now:n {#1}
l. ...\begin{document}
Expand Down
1 change: 1 addition & 0 deletions tests/latex/pdftex-1/error-style-unavailable.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line ....
LaTeX Font Info: ... okay on input line ....
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line ....
LaTeX Font Info: ... okay on input line ....
Package citation-style-language Warning: Empty bibliographic resources. Use \addbibresource.
No file error-style-unavailable.bbl.
! LaTeX Error: File 'style-unavailable.csl' not found.
For immediate help type H <return>.
Expand Down
1 change: 1 addition & 0 deletions tests/latex/pdftex-2/error-style-unavailable.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line ....
LaTeX Font Info: ... okay on input line ....
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line ....
LaTeX Font Info: ... okay on input line ....
Package citation-style-language Warning: Empty bibliographic resources. Use \addbibresource.
No file error-style-unavailable.bbl.
! LaTeX Error: File 'style-unavailable.csl' not found.
For immediate help type H <return>.
Expand Down

0 comments on commit 84400b2

Please sign in to comment.