Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions crates/engine_bibtex/src/auxi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ use crate::{
print_confusion, print_overflow, AuxTy,
},
peekable::PeekableInput,
pool::StringPool,
pool::{StrNumber, StringPool},
scan::Scan,
Bibtex, BibtexError, File, GlobalItems, StrIlk, StrNumber,
Bibtex, BibtexError, File, GlobalItems, StrIlk,
};
use std::ffi::CString;
use tectonic_bridge_core::FileFormat;
Expand Down Expand Up @@ -105,7 +105,7 @@ fn aux_bib_data_command(

let file = &buffers.buffer(BufTy::Base)
[buffers.offset(BufTy::Base, 1)..buffers.offset(BufTy::Base, 2)];
let res = pool.lookup_str_insert(ctx, hash, file, HashExtra::BibFile)?;
let res = hash.lookup_str_insert(ctx, pool, file, HashExtra::BibFile)?;
if res.exists {
ctx.write_logs("This database file appears more than once: ");
print_bib_name(ctx, pool, hash.text(res.loc))?;
Expand Down Expand Up @@ -176,7 +176,7 @@ fn aux_bib_style_command(

let file = &buffers.buffer(BufTy::Base)
[buffers.offset(BufTy::Base, 1)..buffers.offset(BufTy::Base, 2)];
let res = pool.lookup_str_insert(ctx, hash, file, HashExtra::BstFile)?;
let res = hash.lookup_str_insert(ctx, pool, file, HashExtra::BstFile)?;
if res.exists {
ctx.write_logs("Already encountered style file");
print_confusion(ctx);
Expand Down Expand Up @@ -276,15 +276,15 @@ fn aux_citation_command(
let lc_cite = &mut buffers.buffer_mut(BufTy::Ex)[range];
lc_cite.make_ascii_lowercase();

let lc_res = pool.lookup_str_insert(ctx, hash, lc_cite, HashExtra::LcCite(0))?;
let lc_res = hash.lookup_str_insert(ctx, pool, lc_cite, HashExtra::LcCite(0))?;
if lc_res.exists {
let HashExtra::LcCite(cite_loc) = hash.node(lc_res.loc).extra else {
panic!("LcCite lookup didn't have LcCite extra");
};

let cite = &buffers.buffer(BufTy::Base)
[buffers.offset(BufTy::Base, 1)..buffers.offset(BufTy::Base, 2)];
let uc_res = pool.lookup_str(hash, cite, StrIlk::Cite);
let uc_res = hash.lookup_str(pool, cite, StrIlk::Cite);
if !uc_res.exists {
let HashExtra::Cite(cite) = hash.node(cite_loc).extra else {
panic!("LcCite location didn't have a Cite extra");
Expand All @@ -301,7 +301,7 @@ fn aux_citation_command(
} else {
let cite = &buffers.buffer(BufTy::Base)
[buffers.offset(BufTy::Base, 1)..buffers.offset(BufTy::Base, 2)];
let uc_res = pool.lookup_str_insert(ctx, hash, cite, HashExtra::Cite(0))?;
let uc_res = hash.lookup_str_insert(ctx, pool, cite, HashExtra::Cite(0))?;
if uc_res.exists {
hash_cite_confusion(ctx);
return Err(BibtexError::Fatal);
Expand Down Expand Up @@ -375,7 +375,7 @@ fn aux_input_command(

let file = &buffers.buffer(BufTy::Base)
[buffers.offset(BufTy::Base, 1)..buffers.offset(BufTy::Base, 2)];
let res = pool.lookup_str_insert(ctx, hash, file, HashExtra::AuxFile)?;
let res = hash.lookup_str_insert(ctx, pool, file, HashExtra::AuxFile)?;
if res.exists {
ctx.write_logs("Already encountered file ");
print_aux_name(ctx, pool, hash.text(res.loc))?;
Expand Down Expand Up @@ -421,8 +421,8 @@ pub(crate) fn get_aux_command_and_process(
let line = &globals.buffers.buffer(BufTy::Base)
[globals.buffers.offset(BufTy::Base, 1)..globals.buffers.offset(BufTy::Base, 2)];
let res = globals
.pool
.lookup_str(globals.hash, line, StrIlk::AuxCommand);
.hash
.lookup_str(globals.pool, line, StrIlk::AuxCommand);

if res.exists {
let HashExtra::AuxCommand(cmd) = globals.hash.node(res.loc).extra else {
Expand Down
38 changes: 19 additions & 19 deletions crates/engine_bibtex/src/bibs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ use crate::{
print_confusion,
},
peekable::input_ln,
pool::StringPool,
pool::{StrNumber, StringPool},
scan::{scan_and_store_the_field_value_and_eat_white, scan_identifier, Scan, ScanRes},
BibNumber, Bibtex, BibtexError, File, GlobalItems, HashPointer, StrIlk, StrNumber,
BibNumber, Bibtex, BibtexError, File, GlobalItems, HashPointer, StrIlk,
};

#[derive(Copy, Clone, Debug, PartialEq)]
Expand Down Expand Up @@ -191,8 +191,8 @@ pub(crate) fn get_bib_command_or_entry_and_process(
bib_cmd.make_ascii_lowercase();

let res = globals
.pool
.lookup_str(globals.hash, bib_cmd, StrIlk::BibCommand);
.hash
.lookup_str(globals.pool, bib_cmd, StrIlk::BibCommand);

let mut lc_cite_loc = 0;

Expand Down Expand Up @@ -351,11 +351,11 @@ pub(crate) fn get_bib_command_or_entry_and_process(
bib_macro.make_ascii_lowercase();

// let text = globals.hash.text(res.loc);
let res = globals.pool.lookup_str_insert(
let res = globals.hash.lookup_str_insert(
ctx,
globals.hash,
globals.pool,
bib_macro,
HashExtra::Macro(0),
HashExtra::Macro(StrNumber::default()),
)?;
// TODO: Insert overwriting?
globals.hash.node_mut(res.loc).extra = HashExtra::Macro(globals.hash.text(res.loc));
Expand Down Expand Up @@ -439,7 +439,7 @@ pub(crate) fn get_bib_command_or_entry_and_process(

let range = globals.buffers.offset(BufTy::Base, 1)..globals.buffers.offset(BufTy::Base, 2);
let bst_fn = &mut globals.buffers.buffer_mut(BufTy::Base)[range];
let bst_res = globals.pool.lookup_str(globals.hash, bst_fn, StrIlk::BstFn);
let bst_res = globals.hash.lookup_str(globals.pool, bst_fn, StrIlk::BstFn);

let type_exists = if bst_res.exists {
matches!(
Expand Down Expand Up @@ -515,12 +515,12 @@ pub(crate) fn get_bib_command_or_entry_and_process(

let lc_res = if ctx.all_entries {
globals
.pool
.lookup_str_insert(ctx, globals.hash, lc_cite, HashExtra::LcCite(0))?
.hash
.lookup_str_insert(ctx, globals.pool, lc_cite, HashExtra::LcCite(0))?
} else {
globals
.pool
.lookup_str(globals.hash, lc_cite, StrIlk::LcCite)
.hash
.lookup_str(globals.pool, lc_cite, StrIlk::LcCite)
};

let mut res = lc_res;
Expand All @@ -546,9 +546,9 @@ pub(crate) fn get_bib_command_or_entry_and_process(
let range = globals.buffers.offset(BufTy::Base, 1)
..globals.buffers.offset(BufTy::Base, 2);
let cite = &globals.buffers.buffer(BufTy::Base)[range];
let uc_res = globals.pool.lookup_str_insert(
let uc_res = globals.hash.lookup_str_insert(
ctx,
globals.hash,
globals.pool,
cite,
HashExtra::Cite(0),
);
Expand Down Expand Up @@ -578,8 +578,8 @@ pub(crate) fn get_bib_command_or_entry_and_process(
lc_cite.make_ascii_lowercase();

let lc_res2 = globals
.pool
.lookup_str(globals.hash, lc_cite, StrIlk::LcCite);
.hash
.lookup_str(globals.pool, lc_cite, StrIlk::LcCite);

res = lc_res2;

Expand Down Expand Up @@ -637,8 +637,8 @@ pub(crate) fn get_bib_command_or_entry_and_process(
[globals.buffers.offset(BufTy::Base, 1)..globals.buffers.offset(BufTy::Base, 2)];
let res =
globals
.pool
.lookup_str_insert(ctx, globals.hash, cite, HashExtra::Cite(0))?;
.hash
.lookup_str_insert(ctx, globals.pool, cite, HashExtra::Cite(0))?;
if res.exists {
hash_cite_confusion(ctx);
return Err(BibtexError::Fatal);
Expand Down Expand Up @@ -744,7 +744,7 @@ pub(crate) fn get_bib_command_or_entry_and_process(
let bst_fn = &mut globals.buffers.buffer_mut(BufTy::Base)[range];
bst_fn.make_ascii_lowercase();

let res = globals.pool.lookup_str(globals.hash, bst_fn, StrIlk::BstFn);
let res = globals.hash.lookup_str(globals.pool, bst_fn, StrIlk::BstFn);

*field_name_loc = res.loc;
if res.exists {
Expand Down
Loading
Loading