MediaWiki
REL1_32
Scribunto_LuaParserFunctionsLibrary.php
Go to the documentation of this file.
1
<?php
2
3
class
Scribunto_LuaParserFunctionsLibrary
extends
Scribunto_LuaLibraryBase {
4
public
function
register
() {
5
$lib = [
6
'expr'
=> [ $this,
'expr'
],
7
];
8
9
return
$this->getEngine()->registerInterface(
10
__DIR__ .
'/mw.ext.ParserFunctions.lua'
, $lib, []
11
);
12
}
13
14
public
function
expr
( $expression =
null
) {
15
$this->checkType(
'mw.ext.ParserFunctions.expr'
, 1, $expression,
'string'
);
16
try
{
17
return
[
ExtParserFunctions::getExprParser
()->doExpression( $expression ) ];
18
}
catch
(
ExprError
$e
) {
19
throw
new
Scribunto_LuaError(
$e
->getMessage() );
20
}
21
}
22
23
}
ExprError
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Ge...
Definition
ExprError.php:19
ExtParserFunctions\getExprParser
static & getExprParser()
Definition
ExtParserFunctions.php:37
Scribunto_LuaParserFunctionsLibrary
Definition
Scribunto_LuaParserFunctionsLibrary.php:3
Scribunto_LuaParserFunctionsLibrary\expr
expr( $expression=null)
Definition
Scribunto_LuaParserFunctionsLibrary.php:14
$e
returning false will NOT prevent logging $e
Definition
hooks.txt:2226
extensions
ParserFunctions
includes
Scribunto_LuaParserFunctionsLibrary.php
Generated on Mon Nov 25 2024 15:56:40 for MediaWiki by
1.10.0