Skip to content

v0.3.0

Pre-release
Pre-release

Choose a tag to compare

@vcschapp vcschapp released this 22 Sep 04:49
· 216 commits to main since this release

Breaking Changes

  1. Improved content fetch interface ergonomics (commit 7b92405):
    • Replaced lexical::Analyzer::content() and Parser::content() methods that returned Result with a three-method approach:
      1. fn content(&self) -> Content - panics on error token
      2. fn err(&self) -> Error - panics on non-error token
      3. fn try_content(&self) -> Result<Content, Error> - original behavior
    • This eliminates the need for unwieldy .unwrap() and .unwrap_err() calls in parsing loops
  2. Renamed BufAnalyzer to FixedAnalyzer (commit f8d9891):
    • Renamed the main lexical analyzer type to better reflect its purpose (analyzing fixed-size buffers)
    • Reduces confusion with the crate name and provides more descriptive naming
  3. Improved Content::unescaped ergonomics (commit 0c33fcb):
    • Changed Content::unescaped method signature from &mut self -> &str to &mut self -> Cow<'_, str>
    • Returns Cow::Borrowed when no unescaping is needed, Cow::Owned when it expanded at least one escape sequence.

Material Non-Breaking Changes

  1. Reduced fixed::Content (formerly buf::Content) size from 48 to 32 bytes (commit 0c33fcb)
  2. Added Pos::new() constructor (commit 4f0527b):
    • Added convenience constructor for creating Pos instances: Pos::new(offset, line, col)
    • Improves testing ergonomics because it's a shorter "phrase"
  3. Made Token::static_content() a const fn (commit 0cf5efb):
  4. Added module-level documentation for mod lexical (commit 48e1025):
  5. Switched from MIT license to dual MIT and Apache-2.0 (commit ad3f963):
  6. Updated README (commits 4b09f21, 746e335, 0bd677f):

Full Changelog: v0.2.0...v0.3.0