pdftract/crates/pdftract-core/src/parser
jedarden fee6ed8afd fix(pdftract-5upi): correct keyword fallback in lexer
Fixed incorrect fallback behavior in keyword lexer functions. Four
functions (lex_e_keyword, lex_o_keyword, lex_r_keyword, lex_n_keyword)
were incorrectly calling lex_name() instead of lex_keyword() when
keywords didn't match.

When a PDF contains an unrecognized word starting with e/o/n/R
(e.g., "endob" instead of "endobj"), the lexer should fall back to
generic keyword parsing (Token::Keyword(bytes)), not name parsing.
Names always start with /, so calling lex_name() on input without
a leading / would incorrectly skip the first byte.

References:
- Bead: pdftract-5upi
- Notes: notes/pdftract-5upi.md

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 21:55:55 -04:00
..
lexer fix(pdftract-5upi): correct keyword fallback in lexer 2026-05-20 21:55:55 -04:00
object feat(pdftract-59zz): implement MCP bearer token ingress channels and TH-03 enforcement 2026-05-18 02:47:54 -04:00
catalog.rs docs(pdftract-49f8): establish Cargo.lock policy and documentation 2026-05-20 18:13:14 -04:00
diagnostic.rs docs(pdftract-49f8): establish Cargo.lock policy and documentation 2026-05-20 18:13:14 -04:00
mod.rs docs(pdftract-46lw): add forward_scan_xref verification note 2026-05-20 18:52:07 -04:00
objstm.rs feat(pdftract-6bxw): implement object stream (ObjStm) parser 2026-05-20 19:03:53 -04:00
ocg.rs docs(pdftract-49f8): establish Cargo.lock policy and documentation 2026-05-20 18:13:14 -04:00
outline.rs feat(pdftract-5calf): implement outline traversal with UTF-16BE BOM detection 2026-05-20 18:49:52 -04:00
pages.rs docs(pdftract-49f8): establish Cargo.lock policy and documentation 2026-05-20 18:13:14 -04:00
resources.rs docs(pdftract-49f8): establish Cargo.lock policy and documentation 2026-05-20 18:13:14 -04:00
secrets.rs feat(pdftract-59zz): implement MCP bearer token ingress channels and TH-03 enforcement 2026-05-18 02:47:54 -04:00
stream.rs docs(pdftract-49f8): establish Cargo.lock policy and documentation 2026-05-20 18:13:14 -04:00
xref.rs fix(pdftract-5upi): add parse_obj_header_at_memory for xref forward scan 2026-05-18 02:54:35 -04:00