sonic-pi
https://github.com/sonic-pi-net/sonic-pi
C++
Code. Music. Live.
Parslet.dynamic
Designates a piece of the parser as being dynamic. Dynamic parsers can
either return a parser at runtime, which will be applied on the input, or
return a result from a parse.
Dynamic parse pieces are never cached and can introduce performance
abnormalitites - use sparingly where other constructs fail.
Example:
# Parses either 'a' or 'b', depending on the weather
dynamic { rand() < 0.5 ? str('a') : str('b') }Edit
git clone [email protected]:sonic-pi-net/sonic-pi.git
cd sonic-pi
open app/server/ruby/vendor/parslet/lib/parslet.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Parslet-dynamic-for-pr
# Commit to gitgit add app/server/ruby/vendor/parslet/lib/parslet.rbgit commit -m "better docs for Parslet.dynamic"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Parslet-dynamic-for-pr
hub pull-request
# Celebrate!