@@ -123,7 +123,6 @@ module.exports = function( grunt ) {
123123 paths : {
124124 cldr : "../external/cldrjs/dist/cldr" ,
125125 "make-plural" : "../external/make-plural/make-plural" ,
126- messageformat : "../messageformat_hack/messageformat" ,
127126 "messageformat-parser" : "../node_modules/messageformat-parser/parser" ,
128127 "reserved-words" : "../node_modules/reserved-words/lib/reserved-words"
129128 } ,
@@ -138,8 +137,7 @@ module.exports = function( grunt ) {
138137 // Only for root id's (the ones in src, not in src's subpaths). Note there's no
139138 // conditional code checking for this type.
140139 onBuildWrite : function ( id , path , contents ) {
141- var messageformat ,
142- name = camelCase ( id . replace ( / u t i l \/ | c o m m o n \/ / , "" ) ) ;
140+ var name = camelCase ( id . replace ( / u t i l \/ | c o m m o n \/ / , "" ) ) ;
143141
144142 // MakePlural
145143 if ( ( / m a k e - p l u r a l / ) . test ( id ) ) {
@@ -216,97 +214,8 @@ module.exports = function( grunt ) {
216214 "}());" ,
217215 "/* jshint ignore:end */"
218216 ] . join ( "\n" ) ) ;
219-
220- // message/compiler
221- // } else if ( ( /message\/compiler/ ).test( id ) ) {
222- //
223- // messageformatParser = require( "messageformat-parser" );
224- // reservedWords = require( "reserved-words" );
225- // console.log( messageformatParser.SyntaxError.toString() );
226- // contents = contents
227- // .replace( "var Parser = {};", [
228- // "/* jshint ignore:start */",
229- // "var Parser = (function() {",
230- // messageformatParser.toString(),
231- // "return {SyntaxError: peg$SyntaxError, parse: peg$parse};",
232- // "}());",
233- // "/* jshint ignore:end */"
234- // ].join( "\n" ) )
235- // .replace( "var reserved = {}", [
236- // "/* jshint ignore:start */",
237- // "var reserved = (function() {",
238- // reservedWords.toString(),
239- // "return {check: exports.check};",
240- // "}());",
241- // "/* jshint ignore:end */"
242- // ] )
243- // ;
244-
245- // messageformat
246- // } else if ( ( /messageformat/ ).test( id ) ) {
247- // return contents
248- //
249- // // Remove browserify wrappers.
250- // .replace( /^\(function\(f\)\{if\(typeof exports==="object"&&type.*/, "" )
251- // .replace( " },{}],2:[function(require,module,exports){", "" )
252- // .replace( /\ },\{"\.\/messageformat-parser":1,"make-plural\/plural.*/, "" )
253- // .replace( /\ },\{\}\]\ },\{\},\[2\]\)\(2\)[\s\S]*?$/, "" )
254- //
255- // // Set `MessageFormat.plurals` and remove `make-plural/plurals`
256- // // completely. This is populated by Globalize on demand.
257- // .replace( /var _cp = \[[\s\S]*?$/, "" )
258- // .replace(
259- // "MessageFormat.plurals = require('make-plural/plurals')",
260- // "MessageFormat.plurals = {}"
261- // )
262- //
263- // // Set `MessageFormat._parse`
264- // .replace(
265- // "MessageFormat._parse = require('./messageformat-parser').parse;",
266- // ""
267- // )
268- // .replace( /module\.exports = \(function\(\) \{([\s\S]*?)\n\}\)\(\);/, [
269- // "MessageFormat._parse = (function() {",
270- // "$1",
271- // "}()).parse;"
272- // ].join( "\n" ) )
273- //
274- // // Remove unused code.
275- // .replace( /if \(!pluralFunc\) \{\n[\s\S]*?\n \}/, "" )
276- // .replace( /if \(!locale\) \{\n[\s\S]*? \}\n/, "this.lc = [locale];" )
277- // .replace( /(MessageFormat\.formatters) = \{[\s\S]*?\n\};/, "$1 = {};" )
278- // .replace( /MessageFormat\.prototype\.setIntlSupport[\s\S]*?\n\ };/, "" )
279- //
280- // // Wrap everything into a var assignment.
281- // .replace( "module.exports = MessageFormat;", "" )
282- // .replace( /^/, [
283- // "var MessageFormat;",
284- // "/* jshint ignore:start */",
285- // "MessageFormat = (function() {"
286- // ].join( "\n" ) )
287- // .replace( /$/, [
288- // "return MessageFormat;",
289- // "}());",
290- // "/* jshint ignore:end */"
291- // ].join( "\n" ) );
292-
293- // message-runtime
294- // } else if ( ( /message-runtime/ ).test( id ) ) {
295- // messageformat = require( "./external/messageformat/messageformat" );
296- // delete messageformat.prototype.runtime.fmt;
297- // delete messageformat.prototype.runtime.pluralFuncs;
298- // contents = contents.replace( "Globalize._messageFormat = {};", [
299- // "/* jshint ignore:start */",
300- // "Globalize._messageFormat = (function() {",
301- // messageformat.prototype.runtime.toString(),
302- // "return {number: number, plural: plural, select: select};",
303- // "}());",
304- // "/* jshint ignore:end */"
305- // ].join( "\n" ) );
306217 }
307218
308- messageformat = "I don't care" ;
309-
310219 // 1, and 2: Remove define() wrap.
311220 // 3: Remove empty define()'s.
312221 contents = contents
0 commit comments