diff --git a/docs/source/Components/FuncParser.md b/docs/source/Components/FuncParser.md index c5c32f4ad9..05aee2d509 100644 --- a/docs/source/Components/FuncParser.md +++ b/docs/source/Components/FuncParser.md @@ -22,7 +22,7 @@ You say "To get a random value from 1 to 5, use $randint(1,5)." While `randint` may look and work just like `random.randint` from the standard Python library, it is _not_. Instead it's a `inlinefunc` named `randint` made available to Evennia (which in turn uses the standard library function). For security reasons, only functions explicitly assigned to be used as inlinefuncs are viable. -The `FuncParser` tool is initialized with the inlinefuncs it's supposed to recognize. Below is an example of a parser only only understanding a single `$pow` inlinefunc: +You can apply the `FuncParser` manually. The parser is initialized with the inlinefunc(s) it's supposed to recognize in that string. Below is an example of a parser only understanding a single `$pow` inlinefunc: ```python from evennia.utils.funcparser import FuncParser @@ -50,6 +50,8 @@ parser.parse_to_any("$pow(4)") 16 ``` +You don't have to define all your inline functions from scratch. In `evennia.utils.funcparser` you'll find ready-made dicts of inline-funcs you can import and plug into your parsers. See [default funcparser callables](#default-funcparser-callables) below for the defails. + ## Working with FuncParser The FuncParser can be applied to any string. Out of the box it's applied in a few situations: