Permalink
Browse files

recompile recent changes with `sibilant src/* -o lib`

  • Loading branch information...
1 parent 70c9cb2 commit 2e842dc6fc8f66ee98f0b757bdd666d2a9b2cb25 @jbr committed Jan 11, 2013
Showing with 62 additions and 55 deletions.
  1. +40 −33 lib/browser.js
  2. +5 −5 lib/cli.js
  3. +11 −11 lib/options.js
  4. +6 −6 lib/repl.js
View
@@ -1,5 +1,5 @@
(function() {
- var sibilant = { };;
+ var sibilant = { };
var error = (function(str) {
// str:required
throw new Error (str);
@@ -16,15 +16,15 @@
})();
});
;
- (window)["sibilant"] = sibilant;;
- var exports = { };;
+ (window)["sibilant"] = sibilant;
+ var exports = { };
var bulkMap = (function(arr, fn) {
// arr:required fn:required
var index = 0,
groupSize = fn.length,
- retArr = [ ];;
+ retArr = [ ];
(function() {
- var __returnValue__ = undefined;;
+ var __returnValue__ = undefined;
while ((index < arr.length)) {
__returnValue__ = (function() {
retArr.push(fn.apply(undefined, arr.slice(index, (index + groupSize))));
@@ -38,7 +38,7 @@
var inject = (function(start, items, fn) {
// start:required items:required fn:required
- var value = start;;
+ var value = start;
(function() {
if ((items) && (items).constructor.name === "Array") {
return items.forEach((function(item, index) {
@@ -76,9 +76,9 @@
// items:required fn:required
var returnItem = undefined,
index = 0,
- items = items;;
+ items = items;
return (function() {
- var __returnValue__ = undefined;;
+ var __returnValue__ = undefined;
while ((!((items.length === index) || returnItem))) {
__returnValue__ = (function() {
(function() {
@@ -95,7 +95,7 @@
var reject = (function(items, fn) {
// items:required fn:required
- var args = [ items, fn ];;
+ var args = [ items, fn ];
return select(items, (function() {
return (!fn.apply(undefined, arguments));
}));
@@ -144,14 +144,14 @@
// string:required
var tokens = [ ],
parseStack = [ tokens ],
- specials = [ ];;
+ specials = [ ];
var acceptToken = (function(token) {
// token:required
return (parseStack)[0].push(token);
});
;
var increaseNesting = (function() {
- var newArr = [ ];;
+ var newArr = [ ];
acceptToken(newArr);
return parseStack.unshift(newArr);
});
@@ -169,7 +169,7 @@
var handleToken = (function(token) {
// token:required
var special = (token)[0],
- token = token;;
+ token = token;
(function() {
if ((special === "'")) {
token = token.slice(1);
@@ -219,7 +219,7 @@
// x:required
return (sibilant.tokens)[x];
})),
- masterRegex = (new RegExp((orderedRegexen).join("|"), "g"));;
+ masterRegex = (new RegExp((orderedRegexen).join("|"), "g"));
string // chain
.match(masterRegex)
.forEach(handleToken)
@@ -248,7 +248,7 @@
// arrayOfArrays:required
return inject({ }, arrayOfArrays, (function(object, item) {
// object:required item:required
- (object)[(item)[0]] = (object)[(item)[1]];;
+ (object)[(item)[0]] = (object)[(item)[1]];
return object;
}));
});
@@ -257,7 +257,7 @@
(sibilant)["macros"] = macros;
(macros)["return"] = (function(token) {
// token:required
- var defaultReturn = ("return " + translate(token));;
+ var defaultReturn = ("return " + translate(token));
return (function() {
if ((token) && (token).constructor.name === "Array") {
return (function() {
@@ -320,8 +320,8 @@
// body:rest
var body = Array.prototype.slice.call(arguments, 0);
- var lastIndex = Math.max(0, (body.length - 1));;
- (body)[lastIndex] = [ "return", (body)[lastIndex] ];;
+ var lastIndex = Math.max(0, (body.length - 1));
+ (body)[lastIndex] = [ "return", (body)[lastIndex] ];
return (map(body, (function(arg) {
// arg:required
return (translate(arg) + ";");
@@ -346,7 +346,7 @@
} else {
return "var ";
};
- })();;
+ })();
return (start + fnNameTr + " = " + macros.lambda.apply(undefined, argsAndBody) + ";\n");
});
@@ -355,7 +355,7 @@
var argsAndBody = Array.prototype.slice.call(arguments, 1);
var js = macros.lambda.apply(undefined, argsAndBody),
- name = translate(name);;
+ name = translate(name);
(function() {
try {
return (macros)[name] = eval(js);;
@@ -376,7 +376,7 @@
var transformArgs = (function(arglist) {
// arglist:required
var last = undefined,
- args = [ ];;
+ args = [ ];
arglist.forEach((function(arg) {
// arg:required
return (function() {
@@ -398,7 +398,7 @@
macros.reverse = (function(arr) {
// arr:required
- var reversed = [ ];;
+ var reversed = [ ];
arr.forEach((function(item) {
// item:required
return reversed.unshift(item);
@@ -410,7 +410,7 @@
var buildArgsString = (function(args, rest) {
// args:required rest:required
var argsString = "",
- optionalCount = 0;;
+ optionalCount = 0;
args.forEach((function(arg, optionIndex) {
// arg:required optionIndex:required
return (function() {
@@ -460,8 +460,8 @@
// arg:required
return ("rest" === (arg)[0]);
})))[0],
- docString = undefined;;
- (body)[(body.length - 1)] = [ "return", (body)[(body.length - 1)] ];;
+ docString = undefined;
+ (body)[(body.length - 1)] = [ "return", (body)[(body.length - 1)] ];
(function() {
if (((typeof((body)[0]) === "string") && (body)[0].match(/^".*"$/))) {
return docString = ("/* " + eval(body.shift()) + " */\n");
@@ -475,13 +475,20 @@
};
})(),
argsString = buildArgsString(noRestArgs, rest),
- commentString = buildCommentString(args);;
+ commentString = buildCommentString(args);
return ("(function(" + (map(args, (function(arg) {
// arg:required
return translate((arg)[1]);
}))).join(", ") + ") {" + indent(commentString, docString, argsString, (map(body, (function(stmt) {
// stmt:required
- return (translate(stmt) + ";");
+ var tstmt = translate(stmt);
+ return (tstmt + (function() {
+ if (((tstmt.slice(-1))[0] === ";")) {
+ return "";
+ } else {
+ return ";";
+ };
+ })());
}))).join("\n")) + "})");
});
@@ -514,7 +521,7 @@
var pairStrings = bulkMap(pairs, (function(key, value) {
// key:required value:required
return (translate(key) + ": " + translate(value));
- }));;
+ }));
return (function() {
if ((1 >= pairStrings.length)) {
return ("{ " + (pairStrings).join(", ") + " }");
@@ -538,7 +545,7 @@
var translate = (function(token, hint) {
// token:required hint:required
- var hint = hint;;
+ var hint = hint;
(function() {
if ((hint && typeof((macros)[hint]) === 'undefined')) {
return hint = undefined;
@@ -599,10 +606,10 @@
(sibilant)["translate"] = translate;
var translateAll = (function(contents) {
// contents:required
- var buffer = "";;
+ var buffer = "";
tokenize(contents).forEach((function(token) {
// token:required
- var line = translate(token, "statement");;
+ var line = translate(token, "statement");
return (function() {
if (line) {
return buffer = (buffer + line + "\n");
@@ -616,7 +623,7 @@
;
return $((function() {
var sibilant = window.sibilant,
- scripts = [ ];;
+ scripts = [ ];
var evalWithTryCatch = (function(js) {
// js:required
return (function() {
@@ -631,7 +638,7 @@
;
sibilant.scriptLoaded = (function() {
var lisp = null,
- js = null;;
+ js = null;
return (function() {
if ((!sibilant.loadNextScript())) {
return $("script[type=\"text/sibilant\"]:not([src])") // chain
@@ -657,7 +664,7 @@
}))
);
sibilant.loadNextScript = (function() {
- var nextScript = scripts.shift();;
+ var nextScript = scripts.shift();
return (function() {
if (typeof(nextScript) !== 'undefined') {
$.get(nextScript, (function(data) {
View
@@ -6,14 +6,14 @@ var sibilant = require("./sibilant"),
context = vm.createContext();
var createContext = (function() {
context.initialized__QUERY = true;
- (module)["filename"] = (process.cwd() + "/exec");;
+ (module)["filename"] = (process.cwd() + "/exec");
(context)["module"] = module;
- (context)["require"] = require;;
+ (context)["require"] = require;
return (function() {
for (var key in global) (function() {
- return (context)[key] = (global)[key];;
+ return (context)[key] = (global)[key];
})();
- })();;
+ })();
});
var runInSandbox = (function(js, inputPath) {
@@ -174,7 +174,7 @@ var outputDir = (function() {
(cliOptions.input || [ ]).forEach((function(inputFile) {
// inputFile:required
var inputPath = path.join(process.cwd(), inputFile),
- translated = sibilant.translateFile(inputPath);;
+ translated = sibilant.translateFile(inputPath);
return (function() {
if (outputDir) {
var inputBasename = path.basename(inputPath, ".sibilant"),
View
@@ -2,9 +2,9 @@ var bulkMap = (function(arr, fn) {
// arr:required fn:required
var index = 0,
groupSize = fn.length,
- retArr = [ ];;
+ retArr = [ ];
(function() {
- var __returnValue__ = undefined;;
+ var __returnValue__ = undefined;
while ((index < arr.length)) {
__returnValue__ = (function() {
retArr.push(fn.apply(undefined, arr.slice(index, (index + groupSize))));
@@ -18,7 +18,7 @@ var bulkMap = (function(arr, fn) {
var inject = (function(start, items, fn) {
// start:required items:required fn:required
- var value = start;;
+ var value = start;
(function() {
if ((items) && (items).constructor.name === "Array") {
return items.forEach((function(item, index) {
@@ -56,9 +56,9 @@ var detect = (function(items, fn) {
// items:required fn:required
var returnItem = undefined,
index = 0,
- items = items;;
+ items = items;
return (function() {
- var __returnValue__ = undefined;;
+ var __returnValue__ = undefined;
while ((!((items.length === index) || returnItem))) {
__returnValue__ = (function() {
(function() {
@@ -75,7 +75,7 @@ var detect = (function(items, fn) {
var reject = (function(items, fn) {
// items:required fn:required
- var args = [ items, fn ];;
+ var args = [ items, fn ];
return select(items, (function() {
return (!fn.apply(undefined, arguments));
}));
@@ -116,15 +116,15 @@ var extractOptions = (function(config, args) {
currentLabel = defaultLabel,
afterBreak = false,
config = (config || { }),
- unlabeled = [ ];;
+ unlabeled = [ ];
var label__QUERY = (function(item) {
// item:required
return (typeof(item) === "string" && /^-/.test(item));
});
;
var synonymLookup = (function(item) {
// item:required
- var configEntry = (config)[item];;
+ var configEntry = (config)[item];
return (function() {
if (typeof(configEntry) === "string") {
return synonymLookup(configEntry);
@@ -148,7 +148,7 @@ var extractOptions = (function(config, args) {
;
var addValue = (function(hash, key, value) {
// hash:required key:required value:required
- var currentValue = (hash)[key];;
+ var currentValue = (hash)[key];
(function() {
if (typeof(currentValue) === 'undefined') {
currentValue = [ ];
@@ -203,12 +203,12 @@ var processOptions = (function(config) {
if (arguments.length < 1) // if config is missing
var config = undefined;
- var options = extractOptions(config);;
+ var options = extractOptions(config);
(function() {
if (config) {
var handlePair = (function(key, value) {
// key:required value:required
- var handle = (config)[key];;
+ var handle = (config)[key];
(function() {
if (typeof(handle) === "string") {
return handlePair(handle, value);
View
@@ -7,15 +7,15 @@ var input = process.openStdin(),
cmdBuffer = "",
util = require("util");
var createContext = (function() {
- var context = vm.createContext();;
- (module)["filename"] = (process.cwd() + "/exec");;
+ var context = vm.createContext();
+ (module)["filename"] = (process.cwd() + "/exec");
(context)["module"] = module;
- (context)["require"] = require;;
+ (context)["require"] = require;
(function() {
for (var key in global) (function() {
- return (context)[key] = (global)[key];;
+ return (context)[key] = (global)[key];
})();
- })();;
+ })();
return context;
});
@@ -39,7 +39,7 @@ var displayPrompt = (function() {
readline.on("line", (function(cmd) {
// cmd:required
- var jsLine = "";;
+ var jsLine = "";
(function() {
try {
cmdBuffer = (cmdBuffer + cmd);

0 comments on commit 2e842dc

Please sign in to comment.