فهرست منبع

Merge branch 'master' into moka

Nicolas Petton 10 سال پیش
والد
کامیت
97c337e479

+ 2 - 2
Gruntfile.js

@@ -34,7 +34,7 @@ module.exports = function(grunt) {
         output_dir : 'js',
         src: ['st/Kernel-Objects.st', 'st/Kernel-Classes.st', 'st/Kernel-Methods.st', 'st/Kernel-Collections.st',
               'st/Kernel-Infrastructure.st', 'st/Kernel-Exceptions.st', 'st/Kernel-Transcript.st', 'st/Kernel-Announcements.st',
-              'st/Importer-Exporter.st', 'st/Compiler-Exceptions.st', 'st/Compiler-Core.st', 'st/Compiler-AST.st',
+              'st/Kernel-ImportExport.st', 'st/Compiler-Exceptions.st', 'st/Compiler-Core.st', 'st/Compiler-AST.st',
               'st/Compiler-IR.st', 'st/Compiler-Inlining.st', 'st/Compiler-Semantic.st', 'st/Compiler-Interpreter.st',
               'st/Canvas.st', 'st/SUnit.st', 'st/IDE.st',
               'st/Kernel-Tests.st', 'st/Compiler-Tests.st', 'st/SUnit-Tests.st',
@@ -72,7 +72,7 @@ module.exports = function(grunt) {
         libraries: [
         'Compiler-Exceptions', 'Compiler-Core', 'Compiler-AST',
         'Compiler-IR', 'Compiler-Inlining', 'Compiler-Semantic', 'Compiler-Interpreter', 'parser',
-        'SUnit', 'Importer-Exporter',
+        'SUnit', 'Kernel-ImportExport',
         'Kernel-Tests', 'Compiler-Tests', 'SUnit-Tests'],
         main_class: 'NodeTestRunner',
         output_name: 'test/amber_test_runner'

+ 1 - 1
bower.json

@@ -10,7 +10,7 @@
     "tests"
   ],
   "dependencies": {
-    "jquery": "~1.8.3",
+    "jquery": "~1.10.2",
     "bootstrap": "http://getbootstrap.com/2.3.2/assets/bootstrap.zip",
     "jquery-tabby": "git://github.com/alanhogan/Tabby",
 	"jquery-mousewheel": "git://github.com/brandonaaron/jquery-mousewheel",

+ 1 - 1
cli/support/amberc.js

@@ -138,7 +138,7 @@ function AmberC(amber_dir) {
 	this.kernel_libraries = ['boot', 'smalltalk', 'nil', '_st', 'Kernel-Objects', 'Kernel-Classes', 'Kernel-Methods',
 							'Kernel-Collections', 'Kernel-Infrastructure', 'Kernel-Exceptions', 'Kernel-Transcript',
 							'Kernel-Announcements'];
-	this.compiler_libraries = this.kernel_libraries.concat(['parser', 'Importer-Exporter', 'Compiler-Exceptions',
+	this.compiler_libraries = this.kernel_libraries.concat(['parser', 'Kernel-ImportExport', 'Compiler-Exceptions',
 							'Compiler-Core', 'Compiler-AST', 'Compiler-Exceptions', 'Compiler-IR', 'Compiler-Inlining', 'Compiler-Semantic']);
 }
 

+ 3 - 3
js/Kernel-Announcements.js

@@ -254,7 +254,7 @@ $1=_st($AnnouncementSubscription())._new();
 _st($1)._announcementClass_(aClass);
 $2=_st($1)._yourself();
 subscription=$2;
-_st(subscription)._block_((function(ann){
+_st(subscription)._valuable_((function(ann){
 return smalltalk.withContext(function($ctx2) {
 _st(self["@subscriptions"])._remove_(subscription);
 return _st(aBlock)._value_(ann);
@@ -262,8 +262,8 @@ return _st(aBlock)._value_(ann);
 _st(self["@subscriptions"])._add_(subscription);
 return self}, function($ctx1) {$ctx1.fill(self,"on:doOnce:",{aClass:aClass,aBlock:aBlock,subscription:subscription},smalltalk.Announcer)})},
 args: ["aClass", "aBlock"],
-source: "on: aClass doOnce: aBlock\x0a\x09| subscription |\x0a\x09\x0a\x09subscription := AnnouncementSubscription new\x0a\x09\x09announcementClass: aClass;\x0a\x09\x09yourself.\x0a\x09subscription block: [ :ann |\x0a\x09\x09subscriptions remove: subscription.\x0a\x09\x09aBlock value: ann ].\x0a\x0a\x09subscriptions add: subscription",
-messageSends: ["announcementClass:", "new", "yourself", "block:", "remove:", "value:", "add:"],
+source: "on: aClass doOnce: aBlock\x0a\x09| subscription |\x0a\x09\x0a\x09subscription := AnnouncementSubscription new\x0a\x09\x09announcementClass: aClass;\x0a\x09\x09yourself.\x0a\x09subscription valuable: [ :ann |\x0a\x09\x09subscriptions remove: subscription.\x0a\x09\x09aBlock value: ann ].\x0a\x0a\x09subscriptions add: subscription",
+messageSends: ["announcementClass:", "new", "yourself", "valuable:", "remove:", "value:", "add:"],
 referencedClasses: ["AnnouncementSubscription"]
 }),
 smalltalk.Announcer);

+ 2 - 2
js/Kernel-Collections.js

@@ -3726,10 +3726,10 @@ category: 'copying',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-return self + aString;
+return String(self) + aString;
 return self}, function($ctx1) {$ctx1.fill(self,",",{aString:aString},smalltalk.String)})},
 args: ["aString"],
-source: ", aString\x0a\x09<return self + aString>",
+source: ", aString\x0a\x09<return String(self) + aString>",
 messageSends: [],
 referencedClasses: []
 }),

+ 14 - 32
js/Importer-Exporter.js → js/Kernel-ImportExport.js

@@ -1,8 +1,8 @@
-define("amber_core/Importer-Exporter", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Objects", "amber_core/Kernel-Infrastructure"], function(smalltalk,nil,_st){
-smalltalk.addPackage('Importer-Exporter');
-smalltalk.packages["Importer-Exporter"].transport = {"type":"amd","amdNamespace":"amber_core"};
+define("amber_core/Kernel-ImportExport", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Objects", "amber_core/Kernel-Infrastructure"], function(smalltalk,nil,_st){
+smalltalk.addPackage('Kernel-ImportExport');
+smalltalk.packages["Kernel-ImportExport"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('AbstractExporter', smalltalk.Object, [], 'Importer-Exporter');
+smalltalk.addClass('AbstractExporter', smalltalk.Object, [], 'Kernel-ImportExport');
 smalltalk.AbstractExporter.comment="I am an abstract exporter for Amber source code.\x0a\x0a## API\x0a\x0aUse `#exportPackage:on:` to export a given package on a Stream.";
 smalltalk.addMethod(
 smalltalk.method({
@@ -130,7 +130,7 @@ smalltalk.AbstractExporter);
 
 
 
-smalltalk.addClass('ChunkExporter', smalltalk.AbstractExporter, [], 'Importer-Exporter');
+smalltalk.addClass('ChunkExporter', smalltalk.AbstractExporter, [], 'Kernel-ImportExport');
 smalltalk.ChunkExporter.comment="I am an exporter dedicated to outputting Amber source code in the classic Smalltalk chunk format.\x0a\x0aI do not output any compiled code.";
 smalltalk.addMethod(
 smalltalk.method({
@@ -575,7 +575,7 @@ smalltalk.ChunkExporter);
 
 
 
-smalltalk.addClass('Exporter', smalltalk.AbstractExporter, [], 'Importer-Exporter');
+smalltalk.addClass('Exporter', smalltalk.AbstractExporter, [], 'Kernel-ImportExport');
 smalltalk.Exporter.comment="I am responsible for outputting Amber code into a JavaScript string.\x0a\x0aThe generated output is enough to reconstruct the exported data, including Smalltalk source code and other metadata.\x0a\x0a## Use case\x0a\x0aI am typically used to save code outside of the Amber runtime (committing to disk, etc.).";
 smalltalk.addMethod(
 smalltalk.method({
@@ -1000,7 +1000,7 @@ smalltalk.Exporter);
 
 
 
-smalltalk.addClass('AmdExporter', smalltalk.Exporter, ['namespace'], 'Importer-Exporter');
+smalltalk.addClass('AmdExporter', smalltalk.Exporter, ['namespace'], 'Kernel-ImportExport');
 smalltalk.AmdExporter.comment="I am used to export Packages in an AMD (Asynchronous Module Definition) JavaScript format.";
 smalltalk.addMethod(
 smalltalk.method({
@@ -1105,7 +1105,7 @@ smalltalk.AmdExporter);
 
 
 
-smalltalk.addClass('ChunkParser', smalltalk.Object, ['stream'], 'Importer-Exporter');
+smalltalk.addClass('ChunkParser', smalltalk.Object, ['stream'], 'Kernel-ImportExport');
 smalltalk.ChunkParser.comment="I am responsible for parsing aStream contents in the chunk format.\x0a\x0a## API\x0a\x0a    ChunkParser new\x0a        stream: aStream;\x0a        nextChunk";
 smalltalk.addMethod(
 smalltalk.method({
@@ -1187,7 +1187,7 @@ referencedClasses: []
 smalltalk.ChunkParser.klass);
 
 
-smalltalk.addClass('ExportMethodProtocol', smalltalk.Object, ['name', 'theClass'], 'Importer-Exporter');
+smalltalk.addClass('ExportMethodProtocol', smalltalk.Object, ['name', 'theClass'], 'Kernel-ImportExport');
 smalltalk.ExportMethodProtocol.comment="I am an abstraction for a method protocol in a class / metaclass.\x0a\x0aI know of my class, name and methods.\x0aI am used when exporting a package.";
 smalltalk.addMethod(
 smalltalk.method({
@@ -1304,7 +1304,7 @@ referencedClasses: []
 smalltalk.ExportMethodProtocol.klass);
 
 
-smalltalk.addClass('Importer', smalltalk.Object, [], 'Importer-Exporter');
+smalltalk.addClass('Importer', smalltalk.Object, [], 'Kernel-ImportExport');
 smalltalk.Importer.comment="I can import Amber code from a string in the chunk format.\x0a\x0a## API\x0a\x0a    Importer new import: aString";
 smalltalk.addMethod(
 smalltalk.method({
@@ -1351,7 +1351,7 @@ smalltalk.Importer);
 
 
 
-smalltalk.addClass('PackageHandler', smalltalk.InterfacingObject, [], 'Importer-Exporter');
+smalltalk.addClass('PackageHandler', smalltalk.InterfacingObject, [], 'Kernel-ImportExport');
 smalltalk.PackageHandler.comment="I am responsible for handling package loading and committing.\x0a\x0aI should not be used directly. Instead, use the corresponding `Package` methods.";
 smalltalk.addMethod(
 smalltalk.method({
@@ -1603,7 +1603,7 @@ smalltalk.PackageHandler);
 
 
 
-smalltalk.addClass('AmdPackageHandler', smalltalk.PackageHandler, [], 'Importer-Exporter');
+smalltalk.addClass('AmdPackageHandler', smalltalk.PackageHandler, [], 'Kernel-ImportExport');
 smalltalk.AmdPackageHandler.comment="I am responsible for handling package loading and committing.\x0a\x0aI should not be used directly. Instead, use the corresponding `Package` methods.";
 smalltalk.addMethod(
 smalltalk.method({
@@ -1740,7 +1740,7 @@ referencedClasses: ["Smalltalk"]
 smalltalk.AmdPackageHandler.klass);
 
 
-smalltalk.addClass('PackageTransport', smalltalk.Object, ['package'], 'Importer-Exporter');
+smalltalk.addClass('PackageTransport', smalltalk.Object, ['package'], 'Kernel-ImportExport');
 smalltalk.PackageTransport.comment="I represent the transport mechanism used to commit a package.\x0a\x0aMy concrete subclasses have a `#handler` to which committing is delegated.";
 smalltalk.addMethod(
 smalltalk.method({
@@ -2053,7 +2053,7 @@ referencedClasses: []
 smalltalk.PackageTransport.klass);
 
 
-smalltalk.addClass('AmdPackageTransport', smalltalk.PackageTransport, ['namespace'], 'Importer-Exporter');
+smalltalk.addClass('AmdPackageTransport', smalltalk.PackageTransport, ['namespace'], 'Kernel-ImportExport');
 smalltalk.AmdPackageTransport.comment="I am the default transport for committing packages.\x0a\x0aSee `AmdExporter` and `AmdPackageHandler`.";
 smalltalk.addMethod(
 smalltalk.method({
@@ -2256,22 +2256,4 @@ referencedClasses: []
 }),
 smalltalk.AmdPackageTransport.klass);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "commit",
-category: '*Importer-Exporter',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(self._transport())._commit();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"commit",{},smalltalk.Package)})},
-args: [],
-source: "commit\x0a\x09^ self transport commit",
-messageSends: ["commit", "transport"],
-referencedClasses: []
-}),
-smalltalk.Package);
-
 });

+ 1 - 1
st/Kernel-Announcements.st

@@ -110,7 +110,7 @@ on: aClass doOnce: aBlock
 	subscription := AnnouncementSubscription new
 		announcementClass: aClass;
 		yourself.
-	subscription block: [ :ann |
+	subscription valuable: [ :ann |
 		subscriptions remove: subscription.
 		aBlock value: ann ].
 

+ 1 - 1
st/Kernel-Collections.st

@@ -1401,7 +1401,7 @@ uriEncoded
 !String methodsFor: 'copying'!
 
 , aString
-	<return self + aString>
+	<return String(self) + aString>
 !
 
 copyFrom: anIndex to: anotherIndex

+ 12 - 18
st/Importer-Exporter.st → st/Kernel-ImportExport.st

@@ -1,7 +1,7 @@
-Smalltalk current createPackage: 'Importer-Exporter'!
+Smalltalk current createPackage: 'Kernel-ImportExport'!
 Object subclass: #AbstractExporter
 	instanceVariableNames: ''
-	package: 'Importer-Exporter'!
+	package: 'Kernel-ImportExport'!
 !AbstractExporter commentStamp!
 I am an abstract exporter for Amber source code.
 
@@ -65,7 +65,7 @@ exportPackage: aPackage on: aStream
 
 AbstractExporter subclass: #ChunkExporter
 	instanceVariableNames: ''
-	package: 'Importer-Exporter'!
+	package: 'Kernel-ImportExport'!
 !ChunkExporter commentStamp!
 I am an exporter dedicated to outputting Amber source code in the classic Smalltalk chunk format.
 
@@ -218,7 +218,7 @@ exportProtocols: aCollection on: aStream
 
 AbstractExporter subclass: #Exporter
 	instanceVariableNames: ''
-	package: 'Importer-Exporter'!
+	package: 'Kernel-ImportExport'!
 !Exporter commentStamp!
 I am responsible for outputting Amber code into a JavaScript string.
 
@@ -365,7 +365,7 @@ exportPackageTransportOf: aPackage on: aStream
 
 Exporter subclass: #AmdExporter
 	instanceVariableNames: 'namespace'
-	package: 'Importer-Exporter'!
+	package: 'Kernel-ImportExport'!
 !AmdExporter commentStamp!
 I am used to export Packages in an AMD (Asynchronous Module Definition) JavaScript format.!
 
@@ -405,7 +405,7 @@ amdNamespaceOfPackage: aPackage
 
 Object subclass: #ChunkParser
 	instanceVariableNames: 'stream'
-	package: 'Importer-Exporter'!
+	package: 'Kernel-ImportExport'!
 !ChunkParser commentStamp!
 I am responsible for parsing aStream contents in the chunk format.
 
@@ -454,7 +454,7 @@ on: aStream
 
 Object subclass: #ExportMethodProtocol
 	instanceVariableNames: 'name theClass'
-	package: 'Importer-Exporter'!
+	package: 'Kernel-ImportExport'!
 !ExportMethodProtocol commentStamp!
 I am an abstraction for a method protocol in a class / metaclass.
 
@@ -495,7 +495,7 @@ name: aString theClass: aClass
 
 Object subclass: #Importer
 	instanceVariableNames: ''
-	package: 'Importer-Exporter'!
+	package: 'Kernel-ImportExport'!
 !Importer commentStamp!
 I can import Amber code from a string in the chunk format.
 
@@ -523,7 +523,7 @@ import: aStream
 
 InterfacingObject subclass: #PackageHandler
 	instanceVariableNames: ''
-	package: 'Importer-Exporter'!
+	package: 'Kernel-ImportExport'!
 !PackageHandler commentStamp!
 I am responsible for handling package loading and committing.
 
@@ -604,7 +604,7 @@ ajaxPutAt: aURL data: aString
 
 PackageHandler subclass: #AmdPackageHandler
 	instanceVariableNames: ''
-	package: 'Importer-Exporter'!
+	package: 'Kernel-ImportExport'!
 !AmdPackageHandler commentStamp!
 I am responsible for handling package loading and committing.
 
@@ -651,7 +651,7 @@ defaultNamespace: aString
 
 Object subclass: #PackageTransport
 	instanceVariableNames: 'package'
-	package: 'Importer-Exporter'!
+	package: 'Kernel-ImportExport'!
 !PackageTransport commentStamp!
 I represent the transport mechanism used to commit a package.
 
@@ -755,7 +755,7 @@ register: aClass
 
 PackageTransport subclass: #AmdPackageTransport
 	instanceVariableNames: 'namespace'
-	package: 'Importer-Exporter'!
+	package: 'Kernel-ImportExport'!
 !AmdPackageTransport commentStamp!
 I am the default transport for committing packages.
 
@@ -827,9 +827,3 @@ namespace: aString
 		yourself
 ! !
 
-!Package methodsFor: '*Importer-Exporter'!
-
-commit
-	^ self transport commit
-! !
-

+ 1 - 1
support/devel.js

@@ -12,7 +12,7 @@ define([
 	'css!amber_inc/CodeMirror/amber',
 	'css!amber_css/amber',
 	'amber_core/SUnit',
-	'amber_core/Importer-Exporter',
+	'amber_core/Kernel-ImportExport',
 	'amber_core/Compiler-Exceptions',
 	'amber_core/Compiler-Core',
 	'amber_core/Compiler-AST',

+ 1 - 1
support/helios.js

@@ -13,7 +13,7 @@ define([
 	'css!amber_inc/CodeMirror/amber',
 	'css!amber_css/helios',
 	'amber_core/SUnit',
-	'amber_core/Importer-Exporter',
+	'amber_core/Kernel-ImportExport',
 	'amber_core/Compiler-Exceptions',
 	'amber_core/Compiler-Core',
 	'amber_core/Compiler-AST',