From 0564df96510f9e66bfdabdeb453949234c1860ba Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sun, 12 May 2013 21:49:36 -0700 Subject: [PATCH] Add missing comments for pragma tokenizing. --- src/Mustache/Tokenizer.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Mustache/Tokenizer.php b/src/Mustache/Tokenizer.php index ab11a04..99e7056 100644 --- a/src/Mustache/Tokenizer.php +++ b/src/Mustache/Tokenizer.php @@ -176,6 +176,7 @@ class Mustache_Tokenizer $this->filterLine(true); + // Pragmas are hoisted to the front of the template. foreach ($this->pragmas as $pragma) { array_unshift($this->tokens, array( self::TYPE => self::T_PRAGMA, @@ -286,6 +287,14 @@ class Mustache_Tokenizer return $closeIndex + strlen($close) - 1; } + /** + * Add pragma tag this template's list of pragmas. + * + * @param string $text + * @param int $index + * + * @return int New index value + */ private function addPragma($text, $index) { $end = strpos($text, $this->ctag, $index);