Sfoglia il codice sorgente

parser is AMD module; globals not used anymore

Herbert Vojčík 11 anni fa
parent
commit
2560ce464d
2 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 1 1
      grunt/tasks/grunt-peg.js
  2. 2 2
      js/parser.js

+ 1 - 1
grunt/tasks/grunt-peg.js

@@ -23,7 +23,7 @@ module.exports = function(grunt) {
       export_var: 'module.exports'
     });
     var parser = PEG.buildParser(grunt.file.read(this.data.src), options);
-    var content = '(function(smalltalk,nil){\n'+options.export_var + ' = ' + parser.toSource() + ';\n})(global_smalltalk,global_nil);';
+    var content = 'define(["smalltalk","nil"],function(smalltalk,nil){\n'+options.export_var + ' = ' + parser.toSource() + ';\n});';
     grunt.file.write(this.data.dest, content);
   });
 };

+ 2 - 2
js/parser.js

@@ -1,4 +1,4 @@
-(function(smalltalk,nil){
+define(["smalltalk","nil"],function(smalltalk,nil){
 smalltalk.parser = (function(){
   /*
    * Generated by PEG.js 0.7.0.
@@ -4182,4 +4182,4 @@ smalltalk.parser = (function(){
   
   return result;
 })();
-})(global_smalltalk,global_nil);
+});