r94513 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94512‎ | r94513 | r94514 >
Date:13:52, 15 August 2011
Author:vasilievvv
Status:deferred
Tags:
Comment:
Finish renaming by renaming all references in code to WikiScripts
Modified paths:
  • /trunk/extensions/WikiScripts/Hooks.php (modified) (history)
  • /trunk/extensions/WikiScripts/LinksUpdate.php (modified) (history)
  • /trunk/extensions/WikiScripts/WikiScripts.php (modified) (history)
  • /trunk/extensions/WikiScripts/i18n/Messages.php (modified) (history)
  • /trunk/extensions/WikiScripts/interpreter/CallStack.php (modified) (history)
  • /trunk/extensions/WikiScripts/interpreter/Data.php (modified) (history)
  • /trunk/extensions/WikiScripts/interpreter/EvaluationContext.php (modified) (history)
  • /trunk/extensions/WikiScripts/interpreter/Interpreter.php (modified) (history)
  • /trunk/extensions/WikiScripts/interpreter/LRParser.php (modified) (history)
  • /trunk/extensions/WikiScripts/interpreter/LRTable.php (modified) (history)
  • /trunk/extensions/WikiScripts/interpreter/LRTableVersion.php (modified) (history)
  • /trunk/extensions/WikiScripts/interpreter/Scanner.php (modified) (history)
  • /trunk/extensions/WikiScripts/interpreter/Shared.php (modified) (history)
  • /trunk/extensions/WikiScripts/interpreter/buildLRTables.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikiScripts/i18n/Messages.php
@@ -1,6 +1,6 @@
22 <?php
33 /**
4 - * Internationalisation file for extension InlineScripts.
 4+ * Internationalisation file for extension WikiScripts.
55 *
66 * @file
77 * @ingroup Extensions
@@ -12,43 +12,43 @@
1313 * @author Victor Vasiliev
1414 */
1515 $messages['en'] = array(
16 - 'inlinescripts-desc' => 'Provides a build into wikitext scripting language',
 16+ 'wikiscripts-desc' => 'Provides a build into wikitext scripting language',
1717
18 - 'inlinescripts-call-frommodule' => '$1::$2 called by $3::$4 at line $5',
19 - 'inlinescripts-call-fromwikitext' => '$1::$2 called by wikitext',
20 - 'inlinescripts-call-parse' => 'parse( "$1" )',
 18+ 'wikiscripts-call-frommodule' => '$1::$2 called by $3::$4 at line $5',
 19+ 'wikiscripts-call-fromwikitext' => '$1::$2 called by wikitext',
 20+ 'wikiscripts-call-parse' => 'parse( "$1" )',
2121
22 - 'inlinescripts-error' => 'Following parsing {{plural:$1|error|errors}} detected:',
23 - 'inlinescripts-codelocation' => 'in module $1 at line $2',
 22+ 'wikiscripts-error' => 'Following parsing {{plural:$1|error|errors}} detected:',
 23+ 'wikiscripts-codelocation' => 'in module $1 at line $2',
2424
25 - 'inlinescripts-exception-unexceptedtoken' => 'Unexpected token $2 $1: expected $3 (parser state $4)',
26 - 'inlinescripts-exception-unclosedstring' => 'Unclosed string $1',
27 - 'inlinescripts-exception-unrecognisedtoken' => 'Unrecognized token $1',
28 - 'inlinescripts-exception-toomanytokens' => 'Exceeded tokens limit',
29 - 'inlinescripts-exception-toomanyevals' => 'Exceeded evaluations limit $1',
30 - 'inlinescripts-exception-recoverflow' => 'Too deep abstract syntax tree',
31 - 'inlinescripts-exception-notanarray' => 'Tried to get or set an element of a non-array $1',
32 - 'inlinescripts-exception-outofbounds' => 'Got out of array bounds $1',
33 - 'inlinescripts-exception-notenoughargs' => 'Not enough arguments for function $1',
34 - 'inlinescripts-exception-dividebyzero' => 'Division by zero $1',
35 - 'inlinescripts-exception-break' => '"break" called outside of foreach $1',
36 - 'inlinescripts-exception-continue' => '"continue" called outside of foreach $1',
37 - 'inlinescripts-exception-emptyidx' => 'Trying to get a value of an empty index $1',
38 - 'inlinescripts-exception-unknownvar' => 'Trying to use an undeclared variable $1',
39 - 'inlinescripts-exception-unknownfunction' => 'Trying to use an unnknown function $2 $1',
40 - 'inlinescripts-exception-notlist' => 'Trying to append an element to the end of \'\'associated\'\' array $1',
41 - 'inlinescripts-exception-appendyield' => 'Trying to use append and yield in the same function $1',
 25+ 'wikiscripts-exception-unexceptedtoken' => 'Unexpected token $2 $1: expected $3 (parser state $4)',
 26+ 'wikiscripts-exception-unclosedstring' => 'Unclosed string $1',
 27+ 'wikiscripts-exception-unrecognisedtoken' => 'Unrecognized token $1',
 28+ 'wikiscripts-exception-toomanytokens' => 'Exceeded tokens limit',
 29+ 'wikiscripts-exception-toomanyevals' => 'Exceeded evaluations limit $1',
 30+ 'wikiscripts-exception-recoverflow' => 'Too deep abstract syntax tree',
 31+ 'wikiscripts-exception-notanarray' => 'Tried to get or set an element of a non-array $1',
 32+ 'wikiscripts-exception-outofbounds' => 'Got out of array bounds $1',
 33+ 'wikiscripts-exception-notenoughargs' => 'Not enough arguments for function $1',
 34+ 'wikiscripts-exception-dividebyzero' => 'Division by zero $1',
 35+ 'wikiscripts-exception-break' => '"break" called outside of foreach $1',
 36+ 'wikiscripts-exception-continue' => '"continue" called outside of foreach $1',
 37+ 'wikiscripts-exception-emptyidx' => 'Trying to get a value of an empty index $1',
 38+ 'wikiscripts-exception-unknownvar' => 'Trying to use an undeclared variable $1',
 39+ 'wikiscripts-exception-unknownfunction' => 'Trying to use an unnknown function $2 $1',
 40+ 'wikiscripts-exception-notlist' => 'Trying to append an element to the end of \'\'associated\'\' array $1',
 41+ 'wikiscripts-exception-appendyield' => 'Trying to use append and yield in the same function $1',
4242
43 - 'inlinescripts-exception-notenoughargs-user' => 'Not enough arguments for function $2::$3 $1',
44 - 'inlinescripts-exception-nonexistent-module' => 'Call to non-existent module $2 $1',
45 - 'inlinescripts-exception-unknownfunction-user' => 'Trying to use an unnknown user function $2::$3 $1',
46 - 'inlinescripts-exception-recursion' => 'Function loop detected when calling function $2::$3 $1',
47 - 'inlinescripts-exception-toodeeprecursion' => 'The maximum function nesting limit of $2 exceeded $1',
 43+ 'wikiscripts-exception-notenoughargs-user' => 'Not enough arguments for function $2::$3 $1',
 44+ 'wikiscripts-exception-nonexistent-module' => 'Call to non-existent module $2 $1',
 45+ 'wikiscripts-exception-unknownfunction-user' => 'Trying to use an unnknown user function $2::$3 $1',
 46+ 'wikiscripts-exception-recursion' => 'Function loop detected when calling function $2::$3 $1',
 47+ 'wikiscripts-exception-toodeeprecursion' => 'The maximum function nesting limit of $2 exceeded $1',
4848
49 - 'inlinescripts-transerror-notenoughargs-user' => 'Not enough arguments for function $1::$2',
50 - 'inlinescripts-transerror-nonexistent-module' => 'Call to non-existent module $1',
51 - 'inlinescripts-transerror-unknownfunction-user' => 'Trying to use an unnknown user function $1::$2',
52 - 'inlinescripts-transerror-recursion' => 'Function loop detected when calling function $1::$2',
53 - 'inlinescripts-transerror-nofunction' => 'Missing function name when invoking the script',
54 - 'inlinescripts-transerror-toodeeprecursion' => 'The maximum function nesting limit of $1 exceeded',
 49+ 'wikiscripts-transerror-notenoughargs-user' => 'Not enough arguments for function $1::$2',
 50+ 'wikiscripts-transerror-nonexistent-module' => 'Call to non-existent module $1',
 51+ 'wikiscripts-transerror-unknownfunction-user' => 'Trying to use an unnknown user function $1::$2',
 52+ 'wikiscripts-transerror-recursion' => 'Function loop detected when calling function $1::$2',
 53+ 'wikiscripts-transerror-nofunction' => 'Missing function name when invoking the script',
 54+ 'wikiscripts-transerror-toodeeprecursion' => 'The maximum function nesting limit of $1 exceeded',
5555 );
Index: trunk/extensions/WikiScripts/WikiScripts.php
@@ -23,42 +23,42 @@
2424 if( !defined( 'MEDIAWIKI' ) )
2525 die();
2626
27 -$wgExtensionCredits['parserhook']['InlineScripts'] = array(
 27+$wgExtensionCredits['parserhook']['WikiScripts'] = array(
2828 'path' => __FILE__,
29 - 'name' => 'InlineScripts',
 29+ 'name' => 'WikiScripts',
3030 'author' => 'Victor Vasiliev',
31 - 'descriptionmsg' => 'inlinescripts-desc',
32 - 'url' => 'http://www.mediawiki.org/wiki/Extension:InlineScripts',
 31+ 'descriptionmsg' => 'wikiscripts-desc',
 32+ 'url' => 'http://www.mediawiki.org/wiki/Extension:WikiScripts',
3333 );
3434
3535 $dir = dirname(__FILE__) . '/';
36 -$wgExtensionMessagesFiles['InlineScripts'] = $dir . 'i18n/Messages.php';
37 -$wgExtensionMessagesFiles['InlineScriptsMagic'] = $dir . 'i18n/Magic.php';
38 -$wgExtensionMessagesFiles['InlineScriptsNamespaces'] = $dir . 'i18n/Namespaces.php';
 36+$wgExtensionMessagesFiles['WikiScripts'] = $dir . 'i18n/Messages.php';
 37+$wgExtensionMessagesFiles['WikiScriptsMagic'] = $dir . 'i18n/Magic.php';
 38+$wgExtensionMessagesFiles['WikiScriptsNamespaces'] = $dir . 'i18n/Namespaces.php';
3939
40 -$wgAutoloadClasses['ISHooks'] = $dir . '/Hooks.php';
41 -$wgAutoloadClasses['ISLinksUpdateHooks'] = $dir . '/LinksUpdate.php';
 40+$wgAutoloadClasses['WSHooks'] = $dir . '/Hooks.php';
 41+$wgAutoloadClasses['WSLinksUpdateHooks'] = $dir . '/LinksUpdate.php';
4242
43 -$wgAutoloadClasses['ISInterpreter'] = $dir . 'interpreter/Interpreter.php';
44 -$wgAutoloadClasses['ISScanner'] = $dir . 'interpreter/Scanner.php';
45 -$wgAutoloadClasses['ISLRParser'] = $dir . 'interpreter/LRParser.php';
 43+$wgAutoloadClasses['WSInterpreter'] = $dir . 'interpreter/Interpreter.php';
 44+$wgAutoloadClasses['WSScanner'] = $dir . 'interpreter/Scanner.php';
 45+$wgAutoloadClasses['WSLRParser'] = $dir . 'interpreter/LRParser.php';
4646
4747 $wgParserTestFiles[] = $dir . 'interpreterTests.txt';
48 -$wgHooks['ParserFirstCallInit'][] = 'ISHooks::setupParserHook';
49 -$wgHooks['ParserLimitReport'][] = 'ISHooks::reportLimits';
50 -$wgHooks['ParserClearState'][] = 'ISHooks::clearState';
51 -$wgHooks['ParserTestTables'][] = 'ISHooks::addTestTables';
 48+$wgHooks['ParserFirstCallInit'][] = 'WSHooks::setupParserHook';
 49+$wgHooks['ParserLimitReport'][] = 'WSHooks::reportLimits';
 50+$wgHooks['ParserClearState'][] = 'WSHooks::clearState';
 51+$wgHooks['ParserTestTables'][] = 'WSHooks::addTestTables';
5252
53 -$wgHooks['CanonicalNamespaces'][] = 'ISHooks::addCanonicalNamespaces';
54 -$wgHooks['ArticleViewCustom'][] = 'ISHooks::handleScriptView';
55 -$wgHooks['TitleIsWikitextPage'][] = 'ISHooks::isWikitextPage';
56 -$wgHooks['EditFilter'][] = 'ISHooks::validateScript';
 53+$wgHooks['CanonicalNamespaces'][] = 'WSHooks::addCanonicalNamespaces';
 54+$wgHooks['ArticleViewCustom'][] = 'WSHooks::handleScriptView';
 55+$wgHooks['TitleIsWikitextPage'][] = 'WSHooks::isWikitextPage';
 56+$wgHooks['EditFilter'][] = 'WSHooks::validateScript';
5757
58 -$wgHooks['LinksUpdate'][] = 'ISLinksUpdateHooks::updateLinks';
59 -$wgHooks['ArticleEditUpdates'][] = 'ISLinksUpdateHooks::purgeCache';
60 -$wgHooks['ParserAfterTidy'][] = 'ISLinksUpdateHooks::appendToOutput';
61 -$wgHooks['BacklinkCacheGetPrefix'][] = 'ISLinksUpdateHooks::getBacklinkCachePrefix';
62 -$wgHooks['BacklinkCacheGetConditions'][] = 'ISLinksUpdateHooks::getBacklinkCacheConditions';
 58+$wgHooks['LinksUpdate'][] = 'WSLinksUpdateHooks::updateLinks';
 59+$wgHooks['ArticleEditUpdates'][] = 'WSLinksUpdateHooks::purgeCache';
 60+$wgHooks['ParserAfterTidy'][] = 'WSLinksUpdateHooks::appendToOutput';
 61+$wgHooks['BacklinkCacheGetPrefix'][] = 'WSLinksUpdateHooks::getBacklinkCachePrefix';
 62+$wgHooks['BacklinkCacheGetConditions'][] = 'WSLinksUpdateHooks::getBacklinkCacheConditions';
6363
6464 /** Configuration */
6565
@@ -76,7 +76,7 @@
7777 /**
7878 * Different limits of the scripts.
7979 */
80 -$wgInlineScriptsLimits = array(
 80+$wgScriptsLimits = array(
8181 /**
8282 * Maximal amount of tokens (strings, keywords, numbers, operators,
8383 * but not whitespace) in a single module to be parsed.
@@ -101,30 +101,30 @@
102102 * Turn on to true if you have linked or copied wikiscripts.php and
103103 * SyntaxHighlight_GeSHi extension is enabled.
104104 */
105 -$wgInlineScriptsUseGeSHi = false;
 105+$wgScriptsUseGeSHi = false;
106106
107107 /**
108 - * Class of the actual parser. Must implement ISParser interface, as well as
 108+ * Class of the actual parser. Must implement WSParser interface, as well as
109109 * static getVersion() method.
110110 */
111 -$wgInlineScriptsParserClass = 'ISLRParser';
 111+$wgScriptsParserClass = 'WSLRParser';
112112
113113 /**
114114 * Should be enabled unless you are debugging or just have sado-masochistic
115115 * attitude towards your server.
116116 */
117 -$wgInlineScriptsUseCache = true;
 117+$wgScriptsUseCache = true;
118118
119119 /**
120120 * Indicates whether the function recursion is enabled. If it is, then users may
121121 * build a Turing-complete machinge and do nice things like parsers, etc in wikitext!
122122 */
123 -$wgInlineScriptsAllowRecursion = false;
 123+$wgScriptsAllowRecursion = false;
124124
125125 /**
126126 * Maximun call stack depth. Includes functions and invokations of parse() function.
127127 */
128 -$wgInlineScriptsMaxCallStackDepth = 25;
 128+$wgScriptsMaxCallStackDepth = 25;
129129
130130 define( 'NS_MODULE', $wgScriptsNamespaceNumbers['Module'] );
131131 define( 'NS_MODULE_TALK', $wgScriptsNamespaceNumbers['Module_talk'] );
Index: trunk/extensions/WikiScripts/interpreter/Data.php
@@ -27,7 +27,7 @@
2828 /**
2929 * Class implementing data in the scripts.
3030 */
31 -class ISData {
 31+class WSData {
3232 // Data types
3333 const DInt = 'int';
3434 const DString = 'string';
@@ -47,82 +47,82 @@
4848
4949 public static function newFromPHPVar( $var ) {
5050 if( is_string( $var ) )
51 - return new ISData( self::DString, $var );
 51+ return new WSData( self::DString, $var );
5252 elseif( is_int( $var ) )
53 - return new ISData( self::DInt, $var );
 53+ return new WSData( self::DInt, $var );
5454 elseif( is_float( $var ) )
55 - return new ISData( self::DFloat, $var );
 55+ return new WSData( self::DFloat, $var );
5656 elseif( is_bool( $var ) )
57 - return new ISData( self::DBool, $var );
 57+ return new WSData( self::DBool, $var );
5858 elseif( is_array( $var ) ) {
5959 if( !$var )
60 - return new ISData( self::DList, array() );
 60+ return new WSData( self::DList, array() );
6161 $result = array();
6262 foreach( $var as $item )
6363 $result[] = self::newFromPHPVar( $item );
64 - return new ISData( self::DList, $result );
 64+ return new WSData( self::DList, $result );
6565 }
6666 elseif( is_null( $var ) )
67 - return new ISData();
 67+ return new WSData();
6868 else
69 - throw new ISException(
70 - "Data type " . gettype( $var ) . " is not supported by InlineScrtips" );
 69+ throw new WSException(
 70+ "Data type " . gettype( $var ) . " is not supported by WikiScrtips" );
7171 }
7272
7373 public function dup() {
74 - return new ISData( $this->type, $this->data );
 74+ return new WSData( $this->type, $this->data );
7575 }
7676
7777 public static function castTypes( $orig, $target ) {
7878 if( $orig->type == $target )
7979 return $orig->dup();
8080 if( $target == self::DNull ) {
81 - return new ISData();
 81+ return new WSData();
8282 }
8383
8484 if( $orig->isArray() ) {
8585 if( $target == self::DBool )
86 - return new ISData( self::DBool, (bool)count( $orig->data ) );
 86+ return new WSData( self::DBool, (bool)count( $orig->data ) );
8787 if( $target == self::DFloat ) {
88 - return new ISData( self::DFloat, doubleval( count( $orig->data ) ) );
 88+ return new WSData( self::DFloat, doubleval( count( $orig->data ) ) );
8989 }
9090 if( $target == self::DInt ) {
91 - return new ISData( self::DInt, intval( count( $orig->data ) ) );
 91+ return new WSData( self::DInt, intval( count( $orig->data ) ) );
9292 }
9393 if( $target == self::DString ) {
9494 $s = array();
9595 foreach( $orig->data as $item )
9696 $s[] = $item->toString();
97 - return new ISData( self::DString, implode( "\n", $s ) );
 97+ return new WSData( self::DString, implode( "\n", $s ) );
9898 }
9999 }
100100
101101 if( $target == self::DBool ) {
102 - return new ISData( self::DBool, (bool)$orig->data );
 102+ return new WSData( self::DBool, (bool)$orig->data );
103103 }
104104 if( $target == self::DFloat ) {
105 - return new ISData( self::DFloat, doubleval( $orig->data ) );
 105+ return new WSData( self::DFloat, doubleval( $orig->data ) );
106106 }
107107 if( $target == self::DInt ) {
108 - return new ISData( self::DInt, intval( $orig->data ) );
 108+ return new WSData( self::DInt, intval( $orig->data ) );
109109 }
110110 if( $target == self::DString ) {
111 - return new ISData( self::DString, strval( $orig->data ) );
 111+ return new WSData( self::DString, strval( $orig->data ) );
112112 }
113113 if( $target == self::DList ) {
114 - return new ISData( self::DList, array( $orig ) );
 114+ return new WSData( self::DList, array( $orig ) );
115115 }
116116 }
117117
118118 public static function boolInvert( $value ) {
119 - return new ISData( self::DBool, !$value->toBool() );
 119+ return new WSData( self::DBool, !$value->toBool() );
120120 }
121121
122122 public static function pow( $base, $exponent ) {
123123 if( $base->type == self::DInt && $exponent->type == self::DInt )
124 - return new ISData( self::DInt, pow( $base->toInt(), $exponent->toInt() ) );
 124+ return new WSData( self::DInt, pow( $base->toInt(), $exponent->toInt() ) );
125125 else
126 - return new ISData( self::DFloat, pow( $base->toFloat(), $exponent->toFloat() ) );
 126+ return new WSData( self::DFloat, pow( $base->toFloat(), $exponent->toFloat() ) );
127127 }
128128
129129 // Checks whether a is in b
@@ -130,18 +130,18 @@
131131 if( $b->isArray() ) {
132132 foreach( $b->data as $elem ) {
133133 if( self::equals( $elem, $a ) )
134 - return new ISData( self::DBool, true );
 134+ return new WSData( self::DBool, true );
135135 }
136 - return new ISData( self::DBool, false );
 136+ return new WSData( self::DBool, false );
137137 } else {
138138 $a = $a->toString();
139139 $b = $b->toString();
140140
141141 if( $a == '' || $b == '' ) {
142 - return new ISData( self::DBool, false );
 142+ return new WSData( self::DBool, false );
143143 }
144144
145 - return new ISData( self::DBool, in_string( $a, $b ) );
 145+ return new WSData( self::DBool, in_string( $a, $b ) );
146146 }
147147 }
148148
@@ -151,32 +151,32 @@
152152
153153 public static function unaryMinus( $data ) {
154154 if( $data->type == self::DInt ) {
155 - return new ISData( $data->type, -$data->toInt() );
 155+ return new WSData( $data->type, -$data->toInt() );
156156 } else {
157 - return new ISData( $data->type, -$data->toFloat() );
 157+ return new WSData( $data->type, -$data->toFloat() );
158158 }
159159 }
160160
161161 public static function compareOp( $a, $b, $op ) {
162162 if( $op == '==' )
163 - return new ISData( self::DBool, self::equals( $a, $b ) );
 163+ return new WSData( self::DBool, self::equals( $a, $b ) );
164164 if( $op == '!=' )
165 - return new ISData( self::DBool, !self::equals( $a, $b ) );
 165+ return new WSData( self::DBool, !self::equals( $a, $b ) );
166166 if( $op == '===' )
167 - return new ISData( self::DBool, $a->type == $b->type && self::equals( $a, $b ) );
 167+ return new WSData( self::DBool, $a->type == $b->type && self::equals( $a, $b ) );
168168 if( $op == '!==' )
169 - return new ISData( self::DBool, $a->type != $b->type || !self::equals( $a, $b ) );
 169+ return new WSData( self::DBool, $a->type != $b->type || !self::equals( $a, $b ) );
170170 $a = $a->toString();
171171 $b = $b->toString();
172172 if( $op == '>' )
173 - return new ISData( self::DBool, $a > $b );
 173+ return new WSData( self::DBool, $a > $b );
174174 if( $op == '<' )
175 - return new ISData( self::DBool, $a < $b );
 175+ return new WSData( self::DBool, $a < $b );
176176 if( $op == '>=' )
177 - return new ISData( self::DBool, $a >= $b );
 177+ return new WSData( self::DBool, $a >= $b );
178178 if( $op == '<=' )
179 - return new ISData( self::DBool, $a <= $b );
180 - throw new ISException( "Invalid comparison operation: {$op}" ); // Should never happen
 179+ return new WSData( self::DBool, $a <= $b );
 180+ throw new WSException( "Invalid comparison operation: {$op}" ); // Should never happen
181181 }
182182
183183 public static function mulRel( $a, $b, $op, $module, $pos ) {
@@ -193,7 +193,7 @@
194194 }
195195
196196 if( $op != '*' && $b == 0 ) {
197 - throw new ISUserVisibleException( 'dividebyzero', $module, $pos, array($a) );
 197+ throw new WSUserVisibleException( 'dividebyzero', $module, $pos, array($a) );
198198 }
199199
200200 $data = null;
@@ -204,36 +204,36 @@
205205 elseif( $op == '%' )
206206 $data = $a % $b;
207207 else
208 - throw new ISException( "Invalid multiplication-related operation: {$op}" ); // Should never happen
 208+ throw new WSException( "Invalid multiplication-related operation: {$op}" ); // Should never happen
209209
210210 if( $type == self::DInt )
211211 $data = intval( $data );
212212 else
213213 $data = doubleval( $data );
214214
215 - return new ISData( $type, $data );
 215+ return new WSData( $type, $data );
216216 }
217217
218218 public static function sum( $a, $b ) {
219219 if( $a->type == self::DString || $b->type == self::DString )
220 - return new ISData( self::DString, $a->toString() . $b->toString() );
 220+ return new WSData( self::DString, $a->toString() . $b->toString() );
221221 elseif( $a->type == self::DList && $b->type == self::DList )
222 - return new ISData( self::DList, array_merge( $a->toList(), $b->toList() ) );
 222+ return new WSData( self::DList, array_merge( $a->toList(), $b->toList() ) );
223223 elseif( $a->type == self::DList )
224 - return new ISData( self::DList, array_merge( $a->toList(), array( $b ) ) );
 224+ return new WSData( self::DList, array_merge( $a->toList(), array( $b ) ) );
225225 elseif( $a->type == self::DAssoc && $b->type == self::DAssoc )
226 - return new ISData( self::DAssoc, array_merge( $a->toAssoc(), $b->toAssoc() ) );
 226+ return new WSData( self::DAssoc, array_merge( $a->toAssoc(), $b->toAssoc() ) );
227227 elseif( $a->type == self::DInt && $b->type == self::DInt )
228 - return new ISData( self::DInt, $a->toInt() + $b->toInt() );
 228+ return new WSData( self::DInt, $a->toInt() + $b->toInt() );
229229 else
230 - return new ISData( self::DFloat, $a->toFloat() + $b->toFloat() );
 230+ return new WSData( self::DFloat, $a->toFloat() + $b->toFloat() );
231231 }
232232
233233 public static function sub( $a, $b ) {
234234 if( $a->type == self::DInt && $b->type == self::DInt )
235 - return new ISData( self::DInt, $a->toInt() - $b->toInt() );
 235+ return new WSData( self::DInt, $a->toInt() - $b->toInt() );
236236 else
237 - return new ISData( self::DFloat, $a->toFloat() - $b->toFloat() );
 237+ return new WSData( self::DFloat, $a->toFloat() - $b->toFloat() );
238238 }
239239
240240 public function isArray() {
Index: trunk/extensions/WikiScripts/interpreter/Scanner.php
@@ -25,12 +25,12 @@
2626 die();
2727
2828 /**
29 - * Lexical analizator for inline scripts. Splits strings to tokens.
 29+ * Lexical analizator for scripts. Splits strings to tokens.
3030 */
3131
3232 require_once( 'Shared.php' );
3333
34 -class ISScanner implements Iterator {
 34+class WSScanner implements Iterator {
3535 var $mModule, $mCode, $mPos, $mCur, $mEof;
3636
3737 // Order is important. The punctuation-matching regex requires that
@@ -87,14 +87,14 @@
8888 }
8989
9090 private function move() {
91 - if( $this->mEof || ( $this->mCur && $this->mCur->type == ISToken::TEnd ) ) {
 91+ if( $this->mEof || ( $this->mCur && $this->mCur->type == WSToken::TEnd ) ) {
9292 $this->mEof = true;
9393 return $this->mCur = null;
9494 }
9595 list( $val, $type ) = $this->nextToken();
9696
9797 $lineno = count( explode( "\n", substr( $this->mCode, 0, $this->mPos ) ) );
98 - return $this->mCur = new ISToken( $type, $val, $lineno );
 98+ return $this->mCur = new WSToken( $type, $val, $lineno );
9999 }
100100
101101 private function nextToken() {
@@ -106,7 +106,7 @@
107107 $this->mPos += strlen($matches[0]);
108108
109109 if( $this->mPos >= strlen($this->mCode) )
110 - return array( null, ISToken::TEnd );
 110+ return array( null, WSToken::TEnd );
111111
112112 // Comments
113113 if ( substr($this->mCode, $this->mPos, 2) == '/*' ) {
@@ -117,7 +117,7 @@
118118 if( substr( $this->mCode, $this->mPos, 2 ) == '//' ) {
119119 $newlinePos = strpos( $this->mCode, "\n", $this->mPos );
120120 if( $newlinePos === false ) {
121 - return array( null, ISToken::TEnd );
 121+ return array( null, WSToken::TEnd );
122122 } else {
123123 $this->mPos = $newlinePos + 1;
124124 return self::nextToken();
@@ -132,7 +132,7 @@
133133 while( $this->mPos < $strLen ) {
134134 if( $this->mCode[$this->mPos] == $type ) {
135135 $this->mPos++;
136 - return array( $tok, ISToken::TString );
 136+ return array( $tok, WSToken::TString );
137137 }
138138
139139 // Performance: Use a PHP function (implemented in C)
@@ -178,7 +178,7 @@
179179 $this->mPos++;
180180 }
181181 }
182 - throw new ISUserVisibleException( 'unclosedstring', $this->mModule, $this->mPos, array() );
 182+ throw new WSUserVisibleException( 'unclosedstring', $this->mModule, $this->mPos, array() );
183183 }
184184
185185 // Find operators
@@ -252,8 +252,8 @@
253253 ? doubleval( $num )
254254 : intval( $num ),
255255 $float
256 - ? ISToken::TFloat
257 - : ISToken::TInt,
 256+ ? WSToken::TFloat
 257+ : WSToken::TInt,
258258 );
259259 }
260260 }
@@ -268,73 +268,73 @@
269269 $tok = $matches[0];
270270
271271 $type = in_array( $tok, self::$mKeywords )
272 - ? $tok : ISToken::TID;
 272+ ? $tok : WSToken::TID;
273273
274274 $this->mPos += strlen( $tok );
275275 return array( $tok, $type );
276276 }
277277
278 - throw new ISUserVisibleException(
 278+ throw new WSUserVisibleException(
279279 'unrecognisedtoken', $this->mModule, $this->mPos, array( substr( $this->mCode, $this->mPos ) ) );
280280 }
281281
282282 private static function getOperatorType( $op ) {
283283 switch( $op ) {
284284 case '::':
285 - return ISToken::TDoubleColon;
 285+ return WSToken::TDoubleColon;
286286 case ':':
287 - return ISToken::TColon;
 287+ return WSToken::TColon;
288288 case ',':
289 - return ISToken::TComma;
 289+ return WSToken::TComma;
290290 case '>':
291291 case '<':
292292 case '>=':
293293 case '<=':
294 - return ISToken::TCompareOperator;
 294+ return WSToken::TCompareOperator;
295295 case '==':
296296 case '!=':
297297 case '===':
298298 case '!==':
299 - return ISToken::TEqualsToOperator;
 299+ return WSToken::TEqualsToOperator;
300300 case '!':
301 - return ISToken::TBoolInvert;
 301+ return WSToken::TBoolInvert;
302302 case '(':
303 - return ISToken::TLeftBracket;
 303+ return WSToken::TLeftBracket;
304304 case '{':
305 - return ISToken::TLeftCurly;
 305+ return WSToken::TLeftCurly;
306306 case '[':
307 - return ISToken::TLeftSquare;
 307+ return WSToken::TLeftSquare;
308308 case '&':
309309 case '|':
310310 case '^':
311 - return ISToken::TLogicalOperator;
 311+ return WSToken::TLogicalOperator;
312312 case '*':
313313 case '/':
314314 case '%':
315 - return ISToken::TMulOperator;
 315+ return WSToken::TMulOperator;
316316 case '**':
317 - return ISToken::TPow;
 317+ return WSToken::TPow;
318318 case ')':
319 - return ISToken::TRightBracket;
 319+ return WSToken::TRightBracket;
320320 case '}':
321 - return ISToken::TRightCurly;
 321+ return WSToken::TRightCurly;
322322 case ']':
323 - return ISToken::TRightSquare;
 323+ return WSToken::TRightSquare;
324324 case ';':
325 - return ISToken::TSemicolon;
 325+ return WSToken::TSemicolon;
326326 case '=':
327327 case '+=':
328328 case '-=':
329329 case '*=':
330330 case '/=':
331 - return ISToken::TSet;
 331+ return WSToken::TSet;
332332 case '+':
333333 case '-':
334 - return ISToken::TSumOperator;
 334+ return WSToken::TSumOperator;
335335 case '?':
336 - return ISToken::TTrinary;
 336+ return WSToken::TTrinary;
337337 default:
338 - throw new ISException( "Invalid operator: {$op}" );
 338+ throw new WSException( "Invalid operator: {$op}" );
339339 }
340340 }
341341 }
Index: trunk/extensions/WikiScripts/interpreter/LRParser.php
@@ -1,7 +1,7 @@
22 <?php
33
44 /**
5 - * LR parser for inline scripts.
 5+ * LR parser for scripts.
66 * Inputs tokens and LR table (ACTION/GOTO).
77 * Outputs parser tree.
88 *
@@ -10,7 +10,7 @@
1111
1212 require_once( 'LRTableVersion.php' );
1313
14 -class ISLRParser implements ISParser {
 14+class WSLRParser implements WSParser {
1515 const Shift = 0;
1616 const Reduce = 1;
1717 const Accept = 2;
@@ -18,7 +18,7 @@
1919 static $mLoaded, $mNonterminals, $mProductions, $mAction, $mGoto;
2020
2121 public static function getVersion() {
22 - return IS_LR_VERSION;
 22+ return WS_LR_VERSION;
2323 }
2424
2525 private function loadGrammar() {
@@ -29,10 +29,10 @@
3030
3131 require_once( 'LRTable.php' );
3232
33 - self::$mNonterminals = ISLRTable::$nonterminals;
34 - self::$mProductions = ISLRTable::$productions;
35 - self::$mAction = ISLRTable::$action;
36 - self::$mGoto = ISLRTable::$goto;
 33+ self::$mNonterminals = WSLRTable::$nonterminals;
 34+ self::$mProductions = WSLRTable::$productions;
 35+ self::$mAction = WSLRTable::$action;
 36+ self::$mGoto = WSLRTable::$goto;
3737 self::$mLoaded = true;
3838
3939 wfProfileOut( __METHOD__ );
@@ -56,20 +56,20 @@
5757 $cur = $token->type;
5858 if( !$token ) {
5959 wfProfileOut( __METHOD__ );
60 - throw new ISException( 'Non-token input in LRParser::parse' );
 60+ throw new WSException( 'Non-token input in LRParser::parse' );
6161 }
6262
6363 $tokenCount++;
6464 if( $tokenCount > $maxTokens ) {
6565 wfProfileOut( __METHOD__ );
66 - throw new ISUserVisibleException( 'toomanytokens', $module, $token->line );
 66+ throw new WSUserVisibleException( 'toomanytokens', $module, $token->line );
6767 }
6868
6969 list( $stateval, $state ) = end( $states );
7070 $act = @self::$mAction[$state][$cur];
7171 if( !$act ) {
7272 wfProfileOut( __METHOD__ );
73 - throw new ISUserVisibleException( 'unexceptedtoken', $module, $token->line,
 73+ throw new WSUserVisibleException( 'unexceptedtoken', $module, $token->line,
7474 array( $token, implode( ', ', array_keys( @self::$mAction[$state] ) ), $state ) );
7575 }
7676 if( $act[0] == self::Shift ) {
@@ -86,7 +86,7 @@
8787 $str = array_reverse( $str );
8888 list( $stateval, $state ) = end( $states );
8989
90 - $node = new ISParserTreeNode( $this, $nonterm );
 90+ $node = new WSParserTreeNode( $this, $nonterm );
9191 foreach( $str as $symbol ) {
9292 list( $val ) = $symbol;
9393 $node->addChild( $val );
@@ -99,13 +99,13 @@
100100
101101 wfProfileOut( __METHOD__ );
102102
103 - return new ISParserOutput( $states[1][0], $tokenCount );
 103+ return new WSParserOutput( $states[1][0], $tokenCount );
104104 }
105105
106106 public function getSyntaxErrors( $input, $module, $maxTokens ) {
107107 try {
108108 $this->parse( $input, $module, $maxTokens );
109 - } catch( ISUserVisibleException $e ) {
 109+ } catch( WSUserVisibleException $e ) {
110110 return array( $e->getMessage() );
111111 }
112112
Index: trunk/extensions/WikiScripts/interpreter/LRTableVersion.php
@@ -6,4 +6,4 @@
77 * version in separate file.
88 */
99
10 -define( 'IS_LR_VERSION', "2011-08-13 21:53:42" );
 10+define( 'WS_LR_VERSION', "2011-08-13 21:53:42" );
Index: trunk/extensions/WikiScripts/interpreter/EvaluationContext.php
@@ -24,12 +24,12 @@
2525 die();
2626
2727 /**
28 - * An internal class used by InlineScript. Used to evaluate a parsed code
 28+ * An internal class used by WikiScripts. Used to evaluate a parsed code
2929 * in a sepereate context with its own output, variables and parser frame.
3030 *
3131 * Handles evaluation of an individual functions.
3232 */
33 -class ISEvaluationContext {
 33+class WSEvaluationContext {
3434 var $mVars, $mFrame, $mName, $mInterpreter, $mModule;
3535
3636 var $mOutput, $mListOutput;
@@ -75,7 +75,7 @@
7676 $this->mParser = $interpreter->getParser();
7777 $this->mFrame = $frame;
7878
79 - $this->mOutput = new ISData();
 79+ $this->mOutput = new WSData();
8080 $this->mListOutput = array();
8181 }
8282
@@ -88,12 +88,12 @@
8989 }
9090
9191 public function getOutput() {
92 - if( $this->mOutput->type != ISData::DNull ) {
 92+ if( $this->mOutput->type != WSData::DNull ) {
9393 return $this->mOutput;
9494 } elseif( $this->mListOutput ) {
95 - return new ISData( ISData::DList, $this->mListOutput );
 95+ return new WSData( WSData::DList, $this->mListOutput );
9696 } else {
97 - return new ISData();
 97+ return new WSData();
9898 }
9999 }
100100
@@ -107,12 +107,12 @@
108108 * recursively.
109109 */
110110 public function evaluateNode( $node, $rec ) {
111 - if( !$node instanceof ISParserTreeNode ) {
112 - throw new ISException( 'evaluateNode() accepts only nonterminals' );
 111+ if( !$node instanceof WSParserTreeNode ) {
 112+ throw new WSException( 'evaluateNode() accepts only nonterminals' );
113113 }
114114
115115 if( !$this->mInterpreter->checkRecursionLimit( $rec ) ) {
116 - throw new ISUserVisibleException( 'recoverflow', $this->mModuleName, $this->getLine( $node ) );
 116+ throw new WSUserVisibleException( 'recoverflow', $this->mModuleName, $this->getLine( $node ) );
117117 }
118118
119119 $c = $node->getChildren();
@@ -128,7 +128,7 @@
129129 $res = $this->evaluateNode( $stmt, $rec + 1 );
130130 return $res;
131131 case 'stmt':
132 - if( $c[0] instanceof ISToken ) {
 132+ if( $c[0] instanceof WSToken ) {
133133 switch( $c[0]->type ) {
134134 case 'leftcurly':
135135 return $this->evaluateNode( $c[1], $rec + 1 );
@@ -140,27 +140,27 @@
141141 if( isset( $c[6] ) ) {
142142 return $this->evaluateNode( $c[6], $rec + 1 );
143143 } else {
144 - return new ISData();
 144+ return new WSData();
145145 }
146146 }
147147 case 'for':
148148 $array = $this->evaluateNode( $c[4], $rec + 1 );
149149 if( !$array->isArray() )
150 - throw new ISUserVisibleException( 'invalidforeach', $this->mModuleName, $c[0]->line );
151 - $last = new ISData();
 150+ throw new WSUserVisibleException( 'invalidforeach', $this->mModuleName, $c[0]->line );
 151+ $last = new WSData();
152152 $lvalues = $c[2]->getChildren();
153153
154154 foreach( $array->data as $key => $item ) {
155155 // <forlvalue> ::= <lvalue> | <lvalue> colon <lvalue>
156156 if( count( $lvalues ) > 1 ) {
157 - $this->setVar( $lvalues[0], ISData::newFromPHPVar( $key ), $rec );
 157+ $this->setVar( $lvalues[0], WSData::newFromPHPVar( $key ), $rec );
158158 $this->setVar( $lvalues[2], $item, $rec );
159159 } else {
160160 $this->setVar( $lvalues[0], $item, $rec );
161161 }
162162 try {
163163 $last = $this->evaluateNode( $c[6], $rec + 1 );
164 - } catch( ISUserVisibleException $e ) {
 164+ } catch( WSUserVisibleException $e ) {
165165 if( $e->getExceptionID() == 'break' )
166166 break;
167167 elseif( $e->getExceptionID() == 'continue' )
@@ -173,16 +173,16 @@
174174 case 'try':
175175 try {
176176 return $this->evaluateNode( $c[1], $rec + 1 );
177 - } catch( ISUserVisibleException $e ) {
178 - if( $e instanceof ISControlException ) {
 177+ } catch( WSUserVisibleException $e ) {
 178+ if( $e instanceof WSControlException ) {
179179 throw $e;
180180 } else {
181 - $this->setVar( $c[4], new ISData( ISData::DString, $e->getExceptionID() ), $rec );
 181+ $this->setVar( $c[4], new WSData( WSData::DString, $e->getExceptionID() ), $rec );
182182 return $this->evaluateNode( $c[6], $rec + 1 );
183183 }
184184 }
185185 default:
186 - throw new ISException( "Unknown keyword: {$c[0]->type}" );
 186+ throw new WSException( "Unknown keyword: {$c[0]->type}" );
187187 }
188188 } else {
189189 return $this->evaluateNode( $c[0], $rec + 1 );
@@ -194,26 +194,26 @@
195195 $retval = $this->evaluateNode( $c[1], $rec + 1 );
196196 $empty = false;
197197 } else {
198 - $retval = new ISData();
 198+ $retval = new WSData();
199199 $empty = true;
200200 }
201 - throw new ISReturnException( $retval, $empty );
 201+ throw new WSReturnException( $retval, $empty );
202202 case 'append':
203203 if( $this->mListOutput ) {
204 - throw new ISUserVisibleException( 'appendyield', $this->mModuleName, $c[0]->line );
 204+ throw new WSUserVisibleException( 'appendyield', $this->mModuleName, $c[0]->line );
205205 }
206206
207 - $this->mOutput = ISData::sum( $this->mOutput, $this->evaluateNode( $c[1], $rec + 1 ) );
 207+ $this->mOutput = WSData::sum( $this->mOutput, $this->evaluateNode( $c[1], $rec + 1 ) );
208208 break 2;
209209 case 'yield':
210 - if( $this->mOutput->type != ISData::DNull ) {
211 - throw new ISUserVisibleException( 'appendyield', $this->mModuleName, $c[0]->line );
 210+ if( $this->mOutput->type != WSData::DNull ) {
 211+ throw new WSUserVisibleException( 'appendyield', $this->mModuleName, $c[0]->line );
212212 }
213213
214214 $this->mListOutput[] = $this->evaluateNode( $c[1], $rec + 1 );
215215 break 2;
216216 default:
217 - throw new ISException( "Unknown return keyword: {$c[0]->value}" );
 217+ throw new WSException( "Unknown return keyword: {$c[0]->value}" );
218218 }
219219 case 'exprset':
220220 $this->mInterpreter->increaseEvaluationsCount( $this->mModuleName, $c[1]->line );
@@ -242,67 +242,67 @@
243243 switch( $c[1]->value ) {
244244 case '&':
245245 if( !$arg1->toBool() )
246 - return new ISData( ISData::DBool, false );
 246+ return new WSData( WSData::DBool, false );
247247 else
248248 return $this->evaluateNode( $c[2], $rec + 1 );
249249 case '|':
250250 if( $arg1->toBool() )
251 - return new ISData( ISData::DBool, true );
 251+ return new WSData( WSData::DBool, true );
252252 else
253253 return $this->evaluateNode( $c[2], $rec + 1 );
254254 case '^':
255255 $arg2 = $this->evaluateNode( $c[2], $rec + 1 );
256 - return new ISData( ISData::DBool, $arg1->toBool() xor $arg2->toBool() );
 256+ return new WSData( WSData::DBool, $arg1->toBool() xor $arg2->toBool() );
257257 default:
258 - throw new ISException( "Invalid logical operation: {$c[1]->value}" );
 258+ throw new WSException( "Invalid logical operation: {$c[1]->value}" );
259259 }
260260 case 'exprequals':
261261 case 'exprcompare':
262262 $this->mInterpreter->increaseEvaluationsCount( $this->mModuleName, $c[1]->line );
263263 $arg1 = $this->evaluateNode( $c[0], $rec + 1 );
264264 $arg2 = $this->evaluateNode( $c[2], $rec + 1 );
265 - return ISData::compareOp( $arg1, $arg2, $c[1]->value );
 265+ return WSData::compareOp( $arg1, $arg2, $c[1]->value );
266266 case 'exprsum':
267267 $this->mInterpreter->increaseEvaluationsCount( $this->mModuleName, $c[1]->line );
268268 $arg1 = $this->evaluateNode( $c[0], $rec + 1 );
269269 $arg2 = $this->evaluateNode( $c[2], $rec + 1 );
270270 switch( $c[1]->value ) {
271271 case '+':
272 - return ISData::sum( $arg1, $arg2 );
 272+ return WSData::sum( $arg1, $arg2 );
273273 case '-':
274 - return ISData::sub( $arg1, $arg2 );
 274+ return WSData::sub( $arg1, $arg2 );
275275 }
276276 case 'exprmul':
277277 $this->mInterpreter->increaseEvaluationsCount( $this->mModuleName, $c[1]->line );
278278 $arg1 = $this->evaluateNode( $c[0], $rec + 1 );
279279 $arg2 = $this->evaluateNode( $c[2], $rec + 1 );
280 - return ISData::mulRel( $arg1, $arg2, $c[1]->value, $this->mModuleName, $c[1]->line );
 280+ return WSData::mulRel( $arg1, $arg2, $c[1]->value, $this->mModuleName, $c[1]->line );
281281 case 'exprpow':
282282 $this->mInterpreter->increaseEvaluationsCount( $this->mModuleName, $c[1]->line );
283283 $arg1 = $this->evaluateNode( $c[0], $rec + 1 );
284284 $arg2 = $this->evaluateNode( $c[2], $rec + 1 );
285 - return ISData::pow( $arg1, $arg2 );
 285+ return WSData::pow( $arg1, $arg2 );
286286 case 'exprkeyword':
287287 $this->mInterpreter->increaseEvaluationsCount( $this->mModuleName, $c[1]->line );
288288 $arg1 = $this->evaluateNode( $c[0], $rec + 1 );
289289 $arg2 = $this->evaluateNode( $c[2], $rec + 1 );
290290 switch( $c[1]->value ) {
291291 case 'in':
292 - return ISData::keywordIn( $arg1, $arg2 );
 292+ return WSData::keywordIn( $arg1, $arg2 );
293293 case 'contains':
294 - return ISData::keywordIn( $arg2, $arg1 );
 294+ return WSData::keywordIn( $arg2, $arg1 );
295295 default:
296 - throw new ISException( "Invalid keyword: {$c[1]->value}" );
 296+ throw new WSException( "Invalid keyword: {$c[1]->value}" );
297297 }
298298 case 'exprinvert':
299299 $this->mInterpreter->increaseEvaluationsCount( $this->mModuleName, $c[0]->line );
300300 $arg = $this->evaluateNode( $c[1], $rec + 1 );
301 - return ISData::boolInvert( $arg );
 301+ return WSData::boolInvert( $arg );
302302 case 'exprunary':
303303 $this->mInterpreter->increaseEvaluationsCount( $this->mModuleName, $c[0]->line );
304304 $arg = $this->evaluateNode( $c[1], $rec + 1 );
305305 if( $c[0]->value == '-' )
306 - return ISData::unaryMinus( $arg );
 306+ return WSData::unaryMinus( $arg );
307307 else
308308 return $arg;
309309 case 'exprfunction':
@@ -313,7 +313,7 @@
314314
315315 $this->mInterpreter->increaseEvaluationsCount( $this->mModuleName, $c[1]->line );
316316 if( $c[0]->getType() == 'funcid' ) {
317 - if( $c[2] instanceof ISParserTreeNode ) {
 317+ if( $c[2] instanceof WSParserTreeNode ) {
318318 $args = $this->parseArray( $c[2], $rec, $dummy );
319319 } else {
320320 $args = array();
@@ -323,12 +323,12 @@
324324 if( count( $idch ) == 1 ) {
325325 $funcname = $idch[0]->value;
326326 if( !isset( self::$mFunctions[$funcname] ) )
327 - throw new ISUserVisibleException( 'unknownfunction', $this->mModuleName, $idch[0]->line, array( $funcname ) );
 327+ throw new WSUserVisibleException( 'unknownfunction', $this->mModuleName, $idch[0]->line, array( $funcname ) );
328328 $func = self::$mFunctions[$funcname];
329329 return $this->$func( $args, $idch[0]->line );
330330 } else {
331331 $funcname = $idch[2]->value;
332 - if( $idch[0] instanceof ISToken ) {
 332+ if( $idch[0] instanceof WSToken ) {
333333 // self::function()
334334 $module = $this->mModule;
335335 } else {
@@ -343,31 +343,31 @@
344344 switch( $type ) {
345345 case 'isset':
346346 $val = $this->getVar( $c[2], $rec, true );
347 - return new ISData( ISData::DBool, $val !== null );
 347+ return new WSData( WSData::DBool, $val !== null );
348348 case 'delete':
349349 $this->deleteVar( $c[2], $rec );
350 - return new ISData();
 350+ return new WSData();
351351 default:
352 - throw new ISException( "Unknown keyword: {$type}" );
 352+ throw new WSException( "Unknown keyword: {$type}" );
353353 }
354354 }
355355 case 'expratom':
356 - if( $c[0] instanceof ISParserTreeNode ) {
 356+ if( $c[0] instanceof WSParserTreeNode ) {
357357 if( $c[0]->getType() == 'atom' ) {
358358 list( $val ) = $c[0]->getChildren();
359359 switch( $val->type ) {
360360 case 'string':
361 - return new ISData( ISData::DString, $val->value );
 361+ return new WSData( WSData::DString, $val->value );
362362 case 'int':
363 - return new ISData( ISData::DInt, $val->value );
 363+ return new WSData( WSData::DInt, $val->value );
364364 case 'float':
365 - return new ISData( ISData::DFloat, $val->value );
 365+ return new WSData( WSData::DFloat, $val->value );
366366 case 'true':
367 - return new ISData( ISData::DBool, true );
 367+ return new WSData( WSData::DBool, true );
368368 case 'false':
369 - return new ISData( ISData::DBool, false );
 369+ return new WSData( WSData::DBool, false );
370370 case 'null':
371 - return new ISData();
 371+ return new WSData();
372372 }
373373 } else {
374374 return $this->getVar( $c[0], $rec );
@@ -380,16 +380,16 @@
381381 case 'leftcurly':
382382 $arraytype = null;
383383 $array = $this->parseArray( $c[1], $rec + 1, $arraytype );
384 - return new ISData( $arraytype, $array );
 384+ return new WSData( $arraytype, $array );
385385 case 'break':
386 - throw new ISControlException( 'break', $this->mModuleName, $c[0]->line );
 386+ throw new WSControlException( 'break', $this->mModuleName, $c[0]->line );
387387 case 'continue':
388 - throw new ISControlException( 'continue', $this->mModuleName, $c[0]->line );
 388+ throw new WSControlException( 'continue', $this->mModuleName, $c[0]->line );
389389 }
390390 }
391391 default:
392392 $type = $node->getType();
393 - throw new ISException( "Invalid node type passed to evaluateNode(): {$type}" );
 393+ throw new WSException( "Invalid node type passed to evaluateNode(): {$type}" );
394394 }
395395 }
396396
@@ -419,7 +419,7 @@
420420 $result[] = $this->evaluateNode( $elem, $rec + 1 );
421421 }
422422
423 - $arraytype = ISData::DList;
 423+ $arraytype = WSData::DList;
424424 wfProfileOut( __METHOD__ );
425425 return $result;
426426
@@ -432,7 +432,7 @@
433433 $result[ $key->toString() ] = $value;
434434 }
435435
436 - $arraytype = ISData::DAssoc;
 436+ $arraytype = WSData::DAssoc;
437437 wfProfileOut( __METHOD__ );
438438 return $result;
439439 }
@@ -447,18 +447,18 @@
448448 // <arrayIdx> ::= leftsquare <expr> rightsquare | leftsquare rightsquare
449449
450450 if( !$this->mInterpreter->checkRecursionLimit( $rec ) ) {
451 - throw new ISUserVisibleException( 'recoverflow', $this->mModuleName, $this->getLine( $node ) );
 451+ throw new WSUserVisibleException( 'recoverflow', $this->mModuleName, $this->getLine( $node ) );
452452 }
453453
454454 $c = $lval->getChildren();
455 - if( $c[0] instanceof ISToken ) {
 455+ if( $c[0] instanceof WSToken ) {
456456 // Variable ID
457457 $varname = $c[0]->value;
458458 if( !isset( $this->mVars[$varname] ) ) {
459459 if( $nullIfNotSet )
460460 return null;
461461 else
462 - throw new ISUserVisibleException( 'unknownvar', $this->mModuleName, $c[0]->line, array( $varname ) );
 462+ throw new WSUserVisibleException( 'unknownvar', $this->mModuleName, $c[0]->line, array( $varname ) );
463463 }
464464 return $this->mVars[$varname];
465465 } else {
@@ -470,30 +470,30 @@
471471
472472 if( count( $idxchildren ) == 2 ) {
473473 // x = a[]. a[] is still legitimage in a[] = x
474 - throw new ISUserVisibleException( 'emptyidx', $this->mModuleName, $idxchildren[0]->line );
 474+ throw new WSUserVisibleException( 'emptyidx', $this->mModuleName, $idxchildren[0]->line );
475475 }
476476
477477 switch( $var->type ) {
478 - case ISData::DList:
 478+ case WSData::DList:
479479 $idx = $this->evaluateNode( $idxchildren[1], $rec + 1 )->toInt();
480480 if( $idx >= count( $var->data ) ) {
481481 if( $nullIfNotSet )
482482 return null;
483483 else
484 - throw new ISUserVisibleException( 'outofbounds', $this->mModuleName, $idxchildren[0]->line );
 484+ throw new WSUserVisibleException( 'outofbounds', $this->mModuleName, $idxchildren[0]->line );
485485 }
486486 return $var->data[$idx];
487 - case ISData::DAssoc:
 487+ case WSData::DAssoc:
488488 $idx = $this->evaluateNode( $idxchildren[1], $rec + 1 )->toString();
489489 if( !isset( $var->data[$idx] ) ) {
490490 if( $nullIfNotSet )
491491 return null;
492492 else
493 - throw new ISUserVisibleException( 'outofbounds', $this->mModuleName, $idxchildren[0]->line );
 493+ throw new WSUserVisibleException( 'outofbounds', $this->mModuleName, $idxchildren[0]->line );
494494 }
495495 return $var->data[$idx];
496496 default:
497 - throw new ISUserVisibleException( 'notanarray', $this->mModuleName, $idxchildren[0]->line );
 497+ throw new WSUserVisibleException( 'notanarray', $this->mModuleName, $idxchildren[0]->line );
498498 }
499499 }
500500 }
@@ -502,7 +502,7 @@
503503 * Gets the line of the first terminal in the node.
504504 */
505505 protected function getLine( $node ) {
506 - while( $node instanceof ISParserTreeNode ) {
 506+ while( $node instanceof WSParserTreeNode ) {
507507 $children = $node->getChildren();
508508 $node = $children[0];
509509 }
@@ -524,59 +524,59 @@
525525 */
526526 protected function &setVarGetRef( $lval, $rec ) {
527527 if( !$this->mInterpreter->checkRecursionLimit( $rec ) ) {
528 - throw new ISUserVisibleException( 'recoverflow', $this->mModuleName, $this->getLine( $node ) );
 528+ throw new WSUserVisibleException( 'recoverflow', $this->mModuleName, $this->getLine( $node ) );
529529 }
530530
531531 $c = $lval->getChildren();
532532 if( count( $c ) == 1 ) {
533533 if( !isset( $this->mVars[ $c[0]->value ] ) )
534 - $this->mVars[ $c[0]->value ] = new ISPlaceholder();
 534+ $this->mVars[ $c[0]->value ] = new WSPlaceholder();
535535 return $this->mVars[ $c[0]->value ];
536536 } else {
537537 $ref = &$this->setVarGetRef( $c[0], $rec + 1 );
538538
539539 // <arrayIdx> ::= leftsquare <expr> rightsquare | leftsquare rightsquare
540540 $idxc = $c[1]->getChildren();
541 - if( $ref instanceof ISPlaceholder ) {
 541+ if( $ref instanceof WSPlaceholder ) {
542542 if( count( $idxc ) > 2 ) {
543543 $index = $this->evaluateNode( $idxc[1], $rec + 1 );
544 - $ref = new ISData( ISData::DAssoc, array() );
 544+ $ref = new WSData( WSData::DAssoc, array() );
545545 } else {
546 - $ref = new ISData( ISData::DList, array() );
 546+ $ref = new WSData( WSData::DList, array() );
547547 }
548548 }
549549
550550 switch( $ref->type ) {
551 - case ISData::DList:
 551+ case WSData::DList:
552552 if( count( $idxc ) > 2 ) {
553553 $index = $this->evaluateNode( $idxc[1], $rec + 1 );
554554 $key = $index->toInt();
555555
556556 if( $key < 0 || $key > count( $ref->data ) )
557 - throw new ISUserVisibleException( 'outofbounds', $this->mModuleName, $idxc[0]->line );
 557+ throw new WSUserVisibleException( 'outofbounds', $this->mModuleName, $idxc[0]->line );
558558 } else {
559559 $key = count( $ref->data );
560560 }
561561
562562 if( !isset( $ref->data[$key] ) )
563 - $ref->data[$key] = new ISPlaceholder();
 563+ $ref->data[$key] = new WSPlaceholder();
564564
565565 return $ref->data[$key];
566 - case ISData::DAssoc:
 566+ case WSData::DAssoc:
567567 if( count( $idxc ) > 2 ) {
568568 if( !isset( $index ) )
569569 $index = $this->evaluateNode( $idxc[1], $rec + 1 );
570570 $key = $index->toString();
571571
572572 if( !isset( $ref->data[$key] ) )
573 - $ref->data[$key] = new ISPlaceholder();
 573+ $ref->data[$key] = new WSPlaceholder();
574574 return $ref->data[$key];
575575 } else {
576 - throw new ISUserVisibleException( 'notlist', $this->mModuleName, $idxc[0]->line );
 576+ throw new WSUserVisibleException( 'notlist', $this->mModuleName, $idxc[0]->line );
577577 }
578578 break;
579579 default:
580 - throw new ISUserVisibleException( 'notanarray', $this->mModuleName, $idxc[0]->line );
 580+ throw new WSUserVisibleException( 'notanarray', $this->mModuleName, $idxc[0]->line );
581581 }
582582 }
583583 }
@@ -584,13 +584,13 @@
585585 protected function getValueForSetting( $old, $new, $set, $line ) {
586586 switch( $set ) {
587587 case '+=':
588 - return ISData::sum( $old, $new );
 588+ return WSData::sum( $old, $new );
589589 case '-=':
590 - return ISData::sub( $old, $new );
 590+ return WSData::sub( $old, $new );
591591 case '*=':
592 - return ISData::mulRel( $old, $new, '*', $line );
 592+ return WSData::mulRel( $old, $new, '*', $line );
593593 case '/=':
594 - return ISData::mulRel( $old, $new, '/', $line );
 594+ return WSData::mulRel( $old, $new, '/', $line );
595595 default:
596596 return $new;
597597 }
@@ -598,7 +598,7 @@
599599
600600 protected function checkParamsCount( $args, $pos, $count ) {
601601 if( count( $args ) < $count )
602 - throw new ISUserVisibleException( 'notenoughargs', $this->mModuleName, $pos );
 602+ throw new WSUserVisibleException( 'notenoughargs', $this->mModuleName, $pos );
603603 }
604604
605605 protected function deleteVar( $lval, $rec ) {
@@ -606,7 +606,7 @@
607607 $line = $c[0]->line;
608608 $varname = $c[0]->value;
609609 if( isset( $c[1] ) ) {
610 - throw new ISException( 'delete() is not usable for array elements' );
 610+ throw new WSException( 'delete() is not usable for array elements' );
611611 }
612612 unset( $this->mVars[$varname] );
613613 }
@@ -616,19 +616,19 @@
617617 $this->checkParamsCount( $args, $pos, 1 );
618618
619619 $argName = $args[0]->toString();
620 - $default = isset( $args[1] ) ? $args[1] : new ISData();
 620+ $default = isset( $args[1] ) ? $args[1] : new WSData();
621621 if( $this->mFrame->getArgument( $argName ) === false )
622622 return $default;
623623 else
624 - return new ISData( ISData::DString, $this->mFrame->getArgument( $argName ) );
 624+ return new WSData( WSData::DString, $this->mFrame->getArgument( $argName ) );
625625 }
626626
627627 protected function funcArgs( $args, $pos ) {
628 - return ISData::newFromPHPVar( $this->mFrame->getNumberedArguments() );
 628+ return WSData::newFromPHPVar( $this->mFrame->getNumberedArguments() );
629629 }
630630
631631 protected function funcIsTranscluded( $args, $pos ) {
632 - return new ISData( ISData::DBool, $this->mFrame->isTemplate() );
 632+ return new WSData( WSData::DBool, $this->mFrame->isTemplate() );
633633 }
634634
635635 protected function funcParse( $args, $pos ) {
@@ -644,30 +644,30 @@
645645 $this->mParser->setOutputType( $oldOT );
646646
647647 $this->mInterpreter->mCallStack->pop();
648 - return new ISData( ISData::DString, $parsed );
 648+ return new WSData( WSData::DString, $parsed );
649649 }
650650
651651 protected function funcLc( $args, $pos ) {
652652 global $wgContLang;
653653 $this->checkParamsCount( $args, $pos, 1 );
654 - return new ISData( ISData::DString, $wgContLang->lc( $args[0]->toString() ) );
 654+ return new WSData( WSData::DString, $wgContLang->lc( $args[0]->toString() ) );
655655 }
656656
657657 protected function funcUc( $args, $pos ) {
658658 global $wgContLang;
659659 $this->checkParamsCount( $args, $pos, 1 );
660 - return new ISData( ISData::DString, $wgContLang->uc( $args[0]->toString() ) );
 660+ return new WSData( WSData::DString, $wgContLang->uc( $args[0]->toString() ) );
661661 }
662662
663663 protected function funcUcFirst( $args, $pos ) {
664664 global $wgContLang;
665665 $this->checkParamsCount( $args, $pos, 1 );
666 - return new ISData( ISData::DString, $wgContLang->ucfirst( $args[0]->toString() ) );
 666+ return new WSData( WSData::DString, $wgContLang->ucfirst( $args[0]->toString() ) );
667667 }
668668
669669 protected function funcUrlencode( $args, $pos ) {
670670 $this->checkParamsCount( $args, $pos, 1 );
671 - return new ISData( ISData::DString, urlencode( $args[0]->toString() ) );
 671+ return new WSData( WSData::DString, urlencode( $args[0]->toString() ) );
672672 }
673673
674674 protected function funcAnchorEncode( $args, $pos ) {
@@ -677,7 +677,7 @@
678678 $s = strtr( $s, array( '%' => '.', '+' => '_' ) );
679679 $s = str_replace( '.3A', ':', $s );
680680
681 - return new ISData( ISData::DString, $s );
 681+ return new WSData( WSData::DString, $s );
682682 }
683683
684684 protected function funcGrammar( $args, $pos ) {
@@ -685,7 +685,7 @@
686686 list( $case, $word ) = $args;
687687 $res = $this->mParser->getFunctionLang()->convertGrammar(
688688 $word->toString(), $case->toString() );
689 - return new ISData( ISData::DString, $res );
 689+ return new WSData( WSData::DString, $res );
690690 }
691691
692692 protected function funcPlural( $args, $pos ) {
@@ -694,12 +694,12 @@
695695 for( $i = 1; $i < count( $args ); $i++ )
696696 $forms[] = $args[$i]->toString();
697697 $res = $this->mParser->getFunctionLang()->convertPlural( $num, $forms );
698 - return new ISData( ISData::DString, $res );
 698+ return new WSData( WSData::DString, $res );
699699 }
700700
701701 protected function funcStrlen( $args, $pos ) {
702702 $this->checkParamsCount( $args, $pos, 1 );
703 - return new ISData( ISData::DInt, mb_strlen( $args[0]->toString() ) );
 703+ return new WSData( WSData::DInt, mb_strlen( $args[0]->toString() ) );
704704 }
705705
706706 protected function funcSubstr( $args, $pos ) {
@@ -707,7 +707,7 @@
708708 $s = $args[0]->toString();
709709 $start = $args[1]->toInt();
710710 $end = $args[2]->toInt();
711 - return new ISData( ISData::DString, mb_substr( $s, $start, $end ) );
 711+ return new WSData( WSData::DString, mb_substr( $s, $start, $end ) );
712712 }
713713
714714 protected function funcStrreplace( $args, $pos ) {
@@ -715,50 +715,50 @@
716716 $s = $args[0]->toString();
717717 $old = $args[1]->toString();
718718 $new = $args[2]->toString();
719 - return new ISData( ISData::DString, str_replace( $old, $new, $s ) );
 719+ return new WSData( WSData::DString, str_replace( $old, $new, $s ) );
720720 }
721721
722722 protected function funcSplit( $args, $pos ) {
723723 $this->checkParamsCount( $args, $pos, 2 );
724724 $list = explode( $args[0]->toString(), $args[1]->toString() );
725 - return ISData::newFromPHPVar( $list );
 725+ return WSData::newFromPHPVar( $list );
726726 }
727727
728728 protected function funcJoin( $args, $pos ) {
729729 $this->checkParamsCount( $args, $pos, 2 );
730730 $seperator = $args[0]->toString();
731 - if( $args[1]->type == ISData::DList ) {
 731+ if( $args[1]->type == WSData::DList ) {
732732 $bits = $args[1]->data;
733733 } else {
734734 $bits = array_slice( $args, 1 );
735735 }
736736 foreach( $bits as &$bit )
737737 $bit = $bit->toString();
738 - return new ISData( ISData::DString, implode( $seperator, $bits ) );
 738+ return new WSData( WSData::DString, implode( $seperator, $bits ) );
739739 }
740740
741741 protected function funcCount( $args, $pos ) {
742742 $this->checkParamsCount( $args, $pos, 1 );
743 - return new ISData( ISData::DInt, count( $args[0]->toList()->data ) );
 743+ return new WSData( WSData::DInt, count( $args[0]->toList()->data ) );
744744 }
745745
746746 protected function castString( $args, $pos ) {
747747 $this->checkParamsCount( $args, $pos, 1 );
748 - return ISData::castTypes( $args[0], ISData::DString );
 748+ return WSData::castTypes( $args[0], WSData::DString );
749749 }
750750
751751 protected function castInt( $args, $pos ) {
752752 $this->checkParamsCount( $args, $pos, 1 );
753 - return ISData::castTypes( $args[0], ISData::DInt );
 753+ return WSData::castTypes( $args[0], WSData::DInt );
754754 }
755755
756756 protected function castFloat( $args, $pos ) {
757757 $this->checkParamsCount( $args, $pos, 1 );
758 - return ISData::castTypes( $args[0], ISData::DFloat );
 758+ return WSData::castTypes( $args[0], WSData::DFloat );
759759 }
760760
761761 protected function castBool( $args, $pos ) {
762762 $this->checkParamsCount( $args, $pos, 1 );
763 - return ISData::castTypes( $args[0], ISData::DBool );
 763+ return WSData::castTypes( $args[0], WSData::DBool );
764764 }
765765 }
Index: trunk/extensions/WikiScripts/interpreter/CallStack.php
@@ -1,39 +1,39 @@
22 <?php
33
4 -abstract class ISCallStackEntry {
 4+abstract class WSCallStackEntry {
55 abstract function toString();
66 }
77
8 -abstract class ISCallStackFunctionEntry extends ISCallStackEntry {
 8+abstract class WSCallStackFunctionEntry extends WSCallStackEntry {
99 public $module;
1010 public $function;
1111 }
1212
13 -class ISCallStackFunctionFromModuleEntry extends ISCallStackFunctionEntry {
 13+class WSCallStackFunctionFromModuleEntry extends WSCallStackFunctionEntry {
1414 public $invokingModule;
1515 public $line;
1616
1717 public function toString() {
18 - return wfMsg( 'inlinescripts-call-frommodule', $this->module, $this->function,
 18+ return wfMsg( 'wikiscripts-call-frommodule', $this->module, $this->function,
1919 $this->invokingModule, $this->line );
2020 }
2121 }
2222
23 -class ISCallStackFunctionFromWikitextEntry extends ISCallStackFunctionEntry {
 23+class WSCallStackFunctionFromWikitextEntry extends WSCallStackFunctionEntry {
2424 public function toString() {
25 - return wfMsg( 'inlinescripts-call-frommodule', $this->module, $this->function );
 25+ return wfMsg( 'wikiscripts-call-frommodule', $this->module, $this->function );
2626 }
2727 }
2828
29 -class ISCallStackParseEntry extends ISCallStackEntry {
 29+class WSCallStackParseEntry extends WSCallStackEntry {
3030 public $text;
3131
3232 public function toString() {
33 - return wfMsg( 'inlinescripts-call-parse', $this->text );
 33+ return wfMsg( 'wikiscripts-call-parse', $this->text );
3434 }
3535 }
3636
37 -class ISCallStack {
 37+class WSCallStack {
3838 var $mInterpreter, $mStack;
3939
4040 public function __construct( $interpreter ) {
@@ -46,14 +46,14 @@
4747 }
4848
4949 public function isFull() {
50 - global $wgInlineScriptsMaxCallStackDepth;
 50+ global $wgScriptsMaxCallStackDepth;
5151
52 - return count( $this->mStack ) >= $wgInlineScriptsMaxCallStackDepth;
 52+ return count( $this->mStack ) >= $wgScriptsMaxCallStackDepth;
5353 }
5454
5555 public function contains( $module, $name ) {
5656 foreach( $this->mStack as $entry ) {
57 - if( $entry instanceof ISCallStackFunctionEntry ) {
 57+ if( $entry instanceof WSCallStackFunctionEntry ) {
5858 if( $entry->module == $module && $entry->function == $name ) {
5959 return true;
6060 }
@@ -63,7 +63,7 @@
6464 }
6565
6666 public function addFunctionFromModule( $module, $name, $invokingModule, $line ) {
67 - $entry = new ISCallStackFunctionFromModuleEntry();
 67+ $entry = new WSCallStackFunctionFromModuleEntry();
6868 $entry->module = $module;
6969 $entry->function = $name;
7070 $entry->invokingModule = $invokingModule;
@@ -72,7 +72,7 @@
7373 }
7474
7575 public function addFunctionFromWikitext( $module, $name ) {
76 - $entry = new ISCallStackFunctionFromWikitextEntry();
 76+ $entry = new WSCallStackFunctionFromWikitextEntry();
7777 $entry->module = $module;
7878 $entry->function = $name;
7979 $this->mStack[] = $entry;
@@ -83,7 +83,7 @@
8484 $wikitext = substr( $wikitext, 0, 64 ) . "...";
8585 }
8686
87 - $entry = new ISCallStackParseEntry();
 87+ $entry = new WSCallStackParseEntry();
8888 $entry->text = $wikitext;
8989 $this->mStack[] = $entry;
9090 }
Index: trunk/extensions/WikiScripts/interpreter/Interpreter.php
@@ -31,7 +31,7 @@
3232 /**
3333 * The global interpreter object. Each parser has one.
3434 */
35 -class ISInterpreter {
 35+class WSInterpreter {
3636 const ParserVersion = 1;
3737
3838 var $mParser, $mUseCache, $mUsedModules, $mCallStack;
@@ -41,12 +41,12 @@
4242 static $mCodeParser;
4343
4444 public function __construct( $parser ) {
45 - global $wgInlineScriptsUseCache;
 45+ global $wgScriptsUseCache;
4646
4747 $this->mParser = $parser;
48 - $this->mUseCache = $wgInlineScriptsUseCache;
 48+ $this->mUseCache = $wgScriptsUseCache;
4949
50 - $this->mCallStack = new ISCallStack( $this );
 50+ $this->mCallStack = new WSCallStack( $this );
5151 $this->mUsedModules = array();
5252 $this->mMaxRecursion =
5353 $this->mEvaluations =
@@ -54,19 +54,19 @@
5555 }
5656
5757 public static function invokeCodeParser( $code, $module, $method = 'parse' ) {
58 - global $wgInlineScriptsParserClass, $wgInlineScriptsLimits;
 58+ global $wgScriptsParserClass, $wgScriptsLimits;
5959
6060 if( !self::$mCodeParser ) {
61 - self::$mCodeParser = new $wgInlineScriptsParserClass();
 61+ self::$mCodeParser = new $wgScriptsParserClass();
6262 }
6363
6464 if( self::$mCodeParser->needsScanner() ) {
65 - $input = new ISScanner( $module, $code );
 65+ $input = new WSScanner( $module, $code );
6666 } else {
6767 $input = $code;
6868 }
6969
70 - return self::$mCodeParser->$method( $input, $module, $wgInlineScriptsLimits['tokens'] );
 70+ return self::$mCodeParser->$method( $input, $module, $wgScriptsLimits['tokens'] );
7171 }
7272
7373 /**
@@ -75,7 +75,7 @@
7676 public static function invalidateModule( $title ) {
7777 global $parserMemc;
7878
79 - $key = ISModule::getCacheKey( $title );
 79+ $key = WSModule::getCacheKey( $title );
8080 $parserMemc->delete( $key );
8181 }
8282
@@ -108,29 +108,29 @@
109109 * @return Boolean
110110 */
111111 public function checkRecursionLimit( $rec ) {
112 - global $wgInlineScriptsLimits;
 112+ global $wgScriptsLimits;
113113 if( $rec > $this->mMaxRecursion )
114114 $this->mMaxRecursion = $rec;
115 - return $rec <= $wgInlineScriptsLimits['depth'];
 115+ return $rec <= $wgScriptsLimits['depth'];
116116 }
117117
118118 /**
119119 * Increases the number of evaluations.
120120 *
121 - * @param $module ISModule Module where the evaluation happens
 121+ * @param $module WSModule Module where the evaluation happens
122122 * @param $line int Line number of the evaluation
123123 * @return Boolean
124124 */
125125 public function increaseEvaluationsCount( $module, $line ) {
126 - global $wgInlineScriptsLimits;
 126+ global $wgScriptsLimits;
127127 $this->mEvaluations++;
128 - if( $this->mEvaluations > $wgInlineScriptsLimits['evaluations'] )
129 - throw new ISUserVisibleException( 'toomanyevals', $module, $line );
 128+ if( $this->mEvaluations > $wgScriptsLimits['evaluations'] )
 129+ throw new WSUserVisibleException( 'toomanyevals', $module, $line );
130130 }
131131
132132 public function getMaxTokensLeft() {
133 - global $wgInlineScriptsLimits;
134 - return $wgInlineScriptsLimits['tokens'];
 133+ global $wgScriptsLimits;
 134+ return $wgScriptsLimits['tokens'];
135135 }
136136
137137 /**
@@ -159,7 +159,7 @@
160160 $this->addModuleTitle( $title );
161161
162162 // Try local cache
163 - $key = ISModule::getCacheKey( $title );
 163+ $key = WSModule::getCacheKey( $title );
164164 if( $this->mUseCache && isset( $this->mParserCache[$key] ) ) {
165165 $module = $this->mParserCache[$key];
166166 $this->addModuleTitle( $module->getTitle() );
@@ -171,7 +171,7 @@
172172 wfProfileIn( __METHOD__ . '-unserialize' );
173173 $cached = $parserMemc->get( $key );
174174 wfProfileOut( __METHOD__ . '-unserialize' );
175 - if( $this->mUseCache && @$cached instanceof ISModule && !$cached->isOutOfDate() ) {
 175+ if( $this->mUseCache && @$cached instanceof WSModule && !$cached->isOutOfDate() ) {
176176 $this->mParserCache[$key] = $cached;
177177 $this->addModuleTitle( $cached->getTitle() );
178178 wfProfileOut( __METHOD__ );
@@ -187,7 +187,7 @@
188188 // Parse
189189 $moduleName = $rev->getTitle()->getText();
190190 $out = self::invokeCodeParser( $rev->getText(), $moduleName );
191 - $module = ISModule::newFromParserOutput( $this, $rev->getTitle(), $rev->getId(), $out );
 191+ $module = WSModule::newFromParserOutput( $this, $rev->getTitle(), $rev->getId(), $out );
192192
193193 // Save to cache
194194 $this->mParserCache[$key] = $module;
@@ -214,50 +214,50 @@
215215 /**
216216 * Invokes the user function from script code.
217217 *
218 - * @param $module ISModule/string Module or its name
 218+ * @param $module WSModule/string Module or its name
219219 * @param $name string Name of the function
220 - * @param $args array(ISData) Arguments of the function
221 - * @param $parentContext ISEvaluationContext The context from which the function was invoked
 220+ * @param $args array(WSData) Arguments of the function
 221+ * @param $parentContext WSEvaluationContext The context from which the function was invoked
222222 * @param $line The line from which the function was invoked.
223 - * @return ISData
 223+ * @return WSData
224224 */
225225 public function invokeUserFunctionFromModule( $module, $name, $args, $parentContext, $line ) {
226 - global $wgInlineScriptsAllowRecursion, $wgInlineScriptsMaxCallStackDepth;
 226+ global $wgScriptsAllowRecursion, $wgScriptsMaxCallStackDepth;
227227
228228 // Load module
229 - if( $module instanceof ISModule ) {
 229+ if( $module instanceof WSModule ) {
230230 $moduleName = $module->getName();
231231 } else {
232232 $moduleName = $module;
233233
234234 $moduleTitle = Title::makeTitleSafe( NS_MODULE, $moduleName );
235235 if( !$moduleTitle instanceof Title || $moduleTitle->getNamespace() != NS_MODULE ) {
236 - throw new ISUserVisibleException( 'nonexistent-module', $parentContext->mModuleName, $line, array( $moduleName ) );
 236+ throw new WSUserVisibleException( 'nonexistent-module', $parentContext->mModuleName, $line, array( $moduleName ) );
237237 }
238238
239239 $module = $this->getModule( $moduleTitle );
240240 if( !$module ) {
241 - throw new ISUserVisibleException( 'nonexistent-module', $parentContext->mModuleName, $line, array( $moduleName ) );
 241+ throw new WSUserVisibleException( 'nonexistent-module', $parentContext->mModuleName, $line, array( $moduleName ) );
242242 }
243243 }
244244
245245 // Load the function and handle possible errors
246246 $function = $module->getFunction( $name );
247247 if( !$function ) {
248 - throw new ISUserVisibleException( 'unknownfunction-user', $parentContext->mModuleName, $line, array( $moduleName, $name ) );
 248+ throw new WSUserVisibleException( 'unknownfunction-user', $parentContext->mModuleName, $line, array( $moduleName, $name ) );
249249 }
250250 if( count( $args ) < $function->getMinArgCount() ) {
251 - throw new ISUserVisibleException( 'notenoughargs-user', $parentContext->mModuleName, $line, array( $moduleName, $name ) );
 251+ throw new WSUserVisibleException( 'notenoughargs-user', $parentContext->mModuleName, $line, array( $moduleName, $name ) );
252252 }
253 - if( !$wgInlineScriptsAllowRecursion && $this->mCallStack->contains( $moduleName, $name ) ) {
254 - throw new ISUserVisibleException( 'recursion', $parentContext->mModuleName, $line, array( $moduleName, $name ) );
 253+ if( !$wgScriptsAllowRecursion && $this->mCallStack->contains( $moduleName, $name ) ) {
 254+ throw new WSUserVisibleException( 'recursion', $parentContext->mModuleName, $line, array( $moduleName, $name ) );
255255 }
256256 if( $this->mCallStack->isFull() ) {
257 - throw new ISUserVisibleException( 'toodeeprecursion', $parentContext->mModuleName, $line, array( $wgInlineScriptsMaxCallStackDepth ) );
 257+ throw new WSUserVisibleException( 'toodeeprecursion', $parentContext->mModuleName, $line, array( $wgScriptsMaxCallStackDepth ) );
258258 }
259259
260260 // Prepare the context and the arguments
261 - $context = new ISEvaluationContext( $this, $module, $name, $parentContext->getFrame() );
 261+ $context = new WSEvaluationContext( $this, $module, $name, $parentContext->getFrame() );
262262 foreach( $args as $n => $arg ) {
263263 if( isset( $function->args[$n] ) ) {
264264 $argname = $function->args[$n];
@@ -286,42 +286,42 @@
287287 * @return string
288288 */
289289 public function invokeUserFunctionFromWikitext( $moduleName, $name, $args, $frame ) {
290 - global $wgInlineScriptsAllowRecursion;
 290+ global $wgScriptsAllowRecursion;
291291
292292 // Load module
293293 $moduleTitle = Title::makeTitleSafe( NS_MODULE, $moduleName );
294294 if( !$moduleTitle instanceof Title || $moduleTitle->getNamespace() != NS_MODULE ) {
295 - throw new ISTransclusionException( 'nonexistent-module', array( $moduleName ) );
 295+ throw new WSTransclusionException( 'nonexistent-module', array( $moduleName ) );
296296 }
297297
298298 $module = $this->getModule( $moduleTitle );
299299 if( !$module ) {
300 - throw new ISTransclusionException( 'nonexistent-module', array( $moduleName ) );
 300+ throw new WSTransclusionException( 'nonexistent-module', array( $moduleName ) );
301301 }
302302
303303 // Load the function and handle possible errors
304304 $function = $module->getFunction( $name );
305305 if( !$function ) {
306 - throw new ISTransclusionException( 'unknownfunction-user', array( $moduleName, $name ) );
 306+ throw new WSTransclusionException( 'unknownfunction-user', array( $moduleName, $name ) );
307307 }
308308 if( count( $args ) < $function->getMinArgCount() ) {
309 - throw new ISTransclusionException( 'notenoughargs-user', array( $moduleName, $name ) );
 309+ throw new WSTransclusionException( 'notenoughargs-user', array( $moduleName, $name ) );
310310 }
311 - if( !$wgInlineScriptsAllowRecursion && $this->mCallStack->contains( $moduleName, $name ) ) {
312 - throw new ISTransclusionException( 'recursion', array( $moduleName, $name ) );
 311+ if( !$wgScriptsAllowRecursion && $this->mCallStack->contains( $moduleName, $name ) ) {
 312+ throw new WSTransclusionException( 'recursion', array( $moduleName, $name ) );
313313 }
314314 if( $this->mCallStack->isFull() ) {
315315 // Depsite seeming an unlikely place, this may actually happen if the user will try to bypass the
316316 // stack depth limit by using parse( '{{i:module|func}}' )
317 - throw new ISTransclusionException( 'toodeeprecursion', array( $wgInlineScriptsMaxCallStackDepth ) );
 317+ throw new WSTransclusionException( 'toodeeprecursion', array( $wgScriptsMaxCallStackDepth ) );
318318 }
319319
320320 // Prepare the context and the arguments
321 - $context = new ISEvaluationContext( $this, $module, $name, $frame );
 321+ $context = new WSEvaluationContext( $this, $module, $name, $frame );
322322 foreach( $args as $n => $arg ) {
323323 if( isset( $function->args[$n] ) ) {
324324 $argname = $function->args[$n];
325 - $context->setArgument( $argname, new ISData( ISData::DString, strval( $arg ) ) );
 325+ $context->setArgument( $argname, new WSData( WSData::DString, strval( $arg ) ) );
326326 }
327327 }
328328
@@ -339,12 +339,12 @@
340340 protected function doInvokeFunction( $function, $context ) {
341341 // Indicates whether the data from append/yield should be used
342342 $useOutput = true;
343 - $result = new ISData();
 343+ $result = new WSData();
344344
345345 try {
346346 $context->evaluateNode( $function->body, 0 );
347 - } catch( ISException $e ) {
348 - if( $e instanceof ISReturnException ) {
 347+ } catch( WSException $e ) {
 348+ if( $e instanceof WSReturnException ) {
349349 $result = $e->getResult();
350350 $useOutput = $e->isEmpty();
351351 } else {
@@ -364,7 +364,7 @@
365365 /**
366366 * Represents an individual module.
367367 */
368 -class ISModule {
 368+class WSModule {
369369 var $mTitle, $mFunctions, $mParserVersion;
370370
371371 // Revision ID
@@ -377,7 +377,7 @@
378378 * Initializes module from the code parser output.
379379 */
380380 public static function newFromParserOutput( $interpreter, $title, $revid, $output ) {
381 - $m = new ISModule();
 381+ $m = new WSModule();
382382 $m->mTitle = $title;
383383 $m->mRevID = $revid;
384384 $m->mParserVersion = $output->getVersion();
@@ -391,7 +391,7 @@
392392 // <function> ::= function id leftbracket <arglist> rightbracket leftcurly <stmts> rightcurly (total 8)
393393 // <function> ::= function id leftbracket rightbracket leftcurly <stmts> rightcurly (total 7)
394394 $c = $funcnode->getChildren();
395 - $func = new ISFunction();
 395+ $func = new WSFunction();
396396 $func->name = $c[1]->value;
397397
398398 if( $funcnode->getChildrenCount() == 8 ) {
@@ -465,15 +465,15 @@
466466 * Returns whether the module should be reparsed or not.
467467 */
468468 public function isOutOfDate() {
469 - global $wgInlineScriptsParserClass;
470 - return $wgInlineScriptsParserClass::getVersion() != $this->mParserVersion;
 469+ global $wgScriptsParserClass;
 470+ return $wgScriptsParserClass::getVersion() != $this->mParserVersion;
471471 }
472472 }
473473
474474 /**
475475 * Represents a function.
476476 */
477 -class ISFunction {
 477+class WSFunction {
478478 public $name;
479479 public $args;
480480 public $body;
Index: trunk/extensions/WikiScripts/interpreter/LRTable.php
@@ -1,7 +1,7 @@
22 <?php
33
44 /**
5 - * Autogenerated SLR-table for inline scripts language.
 5+ * Autogenerated SLR-table for scripts language.
66 *
77 * You should not try to modify it manually (it's very easy to break).
88 * Use syntax.txt and buildLRTables.php insteaed.
@@ -22,7 +22,7 @@
2323 * Generated on 2011-08-13 21:53:42.
2424 */
2525
26 -class ISLRTable {
 26+class WSLRTable {
2727
2828 const Timestamp = '2011-08-13 21:53:42';
2929
Index: trunk/extensions/WikiScripts/interpreter/Shared.php
@@ -27,7 +27,7 @@
2828 /**
2929 * This class represents a terminal of the script grammar.
3030 */
31 -class ISToken {
 31+class WSToken {
3232 // Constant values should match ones in syntax.txt
3333 const TEnd = '$';
3434 const TAppend = 'append';
@@ -90,7 +90,7 @@
9191 /**
9292 * This class represents a non-terminal of the script grammar.
9393 */
94 -class ISParserTreeNode {
 94+class WSParserTreeNode {
9595 var $mType, $mChildren;
9696
9797 public function __construct( $parser, $id ) {
@@ -101,7 +101,7 @@
102102 public function addChild( $node ) {
103103 // Since we do not want a long chain of "exprSomething -> exprWhatever" in the parser tree,
104104 // we cut it out at the parsing stage
105 - if( $node instanceof ISParserTreeNode ) {
 105+ if( $node instanceof WSParserTreeNode ) {
106106 $children = $node->getChildren();
107107 if( count( $children ) == 1 && strpos( $node->mType, "expr" ) === 0
108108 && strpos( @$children[0]->mType, "expr" ) === 0 ) {
@@ -137,7 +137,7 @@
138138 public function formatStringArray() {
139139 $s = array( "<nonterminal type=\"{$this->mType}\">" );
140140 foreach( $this->mChildren as $child ) {
141 - if( $child instanceof ISParserTreeNode ) {
 141+ if( $child instanceof WSParserTreeNode ) {
142142 $sub = $child->formatStringArray();
143143 foreach( $sub as $str )
144144 $s[] = "\t" . $str;
@@ -153,7 +153,7 @@
154154 /**
155155 * Generalized script parser.
156156 */
157 -interface ISParser {
 157+interface WSParser {
158158 /**
159159 * If this function returns true, code scanner is passed to parse().
160160 * Otherwise, code itself is passed.
@@ -162,29 +162,29 @@
163163
164164 /**
165165 * Parses code (in text or scanner) to parser tree.
166 - * @param input ISScanner Input (scanner or string)
 166+ * @param input WSScanner Input (scanner or string)
167167 * @param maxTokens int Maximal amount of tokens
168 - * @return ISParserTreeNode
 168+ * @return WSParserTreeNode
169169 */
170170 public function parse( $input, $module, $maxTokens );
171171
172172 /**
173173 * Returns an array of the syntax errors in the code
174 - * @param input ISSCanner Input (scanner or string)
 174+ * @param input WSSCanner Input (scanner or string)
175175 * @param maxTokens int Maximal amount of tokens
176176 * @return array(string)
177177 */
178178 public function getSyntaxErrors( $input, $moudle, $maxTokens );
179179 }
180180
181 -class ISException extends MWException {}
 181+class WSException extends MWException {}
182182
183183 // Exceptions that we might conceivably want to report to ordinary users
184184 // (i.e. exceptions that don't represent bugs in the extension itself)
185 -class ISUserVisibleException extends ISException {
 185+class WSUserVisibleException extends WSException {
186186 function __construct( $exception_id, $module, $line, $params = array() ) {
187 - $codelocation = wfMsg( 'inlinescripts-codelocation', $module, $line );
188 - $msg = wfMsgExt( 'inlinescripts-exception-' . $exception_id, array(), array_merge( array( $codelocation ), $params ) );
 187+ $codelocation = wfMsg( 'wikiscripts-codelocation', $module, $line );
 188+ $msg = wfMsgExt( 'wikiscripts-exception-' . $exception_id, array(), array_merge( array( $codelocation ), $params ) );
189189 parent::__construct( $msg );
190190
191191 $this->mExceptionID = $exception_id;
@@ -201,9 +201,9 @@
202202 /**
203203 * Exceptions caused by the error on script transclusion error, i.e. not in script.
204204 */
205 -class ISTransclusionException extends ISException {
 205+class WSTransclusionException extends WSException {
206206 function __construct( $exception_id, $params = array() ) {
207 - $msg = wfMsgExt( 'inlinescripts-transerror-' . $exception_id, array(), $params );
 207+ $msg = wfMsgExt( 'wikiscripts-transerror-' . $exception_id, array(), $params );
208208 parent::__construct( $msg );
209209
210210 $this->mExceptionID = $exception_id;
@@ -215,12 +215,12 @@
216216 * Exceptions used for control structures that need to break out of deep function
217217 * nesting level (e.g. break or continue).
218218 */
219 -class ISControlException extends ISUserVisibleException {}
 219+class WSControlException extends WSUserVisibleException {}
220220
221221 /**
222222 * Exception that allows to return from a function.
223223 */
224 -class ISReturnException extends ISControlException {
 224+class WSReturnException extends WSControlException {
225225 function __construct( $result, $empty ) {
226226 $this->mResult = $result;
227227 $this->mEmpty = $empty;
@@ -238,14 +238,14 @@
239239 /**
240240 * Code parser output.
241241 */
242 -class ISParserOutput {
 242+class WSParserOutput {
243243 var $mTree, $mTokensCount, $mVersion;
244244
245245 public function __construct( $tree, $tokens ) {
246 - global $wgInlineScriptsParserClass;
 246+ global $wgScriptsParserClass;
247247 $this->mTree = $tree;
248248 $this->mTokensCount = $tokens;
249 - $this->mVersion = $wgInlineScriptsParserClass::getVersion();
 249+ $this->mVersion = $wgScriptsParserClass::getVersion();
250250 }
251251
252252 public function getParserTree() {
@@ -257,5 +257,5 @@
258258 }
259259 }
260260
261 -// Used by ISEvaluationContext::setVar
262 -class ISPlaceholder {}
 261+// Used by WSEvaluationContext::setVar
 262+class WSPlaceholder {}
Index: trunk/extensions/WikiScripts/interpreter/buildLRTables.php
@@ -350,7 +350,7 @@
351351 $s = <<<END
352352 <html>
353353 <head>
354 -<title>Inline scripts LR table dump</title>
 354+<title>Scripts LR table dump</title>
355355 <style type="text/css">
356356 table {
357357 margin: 1em 1em 1em 0;
@@ -468,7 +468,7 @@
469469 <?php
470470
471471 /**
472 - * Autogenerated SLR-table for inline scripts language.
 472+ * Autogenerated SLR-table for scripts language.
473473 *
474474 * You should not try to modify it manually (it's very easy to break).
475475 * Use syntax.txt and buildLRTables.php insteaed.
@@ -489,7 +489,7 @@
490490 * Generated on {$date}.
491491 */
492492
493 -class ISLRTable {
 493+class WSLRTable {
494494
495495 const Timestamp = '{$date}';
496496
@@ -545,7 +545,7 @@
546546 * version in separate file.
547547 */
548548
549 -define( 'IS_LR_VERSION', "{$ts}" );
 549+define( 'WS_LR_VERSION', "{$ts}" );
550550
551551 EOF;
552552 }
Index: trunk/extensions/WikiScripts/Hooks.php
@@ -21,18 +21,18 @@
2222 */
2323
2424 /**
25 - * Hooks for InlineScripts extension.
 25+ * Hooks for WikiScripts extension.
2626 */
27 -class ISHooks {
 27+class WSHooks {
2828 /**
2929 * Returns the interpreter for a given parser.
3030 *
3131 * @static
32 - * @return InlineScriptInterpreter
 32+ * @return WSIntepreter
3333 */
3434 public static function getInterpreter( $parser ) {
3535 if( !isset( $parser->is_interpreter ) || !$parser->is_interpreter ) {
36 - $parser->is_interpreter = new ISInterpreter( $parser );
 36+ $parser->is_interpreter = new WSInterpreter( $parser );
3737 }
3838 return $parser->is_interpreter;
3939 }
@@ -42,7 +42,7 @@
4343 * @param $parser Parser
4444 */
4545 public static function setupParserHook( &$parser ) {
46 - $parser->setFunctionHook( 'i', 'ISHooks::callHook', SFH_NO_HASH | SFH_OBJECT_ARGS );
 46+ $parser->setFunctionHook( 'i', 'WSHooks::callHook', SFH_NO_HASH | SFH_OBJECT_ARGS );
4747 return true;
4848 }
4949
@@ -81,7 +81,7 @@
8282
8383 try {
8484 if( count( $args ) < 2 ) {
85 - throw new ISTransclusionException( 'nofunction' );
 85+ throw new WSTransclusionException( 'nofunction' );
8686 }
8787
8888 $moduleName = $parser->mStripState->unstripBoth( array_shift( $args ) );
@@ -91,7 +91,7 @@
9292 }
9393
9494 $result = $i->invokeUserFunctionFromWikitext( $moduleName, $funcName, $args, $frame );
95 - } catch( ISException $e ) {
 95+ } catch( WSException $e ) {
9696 $msg = $e->getMessage();
9797 wfProfileOut( __METHOD__ );
9898 return "<strong class=\"error\">{$msg}</strong>";
@@ -112,10 +112,10 @@
113113 * @return bool
114114 */
115115 public static function handleScriptView( $text, $title, $output ) {
116 - global $wgInlineScriptsUseGeSHi;
 116+ global $wgScriptsUseGeSHi;
117117
118118 if( $title->getNamespace() == NS_MODULE ) {
119 - if( $wgInlineScriptsUseGeSHi ) {
 119+ if( $wgScriptsUseGeSHi ) {
120120 $geshi = SyntaxHighlight_GeSHi::prepare( $text, 'wikiscript' );
121121 $geshi->set_language_path( dirname( __FILE__ ) . '/geshi' );
122122 $geshi->set_language( 'wikiscript' );
@@ -159,11 +159,11 @@
160160 * @return bool
161161 */
162162 public static function reportLimits( $parser, &$report ) {
163 - global $wgInlineScriptsLimits;
 163+ global $wgScriptsLimits;
164164 $i = self::getInterpreter( $parser );
165165 $report .=
166 - "Inline scripts parser evaluations: {$i->mEvaluations}/{$wgInlineScriptsLimits['evaluations']}\n" .
167 - "Inline scripts AST maximal depth: {$i->mMaxRecursion}/{$wgInlineScriptsLimits['depth']}\n";
 166+ "Scripts parser evaluations: {$i->mEvaluations}/{$wgScriptsLimits['evaluations']}\n" .
 167+ "Scripts AST maximal depth: {$i->mMaxRecursion}/{$wgScriptsLimits['depth']}\n";
168168 return true;
169169 }
170170
@@ -181,12 +181,12 @@
182182 $title = $editor->mTitle;
183183
184184 if( $title->getNamespace() == NS_MODULE ) {
185 - $errors = ISInterpreter::getSyntaxErrors( $title->getText(), $text );
 185+ $errors = WSInterpreter::getSyntaxErrors( $title->getText(), $text );
186186 if( !$errors ) {
187187 return true;
188188 }
189189
190 - $errmsg = wfMsgExt( 'inlinescripts-error', array( 'parsemag' ), array( count( $errors ) ) );
 190+ $errmsg = wfMsgExt( 'wikiscripts-error', array( 'parsemag' ), array( count( $errors ) ) );
191191 $errlines = '* ' . implode( "\n* ", array_map( 'wfEscapeWikiText', $errors ) );
192192 $error = <<<HTML
193193 <div class="errorbox">
Index: trunk/extensions/WikiScripts/LinksUpdate.php
@@ -29,7 +29,7 @@
3030 * Class that contains hooks related to tracking links to scripts and invalidating
3131 * pages on script change.
3232 */
33 -class ISLinksUpdateHooks {
 33+class WSLinksUpdateHooks {
3434 /**
3535 * Appends script links to the output.
3636 */
@@ -51,7 +51,7 @@
5252 $new = array();
5353 }
5454
55 - $isupdate = new ISLinksUpdate( $update, $new );
 55+ $isupdate = new WSLinksUpdate( $update, $new );
5656 $isupdate->run();
5757 return true;
5858 }
@@ -64,7 +64,7 @@
6565
6666 if( $article->mTitle->getNamespace() == NS_MODULE ) {
6767 // Invalidate the script cache
68 - ISInterpreter::invalidateModule( $article->mTitle );
 68+ WSInterpreter::invalidateModule( $article->mTitle );
6969
7070 // Invalidate caches of articles which include the script
7171 $wgDeferredUpdateList[] = new HTMLCacheUpdate( $article->mTitle, 'scriptlinks' );
@@ -105,7 +105,7 @@
106106 * A class that updates links on scripts like phase3/includes/LinksUpdate.php does that
107107 * with templates.
108108 */
109 -class ISLinksUpdate {
 109+class WSLinksUpdate {
110110 var $mUpdate, $mId, $mNew;
111111
112112 public function __construct( $update, $new ) {

Status & tagging log