sonic-pi
https://github.com/sonic-pi-net/sonic-pi
C++
Code. Music. Live.
Parslet::Parser.root
Define the parsers #root function. This is the place where you start
parsing; if you have a rule for 'file' that describes what should be
in a file, this would be your root declaration:
class Parser
root :file
rule(:file) { ... }
end
#root declares a 'parse' function that works just like the parse
function that you can call on a simple parslet, taking a string as input
and producing parse output.
In a way, #root is a shorthand for:
def parse(str)
your_parser_root.parse(str)
endEdit
git clone [email protected]:sonic-pi-net/sonic-pi.git
cd sonic-pi
open app/server/ruby/vendor/parslet/lib/parslet/parser.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Parslet--Parser-root-for-pr
# Commit to gitgit add app/server/ruby/vendor/parslet/lib/parslet/parser.rbgit commit -m "better docs for Parslet::Parser.root"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Parslet--Parser-root-for-pr
hub pull-request
# Celebrate!