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
1 changed files with 5 additions and 5 deletions

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.");