Index: trunk/extensions/InlineScripts/interpreter/Data.php |
— | — | @@ -1,5 +1,8 @@ |
2 | 2 | <?php |
3 | 3 | |
| 4 | +/** |
| 5 | + * Class implementing data in the scripts. |
| 6 | + */ |
4 | 7 | class ISData { |
5 | 8 | // Data types |
6 | 9 | const DInt = 'int'; |
— | — | @@ -8,9 +11,10 @@ |
9 | 12 | const DBool = 'bool'; |
10 | 13 | const DFloat = 'float'; |
11 | 14 | const DList = 'list'; // int -> value |
| 15 | + const DAssoc = 'assoc'; // associative array |
12 | 16 | |
13 | | - var $type; |
14 | | - var $data; |
| 17 | + public $type; |
| 18 | + public $data; |
15 | 19 | |
16 | 20 | public function __construct( $type = self::DNull, $val = null ) { |
17 | 21 | $this->type = $type; |
— | — | @@ -52,7 +56,7 @@ |
53 | 57 | return new ISData(); |
54 | 58 | } |
55 | 59 | |
56 | | - if( $orig->type == self::DList ) { |
| 60 | + if( $orig->isArray() ) { |
57 | 61 | if( $target == self::DBool ) |
58 | 62 | return new ISData( self::DBool, (bool)count( $orig->data ) ); |
59 | 63 | if( $target == self::DFloat ) { |
— | — | @@ -99,7 +103,7 @@ |
100 | 104 | |
101 | 105 | // Checks whether a is in b |
102 | 106 | public static function keywordIn( $a, $b ) { |
103 | | - if( $b->type == self::DList ) { |
| 107 | + if( $b->isArray() ) { |
104 | 108 | foreach( $b->data as $elem ) { |
105 | 109 | if( self::equals( $elem, $a ) ) |
106 | 110 | return new ISData( self::DBool, true ); |
— | — | @@ -109,7 +113,7 @@ |
110 | 114 | $a = $a->toString(); |
111 | 115 | $b = $b->toString(); |
112 | 116 | |
113 | | - if ($a == '' || $b == '') { |
| 117 | + if( $a == '' || $b == '' ) { |
114 | 118 | return new ISData( self::DBool, false ); |
115 | 119 | } |
116 | 120 | |
— | — | @@ -164,7 +168,7 @@ |
165 | 169 | $b = $b->toFloat(); |
166 | 170 | } |
167 | 171 | |
168 | | - if ($op != '*' && $b == 0) { |
| 172 | + if( $op != '*' && $b == 0 ) { |
169 | 173 | throw new ISUserVisibleException( 'dividebyzero', $pos, array($a) ); |
170 | 174 | } |
171 | 175 | |
— | — | @@ -178,10 +182,10 @@ |
179 | 183 | else |
180 | 184 | throw new ISException( "Invalid multiplication-related operation: {$op}" ); // Should never happen |
181 | 185 | |
182 | | - if ($type == self::DInt) |
183 | | - $data = intval($data); |
| 186 | + if( $type == self::DInt ) |
| 187 | + $data = intval( $data ); |
184 | 188 | else |
185 | | - $data = doubleval($data); |
| 189 | + $data = doubleval( $data ); |
186 | 190 | |
187 | 191 | return new ISData( $type, $data ); |
188 | 192 | } |
— | — | @@ -203,38 +207,12 @@ |
204 | 208 | else |
205 | 209 | return new ISData( self::DFloat, $a->toFloat() - $b->toFloat() ); |
206 | 210 | } |
207 | | - |
208 | | - public function setValueByIndices( $val, $indices, $line ) { |
209 | | - if( $this->type == self::DNull && $indices[0] === null ) { |
210 | | - $this->type = self::DList; |
211 | | - $this->value = array(); |
212 | | - $this->setValueByIndices( $val, $indices, $line ); |
213 | | - } elseif( $this->type == self::DList ) { |
214 | | - if( $indices[0] === null ) { |
215 | | - $this->data[] = $val; |
216 | | - } else { |
217 | | - $idx = $indices[0]->toInt(); |
218 | | - if( $idx < 0 || $idx >= count( $this->data ) ) |
219 | | - throw new ISUserVisibleException( 'outofbounds', $line, array( count( $this->data ), $idx ) ); |
220 | | - if( count( $indices ) > 1 ) |
221 | | - $this->data[$idx]->setValueByIndices( $val, array_slice( $indices, 1 ), $line ); |
222 | | - else |
223 | | - $this->data[$idx] = $val; |
224 | | - } |
225 | | - } |
226 | | - } |
227 | 211 | |
228 | | - public function checkIssetByIndices( $indices ) { |
229 | | - if( $indices ) { |
230 | | - $idx = array_shift( $indices ); |
231 | | - if( $this->type != self::DList || $idx >= count( $this->data ) ) |
232 | | - return false; |
233 | | - return $this->checkIssetByIndices( $indices ); |
234 | | - } else { |
235 | | - return true; |
236 | | - } |
| 212 | + public function isArray() { |
| 213 | + return $this->type == self::DList || $this->type == self::DAssoc; |
237 | 214 | } |
238 | 215 | |
| 216 | + |
239 | 217 | /** Convert shorteners */ |
240 | 218 | public function toBool() { |
241 | 219 | return self::castTypes( $this, self::DBool )->data; |
— | — | @@ -255,4 +233,8 @@ |
256 | 234 | public function toList() { |
257 | 235 | return self::castTypes( $this, self::DList )->data; |
258 | 236 | } |
| 237 | + |
| 238 | + public function toAssoc() { |
| 239 | + return self::castTypes( $this, self::DAssoc )->data; |
| 240 | + } |
259 | 241 | } |
Index: trunk/extensions/InlineScripts/interpreter/LRParser.php |
— | — | @@ -4,28 +4,36 @@ |
5 | 5 | * LR parser for inline scripts. |
6 | 6 | * Inputs tokens and LR table (ACTION/GOTO). |
7 | 7 | * Outputs parser tree. |
| 8 | + * |
| 9 | + * See http://en.wikipedia.org/wiki/LR_parser for details of how does that works. |
8 | 10 | */ |
9 | 11 | |
10 | 12 | class ISLRParser implements ISParser { |
11 | | - const Version = 1; |
12 | | - |
13 | 13 | const Shift = 0; |
14 | 14 | const Reduce = 1; |
15 | 15 | const Accept = 2; |
16 | 16 | |
17 | 17 | var $mNonterminals, $mProductions, $mAction, $mGoto; |
18 | 18 | |
| 19 | + public static function getVersion() { |
| 20 | + return ISLRTable::Timestamp; |
| 21 | + } |
| 22 | + |
19 | 23 | public function __construct() { |
20 | 24 | $this->loadGrammar(); |
21 | 25 | } |
22 | 26 | |
23 | 27 | private function loadGrammar() { |
| 28 | + wfProfileIn( __METHOD__ ); |
| 29 | + |
24 | 30 | require_once( 'LRTable.php' ); |
25 | 31 | |
26 | 32 | $this->mNonterminals = ISLRTable::$nonterminals; |
27 | 33 | $this->mProductions = ISLRTable::$productions; |
28 | 34 | $this->mAction = ISLRTable::$action; |
29 | 35 | $this->mGoto = ISLRTable::$goto; |
| 36 | + |
| 37 | + wfProfileOut( __METHOD__ ); |
30 | 38 | } |
31 | 39 | |
32 | 40 | public function needsScanner() { |
— | — | @@ -37,19 +45,26 @@ |
38 | 46 | $scanner->rewind(); |
39 | 47 | $tokenCount = 0; |
40 | 48 | |
| 49 | + wfProfileIn( __METHOD__ ); |
| 50 | + |
41 | 51 | for( ; ; ) { |
42 | 52 | $token = $scanner->current(); |
43 | 53 | $cur = $token->type; |
44 | | - if( !$token ) |
| 54 | + if( !$token ) { |
| 55 | + wfProfileOut( __METHOD__ ); |
45 | 56 | throw new ISException( 'Non-token input in LRParser::parse' ); |
| 57 | + } |
46 | 58 | |
47 | 59 | $tokenCount++; |
48 | | - if( $tokenCount > $maxTokens ) |
| 60 | + if( $tokenCount > $maxTokens ) { |
| 61 | + wfProfileOut( __METHOD__ ); |
49 | 62 | throw new ISUserVisibleException( 'toomanytokens', $token->line ); |
| 63 | + } |
50 | 64 | |
51 | 65 | list( $stateval, $state ) = end( $states ); |
52 | 66 | $act = @$this->mAction[$state][$cur]; |
53 | 67 | if( !$act ) { |
| 68 | + wfProfileOut( __METHOD__ ); |
54 | 69 | throw new ISUserVisibleException( 'unexceptedtoken', $token->line, |
55 | 70 | array( $token, implode( ', ', array_keys( @$this->mAction[$state] ) ) ) ); |
56 | 71 | } |
— | — | @@ -78,6 +93,8 @@ |
79 | 94 | } |
80 | 95 | } |
81 | 96 | |
| 97 | + wfProfileOut( __METHOD__ ); |
| 98 | + |
82 | 99 | return new ISParserOutput( $states[1][0], $tokenCount ); |
83 | 100 | } |
84 | 101 | } |
Index: trunk/extensions/InlineScripts/interpreter/syntax.txt |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | <stmt> ::= <expr> semicolon |
6 | 6 | <stmt> ::= if leftbracket <expr> rightbracket <stmt> |
7 | 7 | <stmt> ::= if leftbracket <expr> rightbracket <stmt> else <stmt> |
8 | | -<stmt> ::= for leftbracket <lvalue> in <expr> rightbracket <stmt> |
| 8 | +<stmt> ::= for leftbracket <forlvalue> in <expr> rightbracket <stmt> |
9 | 9 | <stmt> ::= try <stmt> catch leftbracket <lvalue> rightbracket <stmt> |
10 | 10 | <stmt> ::= leftcurly <stmts> rightcurly |
11 | 11 | |
— | — | @@ -23,14 +23,14 @@ |
24 | 24 | <exprFunction> ::= id leftbracket <commaListPlain> rightbracket | id leftbracket rightbracket |
25 | 25 | <exprFunction> ::= <varfunc> leftbracket <lvalue> rightbracket | <exprAtom> |
26 | 26 | <exprAtom> ::= <lvalue> | <atom> | break | continue |
27 | | -<exprAtom> ::= leftbracket <expr> rightbracket | leftsquare <commaList> rightsquare |
| 27 | +<exprAtom> ::= leftbracket <expr> rightbracket |
| 28 | +<exprAtom> ::= leftsquare <commaListPlain> rightsquare | leftcurly <commaListAssoc> rightcurly |
28 | 29 | |
29 | 30 | <varfunc> ::= isset | delete |
30 | | -<commaList> ::= <commaListAssoc> | <commaListPlain> |
31 | 31 | <commaListPlain> ::= <commaListPlain> comma <expr> | <expr> |
32 | 32 | <commaListAssoc> ::= <commaListAssoc> comma <keyValue> | <keyValue> |
33 | 33 | <keyValue> ::= <expr> colon <expr> |
34 | 34 | <atom> ::= string | int | float | true | false | null |
35 | | -<lvalue> ::= id <arrayIdxs> | id |
36 | | -<arrayIdxs> ::= <arrayIdx> <arrayIdxs> | <arrayIdx> |
| 35 | +<lvalue> ::= id | <lvalue> <arrayIdx> |
37 | 36 | <arrayIdx> ::= leftsquare <expr> rightsquare | leftsquare rightsquare |
| 37 | +<forlvalue> ::= <lvalue> | <lvalue> colon <lvalue> |
Index: trunk/extensions/InlineScripts/interpreter/Interpreter.php |
— | — | @@ -8,20 +8,30 @@ |
9 | 9 | require_once( 'Shared.php' ); |
10 | 10 | require_once( 'Data.php' ); |
11 | 11 | |
12 | | -class InlineScriptInterpreter { |
| 12 | +/** |
| 13 | + * The global interpreter object. |
| 14 | + */ |
| 15 | +class ISInterpreter { |
13 | 16 | const ParserVersion = 1; |
14 | 17 | |
15 | | - var $mCodeParser, $mMaxRecursion, $mEvaluations, $mTokens; |
| 18 | + var $mCodeParser, $mMaxRecursion, $mEvaluations, $mTokens, $mUseCache; |
16 | 19 | |
17 | 20 | public function __construct() { |
18 | | - global $wgInlineScriptsParserClass; |
| 21 | + global $wgInlineScriptsParserClass, $wgInlineScriptsUseCache; |
| 22 | + |
19 | 23 | $this->mCodeParser = new $wgInlineScriptsParserClass( $this ); |
20 | 24 | $this->mMaxRecursion = |
21 | 25 | $this->mEvaluations = |
22 | 26 | $this->mTokens = |
23 | 27 | 0; |
| 28 | + |
| 29 | + $this->mUseCache = $wgInlineScriptsUseCache; |
24 | 30 | } |
25 | 31 | |
| 32 | + public function disableCache() { |
| 33 | + $this->mUseCache = false; |
| 34 | + } |
| 35 | + |
26 | 36 | public function checkRecursionLimit( $rec ) { |
27 | 37 | global $wgInlineScriptsLimits; |
28 | 38 | if( $rec > $this->mMaxRecursion ) |
— | — | @@ -43,18 +53,26 @@ |
44 | 54 | |
45 | 55 | public function execute( $code, $parser, $frame ) { |
46 | 56 | wfProfileIn( __METHOD__ ); |
47 | | - $context = new InlineScriptEvaluationContext( $this, $parser, $frame ); |
| 57 | + $context = new ISEvaluationContext( $this, $parser, $frame ); |
48 | 58 | $ast = $this->parseCode( $code ); |
| 59 | + |
| 60 | + wfProfileIn( __METHOD__ . '-evaluation' ); |
49 | 61 | $context->evaluateNode( $ast, 0 )->toString(); |
| 62 | + wfProfileOut( __METHOD__ . '-evaluation' ); |
| 63 | + |
50 | 64 | wfProfileOut( __METHOD__ ); |
51 | 65 | return $context->mOut; |
52 | 66 | } |
53 | 67 | |
54 | 68 | public function evaluate( $code, $parser, $frame ) { |
55 | 69 | wfProfileIn( __METHOD__ ); |
56 | | - $context = new InlineScriptEvaluationContext( $this, $parser, $frame ); |
| 70 | + $context = new ISEvaluationContext( $this, $parser, $frame ); |
57 | 71 | $ast = $this->parseCode( $code ); |
| 72 | + |
| 73 | + wfProfileIn( __METHOD__ . '-evaluation' ); |
58 | 74 | $result = $context->evaluateNode( $ast, 0 )->toString(); |
| 75 | + wfProfileOut( __METHOD__ . '-evaluation' ); |
| 76 | + |
59 | 77 | wfProfileOut( __METHOD__ ); |
60 | 78 | return $result; |
61 | 79 | } |
— | — | @@ -68,13 +86,13 @@ |
69 | 87 | |
70 | 88 | $memcKey = 'isparser:ast:' . md5( $code ); |
71 | 89 | |
72 | | - if( isset( $parserCache[$memcKey] ) ) { |
| 90 | + if( $this->mUseCache && isset( $parserCache[$memcKey] ) ) { |
73 | 91 | wfProfileOut( __METHOD__ ); |
74 | 92 | return $parserCache[$memcKey]; |
75 | 93 | } |
76 | 94 | |
77 | 95 | $cached = $parserMemc->get( $memcKey ); |
78 | | - if( @$cached instanceof ISParserOutput && !$cached->isOutOfDate() ) { |
| 96 | + if( $this->mUseCache && @$cached instanceof ISParserOutput && !$cached->isOutOfDate() ) { |
79 | 97 | $cached->appendTokenCount( $this ); |
80 | 98 | $parserCache[$memcKey] = $cached->getParserTree(); |
81 | 99 | wfProfileOut( __METHOD__ ); |
— | — | @@ -97,7 +115,7 @@ |
98 | 116 | * An internal class used by InlineScript. Used to evaluate a parsed code |
99 | 117 | * in a sepereate context with its own output, variables and parser frame. |
100 | 118 | */ |
101 | | -class InlineScriptEvaluationContext { |
| 119 | +class ISEvaluationContext { |
102 | 120 | var $mVars, $mOut, $mParser, $mFrame, $mInterpreter; |
103 | 121 | |
104 | 122 | static $mFunctions = array( |
— | — | @@ -141,6 +159,11 @@ |
142 | 160 | $this->mFrame = $frame; |
143 | 161 | } |
144 | 162 | |
| 163 | + /** |
| 164 | + * The core interpreter method. Evaluates a single AST node. |
| 165 | + * The $rec parameter must be increated by 1 each time the function is called |
| 166 | + * recursively. |
| 167 | + */ |
145 | 168 | public function evaluateNode( $node, $rec ) { |
146 | 169 | if( !$node instanceof ISParserTreeNode ) { |
147 | 170 | throw new ISException( 'evaluateNode() accepts only nonterminals' ); |
— | — | @@ -180,11 +203,19 @@ |
181 | 204 | } |
182 | 205 | case 'for': |
183 | 206 | $array = $this->evaluateNode( $c[4], $rec + 1 ); |
184 | | - if( $array->type != ISData::DList ) |
| 207 | + if( !$array->isArray() ) |
185 | 208 | throw new ISUserVisibleException( 'invalidforeach', $c[0]->type ); |
186 | 209 | $last = new ISData(); |
187 | | - foreach( $array->data as $item ) { |
188 | | - $this->setVar( $c[2], $item, $rec ); |
| 210 | + $lvalues = $c[2]->getChildren(); |
| 211 | + |
| 212 | + foreach( $array->data as $key => $item ) { |
| 213 | + // <forlvalue> ::= <lvalue> | <lvalue> colon <lvalue> |
| 214 | + if( count( $lvalues ) > 1 ) { |
| 215 | + $this->setVar( $lvalues[0], ISData::newFromPHPVar( $key ), $rec ); |
| 216 | + $this->setVar( $lvalues[2], $item, $rec ); |
| 217 | + } else { |
| 218 | + $this->setVar( $lvalues[0], $item, $rec ); |
| 219 | + } |
189 | 220 | try { |
190 | 221 | $last = $this->evaluateNode( $c[6], $rec + 1 ); |
191 | 222 | } catch( ISUserVisibleException $e ) { |
— | — | @@ -312,7 +343,7 @@ |
313 | 344 | throw new ISUserVisibleException( 'unknownfunction', $c[0]->line ); |
314 | 345 | $func = self::$mFunctions[$funcname]; |
315 | 346 | if( $c[2] instanceof ISParserTreeNode ) { |
316 | | - $args = $this->parseArray( $c[2], $rec ); |
| 347 | + $args = $this->parseArray( $c[2], $rec, $dummy ); |
317 | 348 | } else { |
318 | 349 | $args = array(); |
319 | 350 | } |
— | — | @@ -321,7 +352,8 @@ |
322 | 353 | $type = $c[0]->mChildren[0]->value; |
323 | 354 | switch( $type ) { |
324 | 355 | case 'isset': |
325 | | - return new ISData( ISData::DBool, $this->checkIsset( $c[2], $rec ) ); |
| 356 | + $val = $this->getVar( $c[2], $rec, true ); |
| 357 | + return new ISData( ISData::DBool, $val !== null ); |
326 | 358 | case 'delete': |
327 | 359 | $this->deleteVar( $c[2], $rec ); |
328 | 360 | return new ISData(); |
— | — | @@ -355,7 +387,10 @@ |
356 | 388 | case 'leftbracket': |
357 | 389 | return $this->evaluateNode( $c[1], $rec + 1 ); |
358 | 390 | case 'leftsquare': |
359 | | - return new ISData( ISData::DList, $this->parseArray( $c[1], $rec + 1 ) ); |
| 391 | + case 'leftcurly': |
| 392 | + $arraytype = null; |
| 393 | + $array = $this->parseArray( $c[1], $rec + 1, $arraytype ); |
| 394 | + return new ISData( $arraytype, $array ); |
360 | 395 | case 'break': |
361 | 396 | throw new ISUserVisibleException( 'break', $c[0]->line ); |
362 | 397 | case 'continue': |
— | — | @@ -371,89 +406,190 @@ |
372 | 407 | /* |
373 | 408 | * Converts commaList* to a PHP array. |
374 | 409 | */ |
375 | | - protected function parseArray( $node, $rec ) { |
| 410 | + protected function parseArray( $node, $rec, &$arraytype ) { |
376 | 411 | $c = $node->getChildren(); |
377 | | - switch( $node->getType() ) { |
378 | | - case 'commalist': |
379 | | - return $this->parseArray( $c[0], $rec ); |
| 412 | + $type = $node->getType(); |
| 413 | + if( $type == 'commalist' ) { |
| 414 | + return $this->parseArray( $c[0], $rec, $arraytype ); |
| 415 | + } |
| 416 | + |
| 417 | + wfProfileIn( __METHOD__ ); |
| 418 | + |
| 419 | + // <commaListWhatever> ::= <commaListWhatever> comma <expr> | <expr> |
| 420 | + $elements = $result = array(); |
| 421 | + while( isset( $c[2] ) ) { |
| 422 | + array_unshift( $elements, $c[2] ); |
| 423 | + $c = $c[0]->getChildren(); |
| 424 | + } |
| 425 | + array_unshift( $elements, $c[0] ); |
| 426 | + |
| 427 | + switch( $type ) { |
380 | 428 | case 'commalistplain': |
381 | | - $elements = $result = array(); |
382 | | - while( isset( $c[2] ) ) { |
383 | | - array_unshift( $elements, $c[2] ); |
384 | | - $c = $c[0]->getChildren(); |
| 429 | + foreach( $elements as $elem ) { |
| 430 | + $result[] = $this->evaluateNode( $elem, $rec + 1 ); |
385 | 431 | } |
386 | | - array_unshift( $elements, $c[0] ); |
387 | | - foreach( $elements as $elem ) |
388 | | - $result[] = $this->evaluateNode( $elem, $rec + 1 ); |
| 432 | + |
| 433 | + $arraytype = ISData::DList; |
| 434 | + wfProfileOut( __METHOD__ ); |
389 | 435 | return $result; |
| 436 | + |
390 | 437 | case 'commalistassoc': |
391 | | - throw new ISException( 'Not implemented' ); |
| 438 | + foreach( $elements as $elem ) { |
| 439 | + //<keyValue> ::= <expr> colon <expr> |
| 440 | + list( $key, $crap, $value ) = $elem->getChildren(); |
| 441 | + $key = $this->evaluateNode( $key, $rec + 1 ); |
| 442 | + $value = $this->evaluateNode( $value, $rec + 1 ); |
| 443 | + $result[ $key->toString() ] = $value; |
| 444 | + } |
| 445 | + |
| 446 | + $arraytype = ISData::DAssoc; |
| 447 | + wfProfileOut( __METHOD__ ); |
| 448 | + return $result; |
392 | 449 | } |
393 | 450 | } |
394 | 451 | |
395 | | - protected function getVar( $lval, $rec ) { |
| 452 | + /** |
| 453 | + * Returns a value of the variable in $lval. If $nullIfNotSet is set to true, |
| 454 | + * returns null if variable does not exist, otherwise throws an exception. |
| 455 | + */ |
| 456 | + protected function getVar( $lval, $rec, $nullIfNotSet = false ) { |
| 457 | + // <lvalue> ::= id | <lvalue> <arrayIdx> |
| 458 | + // <arrayIdx> ::= leftsquare <expr> rightsquare | leftsquare rightsquare |
| 459 | + |
| 460 | + if( !$this->mInterpreter->checkRecursionLimit( $rec ) ) { |
| 461 | + throw new ISUserVisibleException( 'recoverflow', 0 ); |
| 462 | + } |
| 463 | + |
396 | 464 | $c = $lval->getChildren(); |
397 | | - $line = $c[0]->line; |
398 | | - $varname = $c[0]->value; |
399 | | - if( !isset( $this->mVars[$varname] ) ) { |
400 | | - throw new ISUserVisibleException( 'unknownvar', $line, array( $varname ) ); |
401 | | - } |
402 | | - if( isset( $c[1] ) ) { |
403 | | - $indices = array(); |
404 | | - $c = $c[1]->getChildren(); |
405 | | - while( isset( $c[1] ) ) { |
406 | | - array_unshift( $indices, $c[1] ); |
407 | | - $c = $c[0]->getChildren(); |
| 465 | + if( $c[0] instanceof ISToken ) { |
| 466 | + $varname = $c[0]->value; |
| 467 | + if( !isset( $this->mVars[$varname] ) ) { |
| 468 | + if( $nullIfNotSet ) |
| 469 | + return null; |
| 470 | + else |
| 471 | + throw new ISUserVisibleException( 'unknownvar', $c[0]->line, array( $varname ) ); |
408 | 472 | } |
409 | | - array_unshift( $indices, $c[0] ); |
410 | | - foreach( $indices as &$idx ) { |
411 | | - $c = $idx->getChildren(); |
412 | | - if( !$c[1] instanceof ISParserTreeNode ) |
413 | | - throw new ISUserVisibleException( 'emptyidx', $line ); |
414 | | - $idx = $this->evaluateNode( $c[1], $rec + 1 ); |
| 473 | + return $this->mVars[$varname]; |
| 474 | + } else { |
| 475 | + $idxchildren = $c[1]->getChildren(); |
| 476 | + $var = $this->getVar( $c[0], $rec + 1, $nullIfNotSet ); |
| 477 | + if( $nullIfNotSet && $var === null ) |
| 478 | + return null; |
| 479 | + |
| 480 | + if( count( $idxchildren ) == 2 ) { |
| 481 | + // x = a[]. a[] is still legitimage in a[] = x |
| 482 | + throw new ISUserVisibleException( 'emptyidx', $idxchildren[0]->line ); |
415 | 483 | } |
416 | 484 | |
417 | | - $val = $this->mVars[$varname]; |
418 | | - foreach( $indices as $idx ) { |
419 | | - if( $val->type == ISData::DList ) { |
420 | | - $idx = $idx->toInt(); |
421 | | - if( count( $val->data ) <= $idx ) |
422 | | - throw new ISUserVisibleException( 'outofbounds', $line ); |
423 | | - $val = $val->data[$idx]; |
424 | | - } else { |
425 | | - throw new ISUserVisibleException( 'notanarray', $line ); |
426 | | - } |
| 485 | + switch( $var->type ) { |
| 486 | + case ISData::DList: |
| 487 | + $idx = $this->evaluateNode( $idxchildren[1], $rec + 1 )->toInt(); |
| 488 | + if( $idx >= count( $var->data ) ) { |
| 489 | + if( $nullIfNotSet ) |
| 490 | + return null; |
| 491 | + else |
| 492 | + throw new ISUserVisibleException( 'outofbounds', $idxchildren[0]->line ); |
| 493 | + } |
| 494 | + return $var->data[$idx]; |
| 495 | + case ISData::DAssoc: |
| 496 | + $idx = $this->evaluateNode( $idxchildren[1], $rec + 1 )->toString(); |
| 497 | + if( !isset( $var->data[$idx] ) ) { |
| 498 | + if( $nullIfNotSet ) |
| 499 | + return null; |
| 500 | + else |
| 501 | + throw new ISUserVisibleException( 'outofbounds', $idxchildren[0]->line ); |
| 502 | + } |
| 503 | + return $var->data[$idx]; |
| 504 | + default: |
| 505 | + throw new ISUserVisibleException( 'notanarray', $idxchildren[0]->line ); |
427 | 506 | } |
428 | | - return $val; |
429 | | - } else { |
430 | | - return $this->mVars[$varname]; |
431 | 507 | } |
432 | 508 | } |
433 | 509 | |
| 510 | + /** |
| 511 | + * Gets the line of the first terminal in the node. |
| 512 | + */ |
| 513 | + protected function getLine( $node ) { |
| 514 | + while( $node instanceof ISParserTreeNode ) { |
| 515 | + $children = $node->getChildren(); |
| 516 | + $node = $children[0]; |
| 517 | + } |
| 518 | + return $node->line; |
| 519 | + } |
| 520 | + |
| 521 | + /** |
| 522 | + * Changes the value of variable or array element specified in $lval to $newval. |
| 523 | + */ |
434 | 524 | protected function setVar( $lval, $newval, $rec ) { |
| 525 | + $var = &$this->setVarGetRef( $lval, $rec ); |
| 526 | + $var = $newval; |
| 527 | + unset( $var ); |
| 528 | + } |
| 529 | + |
| 530 | + /** |
| 531 | + * Recursive function that return the link to the place |
| 532 | + * where the new value of the variable must be set. |
| 533 | + */ |
| 534 | + protected function &setVarGetRef( $lval, $rec ) { |
| 535 | + if( !$this->mInterpreter->checkRecursionLimit( $rec ) ) { |
| 536 | + throw new ISUserVisibleException( 'recoverflow', 0 ); |
| 537 | + } |
| 538 | + |
435 | 539 | $c = $lval->getChildren(); |
436 | | - $varname = $c[0]->value; |
437 | | - if( isset( $c[1] ) ) { |
438 | | - $lineno = 0; |
439 | | - $idxs = array(); |
440 | | - while( isset( $c[1] ) && $c[1]->getType() == 'arrayidxs' ) { |
441 | | - $c = $c[1]->getChildren(); |
442 | | - $idxs[] = $c[0]; |
| 540 | + if( count( $c ) == 1 ) { |
| 541 | + if( !isset( $this->mVars[ $c[0]->value ] ) ) |
| 542 | + $this->mVars[ $c[0]->value ] = new ISPlaceholder(); |
| 543 | + return $this->mVars[ $c[0]->value ]; |
| 544 | + } else { |
| 545 | + $ref = &$this->setVarGetRef( $c[0], $rec + 1 ); |
| 546 | + |
| 547 | + // <arrayIdx> ::= leftsquare <expr> rightsquare | leftsquare rightsquare |
| 548 | + $idxc = $c[1]->getChildren(); |
| 549 | + if( $ref instanceof ISPlaceholder ) { |
| 550 | + if( count( $idxc ) > 2 ) { |
| 551 | + $index = $this->evaluateNode( $idxc[1], $rec + 1 ); |
| 552 | + if( $index->type == ISData::DInt ) |
| 553 | + $ref = new ISData( ISData::DList, array() ); |
| 554 | + else |
| 555 | + $ref = new ISData( ISData::DAssoc, array() ); |
| 556 | + } else { |
| 557 | + $ref = new ISData( ISData::DList, array() ); |
| 558 | + } |
443 | 559 | } |
444 | | - if( !isset( $this->mVars[$varname] ) ) |
445 | | - $this->mVars[$varname] = new ISData( ISData::DList, array() ); |
446 | | - foreach( $idxs as &$idx ) { |
447 | | - $idxchildren = $idx->getChildren(); |
448 | | - if( !$lineno ) |
449 | | - $lineno = $idxchildren[0]->line; |
450 | | - if( count( $idxchildren ) > 2 ) |
451 | | - $idx = $this->evaluateNode( $idxchildren[1], $rec + 1 ); |
452 | | - else |
453 | | - $idx = null; |
| 560 | + |
| 561 | + switch( $ref->type ) { |
| 562 | + case ISData::DList: |
| 563 | + if( count( $idxc ) > 2 ) { |
| 564 | + if( !isset( $index ) ) |
| 565 | + $index = $this->evaluateNode( $idxc[1], $rec + 1 ); |
| 566 | + $key = $index->toInt(); |
| 567 | + |
| 568 | + if( $key < 0 || $key > count( $ref->data ) ) |
| 569 | + throw new ISUserVisibleException( 'outofbounds', $idxc[0]->line ); |
| 570 | + } else { |
| 571 | + $key = count( $ref->data ); |
| 572 | + } |
| 573 | + |
| 574 | + if( !isset( $ref->data[$key] ) ) |
| 575 | + $ref->data[$key] = new ISPlaceholder(); |
| 576 | + |
| 577 | + return $ref->data[$key]; |
| 578 | + case ISData::DAssoc: |
| 579 | + if( count( $idxc ) > 2 ) { |
| 580 | + if( !isset( $index ) ) |
| 581 | + $index = $this->evaluateNode( $idxc[1], $rec + 1 ); |
| 582 | + $key = $index->toString(); |
| 583 | + |
| 584 | + if( !isset( $ref->data[$key] ) ) |
| 585 | + $ref->data[$key] = new ISPlaceholder(); |
| 586 | + return $ref->data[$key]; |
| 587 | + } else { |
| 588 | + throw new ISUserVisibleException( 'notlist', $idxc[0]->line ); |
| 589 | + } |
| 590 | + break; |
| 591 | + default: |
| 592 | + throw new ISUserVisibleException( 'notanarray', $idxc[0]->line ); |
454 | 593 | } |
455 | | - $this->mVars[$varname]->setValueByIndices( $newval, $idxs, $lineno ); |
456 | | - } else { |
457 | | - $this->mVars[$varname] = $newval; |
458 | 594 | } |
459 | 595 | } |
460 | 596 | |
— | — | @@ -476,45 +612,6 @@ |
477 | 613 | if( count( $args ) < $count ) |
478 | 614 | throw new ISUserVisibleException( 'notenoughargs', $pos ); |
479 | 615 | } |
480 | | - |
481 | | - protected function checkIsset( $lval, $rec ) { |
482 | | - $c = $lval->getChildren(); |
483 | | - $line = $c[0]->line; |
484 | | - $varname = $c[0]->value; |
485 | | - if( !isset( $this->mVars[$varname] ) ) { |
486 | | - return false; |
487 | | - } |
488 | | - if( isset( $c[1] ) ) { |
489 | | - $indices = array(); |
490 | | - $c = $c[1]->getChildren(); |
491 | | - while( isset( $c[1] ) ) { |
492 | | - array_unshift( $indices, $c[1] ); |
493 | | - $c = $c[0]->getChildren(); |
494 | | - } |
495 | | - array_unshift( $indices, $c[0] ); |
496 | | - foreach( $indices as &$idx ) { |
497 | | - $c = $idx->getChildren(); |
498 | | - if( !$c[1] instanceof ISParserTreeNode ) |
499 | | - throw new ISUserVisibleException( 'emptyidx', $line ); |
500 | | - $idx = $this->evaluateNode( $c[1], $rec + 1 ); |
501 | | - } |
502 | | - |
503 | | - $val = $this->mVars[$varname]; |
504 | | - foreach( $indices as $idx ) { |
505 | | - if( $val->type == ISData::DList ) { |
506 | | - $idx = $idx->toInt(); |
507 | | - if( count( $val->data ) <= $idx ) |
508 | | - return false; |
509 | | - $val = $val->data[$idx]; |
510 | | - } else { |
511 | | - return false; |
512 | | - } |
513 | | - } |
514 | | - return true; |
515 | | - } else { |
516 | | - return true; |
517 | | - } |
518 | | - } |
519 | 616 | |
520 | 617 | protected function deleteVar( $lval, $rec ) { |
521 | 618 | $c = $lval->getChildren(); |
Index: trunk/extensions/InlineScripts/interpreter/benchmark/benchmark.php |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | if ($lang == 'php') { |
31 | 31 | return eval($source); |
32 | 32 | } else { |
33 | | - $scriptParser = new InlineScriptInterpreter(); |
| 33 | + $scriptParser = new ISInterpreter(); |
34 | 34 | $parser = new Parser(); |
35 | 35 | $frame = null; //new Frame(); |
36 | 36 | return $scriptParser->evaluate( $source, $parser, $frame ); |
Index: trunk/extensions/InlineScripts/interpreter/LRTable.php |
— | — | @@ -19,38 +19,39 @@ |
20 | 20 | * * $productions is a ID -> array( nonterminal, body ) map. |
21 | 21 | * * Production body is an array of production symbols |
22 | 22 | * |
23 | | - * Generated on 2011-08-03 09:33. |
| 23 | + * Generated on 2011-08-06 07:13. |
24 | 24 | */ |
25 | 25 | |
26 | 26 | class ISLRTable { |
27 | 27 | |
| 28 | +const Timestamp = '2011-08-06 07:13'; |
| 29 | + |
28 | 30 | static $nonterminals = array( |
29 | 31 | 0 => 'program', |
30 | 32 | 1 => 'stmts', |
31 | 33 | 2 => 'stmt', |
32 | 34 | 3 => 'expr', |
33 | | - 4 => 'lvalue', |
34 | | - 5 => 'exprset', |
35 | | - 6 => 'exprtrinary', |
36 | | - 7 => 'exprlogical', |
37 | | - 8 => 'exprcompare', |
38 | | - 9 => 'exprequals', |
39 | | - 10 => 'exprsum', |
40 | | - 11 => 'exprmul', |
41 | | - 12 => 'exprpow', |
42 | | - 13 => 'exprinvert', |
43 | | - 14 => 'exprkeyword', |
44 | | - 15 => 'exprunary', |
45 | | - 16 => 'exprfunction', |
46 | | - 17 => 'commalistplain', |
47 | | - 18 => 'varfunc', |
48 | | - 19 => 'expratom', |
49 | | - 20 => 'atom', |
50 | | - 21 => 'commalist', |
| 35 | + 4 => 'forlvalue', |
| 36 | + 5 => 'lvalue', |
| 37 | + 6 => 'exprset', |
| 38 | + 7 => 'exprtrinary', |
| 39 | + 8 => 'exprlogical', |
| 40 | + 9 => 'exprcompare', |
| 41 | + 10 => 'exprequals', |
| 42 | + 11 => 'exprsum', |
| 43 | + 12 => 'exprmul', |
| 44 | + 13 => 'exprpow', |
| 45 | + 14 => 'exprinvert', |
| 46 | + 15 => 'exprkeyword', |
| 47 | + 16 => 'exprunary', |
| 48 | + 17 => 'exprfunction', |
| 49 | + 18 => 'commalistplain', |
| 50 | + 19 => 'varfunc', |
| 51 | + 20 => 'expratom', |
| 52 | + 21 => 'atom', |
51 | 53 | 22 => 'commalistassoc', |
52 | 54 | 23 => 'keyvalue', |
53 | | - 24 => 'arrayidxs', |
54 | | - 25 => 'arrayidx', |
| 55 | + 24 => 'arrayidx', |
55 | 56 | ); |
56 | 57 | |
57 | 58 | static $productions = array( |
— | — | @@ -61,63 +62,62 @@ |
62 | 63 | 4 => array( 2, array( 'if', 'leftbracket', 3, 'rightbracket', 2 ) ), |
63 | 64 | 5 => array( 2, array( 'if', 'leftbracket', 3, 'rightbracket', 2, 'else', 2 ) ), |
64 | 65 | 6 => array( 2, array( 'for', 'leftbracket', 4, 'in', 3, 'rightbracket', 2 ) ), |
65 | | - 7 => array( 2, array( 'try', 2, 'catch', 'leftbracket', 4, 'rightbracket', 2 ) ), |
| 66 | + 7 => array( 2, array( 'try', 2, 'catch', 'leftbracket', 5, 'rightbracket', 2 ) ), |
66 | 67 | 8 => array( 2, array( 'leftcurly', 1, 'rightcurly' ) ), |
67 | | - 9 => array( 3, array( 5 ) ), |
68 | | - 10 => array( 5, array( 4, 'setto', 5 ) ), |
69 | | - 11 => array( 5, array( 6 ) ), |
70 | | - 12 => array( 6, array( 7, 'trinary', 6, 'colon', 6 ) ), |
71 | | - 13 => array( 6, array( 7 ) ), |
72 | | - 14 => array( 7, array( 7, 'logicop', 8 ) ), |
73 | | - 15 => array( 7, array( 8 ) ), |
74 | | - 16 => array( 8, array( 8, 'compareop', 9 ) ), |
75 | | - 17 => array( 8, array( 9 ) ), |
76 | | - 18 => array( 9, array( 10, 'equalsto', 10 ) ), |
77 | | - 19 => array( 9, array( 10 ) ), |
78 | | - 20 => array( 10, array( 10, 'sum', 11 ) ), |
79 | | - 21 => array( 10, array( 11 ) ), |
80 | | - 22 => array( 11, array( 11, 'mul', 12 ) ), |
81 | | - 23 => array( 11, array( 12 ) ), |
82 | | - 24 => array( 12, array( 13, 'pow', 12 ) ), |
83 | | - 25 => array( 12, array( 13 ) ), |
84 | | - 26 => array( 13, array( 'invert', 14 ) ), |
85 | | - 27 => array( 13, array( 14 ) ), |
86 | | - 28 => array( 14, array( 15, 'in', 15 ) ), |
87 | | - 29 => array( 14, array( 15, 'contains', 15 ) ), |
88 | | - 30 => array( 14, array( 15 ) ), |
89 | | - 31 => array( 15, array( 'sum', 16 ) ), |
90 | | - 32 => array( 15, array( 16 ) ), |
91 | | - 33 => array( 16, array( 'id', 'leftbracket', 17, 'rightbracket' ) ), |
92 | | - 34 => array( 16, array( 'id', 'leftbracket', 'rightbracket' ) ), |
93 | | - 35 => array( 16, array( 18, 'leftbracket', 4, 'rightbracket' ) ), |
94 | | - 36 => array( 16, array( 19 ) ), |
95 | | - 37 => array( 19, array( 4 ) ), |
96 | | - 38 => array( 19, array( 20 ) ), |
97 | | - 39 => array( 19, array( 'break' ) ), |
98 | | - 40 => array( 19, array( 'continue' ) ), |
99 | | - 41 => array( 19, array( 'leftbracket', 3, 'rightbracket' ) ), |
100 | | - 42 => array( 19, array( 'leftsquare', 21, 'rightsquare' ) ), |
101 | | - 43 => array( 18, array( 'isset' ) ), |
102 | | - 44 => array( 18, array( 'delete' ) ), |
103 | | - 45 => array( 21, array( 22 ) ), |
104 | | - 46 => array( 21, array( 17 ) ), |
105 | | - 47 => array( 17, array( 17, 'comma', 3 ) ), |
106 | | - 48 => array( 17, array( 3 ) ), |
107 | | - 49 => array( 22, array( 22, 'comma', 23 ) ), |
108 | | - 50 => array( 22, array( 23 ) ), |
109 | | - 51 => array( 23, array( 3, 'colon', 3 ) ), |
110 | | - 52 => array( 20, array( 'string' ) ), |
111 | | - 53 => array( 20, array( 'int' ) ), |
112 | | - 54 => array( 20, array( 'float' ) ), |
113 | | - 55 => array( 20, array( 'true' ) ), |
114 | | - 56 => array( 20, array( 'false' ) ), |
115 | | - 57 => array( 20, array( 'null' ) ), |
116 | | - 58 => array( 4, array( 'id', 24 ) ), |
117 | | - 59 => array( 4, array( 'id' ) ), |
118 | | - 60 => array( 24, array( 25, 24 ) ), |
119 | | - 61 => array( 24, array( 25 ) ), |
120 | | - 62 => array( 25, array( 'leftsquare', 3, 'rightsquare' ) ), |
121 | | - 63 => array( 25, array( 'leftsquare', 'rightsquare' ) ), |
| 68 | + 9 => array( 3, array( 6 ) ), |
| 69 | + 10 => array( 6, array( 5, 'setto', 6 ) ), |
| 70 | + 11 => array( 6, array( 7 ) ), |
| 71 | + 12 => array( 7, array( 8, 'trinary', 7, 'colon', 7 ) ), |
| 72 | + 13 => array( 7, array( 8 ) ), |
| 73 | + 14 => array( 8, array( 8, 'logicop', 9 ) ), |
| 74 | + 15 => array( 8, array( 9 ) ), |
| 75 | + 16 => array( 9, array( 9, 'compareop', 10 ) ), |
| 76 | + 17 => array( 9, array( 10 ) ), |
| 77 | + 18 => array( 10, array( 11, 'equalsto', 11 ) ), |
| 78 | + 19 => array( 10, array( 11 ) ), |
| 79 | + 20 => array( 11, array( 11, 'sum', 12 ) ), |
| 80 | + 21 => array( 11, array( 12 ) ), |
| 81 | + 22 => array( 12, array( 12, 'mul', 13 ) ), |
| 82 | + 23 => array( 12, array( 13 ) ), |
| 83 | + 24 => array( 13, array( 14, 'pow', 13 ) ), |
| 84 | + 25 => array( 13, array( 14 ) ), |
| 85 | + 26 => array( 14, array( 'invert', 15 ) ), |
| 86 | + 27 => array( 14, array( 15 ) ), |
| 87 | + 28 => array( 15, array( 16, 'in', 16 ) ), |
| 88 | + 29 => array( 15, array( 16, 'contains', 16 ) ), |
| 89 | + 30 => array( 15, array( 16 ) ), |
| 90 | + 31 => array( 16, array( 'sum', 17 ) ), |
| 91 | + 32 => array( 16, array( 17 ) ), |
| 92 | + 33 => array( 17, array( 'id', 'leftbracket', 18, 'rightbracket' ) ), |
| 93 | + 34 => array( 17, array( 'id', 'leftbracket', 'rightbracket' ) ), |
| 94 | + 35 => array( 17, array( 19, 'leftbracket', 5, 'rightbracket' ) ), |
| 95 | + 36 => array( 17, array( 20 ) ), |
| 96 | + 37 => array( 20, array( 5 ) ), |
| 97 | + 38 => array( 20, array( 21 ) ), |
| 98 | + 39 => array( 20, array( 'break' ) ), |
| 99 | + 40 => array( 20, array( 'continue' ) ), |
| 100 | + 41 => array( 20, array( 'leftbracket', 3, 'rightbracket' ) ), |
| 101 | + 42 => array( 20, array( 'leftsquare', 18, 'rightsquare' ) ), |
| 102 | + 43 => array( 20, array( 'leftcurly', 22, 'rightcurly' ) ), |
| 103 | + 44 => array( 19, array( 'isset' ) ), |
| 104 | + 45 => array( 19, array( 'delete' ) ), |
| 105 | + 46 => array( 18, array( 18, 'comma', 3 ) ), |
| 106 | + 47 => array( 18, array( 3 ) ), |
| 107 | + 48 => array( 22, array( 22, 'comma', 23 ) ), |
| 108 | + 49 => array( 22, array( 23 ) ), |
| 109 | + 50 => array( 23, array( 3, 'colon', 3 ) ), |
| 110 | + 51 => array( 21, array( 'string' ) ), |
| 111 | + 52 => array( 21, array( 'int' ) ), |
| 112 | + 53 => array( 21, array( 'float' ) ), |
| 113 | + 54 => array( 21, array( 'true' ) ), |
| 114 | + 55 => array( 21, array( 'false' ) ), |
| 115 | + 56 => array( 21, array( 'null' ) ), |
| 116 | + 57 => array( 5, array( 'id' ) ), |
| 117 | + 58 => array( 5, array( 5, 24 ) ), |
| 118 | + 59 => array( 24, array( 'leftsquare', 3, 'rightsquare' ) ), |
| 119 | + 60 => array( 24, array( 'leftsquare', 'rightsquare' ) ), |
| 120 | + 61 => array( 4, array( 5 ) ), |
| 121 | + 62 => array( 4, array( 5, 'colon', 5 ) ), |
122 | 122 | ); |
123 | 123 | |
124 | 124 | static $action = array( |
— | — | @@ -155,6 +155,7 @@ |
156 | 156 | 'continue' => array( 0, 10 ), |
157 | 157 | 'leftbracket' => array( 0, 2 ), |
158 | 158 | 'leftsquare' => array( 0, 11 ), |
| 159 | + 'leftcurly' => array( 0, 40 ), |
159 | 160 | 'string' => array( 0, 14 ), |
160 | 161 | 'int' => array( 0, 15 ), |
161 | 162 | 'float' => array( 0, 16 ), |
— | — | @@ -163,7 +164,7 @@ |
164 | 165 | 'null' => array( 0, 19 ), |
165 | 166 | ), |
166 | 167 | 3 => array( |
167 | | - 'leftbracket' => array( 0, 41 ), |
| 168 | + 'leftbracket' => array( 0, 42 ), |
168 | 169 | ), |
169 | 170 | 4 => array( |
170 | 171 | 'if' => array( 0, 1 ), |
— | — | @@ -208,13 +209,14 @@ |
209 | 210 | 'null' => array( 0, 19 ), |
210 | 211 | ), |
211 | 212 | 6 => array( |
212 | | - 'id' => array( 0, 44 ), |
| 213 | + 'id' => array( 0, 48 ), |
213 | 214 | 'isset' => array( 0, 12 ), |
214 | 215 | 'delete' => array( 0, 13 ), |
215 | 216 | 'break' => array( 0, 9 ), |
216 | 217 | 'continue' => array( 0, 10 ), |
217 | 218 | 'leftbracket' => array( 0, 2 ), |
218 | 219 | 'leftsquare' => array( 0, 11 ), |
| 220 | + 'leftcurly' => array( 0, 40 ), |
219 | 221 | 'string' => array( 0, 14 ), |
220 | 222 | 'int' => array( 0, 15 ), |
221 | 223 | 'float' => array( 0, 16 ), |
— | — | @@ -224,13 +226,14 @@ |
225 | 227 | ), |
226 | 228 | 7 => array( |
227 | 229 | 'sum' => array( 0, 6 ), |
228 | | - 'id' => array( 0, 44 ), |
| 230 | + 'id' => array( 0, 48 ), |
229 | 231 | 'isset' => array( 0, 12 ), |
230 | 232 | 'delete' => array( 0, 13 ), |
231 | 233 | 'break' => array( 0, 9 ), |
232 | 234 | 'continue' => array( 0, 10 ), |
233 | 235 | 'leftbracket' => array( 0, 2 ), |
234 | 236 | 'leftsquare' => array( 0, 11 ), |
| 237 | + 'leftcurly' => array( 0, 40 ), |
235 | 238 | 'string' => array( 0, 14 ), |
236 | 239 | 'int' => array( 0, 15 ), |
237 | 240 | 'float' => array( 0, 16 ), |
— | — | @@ -239,23 +242,24 @@ |
240 | 243 | 'null' => array( 0, 19 ), |
241 | 244 | ), |
242 | 245 | 8 => array( |
243 | | - 'in' => array( 1, 59 ), |
244 | | - 'rightbracket' => array( 1, 59 ), |
245 | | - 'setto' => array( 1, 59 ), |
246 | | - 'pow' => array( 1, 59 ), |
247 | | - 'equalsto' => array( 1, 59 ), |
248 | | - 'trinary' => array( 1, 59 ), |
249 | | - 'semicolon' => array( 1, 59 ), |
250 | | - 'colon' => array( 1, 59 ), |
251 | | - 'logicop' => array( 1, 59 ), |
252 | | - 'compareop' => array( 1, 59 ), |
253 | | - 'sum' => array( 1, 59 ), |
254 | | - 'mul' => array( 1, 59 ), |
255 | | - 'contains' => array( 1, 59 ), |
256 | | - 'rightsquare' => array( 1, 59 ), |
257 | | - 'comma' => array( 1, 59 ), |
258 | | - 'leftbracket' => array( 0, 48 ), |
259 | | - 'leftsquare' => array( 0, 49 ), |
| 246 | + 'rightbracket' => array( 1, 57 ), |
| 247 | + 'setto' => array( 1, 57 ), |
| 248 | + 'in' => array( 1, 57 ), |
| 249 | + 'pow' => array( 1, 57 ), |
| 250 | + 'equalsto' => array( 1, 57 ), |
| 251 | + 'trinary' => array( 1, 57 ), |
| 252 | + 'semicolon' => array( 1, 57 ), |
| 253 | + 'colon' => array( 1, 57 ), |
| 254 | + 'logicop' => array( 1, 57 ), |
| 255 | + 'compareop' => array( 1, 57 ), |
| 256 | + 'sum' => array( 1, 57 ), |
| 257 | + 'mul' => array( 1, 57 ), |
| 258 | + 'contains' => array( 1, 57 ), |
| 259 | + 'leftsquare' => array( 1, 57 ), |
| 260 | + 'rightsquare' => array( 1, 57 ), |
| 261 | + 'comma' => array( 1, 57 ), |
| 262 | + 'rightcurly' => array( 1, 57 ), |
| 263 | + 'leftbracket' => array( 0, 52 ), |
260 | 264 | ), |
261 | 265 | 9 => array( |
262 | 266 | 'in' => array( 1, 39 ), |
— | — | @@ -272,6 +276,7 @@ |
273 | 277 | 'contains' => array( 1, 39 ), |
274 | 278 | 'rightsquare' => array( 1, 39 ), |
275 | 279 | 'comma' => array( 1, 39 ), |
| 280 | + 'rightcurly' => array( 1, 39 ), |
276 | 281 | ), |
277 | 282 | 10 => array( |
278 | 283 | 'in' => array( 1, 40 ), |
— | — | @@ -288,6 +293,7 @@ |
289 | 294 | 'contains' => array( 1, 40 ), |
290 | 295 | 'rightsquare' => array( 1, 40 ), |
291 | 296 | 'comma' => array( 1, 40 ), |
| 297 | + 'rightcurly' => array( 1, 40 ), |
292 | 298 | ), |
293 | 299 | 11 => array( |
294 | 300 | 'id' => array( 0, 8 ), |
— | — | @@ -299,6 +305,7 @@ |
300 | 306 | 'continue' => array( 0, 10 ), |
301 | 307 | 'leftbracket' => array( 0, 2 ), |
302 | 308 | 'leftsquare' => array( 0, 11 ), |
| 309 | + 'leftcurly' => array( 0, 40 ), |
303 | 310 | 'string' => array( 0, 14 ), |
304 | 311 | 'int' => array( 0, 15 ), |
305 | 312 | 'float' => array( 0, 16 ), |
— | — | @@ -307,12 +314,29 @@ |
308 | 315 | 'null' => array( 0, 19 ), |
309 | 316 | ), |
310 | 317 | 12 => array( |
311 | | - 'leftbracket' => array( 1, 43 ), |
| 318 | + 'leftbracket' => array( 1, 44 ), |
312 | 319 | ), |
313 | 320 | 13 => array( |
314 | | - 'leftbracket' => array( 1, 44 ), |
| 321 | + 'leftbracket' => array( 1, 45 ), |
315 | 322 | ), |
316 | 323 | 14 => array( |
| 324 | + 'in' => array( 1, 51 ), |
| 325 | + 'pow' => array( 1, 51 ), |
| 326 | + 'equalsto' => array( 1, 51 ), |
| 327 | + 'trinary' => array( 1, 51 ), |
| 328 | + 'semicolon' => array( 1, 51 ), |
| 329 | + 'rightbracket' => array( 1, 51 ), |
| 330 | + 'colon' => array( 1, 51 ), |
| 331 | + 'logicop' => array( 1, 51 ), |
| 332 | + 'compareop' => array( 1, 51 ), |
| 333 | + 'sum' => array( 1, 51 ), |
| 334 | + 'mul' => array( 1, 51 ), |
| 335 | + 'contains' => array( 1, 51 ), |
| 336 | + 'rightsquare' => array( 1, 51 ), |
| 337 | + 'comma' => array( 1, 51 ), |
| 338 | + 'rightcurly' => array( 1, 51 ), |
| 339 | + ), |
| 340 | + 15 => array( |
317 | 341 | 'in' => array( 1, 52 ), |
318 | 342 | 'pow' => array( 1, 52 ), |
319 | 343 | 'equalsto' => array( 1, 52 ), |
— | — | @@ -327,8 +351,9 @@ |
328 | 352 | 'contains' => array( 1, 52 ), |
329 | 353 | 'rightsquare' => array( 1, 52 ), |
330 | 354 | 'comma' => array( 1, 52 ), |
| 355 | + 'rightcurly' => array( 1, 52 ), |
331 | 356 | ), |
332 | | - 15 => array( |
| 357 | + 16 => array( |
333 | 358 | 'in' => array( 1, 53 ), |
334 | 359 | 'pow' => array( 1, 53 ), |
335 | 360 | 'equalsto' => array( 1, 53 ), |
— | — | @@ -343,8 +368,9 @@ |
344 | 369 | 'contains' => array( 1, 53 ), |
345 | 370 | 'rightsquare' => array( 1, 53 ), |
346 | 371 | 'comma' => array( 1, 53 ), |
| 372 | + 'rightcurly' => array( 1, 53 ), |
347 | 373 | ), |
348 | | - 16 => array( |
| 374 | + 17 => array( |
349 | 375 | 'in' => array( 1, 54 ), |
350 | 376 | 'pow' => array( 1, 54 ), |
351 | 377 | 'equalsto' => array( 1, 54 ), |
— | — | @@ -359,8 +385,9 @@ |
360 | 386 | 'contains' => array( 1, 54 ), |
361 | 387 | 'rightsquare' => array( 1, 54 ), |
362 | 388 | 'comma' => array( 1, 54 ), |
| 389 | + 'rightcurly' => array( 1, 54 ), |
363 | 390 | ), |
364 | | - 17 => array( |
| 391 | + 18 => array( |
365 | 392 | 'in' => array( 1, 55 ), |
366 | 393 | 'pow' => array( 1, 55 ), |
367 | 394 | 'equalsto' => array( 1, 55 ), |
— | — | @@ -375,8 +402,9 @@ |
376 | 403 | 'contains' => array( 1, 55 ), |
377 | 404 | 'rightsquare' => array( 1, 55 ), |
378 | 405 | 'comma' => array( 1, 55 ), |
| 406 | + 'rightcurly' => array( 1, 55 ), |
379 | 407 | ), |
380 | | - 18 => array( |
| 408 | + 19 => array( |
381 | 409 | 'in' => array( 1, 56 ), |
382 | 410 | 'pow' => array( 1, 56 ), |
383 | 411 | 'equalsto' => array( 1, 56 ), |
— | — | @@ -391,23 +419,8 @@ |
392 | 420 | 'contains' => array( 1, 56 ), |
393 | 421 | 'rightsquare' => array( 1, 56 ), |
394 | 422 | 'comma' => array( 1, 56 ), |
| 423 | + 'rightcurly' => array( 1, 56 ), |
395 | 424 | ), |
396 | | - 19 => array( |
397 | | - 'in' => array( 1, 57 ), |
398 | | - 'pow' => array( 1, 57 ), |
399 | | - 'equalsto' => array( 1, 57 ), |
400 | | - 'trinary' => array( 1, 57 ), |
401 | | - 'semicolon' => array( 1, 57 ), |
402 | | - 'rightbracket' => array( 1, 57 ), |
403 | | - 'colon' => array( 1, 57 ), |
404 | | - 'logicop' => array( 1, 57 ), |
405 | | - 'compareop' => array( 1, 57 ), |
406 | | - 'sum' => array( 1, 57 ), |
407 | | - 'mul' => array( 1, 57 ), |
408 | | - 'contains' => array( 1, 57 ), |
409 | | - 'rightsquare' => array( 1, 57 ), |
410 | | - 'comma' => array( 1, 57 ), |
411 | | - ), |
412 | 425 | 20 => array( |
413 | 426 | '$' => array( 2, null ), |
414 | 427 | 'if' => array( 0, 1 ), |
— | — | @@ -454,10 +467,10 @@ |
455 | 468 | 'rightcurly' => array( 1, 2 ), |
456 | 469 | ), |
457 | 470 | 22 => array( |
458 | | - 'semicolon' => array( 0, 58 ), |
| 471 | + 'semicolon' => array( 0, 56 ), |
459 | 472 | ), |
460 | 473 | 23 => array( |
461 | | - 'setto' => array( 0, 59 ), |
| 474 | + 'setto' => array( 0, 57 ), |
462 | 475 | 'in' => array( 1, 37 ), |
463 | 476 | 'pow' => array( 1, 37 ), |
464 | 477 | 'equalsto' => array( 1, 37 ), |
— | — | @@ -472,6 +485,8 @@ |
473 | 486 | 'contains' => array( 1, 37 ), |
474 | 487 | 'rightsquare' => array( 1, 37 ), |
475 | 488 | 'comma' => array( 1, 37 ), |
| 489 | + 'rightcurly' => array( 1, 37 ), |
| 490 | + 'leftsquare' => array( 0, 58 ), |
476 | 491 | ), |
477 | 492 | 24 => array( |
478 | 493 | 'semicolon' => array( 1, 9 ), |
— | — | @@ -479,6 +494,7 @@ |
480 | 495 | 'rightsquare' => array( 1, 9 ), |
481 | 496 | 'comma' => array( 1, 9 ), |
482 | 497 | 'colon' => array( 1, 9 ), |
| 498 | + 'rightcurly' => array( 1, 9 ), |
483 | 499 | ), |
484 | 500 | 25 => array( |
485 | 501 | 'semicolon' => array( 1, 11 ), |
— | — | @@ -486,6 +502,7 @@ |
487 | 503 | 'rightsquare' => array( 1, 11 ), |
488 | 504 | 'comma' => array( 1, 11 ), |
489 | 505 | 'colon' => array( 1, 11 ), |
| 506 | + 'rightcurly' => array( 1, 11 ), |
490 | 507 | ), |
491 | 508 | 26 => array( |
492 | 509 | 'trinary' => array( 0, 60 ), |
— | — | @@ -494,6 +511,7 @@ |
495 | 512 | 'colon' => array( 1, 13 ), |
496 | 513 | 'rightsquare' => array( 1, 13 ), |
497 | 514 | 'comma' => array( 1, 13 ), |
| 515 | + 'rightcurly' => array( 1, 13 ), |
498 | 516 | 'logicop' => array( 0, 61 ), |
499 | 517 | ), |
500 | 518 | 27 => array( |
— | — | @@ -504,6 +522,7 @@ |
505 | 523 | 'logicop' => array( 1, 15 ), |
506 | 524 | 'rightsquare' => array( 1, 15 ), |
507 | 525 | 'comma' => array( 1, 15 ), |
| 526 | + 'rightcurly' => array( 1, 15 ), |
508 | 527 | 'compareop' => array( 0, 62 ), |
509 | 528 | ), |
510 | 529 | 28 => array( |
— | — | @@ -515,6 +534,7 @@ |
516 | 535 | 'compareop' => array( 1, 17 ), |
517 | 536 | 'rightsquare' => array( 1, 17 ), |
518 | 537 | 'comma' => array( 1, 17 ), |
| 538 | + 'rightcurly' => array( 1, 17 ), |
519 | 539 | ), |
520 | 540 | 29 => array( |
521 | 541 | 'equalsto' => array( 0, 63 ), |
— | — | @@ -526,6 +546,7 @@ |
527 | 547 | 'compareop' => array( 1, 19 ), |
528 | 548 | 'rightsquare' => array( 1, 19 ), |
529 | 549 | 'comma' => array( 1, 19 ), |
| 550 | + 'rightcurly' => array( 1, 19 ), |
530 | 551 | 'sum' => array( 0, 64 ), |
531 | 552 | ), |
532 | 553 | 30 => array( |
— | — | @@ -539,6 +560,7 @@ |
540 | 561 | 'sum' => array( 1, 21 ), |
541 | 562 | 'rightsquare' => array( 1, 21 ), |
542 | 563 | 'comma' => array( 1, 21 ), |
| 564 | + 'rightcurly' => array( 1, 21 ), |
543 | 565 | 'mul' => array( 0, 65 ), |
544 | 566 | ), |
545 | 567 | 31 => array( |
— | — | @@ -553,6 +575,7 @@ |
554 | 576 | 'mul' => array( 1, 23 ), |
555 | 577 | 'rightsquare' => array( 1, 23 ), |
556 | 578 | 'comma' => array( 1, 23 ), |
| 579 | + 'rightcurly' => array( 1, 23 ), |
557 | 580 | ), |
558 | 581 | 32 => array( |
559 | 582 | 'pow' => array( 0, 66 ), |
— | — | @@ -567,6 +590,7 @@ |
568 | 591 | 'mul' => array( 1, 25 ), |
569 | 592 | 'rightsquare' => array( 1, 25 ), |
570 | 593 | 'comma' => array( 1, 25 ), |
| 594 | + 'rightcurly' => array( 1, 25 ), |
571 | 595 | ), |
572 | 596 | 33 => array( |
573 | 597 | 'pow' => array( 1, 27 ), |
— | — | @@ -581,6 +605,7 @@ |
582 | 606 | 'mul' => array( 1, 27 ), |
583 | 607 | 'rightsquare' => array( 1, 27 ), |
584 | 608 | 'comma' => array( 1, 27 ), |
| 609 | + 'rightcurly' => array( 1, 27 ), |
585 | 610 | ), |
586 | 611 | 34 => array( |
587 | 612 | 'in' => array( 0, 67 ), |
— | — | @@ -597,6 +622,7 @@ |
598 | 623 | 'mul' => array( 1, 30 ), |
599 | 624 | 'rightsquare' => array( 1, 30 ), |
600 | 625 | 'comma' => array( 1, 30 ), |
| 626 | + 'rightcurly' => array( 1, 30 ), |
601 | 627 | ), |
602 | 628 | 35 => array( |
603 | 629 | 'in' => array( 1, 32 ), |
— | — | @@ -613,6 +639,7 @@ |
614 | 640 | 'contains' => array( 1, 32 ), |
615 | 641 | 'rightsquare' => array( 1, 32 ), |
616 | 642 | 'comma' => array( 1, 32 ), |
| 643 | + 'rightcurly' => array( 1, 32 ), |
617 | 644 | ), |
618 | 645 | 36 => array( |
619 | 646 | 'leftbracket' => array( 0, 69 ), |
— | — | @@ -632,6 +659,7 @@ |
633 | 660 | 'contains' => array( 1, 36 ), |
634 | 661 | 'rightsquare' => array( 1, 36 ), |
635 | 662 | 'comma' => array( 1, 36 ), |
| 663 | + 'rightcurly' => array( 1, 36 ), |
636 | 664 | ), |
637 | 665 | 38 => array( |
638 | 666 | 'in' => array( 1, 38 ), |
— | — | @@ -648,6 +676,7 @@ |
649 | 677 | 'contains' => array( 1, 38 ), |
650 | 678 | 'rightsquare' => array( 1, 38 ), |
651 | 679 | 'comma' => array( 1, 38 ), |
| 680 | + 'rightcurly' => array( 1, 38 ), |
652 | 681 | ), |
653 | 682 | 39 => array( |
654 | 683 | 'id' => array( 0, 8 ), |
— | — | @@ -659,6 +688,7 @@ |
660 | 689 | 'continue' => array( 0, 10 ), |
661 | 690 | 'leftbracket' => array( 0, 2 ), |
662 | 691 | 'leftsquare' => array( 0, 11 ), |
| 692 | + 'leftcurly' => array( 0, 40 ), |
663 | 693 | 'string' => array( 0, 14 ), |
664 | 694 | 'int' => array( 0, 15 ), |
665 | 695 | 'float' => array( 0, 16 ), |
— | — | @@ -667,16 +697,34 @@ |
668 | 698 | 'null' => array( 0, 19 ), |
669 | 699 | ), |
670 | 700 | 40 => array( |
671 | | - 'rightbracket' => array( 0, 71 ), |
| 701 | + 'id' => array( 0, 8 ), |
| 702 | + 'invert' => array( 0, 7 ), |
| 703 | + 'sum' => array( 0, 6 ), |
| 704 | + 'isset' => array( 0, 12 ), |
| 705 | + 'delete' => array( 0, 13 ), |
| 706 | + 'break' => array( 0, 9 ), |
| 707 | + 'continue' => array( 0, 10 ), |
| 708 | + 'leftbracket' => array( 0, 2 ), |
| 709 | + 'leftsquare' => array( 0, 11 ), |
| 710 | + 'leftcurly' => array( 0, 40 ), |
| 711 | + 'string' => array( 0, 14 ), |
| 712 | + 'int' => array( 0, 15 ), |
| 713 | + 'float' => array( 0, 16 ), |
| 714 | + 'true' => array( 0, 17 ), |
| 715 | + 'false' => array( 0, 18 ), |
| 716 | + 'null' => array( 0, 19 ), |
672 | 717 | ), |
673 | 718 | 41 => array( |
674 | | - 'id' => array( 0, 72 ), |
| 719 | + 'rightbracket' => array( 0, 72 ), |
675 | 720 | ), |
676 | 721 | 42 => array( |
677 | | - 'catch' => array( 0, 74 ), |
| 722 | + 'id' => array( 0, 73 ), |
678 | 723 | ), |
679 | 724 | 43 => array( |
680 | | - 'rightcurly' => array( 0, 75 ), |
| 725 | + 'catch' => array( 0, 76 ), |
| 726 | + ), |
| 727 | + 44 => array( |
| 728 | + 'rightcurly' => array( 0, 77 ), |
681 | 729 | 'if' => array( 0, 1 ), |
682 | 730 | 'for' => array( 0, 3 ), |
683 | 731 | 'try' => array( 0, 4 ), |
— | — | @@ -697,26 +745,39 @@ |
698 | 746 | 'false' => array( 0, 18 ), |
699 | 747 | 'null' => array( 0, 19 ), |
700 | 748 | ), |
701 | | - 44 => array( |
702 | | - 'leftbracket' => array( 0, 48 ), |
703 | | - 'in' => array( 1, 59 ), |
704 | | - 'rightbracket' => array( 1, 59 ), |
705 | | - 'setto' => array( 1, 59 ), |
706 | | - 'pow' => array( 1, 59 ), |
707 | | - 'equalsto' => array( 1, 59 ), |
708 | | - 'trinary' => array( 1, 59 ), |
709 | | - 'semicolon' => array( 1, 59 ), |
710 | | - 'colon' => array( 1, 59 ), |
711 | | - 'logicop' => array( 1, 59 ), |
712 | | - 'compareop' => array( 1, 59 ), |
713 | | - 'sum' => array( 1, 59 ), |
714 | | - 'mul' => array( 1, 59 ), |
715 | | - 'contains' => array( 1, 59 ), |
716 | | - 'rightsquare' => array( 1, 59 ), |
717 | | - 'comma' => array( 1, 59 ), |
718 | | - 'leftsquare' => array( 0, 49 ), |
| 749 | + 45 => array( |
| 750 | + 'semicolon' => array( 0, 56 ), |
| 751 | + 'colon' => array( 0, 78 ), |
719 | 752 | ), |
720 | | - 45 => array( |
| 753 | + 46 => array( |
| 754 | + 'rightcurly' => array( 0, 79 ), |
| 755 | + 'comma' => array( 0, 80 ), |
| 756 | + ), |
| 757 | + 47 => array( |
| 758 | + 'rightcurly' => array( 1, 49 ), |
| 759 | + 'comma' => array( 1, 49 ), |
| 760 | + ), |
| 761 | + 48 => array( |
| 762 | + 'leftbracket' => array( 0, 52 ), |
| 763 | + 'rightbracket' => array( 1, 57 ), |
| 764 | + 'setto' => array( 1, 57 ), |
| 765 | + 'in' => array( 1, 57 ), |
| 766 | + 'pow' => array( 1, 57 ), |
| 767 | + 'equalsto' => array( 1, 57 ), |
| 768 | + 'trinary' => array( 1, 57 ), |
| 769 | + 'semicolon' => array( 1, 57 ), |
| 770 | + 'colon' => array( 1, 57 ), |
| 771 | + 'logicop' => array( 1, 57 ), |
| 772 | + 'compareop' => array( 1, 57 ), |
| 773 | + 'sum' => array( 1, 57 ), |
| 774 | + 'mul' => array( 1, 57 ), |
| 775 | + 'contains' => array( 1, 57 ), |
| 776 | + 'leftsquare' => array( 1, 57 ), |
| 777 | + 'rightsquare' => array( 1, 57 ), |
| 778 | + 'comma' => array( 1, 57 ), |
| 779 | + 'rightcurly' => array( 1, 57 ), |
| 780 | + ), |
| 781 | + 49 => array( |
721 | 782 | 'in' => array( 1, 37 ), |
722 | 783 | 'pow' => array( 1, 37 ), |
723 | 784 | 'equalsto' => array( 1, 37 ), |
— | — | @@ -731,8 +792,10 @@ |
732 | 793 | 'contains' => array( 1, 37 ), |
733 | 794 | 'rightsquare' => array( 1, 37 ), |
734 | 795 | 'comma' => array( 1, 37 ), |
| 796 | + 'rightcurly' => array( 1, 37 ), |
| 797 | + 'leftsquare' => array( 0, 58 ), |
735 | 798 | ), |
736 | | - 46 => array( |
| 799 | + 50 => array( |
737 | 800 | 'in' => array( 1, 31 ), |
738 | 801 | 'pow' => array( 1, 31 ), |
739 | 802 | 'equalsto' => array( 1, 31 ), |
— | — | @@ -747,8 +810,9 @@ |
748 | 811 | 'contains' => array( 1, 31 ), |
749 | 812 | 'rightsquare' => array( 1, 31 ), |
750 | 813 | 'comma' => array( 1, 31 ), |
| 814 | + 'rightcurly' => array( 1, 31 ), |
751 | 815 | ), |
752 | | - 47 => array( |
| 816 | + 51 => array( |
753 | 817 | 'pow' => array( 1, 26 ), |
754 | 818 | 'equalsto' => array( 1, 26 ), |
755 | 819 | 'trinary' => array( 1, 26 ), |
— | — | @@ -761,9 +825,10 @@ |
762 | 826 | 'mul' => array( 1, 26 ), |
763 | 827 | 'rightsquare' => array( 1, 26 ), |
764 | 828 | 'comma' => array( 1, 26 ), |
| 829 | + 'rightcurly' => array( 1, 26 ), |
765 | 830 | ), |
766 | | - 48 => array( |
767 | | - 'rightbracket' => array( 0, 76 ), |
| 831 | + 52 => array( |
| 832 | + 'rightbracket' => array( 0, 81 ), |
768 | 833 | 'id' => array( 0, 8 ), |
769 | 834 | 'invert' => array( 0, 7 ), |
770 | 835 | 'sum' => array( 0, 6 ), |
— | — | @@ -773,6 +838,7 @@ |
774 | 839 | 'continue' => array( 0, 10 ), |
775 | 840 | 'leftbracket' => array( 0, 2 ), |
776 | 841 | 'leftsquare' => array( 0, 11 ), |
| 842 | + 'leftcurly' => array( 0, 40 ), |
777 | 843 | 'string' => array( 0, 14 ), |
778 | 844 | 'int' => array( 0, 15 ), |
779 | 845 | 'float' => array( 0, 16 ), |
— | — | @@ -780,81 +846,16 @@ |
781 | 847 | 'false' => array( 0, 18 ), |
782 | 848 | 'null' => array( 0, 19 ), |
783 | 849 | ), |
784 | | - 49 => array( |
785 | | - 'rightsquare' => array( 0, 79 ), |
786 | | - 'id' => array( 0, 8 ), |
787 | | - 'invert' => array( 0, 7 ), |
788 | | - 'sum' => array( 0, 6 ), |
789 | | - 'isset' => array( 0, 12 ), |
790 | | - 'delete' => array( 0, 13 ), |
791 | | - 'break' => array( 0, 9 ), |
792 | | - 'continue' => array( 0, 10 ), |
793 | | - 'leftbracket' => array( 0, 2 ), |
794 | | - 'leftsquare' => array( 0, 11 ), |
795 | | - 'string' => array( 0, 14 ), |
796 | | - 'int' => array( 0, 15 ), |
797 | | - 'float' => array( 0, 16 ), |
798 | | - 'true' => array( 0, 17 ), |
799 | | - 'false' => array( 0, 18 ), |
800 | | - 'null' => array( 0, 19 ), |
801 | | - ), |
802 | | - 50 => array( |
803 | | - 'in' => array( 1, 58 ), |
804 | | - 'rightbracket' => array( 1, 58 ), |
805 | | - 'setto' => array( 1, 58 ), |
806 | | - 'pow' => array( 1, 58 ), |
807 | | - 'equalsto' => array( 1, 58 ), |
808 | | - 'trinary' => array( 1, 58 ), |
809 | | - 'semicolon' => array( 1, 58 ), |
810 | | - 'colon' => array( 1, 58 ), |
811 | | - 'logicop' => array( 1, 58 ), |
812 | | - 'compareop' => array( 1, 58 ), |
813 | | - 'sum' => array( 1, 58 ), |
814 | | - 'mul' => array( 1, 58 ), |
815 | | - 'contains' => array( 1, 58 ), |
816 | | - 'rightsquare' => array( 1, 58 ), |
817 | | - 'comma' => array( 1, 58 ), |
818 | | - ), |
819 | | - 51 => array( |
820 | | - 'in' => array( 1, 61 ), |
821 | | - 'rightbracket' => array( 1, 61 ), |
822 | | - 'setto' => array( 1, 61 ), |
823 | | - 'pow' => array( 1, 61 ), |
824 | | - 'equalsto' => array( 1, 61 ), |
825 | | - 'trinary' => array( 1, 61 ), |
826 | | - 'semicolon' => array( 1, 61 ), |
827 | | - 'colon' => array( 1, 61 ), |
828 | | - 'logicop' => array( 1, 61 ), |
829 | | - 'compareop' => array( 1, 61 ), |
830 | | - 'sum' => array( 1, 61 ), |
831 | | - 'mul' => array( 1, 61 ), |
832 | | - 'contains' => array( 1, 61 ), |
833 | | - 'rightsquare' => array( 1, 61 ), |
834 | | - 'comma' => array( 1, 61 ), |
835 | | - 'leftsquare' => array( 0, 49 ), |
836 | | - ), |
837 | | - 52 => array( |
838 | | - 'rightbracket' => array( 1, 48 ), |
839 | | - 'rightsquare' => array( 1, 48 ), |
840 | | - 'comma' => array( 1, 48 ), |
841 | | - 'colon' => array( 0, 82 ), |
842 | | - ), |
843 | 850 | 53 => array( |
844 | | - 'rightsquare' => array( 1, 46 ), |
845 | | - 'comma' => array( 0, 83 ), |
| 851 | + 'rightbracket' => array( 1, 47 ), |
| 852 | + 'rightsquare' => array( 1, 47 ), |
| 853 | + 'comma' => array( 1, 47 ), |
846 | 854 | ), |
847 | 855 | 54 => array( |
848 | | - 'rightsquare' => array( 0, 84 ), |
| 856 | + 'rightsquare' => array( 0, 83 ), |
| 857 | + 'comma' => array( 0, 84 ), |
849 | 858 | ), |
850 | 859 | 55 => array( |
851 | | - 'rightsquare' => array( 1, 45 ), |
852 | | - 'comma' => array( 0, 85 ), |
853 | | - ), |
854 | | - 56 => array( |
855 | | - 'rightsquare' => array( 1, 50 ), |
856 | | - 'comma' => array( 1, 50 ), |
857 | | - ), |
858 | | - 57 => array( |
859 | 860 | '$' => array( 1, 1 ), |
860 | 861 | 'if' => array( 1, 1 ), |
861 | 862 | 'for' => array( 1, 1 ), |
— | — | @@ -877,7 +878,7 @@ |
878 | 879 | 'null' => array( 1, 1 ), |
879 | 880 | 'rightcurly' => array( 1, 1 ), |
880 | 881 | ), |
881 | | - 58 => array( |
| 882 | + 56 => array( |
882 | 883 | '$' => array( 1, 3 ), |
883 | 884 | 'if' => array( 1, 3 ), |
884 | 885 | 'for' => array( 1, 3 ), |
— | — | @@ -902,7 +903,7 @@ |
903 | 904 | 'catch' => array( 1, 3 ), |
904 | 905 | 'rightcurly' => array( 1, 3 ), |
905 | 906 | ), |
906 | | - 59 => array( |
| 907 | + 57 => array( |
907 | 908 | 'id' => array( 0, 8 ), |
908 | 909 | 'invert' => array( 0, 7 ), |
909 | 910 | 'sum' => array( 0, 6 ), |
— | — | @@ -912,6 +913,7 @@ |
913 | 914 | 'continue' => array( 0, 10 ), |
914 | 915 | 'leftbracket' => array( 0, 2 ), |
915 | 916 | 'leftsquare' => array( 0, 11 ), |
| 917 | + 'leftcurly' => array( 0, 40 ), |
916 | 918 | 'string' => array( 0, 14 ), |
917 | 919 | 'int' => array( 0, 15 ), |
918 | 920 | 'float' => array( 0, 16 ), |
— | — | @@ -919,16 +921,55 @@ |
920 | 922 | 'false' => array( 0, 18 ), |
921 | 923 | 'null' => array( 0, 19 ), |
922 | 924 | ), |
| 925 | + 58 => array( |
| 926 | + 'rightsquare' => array( 0, 86 ), |
| 927 | + 'id' => array( 0, 8 ), |
| 928 | + 'invert' => array( 0, 7 ), |
| 929 | + 'sum' => array( 0, 6 ), |
| 930 | + 'isset' => array( 0, 12 ), |
| 931 | + 'delete' => array( 0, 13 ), |
| 932 | + 'break' => array( 0, 9 ), |
| 933 | + 'continue' => array( 0, 10 ), |
| 934 | + 'leftbracket' => array( 0, 2 ), |
| 935 | + 'leftsquare' => array( 0, 11 ), |
| 936 | + 'leftcurly' => array( 0, 40 ), |
| 937 | + 'string' => array( 0, 14 ), |
| 938 | + 'int' => array( 0, 15 ), |
| 939 | + 'float' => array( 0, 16 ), |
| 940 | + 'true' => array( 0, 17 ), |
| 941 | + 'false' => array( 0, 18 ), |
| 942 | + 'null' => array( 0, 19 ), |
| 943 | + ), |
| 944 | + 59 => array( |
| 945 | + 'rightbracket' => array( 1, 58 ), |
| 946 | + 'setto' => array( 1, 58 ), |
| 947 | + 'in' => array( 1, 58 ), |
| 948 | + 'pow' => array( 1, 58 ), |
| 949 | + 'equalsto' => array( 1, 58 ), |
| 950 | + 'trinary' => array( 1, 58 ), |
| 951 | + 'semicolon' => array( 1, 58 ), |
| 952 | + 'colon' => array( 1, 58 ), |
| 953 | + 'logicop' => array( 1, 58 ), |
| 954 | + 'compareop' => array( 1, 58 ), |
| 955 | + 'sum' => array( 1, 58 ), |
| 956 | + 'mul' => array( 1, 58 ), |
| 957 | + 'contains' => array( 1, 58 ), |
| 958 | + 'leftsquare' => array( 1, 58 ), |
| 959 | + 'rightsquare' => array( 1, 58 ), |
| 960 | + 'comma' => array( 1, 58 ), |
| 961 | + 'rightcurly' => array( 1, 58 ), |
| 962 | + ), |
923 | 963 | 60 => array( |
924 | 964 | 'invert' => array( 0, 7 ), |
925 | 965 | 'sum' => array( 0, 6 ), |
926 | | - 'id' => array( 0, 44 ), |
| 966 | + 'id' => array( 0, 48 ), |
927 | 967 | 'isset' => array( 0, 12 ), |
928 | 968 | 'delete' => array( 0, 13 ), |
929 | 969 | 'break' => array( 0, 9 ), |
930 | 970 | 'continue' => array( 0, 10 ), |
931 | 971 | 'leftbracket' => array( 0, 2 ), |
932 | 972 | 'leftsquare' => array( 0, 11 ), |
| 973 | + 'leftcurly' => array( 0, 40 ), |
933 | 974 | 'string' => array( 0, 14 ), |
934 | 975 | 'int' => array( 0, 15 ), |
935 | 976 | 'float' => array( 0, 16 ), |
— | — | @@ -939,13 +980,14 @@ |
940 | 981 | 61 => array( |
941 | 982 | 'invert' => array( 0, 7 ), |
942 | 983 | 'sum' => array( 0, 6 ), |
943 | | - 'id' => array( 0, 44 ), |
| 984 | + 'id' => array( 0, 48 ), |
944 | 985 | 'isset' => array( 0, 12 ), |
945 | 986 | 'delete' => array( 0, 13 ), |
946 | 987 | 'break' => array( 0, 9 ), |
947 | 988 | 'continue' => array( 0, 10 ), |
948 | 989 | 'leftbracket' => array( 0, 2 ), |
949 | 990 | 'leftsquare' => array( 0, 11 ), |
| 991 | + 'leftcurly' => array( 0, 40 ), |
950 | 992 | 'string' => array( 0, 14 ), |
951 | 993 | 'int' => array( 0, 15 ), |
952 | 994 | 'float' => array( 0, 16 ), |
— | — | @@ -956,13 +998,14 @@ |
957 | 999 | 62 => array( |
958 | 1000 | 'invert' => array( 0, 7 ), |
959 | 1001 | 'sum' => array( 0, 6 ), |
960 | | - 'id' => array( 0, 44 ), |
| 1002 | + 'id' => array( 0, 48 ), |
961 | 1003 | 'isset' => array( 0, 12 ), |
962 | 1004 | 'delete' => array( 0, 13 ), |
963 | 1005 | 'break' => array( 0, 9 ), |
964 | 1006 | 'continue' => array( 0, 10 ), |
965 | 1007 | 'leftbracket' => array( 0, 2 ), |
966 | 1008 | 'leftsquare' => array( 0, 11 ), |
| 1009 | + 'leftcurly' => array( 0, 40 ), |
967 | 1010 | 'string' => array( 0, 14 ), |
968 | 1011 | 'int' => array( 0, 15 ), |
969 | 1012 | 'float' => array( 0, 16 ), |
— | — | @@ -973,13 +1016,14 @@ |
974 | 1017 | 63 => array( |
975 | 1018 | 'invert' => array( 0, 7 ), |
976 | 1019 | 'sum' => array( 0, 6 ), |
977 | | - 'id' => array( 0, 44 ), |
| 1020 | + 'id' => array( 0, 48 ), |
978 | 1021 | 'isset' => array( 0, 12 ), |
979 | 1022 | 'delete' => array( 0, 13 ), |
980 | 1023 | 'break' => array( 0, 9 ), |
981 | 1024 | 'continue' => array( 0, 10 ), |
982 | 1025 | 'leftbracket' => array( 0, 2 ), |
983 | 1026 | 'leftsquare' => array( 0, 11 ), |
| 1027 | + 'leftcurly' => array( 0, 40 ), |
984 | 1028 | 'string' => array( 0, 14 ), |
985 | 1029 | 'int' => array( 0, 15 ), |
986 | 1030 | 'float' => array( 0, 16 ), |
— | — | @@ -990,13 +1034,14 @@ |
991 | 1035 | 64 => array( |
992 | 1036 | 'invert' => array( 0, 7 ), |
993 | 1037 | 'sum' => array( 0, 6 ), |
994 | | - 'id' => array( 0, 44 ), |
| 1038 | + 'id' => array( 0, 48 ), |
995 | 1039 | 'isset' => array( 0, 12 ), |
996 | 1040 | 'delete' => array( 0, 13 ), |
997 | 1041 | 'break' => array( 0, 9 ), |
998 | 1042 | 'continue' => array( 0, 10 ), |
999 | 1043 | 'leftbracket' => array( 0, 2 ), |
1000 | 1044 | 'leftsquare' => array( 0, 11 ), |
| 1045 | + 'leftcurly' => array( 0, 40 ), |
1001 | 1046 | 'string' => array( 0, 14 ), |
1002 | 1047 | 'int' => array( 0, 15 ), |
1003 | 1048 | 'float' => array( 0, 16 ), |
— | — | @@ -1007,13 +1052,14 @@ |
1008 | 1053 | 65 => array( |
1009 | 1054 | 'invert' => array( 0, 7 ), |
1010 | 1055 | 'sum' => array( 0, 6 ), |
1011 | | - 'id' => array( 0, 44 ), |
| 1056 | + 'id' => array( 0, 48 ), |
1012 | 1057 | 'isset' => array( 0, 12 ), |
1013 | 1058 | 'delete' => array( 0, 13 ), |
1014 | 1059 | 'break' => array( 0, 9 ), |
1015 | 1060 | 'continue' => array( 0, 10 ), |
1016 | 1061 | 'leftbracket' => array( 0, 2 ), |
1017 | 1062 | 'leftsquare' => array( 0, 11 ), |
| 1063 | + 'leftcurly' => array( 0, 40 ), |
1018 | 1064 | 'string' => array( 0, 14 ), |
1019 | 1065 | 'int' => array( 0, 15 ), |
1020 | 1066 | 'float' => array( 0, 16 ), |
— | — | @@ -1024,13 +1070,14 @@ |
1025 | 1071 | 66 => array( |
1026 | 1072 | 'invert' => array( 0, 7 ), |
1027 | 1073 | 'sum' => array( 0, 6 ), |
1028 | | - 'id' => array( 0, 44 ), |
| 1074 | + 'id' => array( 0, 48 ), |
1029 | 1075 | 'isset' => array( 0, 12 ), |
1030 | 1076 | 'delete' => array( 0, 13 ), |
1031 | 1077 | 'break' => array( 0, 9 ), |
1032 | 1078 | 'continue' => array( 0, 10 ), |
1033 | 1079 | 'leftbracket' => array( 0, 2 ), |
1034 | 1080 | 'leftsquare' => array( 0, 11 ), |
| 1081 | + 'leftcurly' => array( 0, 40 ), |
1035 | 1082 | 'string' => array( 0, 14 ), |
1036 | 1083 | 'int' => array( 0, 15 ), |
1037 | 1084 | 'float' => array( 0, 16 ), |
— | — | @@ -1040,13 +1087,14 @@ |
1041 | 1088 | ), |
1042 | 1089 | 67 => array( |
1043 | 1090 | 'sum' => array( 0, 6 ), |
1044 | | - 'id' => array( 0, 44 ), |
| 1091 | + 'id' => array( 0, 48 ), |
1045 | 1092 | 'isset' => array( 0, 12 ), |
1046 | 1093 | 'delete' => array( 0, 13 ), |
1047 | 1094 | 'break' => array( 0, 9 ), |
1048 | 1095 | 'continue' => array( 0, 10 ), |
1049 | 1096 | 'leftbracket' => array( 0, 2 ), |
1050 | 1097 | 'leftsquare' => array( 0, 11 ), |
| 1098 | + 'leftcurly' => array( 0, 40 ), |
1051 | 1099 | 'string' => array( 0, 14 ), |
1052 | 1100 | 'int' => array( 0, 15 ), |
1053 | 1101 | 'float' => array( 0, 16 ), |
— | — | @@ -1056,13 +1104,14 @@ |
1057 | 1105 | ), |
1058 | 1106 | 68 => array( |
1059 | 1107 | 'sum' => array( 0, 6 ), |
1060 | | - 'id' => array( 0, 44 ), |
| 1108 | + 'id' => array( 0, 48 ), |
1061 | 1109 | 'isset' => array( 0, 12 ), |
1062 | 1110 | 'delete' => array( 0, 13 ), |
1063 | 1111 | 'break' => array( 0, 9 ), |
1064 | 1112 | 'continue' => array( 0, 10 ), |
1065 | 1113 | 'leftbracket' => array( 0, 2 ), |
1066 | 1114 | 'leftsquare' => array( 0, 11 ), |
| 1115 | + 'leftcurly' => array( 0, 40 ), |
1067 | 1116 | 'string' => array( 0, 14 ), |
1068 | 1117 | 'int' => array( 0, 15 ), |
1069 | 1118 | 'float' => array( 0, 16 ), |
— | — | @@ -1071,12 +1120,15 @@ |
1072 | 1121 | 'null' => array( 0, 19 ), |
1073 | 1122 | ), |
1074 | 1123 | 69 => array( |
1075 | | - 'id' => array( 0, 72 ), |
| 1124 | + 'id' => array( 0, 73 ), |
1076 | 1125 | ), |
1077 | 1126 | 70 => array( |
1078 | | - 'rightbracket' => array( 0, 97 ), |
| 1127 | + 'rightbracket' => array( 0, 98 ), |
1079 | 1128 | ), |
1080 | 1129 | 71 => array( |
| 1130 | + 'colon' => array( 0, 78 ), |
| 1131 | + ), |
| 1132 | + 72 => array( |
1081 | 1133 | 'in' => array( 1, 41 ), |
1082 | 1134 | 'pow' => array( 1, 41 ), |
1083 | 1135 | 'equalsto' => array( 1, 41 ), |
— | — | @@ -1091,32 +1143,39 @@ |
1092 | 1144 | 'contains' => array( 1, 41 ), |
1093 | 1145 | 'rightsquare' => array( 1, 41 ), |
1094 | 1146 | 'comma' => array( 1, 41 ), |
| 1147 | + 'rightcurly' => array( 1, 41 ), |
1095 | 1148 | ), |
1096 | | - 72 => array( |
1097 | | - 'in' => array( 1, 59 ), |
1098 | | - 'rightbracket' => array( 1, 59 ), |
1099 | | - 'setto' => array( 1, 59 ), |
1100 | | - 'pow' => array( 1, 59 ), |
1101 | | - 'equalsto' => array( 1, 59 ), |
1102 | | - 'trinary' => array( 1, 59 ), |
1103 | | - 'semicolon' => array( 1, 59 ), |
1104 | | - 'colon' => array( 1, 59 ), |
1105 | | - 'logicop' => array( 1, 59 ), |
1106 | | - 'compareop' => array( 1, 59 ), |
1107 | | - 'sum' => array( 1, 59 ), |
1108 | | - 'mul' => array( 1, 59 ), |
1109 | | - 'contains' => array( 1, 59 ), |
1110 | | - 'rightsquare' => array( 1, 59 ), |
1111 | | - 'comma' => array( 1, 59 ), |
1112 | | - 'leftsquare' => array( 0, 49 ), |
1113 | | - ), |
1114 | 1149 | 73 => array( |
1115 | | - 'in' => array( 0, 98 ), |
| 1150 | + 'rightbracket' => array( 1, 57 ), |
| 1151 | + 'setto' => array( 1, 57 ), |
| 1152 | + 'in' => array( 1, 57 ), |
| 1153 | + 'pow' => array( 1, 57 ), |
| 1154 | + 'equalsto' => array( 1, 57 ), |
| 1155 | + 'trinary' => array( 1, 57 ), |
| 1156 | + 'semicolon' => array( 1, 57 ), |
| 1157 | + 'colon' => array( 1, 57 ), |
| 1158 | + 'logicop' => array( 1, 57 ), |
| 1159 | + 'compareop' => array( 1, 57 ), |
| 1160 | + 'sum' => array( 1, 57 ), |
| 1161 | + 'mul' => array( 1, 57 ), |
| 1162 | + 'contains' => array( 1, 57 ), |
| 1163 | + 'leftsquare' => array( 1, 57 ), |
| 1164 | + 'rightsquare' => array( 1, 57 ), |
| 1165 | + 'comma' => array( 1, 57 ), |
| 1166 | + 'rightcurly' => array( 1, 57 ), |
1116 | 1167 | ), |
1117 | 1168 | 74 => array( |
1118 | | - 'leftbracket' => array( 0, 99 ), |
| 1169 | + 'in' => array( 0, 99 ), |
1119 | 1170 | ), |
1120 | 1171 | 75 => array( |
| 1172 | + 'in' => array( 1, 61 ), |
| 1173 | + 'colon' => array( 0, 100 ), |
| 1174 | + 'leftsquare' => array( 0, 58 ), |
| 1175 | + ), |
| 1176 | + 76 => array( |
| 1177 | + 'leftbracket' => array( 0, 101 ), |
| 1178 | + ), |
| 1179 | + 77 => array( |
1121 | 1180 | '$' => array( 1, 8 ), |
1122 | 1181 | 'if' => array( 1, 8 ), |
1123 | 1182 | 'for' => array( 1, 8 ), |
— | — | @@ -1141,70 +1200,7 @@ |
1142 | 1201 | 'catch' => array( 1, 8 ), |
1143 | 1202 | 'rightcurly' => array( 1, 8 ), |
1144 | 1203 | ), |
1145 | | - 76 => array( |
1146 | | - 'in' => array( 1, 34 ), |
1147 | | - 'pow' => array( 1, 34 ), |
1148 | | - 'equalsto' => array( 1, 34 ), |
1149 | | - 'trinary' => array( 1, 34 ), |
1150 | | - 'semicolon' => array( 1, 34 ), |
1151 | | - 'rightbracket' => array( 1, 34 ), |
1152 | | - 'colon' => array( 1, 34 ), |
1153 | | - 'logicop' => array( 1, 34 ), |
1154 | | - 'compareop' => array( 1, 34 ), |
1155 | | - 'sum' => array( 1, 34 ), |
1156 | | - 'mul' => array( 1, 34 ), |
1157 | | - 'contains' => array( 1, 34 ), |
1158 | | - 'rightsquare' => array( 1, 34 ), |
1159 | | - 'comma' => array( 1, 34 ), |
1160 | | - ), |
1161 | | - 77 => array( |
1162 | | - 'rightbracket' => array( 1, 48 ), |
1163 | | - 'rightsquare' => array( 1, 48 ), |
1164 | | - 'comma' => array( 1, 48 ), |
1165 | | - ), |
1166 | 1204 | 78 => array( |
1167 | | - 'rightbracket' => array( 0, 100 ), |
1168 | | - 'comma' => array( 0, 83 ), |
1169 | | - ), |
1170 | | - 79 => array( |
1171 | | - 'leftsquare' => array( 1, 63 ), |
1172 | | - 'in' => array( 1, 63 ), |
1173 | | - 'rightbracket' => array( 1, 63 ), |
1174 | | - 'setto' => array( 1, 63 ), |
1175 | | - 'pow' => array( 1, 63 ), |
1176 | | - 'equalsto' => array( 1, 63 ), |
1177 | | - 'trinary' => array( 1, 63 ), |
1178 | | - 'semicolon' => array( 1, 63 ), |
1179 | | - 'colon' => array( 1, 63 ), |
1180 | | - 'logicop' => array( 1, 63 ), |
1181 | | - 'compareop' => array( 1, 63 ), |
1182 | | - 'sum' => array( 1, 63 ), |
1183 | | - 'mul' => array( 1, 63 ), |
1184 | | - 'contains' => array( 1, 63 ), |
1185 | | - 'rightsquare' => array( 1, 63 ), |
1186 | | - 'comma' => array( 1, 63 ), |
1187 | | - ), |
1188 | | - 80 => array( |
1189 | | - 'rightsquare' => array( 0, 101 ), |
1190 | | - ), |
1191 | | - 81 => array( |
1192 | | - 'in' => array( 1, 60 ), |
1193 | | - 'rightbracket' => array( 1, 60 ), |
1194 | | - 'setto' => array( 1, 60 ), |
1195 | | - 'pow' => array( 1, 60 ), |
1196 | | - 'equalsto' => array( 1, 60 ), |
1197 | | - 'trinary' => array( 1, 60 ), |
1198 | | - 'semicolon' => array( 1, 60 ), |
1199 | | - 'colon' => array( 1, 60 ), |
1200 | | - 'logicop' => array( 1, 60 ), |
1201 | | - 'compareop' => array( 1, 60 ), |
1202 | | - 'sum' => array( 1, 60 ), |
1203 | | - 'mul' => array( 1, 60 ), |
1204 | | - 'contains' => array( 1, 60 ), |
1205 | | - 'rightsquare' => array( 1, 60 ), |
1206 | | - 'comma' => array( 1, 60 ), |
1207 | | - ), |
1208 | | - 82 => array( |
1209 | 1205 | 'id' => array( 0, 8 ), |
1210 | 1206 | 'invert' => array( 0, 7 ), |
1211 | 1207 | 'sum' => array( 0, 6 ), |
— | — | @@ -1214,6 +1210,7 @@ |
1215 | 1211 | 'continue' => array( 0, 10 ), |
1216 | 1212 | 'leftbracket' => array( 0, 2 ), |
1217 | 1213 | 'leftsquare' => array( 0, 11 ), |
| 1214 | + 'leftcurly' => array( 0, 40 ), |
1218 | 1215 | 'string' => array( 0, 14 ), |
1219 | 1216 | 'int' => array( 0, 15 ), |
1220 | 1217 | 'float' => array( 0, 16 ), |
— | — | @@ -1221,7 +1218,24 @@ |
1222 | 1219 | 'false' => array( 0, 18 ), |
1223 | 1220 | 'null' => array( 0, 19 ), |
1224 | 1221 | ), |
1225 | | - 83 => array( |
| 1222 | + 79 => array( |
| 1223 | + 'in' => array( 1, 43 ), |
| 1224 | + 'pow' => array( 1, 43 ), |
| 1225 | + 'equalsto' => array( 1, 43 ), |
| 1226 | + 'trinary' => array( 1, 43 ), |
| 1227 | + 'semicolon' => array( 1, 43 ), |
| 1228 | + 'rightbracket' => array( 1, 43 ), |
| 1229 | + 'colon' => array( 1, 43 ), |
| 1230 | + 'logicop' => array( 1, 43 ), |
| 1231 | + 'compareop' => array( 1, 43 ), |
| 1232 | + 'sum' => array( 1, 43 ), |
| 1233 | + 'mul' => array( 1, 43 ), |
| 1234 | + 'contains' => array( 1, 43 ), |
| 1235 | + 'rightsquare' => array( 1, 43 ), |
| 1236 | + 'comma' => array( 1, 43 ), |
| 1237 | + 'rightcurly' => array( 1, 43 ), |
| 1238 | + ), |
| 1239 | + 80 => array( |
1226 | 1240 | 'id' => array( 0, 8 ), |
1227 | 1241 | 'invert' => array( 0, 7 ), |
1228 | 1242 | 'sum' => array( 0, 6 ), |
— | — | @@ -1231,6 +1245,7 @@ |
1232 | 1246 | 'continue' => array( 0, 10 ), |
1233 | 1247 | 'leftbracket' => array( 0, 2 ), |
1234 | 1248 | 'leftsquare' => array( 0, 11 ), |
| 1249 | + 'leftcurly' => array( 0, 40 ), |
1235 | 1250 | 'string' => array( 0, 14 ), |
1236 | 1251 | 'int' => array( 0, 15 ), |
1237 | 1252 | 'float' => array( 0, 16 ), |
— | — | @@ -1238,7 +1253,28 @@ |
1239 | 1254 | 'false' => array( 0, 18 ), |
1240 | 1255 | 'null' => array( 0, 19 ), |
1241 | 1256 | ), |
1242 | | - 84 => array( |
| 1257 | + 81 => array( |
| 1258 | + 'in' => array( 1, 34 ), |
| 1259 | + 'pow' => array( 1, 34 ), |
| 1260 | + 'equalsto' => array( 1, 34 ), |
| 1261 | + 'trinary' => array( 1, 34 ), |
| 1262 | + 'semicolon' => array( 1, 34 ), |
| 1263 | + 'rightbracket' => array( 1, 34 ), |
| 1264 | + 'colon' => array( 1, 34 ), |
| 1265 | + 'logicop' => array( 1, 34 ), |
| 1266 | + 'compareop' => array( 1, 34 ), |
| 1267 | + 'sum' => array( 1, 34 ), |
| 1268 | + 'mul' => array( 1, 34 ), |
| 1269 | + 'contains' => array( 1, 34 ), |
| 1270 | + 'rightsquare' => array( 1, 34 ), |
| 1271 | + 'comma' => array( 1, 34 ), |
| 1272 | + 'rightcurly' => array( 1, 34 ), |
| 1273 | + ), |
| 1274 | + 82 => array( |
| 1275 | + 'rightbracket' => array( 0, 104 ), |
| 1276 | + 'comma' => array( 0, 84 ), |
| 1277 | + ), |
| 1278 | + 83 => array( |
1243 | 1279 | 'in' => array( 1, 42 ), |
1244 | 1280 | 'pow' => array( 1, 42 ), |
1245 | 1281 | 'equalsto' => array( 1, 42 ), |
— | — | @@ -1253,8 +1289,9 @@ |
1254 | 1290 | 'contains' => array( 1, 42 ), |
1255 | 1291 | 'rightsquare' => array( 1, 42 ), |
1256 | 1292 | 'comma' => array( 1, 42 ), |
| 1293 | + 'rightcurly' => array( 1, 42 ), |
1257 | 1294 | ), |
1258 | | - 85 => array( |
| 1295 | + 84 => array( |
1259 | 1296 | 'id' => array( 0, 8 ), |
1260 | 1297 | 'invert' => array( 0, 7 ), |
1261 | 1298 | 'sum' => array( 0, 6 ), |
— | — | @@ -1264,6 +1301,7 @@ |
1265 | 1302 | 'continue' => array( 0, 10 ), |
1266 | 1303 | 'leftbracket' => array( 0, 2 ), |
1267 | 1304 | 'leftsquare' => array( 0, 11 ), |
| 1305 | + 'leftcurly' => array( 0, 40 ), |
1268 | 1306 | 'string' => array( 0, 14 ), |
1269 | 1307 | 'int' => array( 0, 15 ), |
1270 | 1308 | 'float' => array( 0, 16 ), |
— | — | @@ -1271,17 +1309,40 @@ |
1272 | 1310 | 'false' => array( 0, 18 ), |
1273 | 1311 | 'null' => array( 0, 19 ), |
1274 | 1312 | ), |
1275 | | - 86 => array( |
| 1313 | + 85 => array( |
1276 | 1314 | 'semicolon' => array( 1, 10 ), |
1277 | 1315 | 'rightbracket' => array( 1, 10 ), |
1278 | 1316 | 'rightsquare' => array( 1, 10 ), |
1279 | 1317 | 'comma' => array( 1, 10 ), |
1280 | 1318 | 'colon' => array( 1, 10 ), |
| 1319 | + 'rightcurly' => array( 1, 10 ), |
1281 | 1320 | ), |
| 1321 | + 86 => array( |
| 1322 | + 'rightbracket' => array( 1, 60 ), |
| 1323 | + 'setto' => array( 1, 60 ), |
| 1324 | + 'in' => array( 1, 60 ), |
| 1325 | + 'pow' => array( 1, 60 ), |
| 1326 | + 'equalsto' => array( 1, 60 ), |
| 1327 | + 'trinary' => array( 1, 60 ), |
| 1328 | + 'semicolon' => array( 1, 60 ), |
| 1329 | + 'colon' => array( 1, 60 ), |
| 1330 | + 'logicop' => array( 1, 60 ), |
| 1331 | + 'compareop' => array( 1, 60 ), |
| 1332 | + 'sum' => array( 1, 60 ), |
| 1333 | + 'mul' => array( 1, 60 ), |
| 1334 | + 'contains' => array( 1, 60 ), |
| 1335 | + 'leftsquare' => array( 1, 60 ), |
| 1336 | + 'rightsquare' => array( 1, 60 ), |
| 1337 | + 'comma' => array( 1, 60 ), |
| 1338 | + 'rightcurly' => array( 1, 60 ), |
| 1339 | + ), |
1282 | 1340 | 87 => array( |
1283 | | - 'colon' => array( 0, 106 ), |
| 1341 | + 'rightsquare' => array( 0, 106 ), |
1284 | 1342 | ), |
1285 | 1343 | 88 => array( |
| 1344 | + 'colon' => array( 0, 107 ), |
| 1345 | + ), |
| 1346 | + 89 => array( |
1286 | 1347 | 'trinary' => array( 1, 14 ), |
1287 | 1348 | 'semicolon' => array( 1, 14 ), |
1288 | 1349 | 'rightbracket' => array( 1, 14 ), |
— | — | @@ -1289,9 +1350,10 @@ |
1290 | 1351 | 'logicop' => array( 1, 14 ), |
1291 | 1352 | 'rightsquare' => array( 1, 14 ), |
1292 | 1353 | 'comma' => array( 1, 14 ), |
| 1354 | + 'rightcurly' => array( 1, 14 ), |
1293 | 1355 | 'compareop' => array( 0, 62 ), |
1294 | 1356 | ), |
1295 | | - 89 => array( |
| 1357 | + 90 => array( |
1296 | 1358 | 'trinary' => array( 1, 16 ), |
1297 | 1359 | 'semicolon' => array( 1, 16 ), |
1298 | 1360 | 'rightbracket' => array( 1, 16 ), |
— | — | @@ -1300,8 +1362,9 @@ |
1301 | 1363 | 'compareop' => array( 1, 16 ), |
1302 | 1364 | 'rightsquare' => array( 1, 16 ), |
1303 | 1365 | 'comma' => array( 1, 16 ), |
| 1366 | + 'rightcurly' => array( 1, 16 ), |
1304 | 1367 | ), |
1305 | | - 90 => array( |
| 1368 | + 91 => array( |
1306 | 1369 | 'trinary' => array( 1, 18 ), |
1307 | 1370 | 'semicolon' => array( 1, 18 ), |
1308 | 1371 | 'rightbracket' => array( 1, 18 ), |
— | — | @@ -1310,9 +1373,10 @@ |
1311 | 1374 | 'compareop' => array( 1, 18 ), |
1312 | 1375 | 'rightsquare' => array( 1, 18 ), |
1313 | 1376 | 'comma' => array( 1, 18 ), |
| 1377 | + 'rightcurly' => array( 1, 18 ), |
1314 | 1378 | 'sum' => array( 0, 64 ), |
1315 | 1379 | ), |
1316 | | - 91 => array( |
| 1380 | + 92 => array( |
1317 | 1381 | 'equalsto' => array( 1, 20 ), |
1318 | 1382 | 'trinary' => array( 1, 20 ), |
1319 | 1383 | 'semicolon' => array( 1, 20 ), |
— | — | @@ -1323,9 +1387,10 @@ |
1324 | 1388 | 'sum' => array( 1, 20 ), |
1325 | 1389 | 'rightsquare' => array( 1, 20 ), |
1326 | 1390 | 'comma' => array( 1, 20 ), |
| 1391 | + 'rightcurly' => array( 1, 20 ), |
1327 | 1392 | 'mul' => array( 0, 65 ), |
1328 | 1393 | ), |
1329 | | - 92 => array( |
| 1394 | + 93 => array( |
1330 | 1395 | 'equalsto' => array( 1, 22 ), |
1331 | 1396 | 'trinary' => array( 1, 22 ), |
1332 | 1397 | 'semicolon' => array( 1, 22 ), |
— | — | @@ -1337,8 +1402,9 @@ |
1338 | 1403 | 'mul' => array( 1, 22 ), |
1339 | 1404 | 'rightsquare' => array( 1, 22 ), |
1340 | 1405 | 'comma' => array( 1, 22 ), |
| 1406 | + 'rightcurly' => array( 1, 22 ), |
1341 | 1407 | ), |
1342 | | - 93 => array( |
| 1408 | + 94 => array( |
1343 | 1409 | 'equalsto' => array( 1, 24 ), |
1344 | 1410 | 'trinary' => array( 1, 24 ), |
1345 | 1411 | 'semicolon' => array( 1, 24 ), |
— | — | @@ -1350,8 +1416,9 @@ |
1351 | 1417 | 'mul' => array( 1, 24 ), |
1352 | 1418 | 'rightsquare' => array( 1, 24 ), |
1353 | 1419 | 'comma' => array( 1, 24 ), |
| 1420 | + 'rightcurly' => array( 1, 24 ), |
1354 | 1421 | ), |
1355 | | - 94 => array( |
| 1422 | + 95 => array( |
1356 | 1423 | 'pow' => array( 1, 28 ), |
1357 | 1424 | 'equalsto' => array( 1, 28 ), |
1358 | 1425 | 'trinary' => array( 1, 28 ), |
— | — | @@ -1364,8 +1431,9 @@ |
1365 | 1432 | 'mul' => array( 1, 28 ), |
1366 | 1433 | 'rightsquare' => array( 1, 28 ), |
1367 | 1434 | 'comma' => array( 1, 28 ), |
| 1435 | + 'rightcurly' => array( 1, 28 ), |
1368 | 1436 | ), |
1369 | | - 95 => array( |
| 1437 | + 96 => array( |
1370 | 1438 | 'pow' => array( 1, 29 ), |
1371 | 1439 | 'equalsto' => array( 1, 29 ), |
1372 | 1440 | 'trinary' => array( 1, 29 ), |
— | — | @@ -1378,11 +1446,13 @@ |
1379 | 1447 | 'mul' => array( 1, 29 ), |
1380 | 1448 | 'rightsquare' => array( 1, 29 ), |
1381 | 1449 | 'comma' => array( 1, 29 ), |
| 1450 | + 'rightcurly' => array( 1, 29 ), |
1382 | 1451 | ), |
1383 | | - 96 => array( |
1384 | | - 'rightbracket' => array( 0, 107 ), |
| 1452 | + 97 => array( |
| 1453 | + 'rightbracket' => array( 0, 108 ), |
| 1454 | + 'leftsquare' => array( 0, 58 ), |
1385 | 1455 | ), |
1386 | | - 97 => array( |
| 1456 | + 98 => array( |
1387 | 1457 | 'if' => array( 0, 1 ), |
1388 | 1458 | 'for' => array( 0, 3 ), |
1389 | 1459 | 'try' => array( 0, 4 ), |
— | — | @@ -1403,7 +1473,7 @@ |
1404 | 1474 | 'false' => array( 0, 18 ), |
1405 | 1475 | 'null' => array( 0, 19 ), |
1406 | 1476 | ), |
1407 | | - 98 => array( |
| 1477 | + 99 => array( |
1408 | 1478 | 'id' => array( 0, 8 ), |
1409 | 1479 | 'invert' => array( 0, 7 ), |
1410 | 1480 | 'sum' => array( 0, 6 ), |
— | — | @@ -1413,6 +1483,7 @@ |
1414 | 1484 | 'continue' => array( 0, 10 ), |
1415 | 1485 | 'leftbracket' => array( 0, 2 ), |
1416 | 1486 | 'leftsquare' => array( 0, 11 ), |
| 1487 | + 'leftcurly' => array( 0, 40 ), |
1417 | 1488 | 'string' => array( 0, 14 ), |
1418 | 1489 | 'int' => array( 0, 15 ), |
1419 | 1490 | 'float' => array( 0, 16 ), |
— | — | @@ -1420,10 +1491,21 @@ |
1421 | 1492 | 'false' => array( 0, 18 ), |
1422 | 1493 | 'null' => array( 0, 19 ), |
1423 | 1494 | ), |
1424 | | - 99 => array( |
1425 | | - 'id' => array( 0, 72 ), |
| 1495 | + 100 => array( |
| 1496 | + 'id' => array( 0, 73 ), |
1426 | 1497 | ), |
1427 | | - 100 => array( |
| 1498 | + 101 => array( |
| 1499 | + 'id' => array( 0, 73 ), |
| 1500 | + ), |
| 1501 | + 102 => array( |
| 1502 | + 'rightcurly' => array( 1, 50 ), |
| 1503 | + 'comma' => array( 1, 50 ), |
| 1504 | + ), |
| 1505 | + 103 => array( |
| 1506 | + 'rightcurly' => array( 1, 48 ), |
| 1507 | + 'comma' => array( 1, 48 ), |
| 1508 | + ), |
| 1509 | + 104 => array( |
1428 | 1510 | 'in' => array( 1, 33 ), |
1429 | 1511 | 'pow' => array( 1, 33 ), |
1430 | 1512 | 'equalsto' => array( 1, 33 ), |
— | — | @@ -1438,51 +1520,43 @@ |
1439 | 1521 | 'contains' => array( 1, 33 ), |
1440 | 1522 | 'rightsquare' => array( 1, 33 ), |
1441 | 1523 | 'comma' => array( 1, 33 ), |
| 1524 | + 'rightcurly' => array( 1, 33 ), |
1442 | 1525 | ), |
1443 | | - 101 => array( |
1444 | | - 'leftsquare' => array( 1, 62 ), |
1445 | | - 'in' => array( 1, 62 ), |
1446 | | - 'rightbracket' => array( 1, 62 ), |
1447 | | - 'setto' => array( 1, 62 ), |
1448 | | - 'pow' => array( 1, 62 ), |
1449 | | - 'equalsto' => array( 1, 62 ), |
1450 | | - 'trinary' => array( 1, 62 ), |
1451 | | - 'semicolon' => array( 1, 62 ), |
1452 | | - 'colon' => array( 1, 62 ), |
1453 | | - 'logicop' => array( 1, 62 ), |
1454 | | - 'compareop' => array( 1, 62 ), |
1455 | | - 'sum' => array( 1, 62 ), |
1456 | | - 'mul' => array( 1, 62 ), |
1457 | | - 'contains' => array( 1, 62 ), |
1458 | | - 'rightsquare' => array( 1, 62 ), |
1459 | | - 'comma' => array( 1, 62 ), |
1460 | | - ), |
1461 | | - 102 => array( |
1462 | | - 'rightsquare' => array( 1, 51 ), |
1463 | | - 'comma' => array( 1, 51 ), |
1464 | | - ), |
1465 | | - 103 => array( |
1466 | | - 'rightbracket' => array( 1, 47 ), |
1467 | | - 'rightsquare' => array( 1, 47 ), |
1468 | | - 'comma' => array( 1, 47 ), |
1469 | | - ), |
1470 | | - 104 => array( |
1471 | | - 'colon' => array( 0, 82 ), |
1472 | | - ), |
1473 | 1526 | 105 => array( |
1474 | | - 'rightsquare' => array( 1, 49 ), |
1475 | | - 'comma' => array( 1, 49 ), |
| 1527 | + 'rightbracket' => array( 1, 46 ), |
| 1528 | + 'rightsquare' => array( 1, 46 ), |
| 1529 | + 'comma' => array( 1, 46 ), |
1476 | 1530 | ), |
1477 | 1531 | 106 => array( |
| 1532 | + 'rightbracket' => array( 1, 59 ), |
| 1533 | + 'setto' => array( 1, 59 ), |
| 1534 | + 'in' => array( 1, 59 ), |
| 1535 | + 'pow' => array( 1, 59 ), |
| 1536 | + 'equalsto' => array( 1, 59 ), |
| 1537 | + 'trinary' => array( 1, 59 ), |
| 1538 | + 'semicolon' => array( 1, 59 ), |
| 1539 | + 'colon' => array( 1, 59 ), |
| 1540 | + 'logicop' => array( 1, 59 ), |
| 1541 | + 'compareop' => array( 1, 59 ), |
| 1542 | + 'sum' => array( 1, 59 ), |
| 1543 | + 'mul' => array( 1, 59 ), |
| 1544 | + 'contains' => array( 1, 59 ), |
| 1545 | + 'leftsquare' => array( 1, 59 ), |
| 1546 | + 'rightsquare' => array( 1, 59 ), |
| 1547 | + 'comma' => array( 1, 59 ), |
| 1548 | + 'rightcurly' => array( 1, 59 ), |
| 1549 | + ), |
| 1550 | + 107 => array( |
1478 | 1551 | 'invert' => array( 0, 7 ), |
1479 | 1552 | 'sum' => array( 0, 6 ), |
1480 | | - 'id' => array( 0, 44 ), |
| 1553 | + 'id' => array( 0, 48 ), |
1481 | 1554 | 'isset' => array( 0, 12 ), |
1482 | 1555 | 'delete' => array( 0, 13 ), |
1483 | 1556 | 'break' => array( 0, 9 ), |
1484 | 1557 | 'continue' => array( 0, 10 ), |
1485 | 1558 | 'leftbracket' => array( 0, 2 ), |
1486 | 1559 | 'leftsquare' => array( 0, 11 ), |
| 1560 | + 'leftcurly' => array( 0, 40 ), |
1487 | 1561 | 'string' => array( 0, 14 ), |
1488 | 1562 | 'int' => array( 0, 15 ), |
1489 | 1563 | 'float' => array( 0, 16 ), |
— | — | @@ -1490,7 +1564,7 @@ |
1491 | 1565 | 'false' => array( 0, 18 ), |
1492 | 1566 | 'null' => array( 0, 19 ), |
1493 | 1567 | ), |
1494 | | - 107 => array( |
| 1568 | + 108 => array( |
1495 | 1569 | 'in' => array( 1, 35 ), |
1496 | 1570 | 'pow' => array( 1, 35 ), |
1497 | 1571 | 'equalsto' => array( 1, 35 ), |
— | — | @@ -1505,8 +1579,9 @@ |
1506 | 1580 | 'contains' => array( 1, 35 ), |
1507 | 1581 | 'rightsquare' => array( 1, 35 ), |
1508 | 1582 | 'comma' => array( 1, 35 ), |
| 1583 | + 'rightcurly' => array( 1, 35 ), |
1509 | 1584 | ), |
1510 | | - 108 => array( |
| 1585 | + 109 => array( |
1511 | 1586 | '$' => array( 1, 4 ), |
1512 | 1587 | 'if' => array( 1, 4 ), |
1513 | 1588 | 'for' => array( 1, 4 ), |
— | — | @@ -1527,24 +1602,30 @@ |
1528 | 1603 | 'true' => array( 1, 4 ), |
1529 | 1604 | 'false' => array( 1, 4 ), |
1530 | 1605 | 'null' => array( 1, 4 ), |
1531 | | - 'else' => array( 0, 112 ), |
| 1606 | + 'else' => array( 0, 114 ), |
1532 | 1607 | 'catch' => array( 1, 4 ), |
1533 | 1608 | 'rightcurly' => array( 1, 4 ), |
1534 | 1609 | ), |
1535 | | - 109 => array( |
1536 | | - 'rightbracket' => array( 0, 113 ), |
1537 | | - ), |
1538 | 1610 | 110 => array( |
1539 | | - 'rightbracket' => array( 0, 114 ), |
| 1611 | + 'rightbracket' => array( 0, 115 ), |
1540 | 1612 | ), |
1541 | 1613 | 111 => array( |
| 1614 | + 'in' => array( 1, 62 ), |
| 1615 | + 'leftsquare' => array( 0, 58 ), |
| 1616 | + ), |
| 1617 | + 112 => array( |
| 1618 | + 'rightbracket' => array( 0, 116 ), |
| 1619 | + 'leftsquare' => array( 0, 58 ), |
| 1620 | + ), |
| 1621 | + 113 => array( |
1542 | 1622 | 'semicolon' => array( 1, 12 ), |
1543 | 1623 | 'rightbracket' => array( 1, 12 ), |
1544 | 1624 | 'colon' => array( 1, 12 ), |
1545 | 1625 | 'rightsquare' => array( 1, 12 ), |
1546 | 1626 | 'comma' => array( 1, 12 ), |
| 1627 | + 'rightcurly' => array( 1, 12 ), |
1547 | 1628 | ), |
1548 | | - 112 => array( |
| 1629 | + 114 => array( |
1549 | 1630 | 'if' => array( 0, 1 ), |
1550 | 1631 | 'for' => array( 0, 3 ), |
1551 | 1632 | 'try' => array( 0, 4 ), |
— | — | @@ -1565,7 +1646,7 @@ |
1566 | 1647 | 'false' => array( 0, 18 ), |
1567 | 1648 | 'null' => array( 0, 19 ), |
1568 | 1649 | ), |
1569 | | - 113 => array( |
| 1650 | + 115 => array( |
1570 | 1651 | 'if' => array( 0, 1 ), |
1571 | 1652 | 'for' => array( 0, 3 ), |
1572 | 1653 | 'try' => array( 0, 4 ), |
— | — | @@ -1586,7 +1667,7 @@ |
1587 | 1668 | 'false' => array( 0, 18 ), |
1588 | 1669 | 'null' => array( 0, 19 ), |
1589 | 1670 | ), |
1590 | | - 114 => array( |
| 1671 | + 116 => array( |
1591 | 1672 | 'if' => array( 0, 1 ), |
1592 | 1673 | 'for' => array( 0, 3 ), |
1593 | 1674 | 'try' => array( 0, 4 ), |
— | — | @@ -1607,7 +1688,7 @@ |
1608 | 1689 | 'false' => array( 0, 18 ), |
1609 | 1690 | 'null' => array( 0, 19 ), |
1610 | 1691 | ), |
1611 | | - 115 => array( |
| 1692 | + 117 => array( |
1612 | 1693 | '$' => array( 1, 5 ), |
1613 | 1694 | 'if' => array( 1, 5 ), |
1614 | 1695 | 'for' => array( 1, 5 ), |
— | — | @@ -1632,7 +1713,7 @@ |
1633 | 1714 | 'catch' => array( 1, 5 ), |
1634 | 1715 | 'rightcurly' => array( 1, 5 ), |
1635 | 1716 | ), |
1636 | | - 116 => array( |
| 1717 | + 118 => array( |
1637 | 1718 | '$' => array( 1, 6 ), |
1638 | 1719 | 'if' => array( 1, 6 ), |
1639 | 1720 | 'for' => array( 1, 6 ), |
— | — | @@ -1657,7 +1738,7 @@ |
1658 | 1739 | 'catch' => array( 1, 6 ), |
1659 | 1740 | 'rightcurly' => array( 1, 6 ), |
1660 | 1741 | ), |
1661 | | - 117 => array( |
| 1742 | + 119 => array( |
1662 | 1743 | '$' => array( 1, 7 ), |
1663 | 1744 | 'if' => array( 1, 7 ), |
1664 | 1745 | 'for' => array( 1, 7 ), |
— | — | @@ -1685,18 +1766,18 @@ |
1686 | 1767 | ); |
1687 | 1768 | |
1688 | 1769 | static $goto = array( |
1689 | | - 0 => array( 1 => 20, 2 => 21, 3 => 22, 5 => 24, 4 => 23, 6 => 25, 7 => 26, 8 => 27, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 20 => 38 ), |
| 1770 | + 0 => array( 1 => 20, 2 => 21, 3 => 22, 6 => 24, 5 => 23, 7 => 25, 8 => 26, 9 => 27, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 21 => 38 ), |
1690 | 1771 | 1 => array(), |
1691 | | - 2 => array( 3 => 40, 5 => 24, 4 => 23, 6 => 25, 7 => 26, 8 => 27, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 20 => 38 ), |
| 1772 | + 2 => array( 3 => 41, 6 => 24, 5 => 23, 7 => 25, 8 => 26, 9 => 27, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 21 => 38 ), |
1692 | 1773 | 3 => array(), |
1693 | | - 4 => array( 2 => 42, 3 => 22, 5 => 24, 4 => 23, 6 => 25, 7 => 26, 8 => 27, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 20 => 38 ), |
1694 | | - 5 => array( 1 => 43, 2 => 21, 3 => 22, 5 => 24, 4 => 23, 6 => 25, 7 => 26, 8 => 27, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 20 => 38 ), |
1695 | | - 6 => array( 16 => 46, 18 => 36, 19 => 37, 4 => 45, 20 => 38 ), |
1696 | | - 7 => array( 14 => 47, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 4 => 45, 20 => 38 ), |
1697 | | - 8 => array( 24 => 50, 25 => 51 ), |
| 1774 | + 4 => array( 2 => 43, 3 => 22, 6 => 24, 5 => 23, 7 => 25, 8 => 26, 9 => 27, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 21 => 38 ), |
| 1775 | + 5 => array( 1 => 44, 22 => 46, 2 => 21, 23 => 47, 3 => 45, 6 => 24, 5 => 23, 7 => 25, 8 => 26, 9 => 27, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 21 => 38 ), |
| 1776 | + 6 => array( 17 => 50, 19 => 36, 20 => 37, 5 => 49, 21 => 38 ), |
| 1777 | + 7 => array( 15 => 51, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 5 => 49, 21 => 38 ), |
| 1778 | + 8 => array(), |
1698 | 1779 | 9 => array(), |
1699 | 1780 | 10 => array(), |
1700 | | - 11 => array( 21 => 54, 22 => 55, 17 => 53, 23 => 56, 3 => 52, 5 => 24, 4 => 23, 6 => 25, 7 => 26, 8 => 27, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 20 => 38 ), |
| 1781 | + 11 => array( 18 => 54, 3 => 53, 6 => 24, 5 => 23, 7 => 25, 8 => 26, 9 => 27, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 21 => 38 ), |
1701 | 1782 | 12 => array(), |
1702 | 1783 | 13 => array(), |
1703 | 1784 | 14 => array(), |
— | — | @@ -1705,10 +1786,10 @@ |
1706 | 1787 | 17 => array(), |
1707 | 1788 | 18 => array(), |
1708 | 1789 | 19 => array(), |
1709 | | - 20 => array( 2 => 57, 3 => 22, 5 => 24, 4 => 23, 6 => 25, 7 => 26, 8 => 27, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 20 => 38 ), |
| 1790 | + 20 => array( 2 => 55, 3 => 22, 6 => 24, 5 => 23, 7 => 25, 8 => 26, 9 => 27, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 21 => 38 ), |
1710 | 1791 | 21 => array(), |
1711 | 1792 | 22 => array(), |
1712 | | - 23 => array(), |
| 1793 | + 23 => array( 24 => 59 ), |
1713 | 1794 | 24 => array(), |
1714 | 1795 | 25 => array(), |
1715 | 1796 | 26 => array(), |
— | — | @@ -1724,53 +1805,53 @@ |
1725 | 1806 | 36 => array(), |
1726 | 1807 | 37 => array(), |
1727 | 1808 | 38 => array(), |
1728 | | - 39 => array( 3 => 70, 5 => 24, 4 => 23, 6 => 25, 7 => 26, 8 => 27, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 20 => 38 ), |
1729 | | - 40 => array(), |
1730 | | - 41 => array( 4 => 73 ), |
1731 | | - 42 => array(), |
1732 | | - 43 => array( 2 => 57, 3 => 22, 5 => 24, 4 => 23, 6 => 25, 7 => 26, 8 => 27, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 20 => 38 ), |
1733 | | - 44 => array( 24 => 50, 25 => 51 ), |
| 1809 | + 39 => array( 3 => 70, 6 => 24, 5 => 23, 7 => 25, 8 => 26, 9 => 27, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 21 => 38 ), |
| 1810 | + 40 => array( 22 => 46, 23 => 47, 3 => 71, 6 => 24, 5 => 23, 7 => 25, 8 => 26, 9 => 27, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 21 => 38 ), |
| 1811 | + 41 => array(), |
| 1812 | + 42 => array( 4 => 74, 5 => 75 ), |
| 1813 | + 43 => array(), |
| 1814 | + 44 => array( 2 => 55, 3 => 22, 6 => 24, 5 => 23, 7 => 25, 8 => 26, 9 => 27, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 21 => 38 ), |
1734 | 1815 | 45 => array(), |
1735 | 1816 | 46 => array(), |
1736 | 1817 | 47 => array(), |
1737 | | - 48 => array( 17 => 78, 3 => 77, 5 => 24, 4 => 23, 6 => 25, 7 => 26, 8 => 27, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 20 => 38 ), |
1738 | | - 49 => array( 3 => 80, 5 => 24, 4 => 23, 6 => 25, 7 => 26, 8 => 27, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 20 => 38 ), |
| 1818 | + 48 => array(), |
| 1819 | + 49 => array( 24 => 59 ), |
1739 | 1820 | 50 => array(), |
1740 | | - 51 => array( 24 => 81, 25 => 51 ), |
1741 | | - 52 => array(), |
| 1821 | + 51 => array(), |
| 1822 | + 52 => array( 18 => 82, 3 => 53, 6 => 24, 5 => 23, 7 => 25, 8 => 26, 9 => 27, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 21 => 38 ), |
1742 | 1823 | 53 => array(), |
1743 | 1824 | 54 => array(), |
1744 | 1825 | 55 => array(), |
1745 | 1826 | 56 => array(), |
1746 | | - 57 => array(), |
1747 | | - 58 => array(), |
1748 | | - 59 => array( 5 => 86, 4 => 23, 6 => 25, 7 => 26, 8 => 27, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 20 => 38 ), |
1749 | | - 60 => array( 6 => 87, 7 => 26, 8 => 27, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 4 => 45, 20 => 38 ), |
1750 | | - 61 => array( 8 => 88, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 4 => 45, 20 => 38 ), |
1751 | | - 62 => array( 9 => 89, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 4 => 45, 20 => 38 ), |
1752 | | - 63 => array( 10 => 90, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 4 => 45, 20 => 38 ), |
1753 | | - 64 => array( 11 => 91, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 4 => 45, 20 => 38 ), |
1754 | | - 65 => array( 12 => 92, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 4 => 45, 20 => 38 ), |
1755 | | - 66 => array( 12 => 93, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 4 => 45, 20 => 38 ), |
1756 | | - 67 => array( 15 => 94, 16 => 35, 18 => 36, 19 => 37, 4 => 45, 20 => 38 ), |
1757 | | - 68 => array( 15 => 95, 16 => 35, 18 => 36, 19 => 37, 4 => 45, 20 => 38 ), |
1758 | | - 69 => array( 4 => 96 ), |
| 1827 | + 57 => array( 6 => 85, 5 => 23, 7 => 25, 8 => 26, 9 => 27, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 21 => 38 ), |
| 1828 | + 58 => array( 3 => 87, 6 => 24, 5 => 23, 7 => 25, 8 => 26, 9 => 27, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 21 => 38 ), |
| 1829 | + 59 => array(), |
| 1830 | + 60 => array( 7 => 88, 8 => 26, 9 => 27, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 5 => 49, 21 => 38 ), |
| 1831 | + 61 => array( 9 => 89, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 5 => 49, 21 => 38 ), |
| 1832 | + 62 => array( 10 => 90, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 5 => 49, 21 => 38 ), |
| 1833 | + 63 => array( 11 => 91, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 5 => 49, 21 => 38 ), |
| 1834 | + 64 => array( 12 => 92, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 5 => 49, 21 => 38 ), |
| 1835 | + 65 => array( 13 => 93, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 5 => 49, 21 => 38 ), |
| 1836 | + 66 => array( 13 => 94, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 5 => 49, 21 => 38 ), |
| 1837 | + 67 => array( 16 => 95, 17 => 35, 19 => 36, 20 => 37, 5 => 49, 21 => 38 ), |
| 1838 | + 68 => array( 16 => 96, 17 => 35, 19 => 36, 20 => 37, 5 => 49, 21 => 38 ), |
| 1839 | + 69 => array( 5 => 97 ), |
1759 | 1840 | 70 => array(), |
1760 | 1841 | 71 => array(), |
1761 | | - 72 => array( 24 => 50, 25 => 51 ), |
| 1842 | + 72 => array(), |
1762 | 1843 | 73 => array(), |
1763 | 1844 | 74 => array(), |
1764 | | - 75 => array(), |
| 1845 | + 75 => array( 24 => 59 ), |
1765 | 1846 | 76 => array(), |
1766 | 1847 | 77 => array(), |
1767 | | - 78 => array(), |
| 1848 | + 78 => array( 3 => 102, 6 => 24, 5 => 23, 7 => 25, 8 => 26, 9 => 27, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 21 => 38 ), |
1768 | 1849 | 79 => array(), |
1769 | | - 80 => array(), |
| 1850 | + 80 => array( 23 => 103, 3 => 71, 6 => 24, 5 => 23, 7 => 25, 8 => 26, 9 => 27, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 21 => 38 ), |
1770 | 1851 | 81 => array(), |
1771 | | - 82 => array( 3 => 102, 5 => 24, 4 => 23, 6 => 25, 7 => 26, 8 => 27, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 20 => 38 ), |
1772 | | - 83 => array( 3 => 103, 5 => 24, 4 => 23, 6 => 25, 7 => 26, 8 => 27, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 20 => 38 ), |
1773 | | - 84 => array(), |
1774 | | - 85 => array( 23 => 105, 3 => 104, 5 => 24, 4 => 23, 6 => 25, 7 => 26, 8 => 27, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 20 => 38 ), |
| 1852 | + 82 => array(), |
| 1853 | + 83 => array(), |
| 1854 | + 84 => array( 3 => 105, 6 => 24, 5 => 23, 7 => 25, 8 => 26, 9 => 27, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 21 => 38 ), |
| 1855 | + 85 => array(), |
1775 | 1856 | 86 => array(), |
1776 | 1857 | 87 => array(), |
1777 | 1858 | 88 => array(), |
— | — | @@ -1782,27 +1863,29 @@ |
1783 | 1864 | 94 => array(), |
1784 | 1865 | 95 => array(), |
1785 | 1866 | 96 => array(), |
1786 | | - 97 => array( 2 => 108, 3 => 22, 5 => 24, 4 => 23, 6 => 25, 7 => 26, 8 => 27, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 20 => 38 ), |
1787 | | - 98 => array( 3 => 109, 5 => 24, 4 => 23, 6 => 25, 7 => 26, 8 => 27, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 20 => 38 ), |
1788 | | - 99 => array( 4 => 110 ), |
1789 | | - 100 => array(), |
1790 | | - 101 => array(), |
| 1867 | + 97 => array( 24 => 59 ), |
| 1868 | + 98 => array( 2 => 109, 3 => 22, 6 => 24, 5 => 23, 7 => 25, 8 => 26, 9 => 27, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 21 => 38 ), |
| 1869 | + 99 => array( 3 => 110, 6 => 24, 5 => 23, 7 => 25, 8 => 26, 9 => 27, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 21 => 38 ), |
| 1870 | + 100 => array( 5 => 111 ), |
| 1871 | + 101 => array( 5 => 112 ), |
1791 | 1872 | 102 => array(), |
1792 | 1873 | 103 => array(), |
1793 | 1874 | 104 => array(), |
1794 | 1875 | 105 => array(), |
1795 | | - 106 => array( 6 => 111, 7 => 26, 8 => 27, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 4 => 45, 20 => 38 ), |
1796 | | - 107 => array(), |
| 1876 | + 106 => array(), |
| 1877 | + 107 => array( 7 => 113, 8 => 26, 9 => 27, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 5 => 49, 21 => 38 ), |
1797 | 1878 | 108 => array(), |
1798 | 1879 | 109 => array(), |
1799 | 1880 | 110 => array(), |
1800 | | - 111 => array(), |
1801 | | - 112 => array( 2 => 115, 3 => 22, 5 => 24, 4 => 23, 6 => 25, 7 => 26, 8 => 27, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 20 => 38 ), |
1802 | | - 113 => array( 2 => 116, 3 => 22, 5 => 24, 4 => 23, 6 => 25, 7 => 26, 8 => 27, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 20 => 38 ), |
1803 | | - 114 => array( 2 => 117, 3 => 22, 5 => 24, 4 => 23, 6 => 25, 7 => 26, 8 => 27, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 18 => 36, 19 => 37, 20 => 38 ), |
1804 | | - 115 => array(), |
1805 | | - 116 => array(), |
| 1881 | + 111 => array( 24 => 59 ), |
| 1882 | + 112 => array( 24 => 59 ), |
| 1883 | + 113 => array(), |
| 1884 | + 114 => array( 2 => 117, 3 => 22, 6 => 24, 5 => 23, 7 => 25, 8 => 26, 9 => 27, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 21 => 38 ), |
| 1885 | + 115 => array( 2 => 118, 3 => 22, 6 => 24, 5 => 23, 7 => 25, 8 => 26, 9 => 27, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 21 => 38 ), |
| 1886 | + 116 => array( 2 => 119, 3 => 22, 6 => 24, 5 => 23, 7 => 25, 8 => 26, 9 => 27, 10 => 28, 11 => 29, 12 => 30, 13 => 31, 14 => 32, 15 => 33, 16 => 34, 17 => 35, 19 => 36, 20 => 37, 21 => 38 ), |
1806 | 1887 | 117 => array(), |
| 1888 | + 118 => array(), |
| 1889 | + 119 => array(), |
1807 | 1890 | ); |
1808 | 1891 | |
1809 | 1892 | } |
Index: trunk/extensions/InlineScripts/interpreter/Shared.php |
— | — | @@ -5,6 +5,9 @@ |
6 | 6 | * inline scripts interpreter. |
7 | 7 | */ |
8 | 8 | |
| 9 | +/** |
| 10 | + * This class represents a terminal of the script grammar. |
| 11 | + */ |
9 | 12 | class ISToken { |
10 | 13 | // Constant values should match ones in syntax.txt |
11 | 14 | const TEnd = '$'; |
— | — | @@ -60,6 +63,9 @@ |
61 | 64 | } |
62 | 65 | } |
63 | 66 | |
| 67 | +/** |
| 68 | + * This class represents a non-terminal of the script grammar. |
| 69 | + */ |
64 | 70 | class ISParserTreeNode { |
65 | 71 | var $mType, $mChildren; |
66 | 72 | |
— | — | @@ -68,14 +74,17 @@ |
69 | 75 | } |
70 | 76 | |
71 | 77 | public function addChild( $node ) { |
| 78 | + // Since we do not want a long chain of "exprSomething -> exprWhatever" in the parser tree, |
| 79 | + // we cut it out at the parsing stage |
72 | 80 | if( $node instanceof ISParserTreeNode ) { |
73 | | - $children = $node->getChildren(); |
| 81 | + $children = $node->getChildren(); |
74 | 82 | if( count( $children ) == 1 && strpos( $node->mType, "expr" ) === 0 |
75 | 83 | && strpos( @$children[0]->mType, "expr" ) === 0 ) { |
76 | 84 | $this->mChildren[] = $children[0]; |
77 | 85 | return; |
78 | 86 | } |
79 | 87 | } |
| 88 | + |
80 | 89 | $this->mChildren[] = $node; |
81 | 90 | } |
82 | 91 | |
— | — | @@ -150,7 +159,7 @@ |
151 | 160 | global $wgInlineScriptsParserClass; |
152 | 161 | $this->mTree = $tree; |
153 | 162 | $this->mTokensCount = $tokens; |
154 | | - $this->mVersion = constant( "$wgInlineScriptsParserClass::Version" ); |
| 163 | + $this->mVersion = $wgInlineScriptsParserClass::getVersion(); |
155 | 164 | } |
156 | 165 | |
157 | 166 | public function getParserTree() { |
— | — | @@ -159,7 +168,7 @@ |
160 | 169 | |
161 | 170 | public function isOutOfDate() { |
162 | 171 | global $wgInlineScriptsParserClass; |
163 | | - return constant( "$wgInlineScriptsParserClass::Version" ) > $this->mVersion; |
| 172 | + return $wgInlineScriptsParserClass::getVersion() > $this->mVersion; |
164 | 173 | } |
165 | 174 | |
166 | 175 | public function appendTokenCount( &$interpr ) { |
— | — | @@ -169,3 +178,6 @@ |
170 | 179 | throw new ISUserVisibleException( 'toomanytokens', 0 ); |
171 | 180 | } |
172 | 181 | } |
| 182 | + |
| 183 | +// Used by ISEvaluationContext::setVar |
| 184 | +class ISPlaceholder {} |
Index: trunk/extensions/InlineScripts/interpreter/buildLRTables.php |
— | — | @@ -61,9 +61,12 @@ |
62 | 62 | if( !$line ) |
63 | 63 | continue; |
64 | 64 | |
65 | | - list( $name, $vals ) = self::parseLine( $g, $line, $i ); |
66 | | - foreach( $vals as $val ) |
67 | | - $g->addProduction( $name, $val ); |
| 65 | + $namevalpailr = self::parseLine( $g, $line, $i ); |
| 66 | + if( $namevalpailr ) { |
| 67 | + list( $name, $vals ) = $namevalpailr; |
| 68 | + foreach( $vals as $val ) |
| 69 | + $g->addProduction( $name, $val ); |
| 70 | + } |
68 | 71 | } |
69 | 72 | foreach( $g->mProductions as $prod ) { |
70 | 73 | list( $ntid, $prod ) = $prod; |
— | — | @@ -81,6 +84,8 @@ |
82 | 85 | wfSuppressWarnings(); // @ doesn't help to supress "uninitialized string offset" warning |
83 | 86 | |
84 | 87 | self::skipWhitespace( $line, $i ); |
| 88 | + if( $line[$i] == '#' ) |
| 89 | + return null; |
85 | 90 | if( $line[$i] != '<' ) |
86 | 91 | die( "Invalid BNF at line $lnum" ); |
87 | 92 | $i++; |
— | — | @@ -486,7 +491,9 @@ |
487 | 492 | |
488 | 493 | class ISLRTable { |
489 | 494 | |
| 495 | +const Timestamp = '{$date}'; |
490 | 496 | |
| 497 | + |
491 | 498 | ENDOFHEADER; |
492 | 499 | |
493 | 500 | $s .= "static \$nonterminals = array(\n"; |
Index: trunk/extensions/InlineScripts/interpreterTests.txt |
— | — | @@ -377,3 +377,33 @@ |
378 | 378 | <p>2 |
379 | 379 | </p> |
380 | 380 | !! end |
| 381 | + |
| 382 | +!! test |
| 383 | +Associated arrays: basics |
| 384 | +!! input |
| 385 | +<wikiscript> |
| 386 | +a = { "a" : 2, "b" : 13 }; |
| 387 | +a["c"] = 21; |
| 388 | + |
| 389 | +for( k : v in a ) { |
| 390 | + out( k + " = " + v + "\n\n" ); |
| 391 | +} |
| 392 | +</wikiscript> |
| 393 | +!! result |
| 394 | +<p>a = 2 |
| 395 | +</p><p>b = 13 |
| 396 | +</p><p>c = 21 |
| 397 | +</p> |
| 398 | +!! end |
| 399 | + |
| 400 | +!! test |
| 401 | +Mixed arrays |
| 402 | +!! input |
| 403 | +<wikiscript> |
| 404 | +a["b"][][0][]["c"] = 11; |
| 405 | +out( a["b"][0][0][0]["c"] ); |
| 406 | +</wikiscript> |
| 407 | +!! result |
| 408 | +<p>11 |
| 409 | +</p> |
| 410 | +!! end |
Index: trunk/extensions/InlineScripts/InlineScripts.i18n.php |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | * @author Victor Vasiliev |
14 | 14 | */ |
15 | 15 | $messages['en'] = array( |
16 | | - 'inlinescripts-desc' => 'Provides a build into wikitext scripting language', |
| 16 | + 'inlinescriprs-desc' => 'Provides a build into wikitext scripting language', |
17 | 17 | |
18 | 18 | 'inlinescripts-exception-unexceptedtoken' => 'Unexpected token $1 at line $2: expected $3', |
19 | 19 | 'inlinescripts-exception-unclosedstring' => 'Unclosed string at char $1', |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | 'inlinescripts-exception-toomanytokens' => 'Exceeded tokens limit', |
22 | 22 | 'inlinescripts-exception-toomanyevals' => 'Exceeded evaluations limit', |
23 | 23 | 'inlinescripts-exception-recoverflow' => 'Too deep abstract syntax tree', |
24 | | - 'inlinescripts-exception-notanarray' => 'Tried to get an element of a non-array at line $1', |
| 24 | + 'inlinescripts-exception-notanarray' => 'Tried to get or set an element of a non-array at line $1', |
25 | 25 | 'inlinescripts-exception-outofbounds' => 'Got out of array bounds at line $1', |
26 | 26 | 'inlinescripts-exception-notenoughargs' => 'Not enough arguments for function at line $1', |
27 | 27 | 'inlinescripts-exception-dividebyzero' => 'Division by zero at line $1', |
— | — | @@ -29,6 +29,7 @@ |
30 | 30 | 'inlinescripts-exception-emptyidx' => 'Trying to get a value of an empty index at line $1', |
31 | 31 | 'inlinescripts-exception-unknownvar' => 'Trying to use an undeclared variable at line $1', |
32 | 32 | 'inlinescripts-exception-unknownfunction' => 'Trying to use an unnknown function at line $1', |
| 33 | + 'inlinescripts-exception-notlist' => 'Trying to append an element to the end of \'\'associated\'\' array at line $1', |
33 | 34 | ); |
34 | 35 | |
35 | 36 | // == Magic words == |
Index: trunk/extensions/InlineScripts/InlineScripts.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | |
35 | 35 | $dir = dirname(__FILE__) . '/'; |
36 | 36 | $wgExtensionMessagesFiles['InlineScripts'] = $dir . 'InlineScripts.i18n.php'; |
37 | | -$wgAutoloadClasses['InlineScriptInterpreter'] = $dir . 'interpreter/Interpreter.php'; |
| 37 | +$wgAutoloadClasses['ISInterpreter'] = $dir . 'interpreter/Interpreter.php'; |
38 | 38 | $wgAutoloadClasses['ISScanner'] = $dir . 'interpreter/Scanner.php'; |
39 | 39 | $wgAutoloadClasses['ISLRParser'] = $dir . 'interpreter/LRParser.php'; |
40 | 40 | $wgParserTestFiles[] = $dir . 'interpreterTests.txt'; |
— | — | @@ -61,6 +61,7 @@ |
62 | 62 | ); |
63 | 63 | |
64 | 64 | $wgInlineScriptsParserClass = 'ISLRParser'; |
| 65 | +$wgInlineScriptsUseCache = false; |
65 | 66 | |
66 | 67 | class InlineScriptsHooks { |
67 | 68 | static $scriptParser = null; |
— | — | @@ -128,7 +129,9 @@ |
129 | 130 | return "<strong class=\"error\">{$msg}</strong>"; |
130 | 131 | } |
131 | 132 | if( !(isset( $attribs['noparse'] ) && $attribs['noparse']) ) { |
| 133 | + wfProfileIn( __METHOD__ . '-replacevars' ); |
132 | 134 | $result = $parser->replaceVariables( $result, $frame ); |
| 135 | + wfProfileOut( __METHOD__ . '-replacevars' ); |
133 | 136 | } |
134 | 137 | wfProfileOut( __METHOD__ ); |
135 | 138 | return trim( $result ); |
— | — | @@ -156,7 +159,7 @@ |
157 | 160 | */ |
158 | 161 | public static function getInterpreter() { |
159 | 162 | if( !self::$scriptParser ) { |
160 | | - self::$scriptParser = new InlineScriptInterpreter(); |
| 163 | + self::$scriptParser = new ISInterpreter(); |
161 | 164 | } |
162 | 165 | return self::$scriptParser; |
163 | 166 | } |