Completed
Pull Request — master (#3)
by Chris
02:51
created
php/hamle/Field/Memo.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,6 +37,6 @@
 block discarded – undo
37 37
 
38 38
   function isClicked()
39 39
   {
40
-    return isset($_REQUEST[$this->form . '_' . $this->name]);
40
+    return isset($_REQUEST[$this->form.'_'.$this->name]);
41 41
   }
42 42
 }
Please login to merge, or discard this patch.
php/autoload.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,11 +34,11 @@
 block discarded – undo
34 34
  * @param string $class Class name to be autoloaded
35 35
  */
36 36
 spl_autoload_register(
37
-  function ($class) {
37
+  function($class) {
38 38
     if (strpos($class, 'Seufert\\Hamle\\') === 0) {
39 39
       $s = DIRECTORY_SEPARATOR;
40 40
       $class = str_replace('\\', $s, substr($class, 14));
41
-      $path = __DIR__ . $s . 'hamle' . $s . "$class.php";
41
+      $path = __DIR__.$s.'hamle'.$s."$class.php";
42 42
       if (is_file($path)) {
43 43
         include_once $path;
44 44
       }
Please login to merge, or discard this patch.
php/hamle/Parse.php 1 patch
Spacing   -279 removed lines patch added patch discarded remove patch
@@ -54,282 +54,3 @@
 block discarded – undo
54 54
    */
55 55
 
56 56
   const REGEX_PARSE_LINE = <<<'ENDREGEX'
57
-  /^(\s*)(?:(?:([a-zA-Z0-9-]*)((?:[\.#!][\w\-\_]+)*)(\[(?:(?:\{\$[^\}]+\})?[^\\\]{]*?(?:\\.)*?(?:{[^\$])*?)+\])?)|([_\/]{1,3})|([\|:\$]\w+)|({?\$[^}]+}?)|)(?: (.*))?$/
58
-  ENDREGEX;
59
-
60
-  /**
61
-   * @var int Current Line Number
62
-   */
63
-  protected $lineNo;
64
-  /**
65
-   * @var int Total Lines in File
66
-   */
67
-  protected $lineCount;
68
-
69
-  function __construct()
70
-  {
71
-    $this->init();
72
-  }
73
-
74
-  /**
75
-   * Clear Lines, and Line Number, so if output is
76
-   * called, no output will be produced
77
-   */
78
-  protected function init()
79
-  {
80
-    $this->lines = [];
81
-    $this->lineNo = 0;
82
-    $this->lineCount = 0;
83
-    $this->root = [];
84
-  }
85
-
86
-  protected function loadLines($s)
87
-  {
88
-    $this->lines = explode("\n", str_replace("\r", '', $s));
89
-    $this->lineCount = count($this->lines);
90
-    $this->lineNo = 0;
91
-  }
92
-
93
-  function parseFilter(ParseFilter $filter)
94
-  {
95
-    foreach ($this->root as $k => $tag) {
96
-      $this->root[$k] = $filter->filterTag($tag);
97
-    }
98
-  }
99
-
100
-  function parseSnip($s)
101
-  {
102
-    //save root tags
103
-    /** @var Tag[] $roots */
104
-    $roots = $this->root;
105
-    $this->root = [];
106
-    $this->loadLines($s);
107
-    $this->procLines();
108
-    $this->root = array_merge($roots, $this->root);
109
-  }
110
-
111
-  function applySnip()
112
-  {
113
-    /** @var Tag\Snippet[] $fwdSnip */
114
-    $fwdSnip = [];
115
-    /** @var Tag\Snippet[] $revSnip */
116
-    $revSnip = [];
117
-    /** @var Tag[] $roots */
118
-    $roots = [];
119
-    foreach ($this->root as $snip) {
120
-      if ($snip instanceof Tag\Snippet) {
121
-        if ($snip->getType() == 'append') {
122
-          array_unshift($revSnip, $snip);
123
-        } else {
124
-          $fwdSnip[] = $snip;
125
-        }
126
-      } else {
127
-        $roots[] = $snip;
128
-      }
129
-    }
130
-    foreach ($fwdSnip as $snip) {
131
-      foreach ($roots as $root) {
132
-        $snip->apply($root);
133
-      }
134
-    }
135
-    foreach ($revSnip as $snip) {
136
-      foreach ($roots as $root) {
137
-        $snip->apply($root);
138
-      }
139
-    }
140
-    $this->root = $roots;
141
-  }
142
-
143
-  /**
144
-   * Parse HAMLE template, from a string
145
-   * @param string $s String to parse
146
-   */
147
-  function str($s)
148
-  {
149
-    $this->init();
150
-    $this->loadLines($s);
151
-    $this->procLines();
152
-  }
153
-
154
-  function procLines()
155
-  {
156
-    /* @var $heir Tag[] Tag Heirachy Array */
157
-    $heir = [];
158
-    while ($this->lineNo < $this->lineCount) {
159
-      $line = $this->lines[$this->lineNo];
160
-      if (trim($line)) {
161
-        if (preg_match(self::REGEX_PARSE_LINE, $line, $m)) {
162
-          if (false !== strpos($m[1], "\t")) {
163
-            throw new ParseError(
164
-              'Tabs are not supported in templates at this time',
165
-            );
166
-          }
167
-          $indent = strlen($m[1]);
168
-          $tag = isset($m[2]) ? ($tag = $m[2]) : '';
169
-          $classid = isset($m[3]) ? $m[3] : '';
170
-          $params = str_replace(
171
-            ['\[', '\]', '\\&'],
172
-            ['[', ']', '%26'],
173
-            isset($m[4]) ? $m[4] : '',
174
-          );
175
-          $textcode = isset($m[5]) ? $m[5] : '';
176
-          $text = isset($m[8]) ? $m[8] : '';
177
-          $code = isset($m[6]) ? $m[6] : '';
178
-          $i = self::indentLevel($indent);
179
-          unset($m[0]);
180
-          switch (strlen($code) ? $code[0] : ($textcode ? $textcode : '')) {
181
-            case '|': //Control Tag
182
-              if ($code == '|snippet') {
183
-                $hTag = new Tag\Snippet($text);
184
-              } elseif ($code == '|form') {
185
-                $hTag = new Tag\Form($text);
186
-              } elseif ($code == '|formhint') {
187
-                $hTag = new Tag\FormHint();
188
-              } elseif ($code == '|else') {
189
-                $hTag = new Tag\Control(substr($code, 1), $heir[$i - 1]);
190
-                $hTag->setVar($text);
191
-              } else {
192
-                $hTag = new Tag\Control(substr($code, 1));
193
-                $hTag->setVar($text);
194
-              }
195
-              break;
196
-            case ':': //Filter Tag
197
-              $hTag = new Tag\Filter(substr($code, 1));
198
-              $hTag->addContent($text, Text::TOKEN_CODE);
199
-              foreach ($this->consumeBlock($indent) as $l) {
200
-                $hTag->addContent($l, Text::TOKEN_CODE);
201
-              }
202
-              break;
203
-            case '_': //String Tag
204
-            case '__': //Unescape String Tag
205
-            case '___': //Unescape String Tag (with unescaped vars)
206
-              $hTag = new Tag\Text($textcode);
207
-              $hTag->addContent($text);
208
-              break;
209
-            case '___': //Unescape String Tag
210
-              $hTag = new Tag\Text($textcode);
211
-              $hTag->addContent($text);
212
-              break;
213
-            case '/': // HTML Comment
214
-            case '//': // Non Printed Comment
215
-              $hTag = new Tag\Comment($textcode);
216
-              $hTag->addContent($text);
217
-              foreach ($this->consumeBlock($indent) as $l) {
218
-                $hTag->addContent($l, Text::TOKEN_CODE);
219
-              }
220
-              break;
221
-            default:
222
-              $attr = [];
223
-              if (isset($params[0]) && $params[0] == '[') {
224
-                $param = substr($params, 1, -1);
225
-                $param = str_replace(['+', '\\&'], ['%2B', '%26'], $param);
226
-                //              parse_str($param, $attr);
227
-                $attr = $this->parseQueryString($param);
228
-              }
229
-              $class = [];
230
-              $id = '';
231
-              $ref = '';
232
-              preg_match_all('/[#\.!][a-zA-Z0-9\-\_]+/m', $classid, $cid);
233
-              if (isset($cid[0])) {
234
-                foreach ($cid[0] as $s) {
235
-                  if ($s[0] == '#') {
236
-                    $id = substr($s, 1);
237
-                  }
238
-                  if ($s[0] == '.') {
239
-                    $class[] = substr($s, 1);
240
-                  }
241
-                  if ($s[0] == '!') {
242
-                    $ref = substr($s, 1);
243
-                  }
244
-                }
245
-              }
246
-              if ($ref) {
247
-                $hTag = new Tag\DynHtml($tag, $class, $attr, $id, $ref);
248
-              } else {
249
-                $hTag = new Tag\Html($tag, $class, $attr, $id);
250
-              }
251
-              $hTag->addContent($text);
252
-              break;
253
-          }
254
-          $heir[$i] = $hTag;
255
-          if ($i > 0) {
256
-            $heir[$i - 1]->addChild($hTag);
257
-          } else {
258
-            $this->root[] = $hTag;
259
-          }
260
-        } else {
261
-          throw new ParseError(
262
-            "Unable to parse line {$this->lineNo}\n\"$line\"/" .
263
-              preg_last_error(),
264
-          );
265
-        }
266
-      }
267
-      $this->lineNo++;
268
-    }
269
-  }
270
-
271
-  function parseQueryString($qs)
272
-  {
273
-    $out = [];
274
-    foreach (explode('&', $qs) as $s) {
275
-      $kv = explode('=', $s, 2);
276
-      $out[urldecode($kv[0])] = isset($kv[1]) ? urldecode($kv[1]) : null;
277
-    }
278
-    return $out;
279
-  }
280
-
281
-  function output($minify = false)
282
-  {
283
-    $out = "<?php\nuse Seufert\\Hamle;\n?>";
284
-    foreach ($this->root as $tag) {
285
-      $out .= $tag->render(0, $minify);
286
-    }
287
-    return $out;
288
-  }
289
-
290
-  function consumeBlock($indent)
291
-  {
292
-    $out = [];
293
-    $m = [];
294
-    while (
295
-      $this->lineNo + 1 < $this->lineCount &&
296
-      (!trim($this->lines[$this->lineNo + 1]) ||
297
-        preg_match(
298
-          '/^(\s){' . $indent . '}((\s)+[^\s].*)$/',
299
-          $this->lines[$this->lineNo + 1],
300
-          $m,
301
-        ))
302
-    ) {
303
-      if (trim($this->lines[$this->lineNo + 1])) {
304
-        $out[] = $m[2];
305
-      }
306
-      $this->lineNo++;
307
-    }
308
-    return $out;
309
-  }
310
-
311
-  function indentLevel($indent)
312
-  {
313
-    if (!isset($this->indents)) {
314
-      $this->indents = [];
315
-    }
316
-    if (!count($this->indents)) {
317
-      $this->indents = [0 => $indent];
318
-      // Key = indent level, Value = Depth in spaces
319
-      return 0;
320
-    }
321
-    foreach ($this->indents as $k => $v) {
322
-      if ($v == $indent) {
323
-        $this->indents = array_slice($this->indents, 0, $k + 1);
324
-        return $k;
325
-      }
326
-    }
327
-    $this->indents[] = $indent;
328
-    return max(array_keys($this->indents));
329
-  }
330
-
331
-  function getLineNo()
332
-  {
333
-    return $this->lineNo;
334
-  }
335
-}
Please login to merge, or discard this patch.
php/hamle/Grammar/Parser.php 1 patch
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     private $peg_currPos          = 0;
68 68
     private $peg_reportedPos      = 0;
69 69
     private $peg_cachedPos        = 0;
70
-    private $peg_cachedPosDetails = array('line' => 1, 'column' => 1, 'seenCR' => false );
70
+    private $peg_cachedPosDetails = array('line' => 1, 'column' => 1, 'seenCR' => false);
71 71
     private $peg_maxFailPos       = 0;
72 72
     private $peg_maxFailExpected  = array();
73 73
     private $peg_silentFails      = 0;
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
       $this->peg_currPos          = 0;
79 79
       $this->peg_reportedPos      = 0;
80 80
       $this->peg_cachedPos        = 0;
81
-      $this->peg_cachedPosDetails = array('line' => 1, 'column' => 1, 'seenCR' => false );
81
+      $this->peg_cachedPosDetails = array('line' => 1, 'column' => 1, 'seenCR' => false);
82 82
       $this->peg_maxFailPos       = 0;
83 83
       $this->peg_maxFailExpected  = array();
84 84
       $this->peg_silentFails      = 0;
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     private function expected($description) {
122 122
       throw $this->peg_buildException(
123 123
         null,
124
-        array(array("type" => "other", "description" => $description )),
124
+        array(array("type" => "other", "description" => $description)),
125 125
         $this->peg_reportedPos
126 126
       );
127 127
     }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
       if ($this->peg_cachedPos !== $pos) {
153 153
         if ($this->peg_cachedPos > $pos) {
154 154
           $this->peg_cachedPos = 0;
155
-          $this->peg_cachedPosDetails = array( "line" => 1, "column" => 1, "seenCR" => false );
155
+          $this->peg_cachedPosDetails = array("line" => 1, "column" => 1, "seenCR" => false);
156 156
         }
157 157
         $this->peg_advancePos($this->peg_cachedPosDetails, $this->peg_cachedPos, $pos);
158 158
         $this->peg_cachedPos = $pos;
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 
214 214
         $foundDesc = $found ? json_encode($found) : "end of input";
215 215
 
216
-        $message = "Expected " . $expectedDesc . " but " . $foundDesc . " found.";
216
+        $message = "Expected ".$expectedDesc." but ".$foundDesc." found.";
217 217
       }
218 218
 
219 219
       return new SyntaxError(
@@ -302,13 +302,13 @@  discard block
 block discarded – undo
302 302
                                                   array_walk_recursive($i, function($a) use (&$return) { $return[] = $a; });
303 303
                                                   return $return;
304 304
                                          }
305
-    private function peg_f2($text) { return new \Seufert\Hamle\TextNode\StringLit(join('',$text)); }
305
+    private function peg_f2($text) { return new \Seufert\Hamle\TextNode\StringLit(join('', $text)); }
306 306
     private function peg_f3($body) { return $body; }
307 307
     private function peg_f4($name) {
308 308
             return new \Seufert\Hamle\TextNode\ScopeId(null, null, new \Seufert\Hamle\TextNode\ModelParam($name)); }
309
-    private function peg_f5($expr, $chain) { if(!$chain) return $expr;
309
+    private function peg_f5($expr, $chain) { if (!$chain) return $expr;
310 310
                            $top = array_pop($chain);
311
-                           while($chain) { $top = array_pop($chain)->withChain($top); } return $expr->withChain($top); }
311
+                           while ($chain) { $top = array_pop($chain)->withChain($top); } return $expr->withChain($top); }
312 312
     private function peg_f6($sub) { return $sub; }
313 313
     private function peg_f7($filter) { return $filter; }
314 314
     private function peg_f8($name) { return new \Seufert\Hamle\TextNode\ModelParam($name, null); }
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
     private function peg_f15($query) { return new \Seufert\Hamle\TextNode\Query($query); }
322 322
     private function peg_f16($id, $query) { return array_merge([['q'=>'type', 'id'=> $id]], $query); }
323 323
     private function peg_f17($query) { return array_merge([['q'=>'type', 'id'=> '*']], $query); }
324
-    private function peg_f18($rel, $sub) { return \Seufert\Hamle\TextNode\RelQuery::for($rel, $sub); }
324
+    private function peg_f18($rel, $sub) { return \Seufert\Hamle\TextNode\RelQuery::for ($rel, $sub); }
325 325
     private function peg_f19($id) { return ['q'=>'id', 'id'=> $id]; }
326 326
     private function peg_f20($id) { return ['q'=>'type', 'id'=> $id]; }
327 327
     private function peg_f21($id) { return ['q'=>'tag', 'id'=> $id]; }
@@ -335,23 +335,23 @@  discard block
 block discarded – undo
335 335
     private function peg_f29($func, $args) { return new \Seufert\Hamle\TextNode\FilterFunc($func, null, $args); }
336 336
     private function peg_f30($func) { return new \Seufert\Hamle\TextNode\FilterFunc($func); }
337 337
     private function peg_f31($arg) { return $arg; }
338
-    private function peg_f32($s, $n, $d) { return \Seufert\Hamle\TextNode\FloatLit((float)"$s$n.$d"); }
338
+    private function peg_f32($s, $n, $d) { return \Seufert\Hamle\TextNode\FloatLit((float) "$s$n.$d"); }
339 339
     private function peg_f33($parts) { return $parts[1]; }
340 340
     private function peg_f34($s, $e, $post) {
341 341
             $o = [];
342
-            if($s) $o[] = new \Seufert\Hamle\TextNode\StringLit(join('',$s));
343
-            if($e) $o[] = $e;
344
-            if($post) foreach($post as $p) $o[] = $p;
345
-            if(!$o) return new \Seufert\Hamle\TextNode\StringLit('');
342
+            if ($s) $o[] = new \Seufert\Hamle\TextNode\StringLit(join('', $s));
343
+            if ($e) $o[] = $e;
344
+            if ($post) foreach ($post as $p) $o[] = $p;
345
+            if (!$o) return new \Seufert\Hamle\TextNode\StringLit('');
346 346
             return \Seufert\Hamle\TextNode\StringConcat::fromList($o);
347 347
         }
348
-    private function peg_f35($s) { return new \Seufert\Hamle\TextNode\StringLit(join('',$s)); }
348
+    private function peg_f35($s) { return new \Seufert\Hamle\TextNode\StringLit(join('', $s)); }
349 349
     private function peg_f36($s, $e, $post) {
350 350
                                $o = [];
351
-                               if($s) $o[] = new \Seufert\Hamle\TextNode\StringLit(join('',$s));
352
-                               if($e) $o[] = $e;
353
-                               if($post) foreach($post as $p) $o[] = $p;
354
-                               if(!$o) return new \Seufert\Hamle\TextNode\StringLit('');
351
+                               if ($s) $o[] = new \Seufert\Hamle\TextNode\StringLit(join('', $s));
352
+                               if ($e) $o[] = $e;
353
+                               if ($post) foreach ($post as $p) $o[] = $p;
354
+                               if (!$o) return new \Seufert\Hamle\TextNode\StringLit('');
355 355
                                return \Seufert\Hamle\TextNode\StringConcat::fromList($o);
356 356
                            }
357 357
     private function peg_f37($parts) { return new \Seufert\Hamle\TextNode\StringLit($parts[1]); }
@@ -360,12 +360,12 @@  discard block
 block discarded – undo
360 360
     private function peg_f40($s) { return $s; }
361 361
     private function peg_f41($char) { return $char; }
362 362
     private function peg_f42($sequence) { return $sequence; }
363
-    private function peg_f43($n) { return (int)join('', $n); }
364
-    private function peg_f44($sign, $n) { return new \Seufert\Hamle\TextNode\IntLit((int)($sign.join('', $n))); }
365
-    private function peg_f45($name) { return join('',$name); }
363
+    private function peg_f43($n) { return (int) join('', $n); }
364
+    private function peg_f44($sign, $n) { return new \Seufert\Hamle\TextNode\IntLit((int) ($sign.join('', $n))); }
365
+    private function peg_f45($name) { return join('', $name); }
366 366
     private function peg_f46($p, $s) { return $p.join('', $s); }
367 367
     private function peg_f47($s) { return join('', $s); }
368
-    private function peg_f48($char_) { return str_replace(['n', 'r', 't'], ['\\n','\\r','\\t'], $char_); }
368
+    private function peg_f48($char_) { return str_replace(['n', 'r', 't'], ['\\n', '\\r', '\\t'], $char_); }
369 369
 
370 370
     private function peg_parseHtmlInput() {
371 371
 
@@ -3279,77 +3279,77 @@  discard block
 block discarded – undo
3279 3279
 
3280 3280
     $this->peg_FAILED = new \stdClass;
3281 3281
     $this->peg_c0 = "{";
3282
-    $this->peg_c1 = array( "type" => "literal", "value" => "{", "description" => "\"{\"" );
3282
+    $this->peg_c1 = array("type" => "literal", "value" => "{", "description" => "\"{\"");
3283 3283
     $this->peg_c2 = "}";
3284
-    $this->peg_c3 = array( "type" => "literal", "value" => "}", "description" => "\"}\"" );
3284
+    $this->peg_c3 = array("type" => "literal", "value" => "}", "description" => "\"}\"");
3285 3285
     $this->peg_c4 = "$";
3286
-    $this->peg_c5 = array( "type" => "literal", "value" => "$", "description" => "\"$\"" );
3286
+    $this->peg_c5 = array("type" => "literal", "value" => "$", "description" => "\"$\"");
3287 3287
     $this->peg_c6 = "|";
3288
-    $this->peg_c7 = array( "type" => "literal", "value" => "|", "description" => "\"|\"" );
3288
+    $this->peg_c7 = array("type" => "literal", "value" => "|", "description" => "\"|\"");
3289 3289
     $this->peg_c8 = "(";
3290
-    $this->peg_c9 = array( "type" => "literal", "value" => "(", "description" => "\"(\"" );
3290
+    $this->peg_c9 = array("type" => "literal", "value" => "(", "description" => "\"(\"");
3291 3291
     $this->peg_c10 = ")";
3292
-    $this->peg_c11 = array( "type" => "literal", "value" => ")", "description" => "\")\"" );
3292
+    $this->peg_c11 = array("type" => "literal", "value" => ")", "description" => "\")\"");
3293 3293
     $this->peg_c12 = "[";
3294
-    $this->peg_c13 = array( "type" => "literal", "value" => "[", "description" => "\"[\"" );
3294
+    $this->peg_c13 = array("type" => "literal", "value" => "[", "description" => "\"[\"");
3295 3295
     $this->peg_c14 = "]";
3296
-    $this->peg_c15 = array( "type" => "literal", "value" => "]", "description" => "\"]\"" );
3296
+    $this->peg_c15 = array("type" => "literal", "value" => "]", "description" => "\"]\"");
3297 3297
     $this->peg_c16 = "*";
3298
-    $this->peg_c17 = array( "type" => "literal", "value" => "*", "description" => "\"*\"" );
3298
+    $this->peg_c17 = array("type" => "literal", "value" => "*", "description" => "\"*\"");
3299 3299
     $this->peg_c18 = " ";
3300
-    $this->peg_c19 = array( "type" => "literal", "value" => " ", "description" => "\" \"" );
3300
+    $this->peg_c19 = array("type" => "literal", "value" => " ", "description" => "\" \"");
3301 3301
     $this->peg_c20 = "/^[><]/";
3302
-    $this->peg_c21 = array( "type" => "class", "value" => "[><]", "description" => "[><]" );
3302
+    $this->peg_c21 = array("type" => "class", "value" => "[><]", "description" => "[><]");
3303 3303
     $this->peg_c22 = "#";
3304
-    $this->peg_c23 = array( "type" => "literal", "value" => "#", "description" => "\"#\"" );
3304
+    $this->peg_c23 = array("type" => "literal", "value" => "#", "description" => "\"#\"");
3305 3305
     $this->peg_c24 = ",";
3306
-    $this->peg_c25 = array( "type" => "literal", "value" => ",", "description" => "\",\"" );
3306
+    $this->peg_c25 = array("type" => "literal", "value" => ",", "description" => "\",\"");
3307 3307
     $this->peg_c26 = ".";
3308
-    $this->peg_c27 = array( "type" => "literal", "value" => ".", "description" => "\".\"" );
3308
+    $this->peg_c27 = array("type" => "literal", "value" => ".", "description" => "\".\"");
3309 3309
     $this->peg_c28 = "^";
3310
-    $this->peg_c29 = array( "type" => "literal", "value" => "^", "description" => "\"^\"" );
3310
+    $this->peg_c29 = array("type" => "literal", "value" => "^", "description" => "\"^\"");
3311 3311
     $this->peg_c30 = "@";
3312
-    $this->peg_c31 = array( "type" => "literal", "value" => "@", "description" => "\"@\"" );
3312
+    $this->peg_c31 = array("type" => "literal", "value" => "@", "description" => "\"@\"");
3313 3313
     $this->peg_c32 = ":";
3314
-    $this->peg_c33 = array( "type" => "literal", "value" => ":", "description" => "\":\"" );
3314
+    $this->peg_c33 = array("type" => "literal", "value" => ":", "description" => "\":\"");
3315 3315
     $this->peg_c34 = "-";
3316
-    $this->peg_c35 = array( "type" => "literal", "value" => "-", "description" => "\"-\"" );
3316
+    $this->peg_c35 = array("type" => "literal", "value" => "-", "description" => "\"-\"");
3317 3317
     $this->peg_c36 = ">";
3318
-    $this->peg_c37 = array( "type" => "literal", "value" => ">", "description" => "\">\"" );
3318
+    $this->peg_c37 = array("type" => "literal", "value" => ">", "description" => "\">\"");
3319 3319
     $this->peg_c38 = "!";
3320
-    $this->peg_c39 = array( "type" => "literal", "value" => "!", "description" => "\"!\"" );
3320
+    $this->peg_c39 = array("type" => "literal", "value" => "!", "description" => "\"!\"");
3321 3321
     $this->peg_c40 = "/^[0-9]/";
3322
-    $this->peg_c41 = array( "type" => "class", "value" => "[0-9]", "description" => "[0-9]" );
3322
+    $this->peg_c41 = array("type" => "class", "value" => "[0-9]", "description" => "[0-9]");
3323 3323
     $this->peg_c42 = "\"";
3324
-    $this->peg_c43 = array( "type" => "literal", "value" => "\"", "description" => "\"\\\"\"" );
3324
+    $this->peg_c43 = array("type" => "literal", "value" => "\"", "description" => "\"\\\"\"");
3325 3325
     $this->peg_c44 = "'";
3326
-    $this->peg_c45 = array( "type" => "literal", "value" => "'", "description" => "\"'\"" );
3327
-    $this->peg_c46 = array("type" => "other", "description" => "string" );
3326
+    $this->peg_c45 = array("type" => "literal", "value" => "'", "description" => "\"'\"");
3327
+    $this->peg_c46 = array("type" => "other", "description" => "string");
3328 3328
     $this->peg_c47 = "\\";
3329
-    $this->peg_c48 = array( "type" => "literal", "value" => "\\", "description" => "\"\\\\\"" );
3330
-    $this->peg_c49 = array("type" => "any", "description" => "any character" );
3329
+    $this->peg_c48 = array("type" => "literal", "value" => "\\", "description" => "\"\\\\\"");
3330
+    $this->peg_c49 = array("type" => "any", "description" => "any character");
3331 3331
     $this->peg_c50 = "/^[a-zA-Z_]/";
3332
-    $this->peg_c51 = array( "type" => "class", "value" => "[a-zA-Z_]", "description" => "[a-zA-Z_]" );
3332
+    $this->peg_c51 = array("type" => "class", "value" => "[a-zA-Z_]", "description" => "[a-zA-Z_]");
3333 3333
     $this->peg_c52 = "/^[a-zA-Z_-]/";
3334
-    $this->peg_c53 = array( "type" => "class", "value" => "[a-zA-Z_-]", "description" => "[a-zA-Z_-]" );
3334
+    $this->peg_c53 = array("type" => "class", "value" => "[a-zA-Z_-]", "description" => "[a-zA-Z_-]");
3335 3335
     $this->peg_c54 = "/^[0-9a-zA-Z_-]/";
3336
-    $this->peg_c55 = array( "type" => "class", "value" => "[0-9a-zA-Z_-]", "description" => "[0-9a-zA-Z_-]" );
3336
+    $this->peg_c55 = array("type" => "class", "value" => "[0-9a-zA-Z_-]", "description" => "[0-9a-zA-Z_-]");
3337 3337
     $this->peg_c56 = "/^[^{\\\$]/";
3338
-    $this->peg_c57 = array( "type" => "class", "value" => "[{\$]", "description" => "[{\$]" );
3338
+    $this->peg_c57 = array("type" => "class", "value" => "[{\$]", "description" => "[{\$]");
3339 3339
     $this->peg_c58 = "/^[a-z]/";
3340
-    $this->peg_c59 = array( "type" => "class", "value" => "[a-z]", "description" => "[a-z]" );
3340
+    $this->peg_c59 = array("type" => "class", "value" => "[a-z]", "description" => "[a-z]");
3341 3341
     $this->peg_c60 = "/^[^{]/";
3342
-    $this->peg_c61 = array( "type" => "class", "value" => "[{]", "description" => "[{]" );
3342
+    $this->peg_c61 = array("type" => "class", "value" => "[{]", "description" => "[{]");
3343 3343
     $this->peg_c62 = "/^[\\n\\r\\x{2028}\\x{2029}]/";
3344
-    $this->peg_c63 = array( "type" => "class", "value" => "[\n\r\x{2028}\x{2029}]", "description" => "[\n\r\x{2028}\x{2029}]" );
3344
+    $this->peg_c63 = array("type" => "class", "value" => "[\n\r\x{2028}\x{2029}]", "description" => "[\n\r\x{2028}\x{2029}]");
3345 3345
     $this->peg_c64 = "/^['\"\\\\bfnrtv]/";
3346
-    $this->peg_c65 = array( "type" => "class", "value" => "['\"\\bfnrtv]", "description" => "['\"\\bfnrtv]" );
3346
+    $this->peg_c65 = array("type" => "class", "value" => "['\"\\bfnrtv]", "description" => "['\"\\bfnrtv]");
3347 3347
 
3348
-    $peg_startRuleFunctions = array( 'HtmlInput' => array($this, "peg_parseHtmlInput"), 'CodeInput' => array($this, "peg_parseCodeInput"), 'ControlInput' => array($this, "peg_parseControlInput") );
3348
+    $peg_startRuleFunctions = array('HtmlInput' => array($this, "peg_parseHtmlInput"), 'CodeInput' => array($this, "peg_parseCodeInput"), 'ControlInput' => array($this, "peg_parseControlInput"));
3349 3349
     $peg_startRuleFunction  = array($this, "peg_parseHtmlInput");
3350 3350
     if (isset($options["startRule"])) {
3351 3351
       if (!(isset($peg_startRuleFunctions[$options["startRule"]]))) {
3352
-        throw new \Exception("Can't start parsing from rule \"" + $options["startRule"] + "\".");
3352
+        throw new \Exception("Can't start parsing from rule \"" +$options["startRule"] + "\".");
3353 3353
       }
3354 3354
 
3355 3355
       $peg_startRuleFunction = $peg_startRuleFunctions[$options["startRule"]];
@@ -3363,7 +3363,7 @@  discard block
 block discarded – undo
3363 3363
       return $peg_result;
3364 3364
     } else {
3365 3365
       if ($peg_result !== $this->peg_FAILED && $this->peg_currPos < $this->input_length) {
3366
-        $this->peg_fail(array("type" => "end", "description" => "end of input" ));
3366
+        $this->peg_fail(array("type" => "end", "description" => "end of input"));
3367 3367
       }
3368 3368
 
3369 3369
       $exception = $this->peg_buildException(null, $this->peg_maxFailExpected, $this->peg_maxFailPos);
Please login to merge, or discard this patch.