1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-12-22 13:45:02 +00:00

Update documentation for add_parser

This commit is contained in:
Starbeamrainbowlabs 2019-02-10 23:13:08 +00:00
parent 0f79a8ec13
commit 429c3eaf50
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -1731,12 +1731,12 @@ $parsers = [
];
/**
* Registers a new parser.
* @package core
* @param string $name The name of the new parser to register.
* @param function $parser_code The function to register as a new parser.
* @package core
* @param string $name The name of the new parser to register.
* @param function $parser_code The function to register as a new parser.
* @param function $hash_generator A function that should take a single argument of the input source text, and return a unique hash for that content. The return value is used as the filename for cache entries, so should be safe to use as such.
*/
function add_parser($name, $parser_code, $hash_generator)
{
function add_parser($name, $parser_code, $hash_generator) {
global $parsers;
if(isset($parsers[$name]))
throw new Exception("Can't register parser with name '$name' because a parser with that name already exists.");