Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Dec 29, 2011
  1. Better definition of super keyword

    Fixes #36.
Commits on Nov 4, 2011
  1. Version 2.4.1

Commits on Oct 27, 2011
Commits on Jul 5, 2011
Commits on May 12, 2011
  1. Bumped to version 2.4.0

  2. Added lib/citrus/grammars.rb

    Also, moved all example grammars and tests into the main library tree so
    that they may easily be used by client code.
  3. Don't check for space after {

    Fixes #21
Commits on Feb 20, 2011
  1. Bumped version to 2.3.7

Commits on Feb 19, 2011
  1. Bumped version to 2.3.6

Commits on Feb 7, 2011
  1. Bumped version to 2.3.5

Commits on Feb 4, 2011
Commits on Jan 25, 2011
  1. Doc tweak

Commits on Jan 18, 2011
  1. Minor style tweaks

Commits on Jan 17, 2011
  1. Bumped version to 2.3.4

  2. Bumped version to 2.3.3

  3. Tweaked some docs

Commits on Jan 13, 2011
Commits on Jan 11, 2011
  1. Adds self to Match#captures

    A common point of confusion for some Citrus users is that they are not
    able to retrieve a match by calling its own name on itself. This commit
    adds self to the internal @captures Hash in the first position.
    Also, Match#to_a and Match#[] were added for convenience when retrieving
    captures and submatches.
Commits on Jan 5, 2011
  1. Use consistent test style for examples

    All example test suites are run with the default Rake test task. This
    ensures that examples are always working with the current version of the
    Also, Citrus.require should raise Citrus::LoadError if it cannot find a
    suitable file to load.
Commits on Jan 4, 2011
  1. Refactored terminal rule

  2. Added Citrus.require

    Added the ability for require statements inside Citrus files to require
    other Citrus files that may be in the $LOAD_PATH. Also, modified the
    behavior of Citrus.load to cache the result of already loaded files so
    that we don't load the same file twice.
    Modified examples/ipaddress.citrus to demonstrate the use of require
    from within Citrus files.
  3. Return an empty array by default

    The Hash returned by Match#captures now returns empty arrays for unknown
    keys. This supports a more natural flow of programming when using it in
    semantic blocks.
Commits on Jan 3, 2011
Commits on Dec 28, 2010
  1. Removed {+ notation

    Since we can detect if a block is a module block or not using some
    simple heuristics, we shouldn't provide a second notation. If it turns
    out that the detection mechanism doesn't work as well as it should,
    we'll introduce a second notation in the future.
  2. Changed Terminal#rule to Terminal#regexp

    Also added versions of Terminal#== and StringTerminal#== to detect
    equality with regular expressions and strings respectively.
Commits on Dec 25, 2010
  1. Added Rule#elide?

    This restores the former behavior to matches that are the results of a
    Choice rule, which is that they are essentially the same match as is
    returned by the first matching rule of that choice. This largely
    eliminates the need to call Match#first in the value blocks of choices,
    which feels more natural when writing them.
Commits on Dec 19, 2010
  1. Added Match#captures.

    Match#captures is the preferred method of retrieving named sub-captures
    when performing match evaluation. It's easier to use than Match#matches
    because it provides direct access to matches as they were written in the
    rule definition, without requiring the user to think about how the
    actual match tree was constructed.
    This commit deprecates Match#name, Match#names, Match#has_name?,
    Match#find, and match naming in general. Matches should not keep track
    of the names of the rules that created them since that information can
    be derived as needed from the event stream as demonstrated by
    Also, Citrus::NoMatchError was eliminated to favor a more fluid style of
    use when using Match#method_missing to find a capture of a given name.
Commits on Dec 16, 2010
  1. Eliminate Label, Predicate, and List classes.

    This commit introduces a number of incompatibilities with previous
    versions. The most significant changes are listed below.
    - Rule, Proxy, and Nonterminal are modules. This is because they should
      never be instantiated directly.
    - Labels are stored as a symbol on the rule object that has them. This
      eliminates the unnecessary wrap in the event stream.
    - Proxy objects do not wrap the events of the rule they are proxy for in
      the event stream. Instead, they simply insert themselves into the
      event stream in its place. This allows them to maintain the nesting
      level of the original rule in the event stream, while still giving
      them the opportunity to extend matches themselves.
    - Choice objects no longer automatically return the value of their first
      match. While this technique was convenient in some situations, it was
      also a bit unpredictable and confusing for some users. Making it
      behave like all other nonterminals is more predictable and easier to
      handle in the code as well.
Commits on Dec 7, 2010
  1. Add ability to detect and specify a module style block

    Evan Phoenix authored
  2. Restore to mj block style

    Evan Phoenix authored
Something went wrong with that request. Please try again.