Skip to content

Releases: jsim2010/rec

rec as a macro

13 Aug 19:09

Choose a tag to compare

This release is a large rewrite of the rec crate that causes major breaking changes. Although some of the previous functionality is lost, it is intended that much of it will be replaced and the benefit of getting more control over the allowed syntax and implementations outweighed the cost.

Convert Ch to enum

01 Jul 13:19

Choose a tag to compare

0.10.0

Bump to 0.10.0 (#56)

Improving single character classes

28 Jun 12:13

Choose a tag to compare

0.9.0

bump to 0.9.0 (#48)

Simplify API

18 Jun 12:45

Choose a tag to compare

  • Add functions that simplify interaction with Patterns and Tokens.

Small ease of use improvements

13 Jun 12:14

Choose a tag to compare

Small improvements that improve the ease of use

Expand Ch

07 Jun 14:40

Choose a tag to compare

  • Makes Rec public
  • Adds alpha() and alphanum() to Ch
  • Improves union() to backslash -

Replace ChCls with Ch

06 Jun 16:57

Choose a tag to compare

Changes ChCls emum to be Ch struct; replaces variants with functions.
Adds Ch::start().
Implement Not for Ch.

Large refactoring - splitting out files and updating documentation.
Adding CI support for testing

Better Conventions

04 Apr 15:45
a7c43d7

Choose a tag to compare

This release makes some changes so that rec better matches Rust conventions.

Breaking Changes

  • Updates some function calls of Pattern to better match Rust convention: define -> new, load -> from_str of std::str::FromStr trait.
  • Location now provides end- the index at which the match ends, in place oflength`.

New features

  • TokensIter and Locations implement Debug (although the current implementation is rather unhelpful).

Simplify Syntax

23 Jan 20:13

Choose a tag to compare

This release brings fairly major changes to the rec syntax. The overarching goal of these changes was to make rec simpler in 3 ways:

  1. Composing a rec generally requires less characters.
  2. Reading a rec is easier.
  3. The code implementing rec is simpler due to removing some structures and utilizing some internal macros to reduce code repetition in the library.

Breaking changes:

  • Atom has been removed. Now rec includes the Element trait which serves a similar function of converting multiple types into Recs with the exception that Rec also implements Element. Also Pattern methods define and load now take an Element.
  • Rec no longer has a rpt method and the Quantifier trait and ConstantQuantifiers VAR, SOME and OPT have been removed. Instead, quantifiers are generated directly from functions.
    • var(Element), some(Element) and opt(Element) replace the ConstantQuantifiers while exact(reps, Element), min(min_reps, Element) and btwn(min_reps, max_reps, Element) replace the value Quantifiers.
    • all functions except exact provide a lazy version by prepending lazy_ to the function name. Ex: lazy_var(Element).
  • Rec no longer has a name method. Instead, capture groups are generated using a tkn! macro (tkn is an abbreviation of token). The syntax is: tkn!(Element => name), which defines Element as a capture group with the given name. Ex: tkn!(some(ChCls::Digit) => "number").
  • ChCls variants None and WhSpc have been renamed to Not and Whitespace respectively.

New features:

  • ChCls includes a new variant Sign which matches either a + or a -.

Location

08 Jan 17:57

Choose a tag to compare

This release adds the functionality to search for only the start and length of a match.

New

  • Added Pattern.load() to attempt creating Patterns from data unknown prior to runtime.
  • Added Location and Locations to store data about location of one and multiple matches respectively.
  • Added Pattern.locate() and Pattern.locate_iter() to return Location(s)

Improved

  • Updated Rust edition to 2018.
  • Added to &str.to_rec() ability to escape "*".