Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/js/development/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
this.init.apply(this, arguments);
}
};
Block.prototype = new Expression();;
Block.prototype = new Expression();
Block.prototype.block = function () {
var _this = this;
var dst_tmpl;
Expand Down
15 changes: 7 additions & 8 deletions src/js/development/class.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
this.init.apply(this, arguments);
}
};
Class.prototype = new Block();;
Class.prototype = new Block();
Class.prototype.init = function () {
var _this = this;
_this.instanceVariables = {};
Expand All @@ -19,17 +19,16 @@
Class.prototype.classHeader = function () {
var _this = this;
var dst_tmpl;
dst_tmpl = "var %className%;\n%className% = function () { %variableInitialization%if (this.init) { this.init.apply(this, arguments); } };\n%className%.prototype = new %superClass%()";
dst_tmpl = "%className% = function () { %variableInitialization%if (this.init) { this.init.apply(this, arguments); } };\n%className%.prototype = new %superClass%()";
return _this.cacheaParser("classHeader", function () {
var className, superClass, variables, v_init;
_this.optional(function () {
return _this.chr("+");
});
superClass = _this.variable();
className = _this.variable();
_this.skipSpace();
_this.string("subclass:");
_this.assignmentArrow();
_this.skipSpace();
superClass = _this.variable();
_this.skipSpace();
className = _this.variablableStringContent();
_this.string("subclass");
_this.skipSpace();
_this.string("variables:");
_this.skipSpace();
Expand Down
2 changes: 1 addition & 1 deletion src/js/development/expression.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
this.init.apply(this, arguments);
}
};
Expression.prototype = new LittleParser();;
Expression.prototype = new LittleParser();
Expression.prototype.init = function () {
var _this = this;
return _this.bundledMethods = [];
Expand Down
2 changes: 1 addition & 1 deletion src/js/development/littleparser.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
this.init.apply(this, arguments);
}
};
LittleParser.prototype = new Packrat();;
LittleParser.prototype = new Packrat();
LittleParser.prototype.space = function () {
var _this = this;
return _this.cacheaParser("space", function () {
Expand Down
2 changes: 1 addition & 1 deletion src/js/development/littlesmallscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
this.init.apply(this, arguments);
}
};
LittleSmallscript.prototype = new Statement();;
LittleSmallscript.prototype = new Statement();
LittleSmallscript.prototype.initWithInputandOptions = function (text, opt) {
var _this = this;
_this.input = text;
Expand Down
4 changes: 3 additions & 1 deletion src/js/development/optimization.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@
}), v.variable);
})();
} catch (err) {
_ret = function () {}(err);
_ret = function () {
return null;
}(err);
}
return _ret;
})();
Expand Down
14 changes: 10 additions & 4 deletions src/js/development/packrat.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
this.init.apply(this, arguments);
}
};
Packrat.prototype = new Object();;
Packrat.prototype = new Object();
Packrat.prototype.init = function (text) {
var _this = this;
_this.input = text;
Expand Down Expand Up @@ -54,7 +54,9 @@
fn = (fn !== undefined) ? ((function () {
return fn;
}))() : (function () {
return function () {};
return function () {
return null;
};
})();
c = {};
(_this.logNest += 1);
Expand Down Expand Up @@ -207,7 +209,9 @@
return f = false;
})();
} catch (err) {
_ret = function () {}(err);
_ret = function () {
return null;
}(err);
}
return _ret;
})();
Expand All @@ -231,7 +235,9 @@
return f = true;
})();
} catch (err) {
_ret = function () {}(err);
_ret = function () {
return null;
}(err);
}
return _ret;
})();
Expand Down
6 changes: 2 additions & 4 deletions src/js/development/statement.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
this.init.apply(this, arguments);
}
};
Statement.prototype = new Class();;
Statement.prototype = new Class();
Statement.prototype.statement = function () {
var _this = this;
return _this.cacheaParser("statement", function () {
Expand All @@ -26,9 +26,7 @@
var a;
a = _this.statementable();
_this.skipSpace();
_this.optional(function () {
return _this.chr(".");
});
_this.chr(".");
_this.skipSpace();
_this.followedBy(function () {
return _this.statementable();
Expand Down
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

var LittleSmallscript, fs, optimist, argv, readline, rl, help;

LittleSmallscript = require("./js/production/littlesmallscript").LittleSmallscript;
LittleSmallscript = require("./js/production/littlesmallscript");

fs = require('fs');

Expand Down
14 changes: 7 additions & 7 deletions src/st/class.st
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ init
instanceVariables := #{}.
currentClass := null
!.
"Animal subclass: #Snake variables: #(#name #colour #awake)"
"Snake := Animal subclass variables: #(#name #colour)"
!Class
classHeader | dst_tmpl |
dst_tmpl :=
'var %className%;
%className% = function () { %variableInitialization%if (this.init) { this.init.apply(this, arguments); } };
'%className% = function () { %variableInitialization%if (this.init) { this.init.apply(this, arguments); } };
%className%.prototype = new %superClass%()'.
self cache: #classHeader aParser: [| className superClass variables v_init |
self optional: [self chr: '+']. "LSt compatibility"
superClass := self variable.
className := self variable.
self skipSpace.
self string: 'subclass:'.
self assignmentArrow.
self skipSpace.
superClass := self variable.
self skipSpace.
className := self variablableStringContent.
self string: 'subclass'.
self skipSpace.
self string: 'variables:'.
self skipSpace.
Expand Down