Localisation updates from https://translatewiki.net.
[mediawiki.git] / languages / utils / CLDRPluralRuleConverterExpression.php
blob1ee6b4c54e58b7dec107646c6a5b11250f1c1cdf
1 <?php
2 /**
3 * @author Niklas Laxström, Tim Starling
5 * @copyright Copyright © 2010-2012, Niklas Laxström
6 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
8 * @file
9 * @since 1.20
12 /**
13 * Helper for CLDRPluralRuleConverter.
14 * An expression object, representing a region of the input string (for error
15 * messages), the RPN notation used to evaluate it, and the result type for
16 * validation.
18 class CLDRPluralRuleConverterExpression extends CLDRPluralRuleConverterFragment {
19 /** @var string */
20 public $type;
22 /** @var string */
23 public $rpn;
25 function __construct( $parser, $type, $rpn, $pos, $length ) {
26 parent::__construct( $parser, $pos, $length );
27 $this->type = $type;
28 $this->rpn = $rpn;
31 public function isType( $type ) {
32 if ( $type === 'range' && ( $this->type === 'range' || $this->type === 'number' ) ) {
33 return true;
35 if ( $type === $this->type ) {
36 return true;
39 return false;