From a4565e88edbc8e3bd092a475469769c86a4c350c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 2 Aug 2013 22:40:51 +0200 Subject: add Twig & refactor poche --- inc/Twig/Extensions/Grammar/Constant.php | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 inc/Twig/Extensions/Grammar/Constant.php (limited to 'inc/Twig/Extensions/Grammar/Constant.php') diff --git a/inc/Twig/Extensions/Grammar/Constant.php b/inc/Twig/Extensions/Grammar/Constant.php new file mode 100644 index 00000000..9df60458 --- /dev/null +++ b/inc/Twig/Extensions/Grammar/Constant.php @@ -0,0 +1,37 @@ +name = $name; + $this->type = null === $type ? Twig_Token::NAME_TYPE : $type; + } + + public function __toString() + { + return $this->name; + } + + public function parse(Twig_Token $token) + { + $this->parser->getStream()->expect($this->type, $this->name); + + return $this->name; + } + + public function getType() + { + return $this->type; + } +} -- cgit v1.2.3