Browse Source

Merge branch 'master' into traits-in-core

# Conflicts:
#	CHANGELOG
#	src/Kernel-Classes.js
#	src/Kernel-Infrastructure.st
Herbert Vojčík 7 years ago
parent
commit
5e0f102c62

+ 10 - 1
CHANGELOG

@@ -7,7 +7,16 @@
 Commits: https://lolg.it/amber/amber/commits/0.19.0.
 
 
-?? March 2017 - Release 0.18.4
+7 April 2017 - Release 0.18.5
+===================================
+
+* Fix inability to change ivars.
+* Wrapper-JQuery bumped to use inlineJS: syntax.
+
+Commits: https://lolg.it/amber/amber/commits/0.18.5.
+
+
+5 March 2017 - Release 0.18.4
 ===================================
 
 * Fix export of extension trait methods.

File diff suppressed because it is too large
+ 376 - 371
external/amber-cli/support/amber-cli.js


+ 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": {

+ 15 - 9
src/Compiler-Core.js

@@ -245,7 +245,7 @@ $globals.AbstractCodeGenerator);
 
 
 
-$core.addClass("CodeGenerator", $globals.AbstractCodeGenerator, [], "Compiler-Core");
+$core.addClass("CodeGenerator", $globals.AbstractCodeGenerator, ["transformersDictionary"], "Compiler-Core");
 //>>excludeStart("ide", pragmas.excludeIdeData);
 $globals.CodeGenerator.comment="I am a basic code generator. I generate a valid JavaScript output, but no not perform any inlining.\x0aSee `InliningCodeGenerator` for an optimized JavaScript code generation.";
 //>>excludeEnd("ide");
@@ -328,28 +328,34 @@ var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1;
-$1=$recv($globals.Dictionary)._new();
-$recv($1)._at_put_("2000-semantic",self._semanticAnalyzer());
+var $1,$2,$receiver;
+$1=self["@transformersDictionary"];
+if(($receiver = $1) == null || $receiver.isNil){
+$2=$recv($globals.Dictionary)._new();
+$recv($2)._at_put_("2000-semantic",self._semanticAnalyzer());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["at:put:"]=1;
 //>>excludeEnd("ctx");
-$recv($1)._at_put_("5000-astToIr",self._translator());
+$recv($2)._at_put_("5000-astToIr",self._translator());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["at:put:"]=2;
 //>>excludeEnd("ctx");
-$recv($1)._at_put_("8000-irToJs",self._irTranslator());
-return $recv($1)._yourself();
+$recv($2)._at_put_("8000-irToJs",self._irTranslator());
+self["@transformersDictionary"]=$recv($2)._yourself();
+return self["@transformersDictionary"];
+} else {
+return $1;
+}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"transformersDictionary",{},$globals.CodeGenerator)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "transformersDictionary\x0a\x09^ Dictionary new\x0a\x09\x09at: '2000-semantic' put: self semanticAnalyzer;\x0a\x09\x09at: '5000-astToIr' put: self translator;\x0a\x09\x09at: '8000-irToJs' put: self irTranslator;\x0a\x09\x09yourself",
+source: "transformersDictionary\x0a\x09^ transformersDictionary ifNil: [ transformersDictionary := Dictionary new\x0a\x09\x09at: '2000-semantic' put: self semanticAnalyzer;\x0a\x09\x09at: '5000-astToIr' put: self translator;\x0a\x09\x09at: '8000-irToJs' put: self irTranslator;\x0a\x09\x09yourself ]",
 referencedClasses: ["Dictionary"],
 //>>excludeEnd("ide");
-messageSends: ["at:put:", "new", "semanticAnalyzer", "translator", "irTranslator", "yourself"]
+messageSends: ["ifNil:", "at:put:", "new", "semanticAnalyzer", "translator", "irTranslator", "yourself"]
 }),
 $globals.CodeGenerator);
 

+ 3 - 3
src/Compiler-Core.st

@@ -54,7 +54,7 @@ transformersDictionary
 ! !
 
 AbstractCodeGenerator subclass: #CodeGenerator
-	instanceVariableNames: ''
+	instanceVariableNames: 'transformersDictionary'
 	package: 'Compiler-Core'!
 !CodeGenerator commentStamp!
 I am a basic code generator. I generate a valid JavaScript output, but no not perform any inlining.
@@ -79,11 +79,11 @@ semanticAnalyzer
 !
 
 transformersDictionary
-	^ Dictionary new
+	^ transformersDictionary ifNil: [ transformersDictionary := Dictionary new
 		at: '2000-semantic' put: self semanticAnalyzer;
 		at: '5000-astToIr' put: self translator;
 		at: '8000-irToJs' put: self irTranslator;
-		yourself
+		yourself ]
 !
 
 translator

+ 14 - 8
src/Compiler-Inlining.js

@@ -2194,8 +2194,10 @@ var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1;
-$1=(
+var $1,$2,$receiver;
+$1=self["@transformersDictionary"];
+if(($receiver = $1) == null || $receiver.isNil){
+$2=(
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = true,
 //>>excludeEnd("ctx");
@@ -2203,26 +2205,30 @@ $ctx1.supercall = true,
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = false;
 //>>excludeEnd("ctx");;
-$recv($1)._at_put_("3000-inlinerTagging",self._preInliner());
+$recv($2)._at_put_("3000-inlinerTagging",self._preInliner());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["at:put:"]=1;
 //>>excludeEnd("ctx");
-$recv($1)._at_put_("6000-inliner",self._inliner());
+$recv($2)._at_put_("6000-inliner",self._inliner());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["at:put:"]=2;
 //>>excludeEnd("ctx");
-$recv($1)._at_put_("8000-irToJs",self._irTranslator());
-return $recv($1)._yourself();
+$recv($2)._at_put_("8000-irToJs",self._irTranslator());
+self["@transformersDictionary"]=$recv($2)._yourself();
+return self["@transformersDictionary"];
+} else {
+return $1;
+}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"transformersDictionary",{},$globals.InliningCodeGenerator)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "transformersDictionary\x0a\x09^ super transformersDictionary\x0a\x09\x09at: '3000-inlinerTagging' put: self preInliner;\x0a\x09\x09at: '6000-inliner' put: self inliner;\x0a\x09\x09at: '8000-irToJs' put: self irTranslator;\x0a\x09\x09yourself",
+source: "transformersDictionary\x0a\x09^ transformersDictionary ifNil: [ transformersDictionary := super transformersDictionary\x0a\x09\x09at: '3000-inlinerTagging' put: self preInliner;\x0a\x09\x09at: '6000-inliner' put: self inliner;\x0a\x09\x09at: '8000-irToJs' put: self irTranslator;\x0a\x09\x09yourself ]",
 referencedClasses: [],
 //>>excludeEnd("ide");
-messageSends: ["at:put:", "transformersDictionary", "preInliner", "inliner", "irTranslator", "yourself"]
+messageSends: ["ifNil:", "at:put:", "transformersDictionary", "preInliner", "inliner", "irTranslator", "yourself"]
 }),
 $globals.InliningCodeGenerator);
 

+ 2 - 2
src/Compiler-Inlining.st

@@ -574,11 +574,11 @@ preInliner
 !
 
 transformersDictionary
-	^ super transformersDictionary
+	^ transformersDictionary ifNil: [ transformersDictionary := super transformersDictionary
 		at: '3000-inlinerTagging' put: self preInliner;
 		at: '6000-inliner' put: self inliner;
 		at: '8000-irToJs' put: self irTranslator;
-		yourself
+		yourself ]
 ! !
 
 SemanticError subclass: #InliningError

+ 6 - 8
src/Kernel-Classes.js

@@ -1159,25 +1159,23 @@ $1;
 } else {
 $recv(theClass)._package_(thePackage);
 $2=$recv($recv(theClass)._superclass()).__eq_eq(aClass);
-if($core.assert($2)){
-$3=theClass;
-$recv($3)._recompile();
-return $recv($3)._yourself();
-} else {
+if(!$core.assert($2)){
 return self._migrateClassNamed_superclass_instanceVariableNames_package_(className,aClass,aCollection,packageName);
 }
 }
-return self._basicAddSubclassOf_named_instanceVariableNames_package_(aClass,className,aCollection,packageName);
+$3=self._basicAddSubclassOf_named_instanceVariableNames_package_(aClass,className,aCollection,packageName);
+$recv($3)._recompile();
+return $recv($3)._yourself();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"addSubclassOf:named:instanceVariableNames:package:",{aClass:aClass,className:className,aCollection:aCollection,packageName:packageName,theClass:theClass,thePackage:thePackage},$globals.ClassBuilder)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aClass", "className", "aCollection", "packageName"],
-source: "addSubclassOf: aClass named: className instanceVariableNames: aCollection package: packageName\x0a\x09| theClass thePackage |\x0a\x09\x0a\x09theClass := Smalltalk globals at: className.\x0a\x09thePackage := Package named: packageName.\x0a\x09\x0a\x09theClass ifNotNil: [\x0a\x09\x09theClass package: thePackage.\x0a\x09\x09theClass superclass == aClass\x0a\x09\x09\x09ifFalse: [ ^ self\x0a\x09\x09\x09\x09migrateClassNamed: className\x0a\x09\x09\x09\x09superclass: aClass\x0a\x09\x09\x09\x09instanceVariableNames: aCollection\x0a\x09\x09\x09\x09package: packageName ]\x0a\x09\x09\x09ifTrue: [ ^ theClass recompile; yourself ] ].\x0a\x09\x09\x0a\x09^ self\x0a\x09\x09basicAddSubclassOf: aClass\x0a\x09\x09named: className\x0a\x09\x09instanceVariableNames: aCollection\x0a\x09\x09package: packageName",
+source: "addSubclassOf: aClass named: className instanceVariableNames: aCollection package: packageName\x0a\x09| theClass thePackage |\x0a\x09\x0a\x09theClass := Smalltalk globals at: className.\x0a\x09thePackage := Package named: packageName.\x0a\x09\x0a\x09theClass ifNotNil: [\x0a\x09\x09theClass package: thePackage.\x0a\x09\x09theClass superclass == aClass\x0a\x09\x09\x09ifFalse: [ ^ self\x0a\x09\x09\x09\x09migrateClassNamed: className\x0a\x09\x09\x09\x09superclass: aClass\x0a\x09\x09\x09\x09instanceVariableNames: aCollection\x0a\x09\x09\x09\x09package: packageName ] ].\x0a\x09\x09\x0a\x09^ (self\x0a\x09\x09basicAddSubclassOf: aClass\x0a\x09\x09named: className\x0a\x09\x09instanceVariableNames: aCollection\x0a\x09\x09package: packageName) recompile; yourself",
 referencedClasses: ["Smalltalk", "Package"],
 //>>excludeEnd("ide");
-messageSends: ["at:", "globals", "named:", "ifNotNil:", "package:", "ifFalse:ifTrue:", "==", "superclass", "migrateClassNamed:superclass:instanceVariableNames:package:", "recompile", "yourself", "basicAddSubclassOf:named:instanceVariableNames:package:"]
+messageSends: ["at:", "globals", "named:", "ifNotNil:", "package:", "ifFalse:", "==", "superclass", "migrateClassNamed:superclass:instanceVariableNames:package:", "recompile", "basicAddSubclassOf:named:instanceVariableNames:package:", "yourself"]
 }),
 $globals.ClassBuilder);
 

+ 3 - 4
src/Kernel-Classes.st

@@ -287,14 +287,13 @@ addSubclassOf: aClass named: className instanceVariableNames: aCollection packag
 				migrateClassNamed: className
 				superclass: aClass
 				instanceVariableNames: aCollection
-				package: packageName ]
-			ifTrue: [ ^ theClass recompile; yourself ] ].
+				package: packageName ] ].
 		
-	^ self
+	^ (self
 		basicAddSubclassOf: aClass
 		named: className
 		instanceVariableNames: aCollection
-		package: packageName
+		package: packageName) recompile; yourself
 !
 
 addTraitNamed: traitName package: packageName

+ 0 - 24
src/Kernel-Collections.js

@@ -8985,30 +8985,6 @@ messageSends: ["do:", "nextPut:"]
 }),
 $globals.ProtoStream);
 
-$core.addMethod(
-$core.method({
-selector: "nextPutJSObject:",
-protocol: "writing",
-fn: function (aJSObject){
-var self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-self._nextPut_(aJSObject);
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"nextPutJSObject:",{aJSObject:aJSObject},$globals.ProtoStream)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["aJSObject"],
-source: "nextPutJSObject: aJSObject\x0a\x09self nextPut: aJSObject",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["nextPut:"]
-}),
-$globals.ProtoStream);
-
 $core.addMethod(
 $core.method({
 selector: "nextPutString:",

+ 0 - 4
src/Kernel-Collections.st

@@ -2181,10 +2181,6 @@ nextPutAll: aCollection
 		self nextPut: each ]
 !
 
-nextPutJSObject: aJSObject
-	self nextPut: aJSObject
-!
-
 nextPutString: aString
 	self nextPut: aString
 !

+ 24 - 0
src/Kernel-Infrastructure.js

@@ -3610,6 +3610,30 @@ $globals.SmalltalkImage.klass);
 
 $core.setTraitComposition([{trait: $globals.TThenable}], $globals.JSObjectProxy);
 
+$core.addMethod(
+$core.method({
+selector: "nextPutJSObject:",
+protocol: "*Kernel-Infrastructure",
+fn: function (aJSObject){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+self._nextPut_(aJSObject);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"nextPutJSObject:",{aJSObject:aJSObject},$globals.ProtoStream)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aJSObject"],
+source: "nextPutJSObject: aJSObject\x0a\x09self nextPut: aJSObject",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["nextPut:"]
+}),
+$globals.ProtoStream);
+
 $core.addMethod(
 $core.method({
 selector: "asJavaScriptPropertyName",

+ 6 - 0
src/Kernel-Infrastructure.st

@@ -967,6 +967,12 @@ new
 JSObjectProxy setTraitComposition: {TThenable} asTraitComposition!
 ! !
 
+!ProtoStream methodsFor: '*Kernel-Infrastructure'!
+
+nextPutJSObject: aJSObject
+	self nextPut: aJSObject
+! !
+
 !String methodsFor: '*Kernel-Infrastructure'!
 
 asJavaScriptPropertyName

File diff suppressed because it is too large
+ 363 - 356
support/parser.js


+ 300 - 243
support/parser.pegjs

@@ -1,250 +1,307 @@
 start = method
 
-separator      = [ \t\v\f\u00A0\uFEFF\n\r\u2028\u2029]+
-comments       = ('"' [^"]* '"')+
-ws             = (separator / comments)*
-maybeDotsWs = ("." / separator / comments)*
-identifier     = first:[a-zA-Z] others:[a-zA-Z0-9]* {return first + others.join("");}
-keyword        = first:identifier last:":" {return first + last;}
-className      = first:[A-Z] others:[a-zA-Z0-9]* {return first + others.join("");}
-string         = contents:rawString {
-                     return $globals.ValueNode._new()
-                            ._location_(location())
-                            ._source_(text())
-                            ._value_(contents);
-                 }
-rawString         = "'" val:(("''" {return "'";} / [^'])*) "'" {return val.join("");}
-character      = "$" char:.
-                  {
-                      return $globals.ValueNode._new()
-                             ._location_(location())
-                             ._source_(text())
-                             ._value_(char);
-                  }
-symbol         = "#" rest:bareSymbol {return rest;}
-bareSymbol         = val:(keywords:keyword+ {return keywords.join("");} / binarySelector / unarySelector / rawString)
-                  {
-                      return $globals.ValueNode._new()
-                             ._location_(location())
-                             ._source_(text())
-                             ._value_(val);
-                  }
-number         = n:(numberExp / hex / float / integer) {
-                     return $globals.ValueNode._new()
-                            ._location_(location())
-                            ._source_(text())
-                            ._value_(n);
-                 }
-numberExp      = n:((float / integer) "e" integer) {return parseFloat(n.join(""));}
-hex            = neg:"-"? "16r" num:[0-9a-fA-F]+ {return parseInt(((neg || '') + num.join("")), 16);}
-float          = neg:"-"? digits:[0-9]+ "." dec:[0-9]+ {return parseFloat(((neg || '') + digits.join("") + "." + dec.join("")), 10);}
-integer        = neg:"-"? digits:[0-9]+ {return (parseInt((neg || '') + digits.join(""), 10));}
-
-literalArray   = "#(" rest:wsLiteralArrayContents ws ")" {
-    return rest
-        ._location_(location())
-        ._source_(text());
-}
-bareLiteralArray   = "(" rest:wsLiteralArrayContents ws ")" {
-    return rest
-        ._location_(location())
-        ._source_(text());
+separator =
+	[ \t\v\f\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF\n\r\u2028\u2029]+
+
+comments = ('"' [^"]* '"')+
+
+ws = (separator / comments)*
+
+maybeDotsWs = ('.' / separator / comments)*
+
+identifier = $([a-zA-Z] [a-zA-Z0-9]*)
+
+keyword = $(identifier ':')
+
+className = $([A-Z] [a-zA-Z0-9]*)
+
+string = val:rawString {
+	return $globals.ValueNode._new()
+		._location_(location())
+		._source_(text())
+		._value_(val);
+}
+
+rawString = '\'' val:(('\'\'' {return '\'';} / [^'])*) '\'' {return val.join('');}
+
+character = '$' char:. {
+	return $globals.ValueNode._new()
+		._location_(location())
+		._source_(text())
+		._value_(char);
+}
+
+symbol = '#' rest:bareSymbol {return rest;}
+
+bareSymbol = val:($(keyword+) / binarySelector / unarySelector / rawString) {
+	return $globals.ValueNode._new()
+		._location_(location())
+		._source_(text())
+		._value_(val);
+}
+
+number = val:rawNumber {
+	return $globals.ValueNode._new()
+		._location_(location())
+		._source_(text())
+		._value_(val);
+}
+
+rawNumber = numberExp / hex / float / integer
+
+numberExp = n:$((float / integer) 'e' integer) {return parseFloat(n);}
+
+hex = neg:'-'? '16r' num:$[0-9a-fA-F]+ {
+	return parseInt(((neg || '') + num), 16);
+}
+
+float = n:$('-'? [0-9]+ '.' [0-9]+) {return parseFloat(n, 10);}
+
+integer = n:$('-'? [0-9]+) {return parseInt(n, 10);}
+
+literalArray = '#(' rest:wsLiteralArrayContents ws ')' {
+	return rest
+		._location_(location())
+		._source_(text());
+}
+
+bareLiteralArray = '(' rest:wsLiteralArrayContents ws ')' {
+	return rest
+		._location_(location())
+		._source_(text());
 }
 
 literalArrayElement = parseTimeLiteral / bareLiteralArray / bareSymbol
-wsLiteralArrayContents   = lits:(ws lit:literalArrayElement {return lit._value();})* {
-                     return $globals.ValueNode._new()
-                            ._value_(lits);
-                 }
-dynamicArray   = "{" expressions:wsExpressions? maybeDotsWs "}" {
-                     return $globals.DynamicArrayNode._new()
-                            ._location_(location())
-                            ._source_(text())
-                            ._dagChildren_(expressions || []);
-                 }
-dynamicDictionary = "#{" expressions:wsAssociations? maybeDotsWs  "}" {
-                        return $globals.DynamicDictionaryNode._new()
-                               ._location_(location())
-                               ._source_(text())
-                               ._dagChildren_(expressions || []);
-                    }
+
+wsLiteralArrayContents =
+	lits:(ws lit:literalArrayElement {return lit._value();})* {
+		return $globals.ValueNode._new()
+			._value_(lits);
+	}
+
+dynamicArray = '{' expressions:wsExpressions? maybeDotsWs '}' {
+	return $globals.DynamicArrayNode._new()
+		._location_(location())
+		._source_(text())
+		._dagChildren_(expressions || []);
+}
+
+dynamicDictionary = '#{' expressions:wsAssociations? maybeDotsWs  '}' {
+	return $globals.DynamicDictionaryNode._new()
+		._location_(location())
+		._source_(text())
+		._dagChildren_(expressions || []);
+}
+
 pseudoVariable = val:(
-                   'true' {return true;}
-                 / 'false' {return false;}
-                 / 'nil' {return nil;}) {
-                       return $globals.ValueNode._new()
-                              ._location_(location())
-                              ._source_(text())
-                              ._value_(val);
-                   }
-parseTimeLiteral        = pseudoVariable / number / literalArray / string / symbol / character
-runtimeLiteral        = dynamicDictionary / dynamicArray / block
-literal        = runtimeLiteral / parseTimeLiteral
-
-
-variable       = identifier:identifier {
-                     return $globals.VariableNode._new()
-                            ._location_(location())
-                            ._source_(text())
-                            ._value_(identifier);
-                 }
-
-reference      = variable
-
-binarySelector = bin:[\\+*/=><,@%~|&-]+ {return bin.join("");}
-unarySelector  = identifier
-
-wsKeywordPattern = pairs:(ws key:keyword ws arg:identifier {return {key:key, arg:arg};})+ {
-                     var selector = "";
-                     var params = [];
-                     for(var i = 0; i < pairs.length; i++){
-                         selector += pairs[i].key;
-                         params.push(pairs[i].arg);
-                     }
-                     return [selector, params];
-                 }
-wsBinaryPattern  = ws selector:binarySelector ws arg:identifier {return [selector, [arg]];}
-wsUnaryPattern   = ws selector:unarySelector {return [selector, []];}
-
-expression     = assignment / cascade / keywordSend
-
-wsExpressionsRest = ws "." maybeDotsWs expression:expression {return expression;}
-wsExpressions    = maybeDotsWs first:expression others:wsExpressionsRest* { return [first].concat(others); }
-
-assignment     = variable:variable ws ':=' ws expression:expression {
-                     return $globals.AssignmentNode._new()
-                            ._location_(location())
-                            ._source_(text())
-                            ._left_(variable)
-                            ._right_(expression);
-                 }
-
-ret            = '^' ws expression:expression {
-                     return $globals.ReturnNode._new()
-                            ._location_(location())
-                            ._source_(text())
-                            ._dagChildren_([expression]);
-                 }
+	'true' {return true;} /
+	'false' {return false;} /
+	'nil' {return null;}
+) {
+	return $globals.ValueNode._new()
+		._location_(location())
+		._source_(text())
+		._value_(val);
+}
+
+parseTimeLiteral =
+	pseudoVariable / number / literalArray / string / symbol / character
+
+runtimeLiteral = dynamicDictionary / dynamicArray / block
+
+literal = runtimeLiteral / parseTimeLiteral
+
+variable = identifier:identifier {
+	return $globals.VariableNode._new()
+		._location_(location())
+		._source_(text())
+		._value_(identifier);
+}
+
+reference = variable
+
+binarySelector = $[\\+*/=><,@%~|&-]+
+
+unarySelector = identifier
+
+wsKeywordPattern =
+	pairs:(ws key:keyword ws arg:identifier {return {key:key, arg:arg};})+ {
+		var selector = '';
+		var params = [];
+		for(var i = 0; i < pairs.length; i++) {
+			selector += pairs[i].key;
+			params.push(pairs[i].arg);
+		}
+		return [selector, params];
+	}
+
+wsBinaryPattern = ws selector:binarySelector ws arg:identifier {
+	return [selector, [arg]];
+}
+
+wsUnaryPattern = ws selector:unarySelector {return [selector, []];}
+
+expression = assignment / cascade / keywordSend
+
+wsExpressionsRest = ws '.' maybeDotsWs expression:expression {
+	return expression;
+}
+
+wsExpressions = maybeDotsWs first:expression others:wsExpressionsRest* {
+	return [first].concat(others);
+}
+
+assignment = variable:variable ws ':=' ws expression:expression {
+	return $globals.AssignmentNode._new()
+		._location_(location())
+		._source_(text())
+		._left_(variable)
+		._right_(expression);
+}
+
+ret = '^' ws expression:expression {
+	return $globals.ReturnNode._new()
+		._location_(location())
+		._source_(text())
+		._dagChildren_([expression]);
+}
   
-temps          = "|" vars:(ws variable:identifier {return variable;})* ws "|" {return vars;}
-
-wsBlockParamList = params:((ws ":" ws param:identifier {return param;})+) ws "|" {return params;}
-
-subexpression  = '(' ws expression:expression ws ')' {return expression;}
-
-wsStatementsWs     = maybeDotsWs ret:ret maybeDotsWs {return [ret];}
-                 / exps:wsExpressions ws "." maybeDotsWs ret:ret maybeDotsWs {
-                       var expressions = exps;
-                       expressions.push(ret);
-                       return expressions;
-                   }
-                 / expressions:wsExpressions? maybeDotsWs {
-                       return expressions || [];
-                   }
-
-wsSequenceWs       = (ws js:jsSequence ws { return js; }) / wsStSequenceWs
-
-wsStSequenceWs    = ws temps:temps? statements:wsStatementsWs? {
-                     return $globals.SequenceNode._new()
-                            ._location_(location())
-                            ._source_(text())
-                            ._temps_(temps || [])
-                            ._dagChildren_(statements || []);
-                 }
-
-jsSequence     = jsStatement
-
-block          = '[' params:wsBlockParamList? sequence:wsSequenceWs? ']' {
-                     return $globals.BlockNode._new()
-                            ._location_(location())
-                            ._source_(text())
-                            ._parameters_(params || [])
-                            ._dagChildren_([sequence._asBlockSequenceNode()]);
-                 }
-
-operand        = literal / reference / subexpression
-
-
-
-wsUnaryMessage   = ws selector:unarySelector !":" {
-                     return $globals.SendNode._new()
-                            ._location_(location())
-                            ._source_(text())
-                            ._selector_(selector);
-                 }
-
-unarySend      = receiver:operand tail:wsUnaryMessage* {
-					 return receiver._withTail_(tail);
-                 }
-
-wsBinaryMessage  = ws selector:binarySelector ws arg:unarySend {
-                     return $globals.SendNode._new()
-                            ._location_(location())
-                            ._source_(text())
-                            ._selector_(selector)
-                            ._arguments_([arg]);
-                 }
-
-binarySend     = receiver:unarySend tail:wsBinaryMessage* {
-					 return receiver._withTail_(tail);
-                 }
-
-
-wsKeywordMessage = pairs:(ws key:keyword ws arg:binarySend {return {key:key, arg:arg};})+ {
-                     var selector = "";
-                     var args = [];
-                      for(var i = 0; i < pairs.length; i++) {
-                          selector += pairs[i].key;
-                          args.push(pairs[i].arg);
-                      }
-                      return $globals.SendNode._new()
-                             ._location_(location())
-                             ._source_(text())
-                             ._selector_(selector)
-                             ._arguments_(args);
-                 }
-
-keywordSend    = receiver:binarySend tail:wsKeywordMessage? {
-					 return tail ? receiver._withTail_([tail]) : receiver;
-                 }
-
-wsMessage        = wsBinaryMessage / wsUnaryMessage / wsKeywordMessage
-
-cascade        = send:keywordSend & { return send._isSendNode(); } messages:(ws ";" mess:wsMessage {return mess;})+ {
-                     messages.unshift(send);
-                     return $globals.CascadeNode._new()
-                            ._location_(location())
-                            ._source_(text())
-                            ._dagChildren_(messages);
-                 }
-
-jsStatement    = pragmaJsStatement / legacyJsStatement
-
-legacyJsStatement = "<" val:((">>" {return ">";} / [^>])*) ">" & { return !/^\s*inlineJS/.test(val.join("")) } {
-                     console.warn("Use of <...js code...> is deprecated, in:\n" + val.join(""));
-                     return $globals.JSStatementNode._new()
-                            ._location_(location())
-                            ._source_(val.join(""))
-                 }
-
-pragmaJsStatement = "<" ws "inlineJS:" ws val:rawString ws ">" {
-                     return $globals.JSStatementNode._new()
-                            ._location_(location())
-                            ._source_(val)
-                 }
-
-
-method         = pattern:(wsKeywordPattern / wsBinaryPattern / wsUnaryPattern) sequence:wsSequenceWs? {
-                      return $globals.MethodNode._new()
-                             ._location_(location())
-                             ._source_(text())
-                             ._selector_(pattern[0])
-                             ._arguments_(pattern[1])
-                             ._dagChildren_([sequence]);
-                 }
-
-
-associationSend     = send:binarySend & { return send._isSendNode() && send._selector() === "->" } { return [send._receiver(), send._arguments()[0]]; }
-
-wsAssociationsRest = ws "." maybeDotsWs expression:associationSend {return expression;}
-wsAssociations    = maybeDotsWs first:associationSend others:wsAssociationsRest* { return first.concat.apply(first, others); }
+temps = '|' vars:(ws variable:identifier {return variable;})* ws '|' {
+	return vars;
+}
+
+wsBlockParamList =
+	params:((ws ':' ws param:identifier {return param;})+) ws '|' {
+		return params;
+	}
+
+subexpression = '(' ws expression:expression ws ')' {
+	return expression;
+}
+
+wsStatementsWs =
+	maybeDotsWs ret:ret maybeDotsWs {return [ret];} /
+	exps:wsExpressions ws '.' maybeDotsWs ret:ret maybeDotsWs {
+		var expressions = exps;
+		expressions.push(ret);
+		return expressions;
+	} /
+	expressions:wsExpressions? maybeDotsWs {return expressions || [];}
+
+wsSequenceWs = (ws js:jsSequence ws {return js;}) / wsStSequenceWs
+
+wsStSequenceWs = ws temps:temps? statements:wsStatementsWs? {
+	return $globals.SequenceNode._new()
+		._location_(location())
+		._source_(text())
+		._temps_(temps || [])
+		._dagChildren_(statements || []);
+}
+
+jsSequence = jsStatement
+
+block = '[' params:wsBlockParamList? sequence:wsSequenceWs? ']' {
+	return $globals.BlockNode._new()
+		._location_(location())
+		._source_(text())
+		._parameters_(params || [])
+		._dagChildren_([sequence._asBlockSequenceNode()]);
+}
+
+operand = literal / reference / subexpression
+
+wsUnaryMessage = ws selector:unarySelector !':' {
+	return $globals.SendNode._new()
+		._location_(location())
+		._source_(text())
+		._selector_(selector);
+}
+
+unarySend = receiver:operand tail:wsUnaryMessage* {
+	return receiver._withTail_(tail);
+}
+
+wsBinaryMessage = ws selector:binarySelector ws arg:unarySend {
+	return $globals.SendNode._new()
+		._location_(location())
+		._source_(text())
+		._selector_(selector)
+		._arguments_([arg]);
+}
+
+binarySend = receiver:unarySend tail:wsBinaryMessage* {
+	return receiver._withTail_(tail);
+}
+
+wsKeywordMessage =
+	pairs:(ws key:keyword ws arg:binarySend {return {key:key, arg:arg};})+ {
+		var selector = '';
+		var args = [];
+		for(var i = 0; i < pairs.length; i++) {
+			selector += pairs[i].key;
+			args.push(pairs[i].arg);
+		}
+		return $globals.SendNode._new()
+			._location_(location())
+			._source_(text())
+			._selector_(selector)
+			._arguments_(args);
+	}
+
+keywordSend = receiver:binarySend tail:wsKeywordMessage? {
+	return tail ? receiver._withTail_([tail]) : receiver;
+}
+
+wsMessage = wsBinaryMessage / wsUnaryMessage / wsKeywordMessage
+
+cascade =
+	send:keywordSend & {return send._isSendNode();}
+	messages:(ws ';' mess:wsMessage {return mess;})+ {
+		messages.unshift(send);
+		return $globals.CascadeNode._new()
+			._location_(location())
+			._source_(text())
+			._dagChildren_(messages);
+	}
+
+jsStatement = pragmaJsStatement / legacyJsStatement
+
+legacyJsStatement =
+	'<' val:(('>>' {return '>';} / [^>])*) '>'
+	& {return !/^\s*inlineJS/.test(val.join(''));} {
+		console.warn('Use of <...js code...> is deprecated, in:\n' + val.join(''));
+		return $globals.JSStatementNode._new()
+			._location_(location())
+			._source_(val.join(''))
+	}
+
+pragmaJsStatement = '<' ws 'inlineJS:' ws val:rawString ws '>' {
+	return $globals.JSStatementNode._new()
+		._location_(location())
+		._source_(val)
+}
+
+method =
+	pattern:(wsKeywordPattern / wsBinaryPattern / wsUnaryPattern)
+	sequence:wsSequenceWs? {
+		return $globals.MethodNode._new()
+			._location_(location())
+			._source_(text())
+			._selector_(pattern[0])
+			._arguments_(pattern[1])
+			._dagChildren_([sequence]);
+	}
+
+associationSend =
+	send:binarySend
+	& { return send._isSendNode() && send._selector() === '->' } {
+		return [send._receiver(), send._arguments()[0]];
+	}
+
+wsAssociationsRest = ws '.' maybeDotsWs expression:associationSend {
+	return expression;
+}
+
+wsAssociations = maybeDotsWs first:associationSend others:wsAssociationsRest* {
+	return first.concat.apply(first, others);
+}

Some files were not shown because too many files changed in this diff