mirror of https://github.com/dirtbags/tanks.git
jstanks: handle lack of whitespace around braces
This commit is contained in:
parent
53e0829b8a
commit
0cad982dbd
|
@ -161,7 +161,8 @@ Forf.prototype.init = function(code) {
|
|||
Forf.prototype.parse = function() {
|
||||
// 'parse' the input
|
||||
this.code = this.code.replace(/\([^)]*\)/g, "");
|
||||
var tokens = this.code.split(/\s+/).filter(Boolean); // filter to deal with newlines etc
|
||||
var splitCode = this.code.split(/([{}])/).join(" ");
|
||||
var tokens = splitCode.split(/\s+/).filter(Boolean); // filter to deal with newlines etc
|
||||
// FIXME: this is a hack right now because ugh stacks
|
||||
var parseTokensAt = function(i, stack) {
|
||||
var val = tokens[i];
|
||||
|
|
Loading…
Reference in New Issue