sonic-pi
https://github.com/sonic-pi-net/sonic-pi
C++
Code. Music. Live.
Parslet::Atoms::Context#try_with_cache
Caches a parse answer for obj at source.pos. Applying the same parslet at one position of input always yields the same result, unless the input has changed. We need the entire source here so we can ask for how many characters were consumed by a successful parse. Imitation of such a parse must advance the input pos by the same amount of bytes.
Edit
git clone [email protected]:sonic-pi-net/sonic-pi.git
cd sonic-pi
open app/server/ruby/vendor/parslet/lib/parslet/atoms/context.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Parslet--Atoms--Context-try_with_cache-for-pr
# Commit to gitgit add app/server/ruby/vendor/parslet/lib/parslet/atoms/context.rbgit commit -m "better docs for Parslet::Atoms::Context#try_with_cache"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Parslet--Atoms--Context-try_with_cache-for-pr
hub pull-request
# Celebrate!