sonic-pi

https://github.com/sonic-pi-net/sonic-pi

C++

Code. Music. Live.

Parslet::Atoms::DSL#capture

Captures a part of the input and stores it under the name given. This 
is very useful to create self-referential parses. A capture stores
the result of its parse (may be complex) on a successful parse action.

Example: 
  str('a').capture(:b)  # will store captures[:b] == 'a'

Source | Google | Stack overflow

Edit

git clone [email protected]:sonic-pi-net/sonic-pi.git

cd sonic-pi

open app/server/ruby/vendor/parslet/lib/parslet/atoms/dsl.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Parslet--Atoms--DSL-capture-for-pr


# Commit to git

git add app/server/ruby/vendor/parslet/lib/parslet/atoms/dsl.rbgit commit -m "better docs for Parslet::Atoms::DSL#capture"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Parslet--Atoms--DSL-capture-for-pr

hub pull-request


# Celebrate!