Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Biblatex parse errors #210

Closed
ivomac opened this issue Mar 23, 2023 · 2 comments
Closed

Biblatex parse errors #210

ivomac opened this issue Mar 23, 2023 · 2 comments

Comments

@ivomac
Copy link

ivomac commented Mar 23, 2023

Compilation fails if the bibliography (.bib) file has an entry such as this:

@article{1,
    title = {A},
    number = {B4},
    pages = {B97},
    volume = {40-42}
}

Parse errors due to letters ("B") in pages and "-" in volume. No error due to "B" in number.

I think this entry should be valid. I don't know where the bibliography is parsed, otherwise I could look into this myself.

@ivomac
Copy link
Author

ivomac commented Mar 23, 2023

minor error: Also fails with price = {$76.60}, with unexpected end of file due to the dollar.

@tmistele
Copy link

This code looks related
https://github.com/typst/biblatex/blob/932ad283dd45dd88d4fa14dc5b9bda7a270ba027/src/lib.rs#L462-L480

            let error = match key.as_str() {
                "edition" => chunks.parse::<Edition>().err(),
                "organization" => chunks.parse::<Vec<Chunks>>().err(),
                "pages" => chunks.parse::<Vec<std::ops::Range<u32>>>().err(),
                "publisher" => chunks.parse::<Vec<Chunks>>().err(),
                "volume" => chunks.parse::<i64>().err(),
                "bookpagination" => chunks.parse::<Pagination>().err(),
                "pagination" => chunks.parse::<Pagination>().err(),
                "volumes" => chunks.parse::<i64>().err(),
                "gender" => chunks.parse::<Gender>().err(),
                "editortype" => chunks.parse::<EditorType>().err(),
                "editoratype" => chunks.parse::<EditorType>().err(),
                "editorbtype" => chunks.parse::<EditorType>().err(),
                "editorctype" => chunks.parse::<EditorType>().err(),
                "xref" => chunks.parse::<Vec<String>>().err(),
                "xdata" => chunks.parse::<Vec<String>>().err(),
                "ids" => chunks.parse::<Vec<String>>().err(),
                _ => continue,
            };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants