mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-22 04:23:01 +00:00
Update documentation for add_parser
This commit is contained in:
parent
0f79a8ec13
commit
429c3eaf50
1 changed files with 5 additions and 5 deletions
10
core.php
10
core.php
|
@ -1731,12 +1731,12 @@ $parsers = [
|
||||||
];
|
];
|
||||||
/**
|
/**
|
||||||
* Registers a new parser.
|
* Registers a new parser.
|
||||||
* @package core
|
* @package core
|
||||||
* @param string $name The name of the new parser to register.
|
* @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 $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;
|
global $parsers;
|
||||||
if(isset($parsers[$name]))
|
if(isset($parsers[$name]))
|
||||||
throw new Exception("Can't register parser with name '$name' because a parser with that name already exists.");
|
throw new Exception("Can't register parser with name '$name' because a parser with that name already exists.");
|
||||||
|
|
Loading…
Reference in a new issue