Browse Source

parser: use `null` for `nil`

Herbert Vojčík 7 years ago
parent
commit
fa7d718c54
4 changed files with 5 additions and 5 deletions
  1. 1 1
      internal/grunt-tasks/grunt-peg.js
  2. 1 1
      package.json
  3. 2 2
      support/parser.js
  4. 1 1
      support/parser.pegjs

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

@@ -18,7 +18,7 @@ module.exports = function (grunt) {
             export_var: 'module.exports'
         });
         var parser = PEG.buildParser(grunt.file.read(this.data.src), options);
-        var content = "define(['./boot'], function($boot) {\nvar $globals = $boot.globals, nil = $boot.nilAsReceiver;\n" + options.export_var + " = " + parser + ";\n});";
+        var content = "define(['./boot'], function($boot) {\nvar $globals = $boot.globals;\n" + options.export_var + " = " + parser + ";\n});";
         grunt.file.write(this.data.dest, content);
     });
 };

+ 1 - 1
package.json

@@ -24,7 +24,7 @@
     "node": "0.10.x || 0.12.x || >=4.0.0"
   },
   "strings": {
-    "buildParserBegin": "define(['./boot'], function($boot) {\nvar $globals = $boot.globals, nil = $boot.nilAsReceiver;\n",
+    "buildParserBegin": "define(['./boot'], function($boot) {\nvar $globals = $boot.globals;\n",
     "buildParserEnd": "});"
   },
   "scripts": {

+ 2 - 2
support/parser.js

@@ -1,5 +1,5 @@
 define(['./boot'], function($boot) {
-var $globals = $boot.globals, nil = $boot.nilAsReceiver;
+var $globals = $boot.globals;
 $globals.SmalltalkParser = (function() {
   "use strict";
 
@@ -150,7 +150,7 @@ $globals.SmalltalkParser = (function() {
         peg$c70 = function() {return false;},
         peg$c71 = "nil",
         peg$c72 = { type: "literal", value: "nil", description: "\"nil\"" },
-        peg$c73 = function() {return nil;},
+        peg$c73 = function() {return null;},
         peg$c74 = function(identifier) {
         	return $globals.VariableNode._new()
         		._location_(location())

+ 1 - 1
support/parser.pegjs

@@ -96,7 +96,7 @@ dynamicDictionary = '#{' expressions:wsAssociations? maybeDotsWs  '}' {
 pseudoVariable = val:(
 	'true' {return true;} /
 	'false' {return false;} /
-	'nil' {return nil;}
+	'nil' {return null;}
 ) {
 	return $globals.ValueNode._new()
 		._location_(location())