Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

Number.php 593B

123456789101112131415161718192021222324
  1. <?php
  2. /*
  3. * This file is part of Twig.
  4. *
  5. * (c) 2010 Fabien Potencier
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. class Twig_Extensions_Grammar_Number extends Twig_Extensions_Grammar
  11. {
  12. public function __toString()
  13. {
  14. return sprintf('<%s:number>', $this->name);
  15. }
  16. public function parse(Twig_Token $token)
  17. {
  18. $this->parser->getStream()->expect(Twig_Token::NUMBER_TYPE);
  19. return new Twig_Node_Expression_Constant($token->getValue(), $token->getLine());
  20. }
  21. }