Test lexer / remove unused functionality

Open
#6 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
50/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
backend

Research direction

Start with next_word in parser/lexer/mod.rs and its doc comment, which describes where the pointer lands for forward and backward moves. Find the callers of next, peek and back to see how the lexer is exercised, then add unit tests for next_word covering both directions. Done when the tests pass and check the documented pointer behaviour. Whether to remove back() is unresolved, so confirm with the maintainers before deleting it.

Written by the indexing model from the issue text.

Description

todo

Generally need tests for the lexer module.

next_word in parser/lexer/mod.rs:

/// Used by next, peek and back - returns substring and new position
/// If forward, places pointer at the next non-whitespace character.
/// If backward, places pointer at the start of the current word.

Needs a test to validate this.

And I don't think that the "previous lexeme"/back functionality is used anyway. Anyway - where back() is used, we can probably use peek() instead.

Dominant language
Rust
Stars
1.7k
Forks
151
Avg merge
31m
Merged PRs (30d)
4

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pdf-rs/pdf

All issues in pdf-rs/pdf

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.