Permalink
Browse files

Further minimize runmode-standalone.js, fix failing build

  • Loading branch information...
1 parent 53b6852 commit 4ec75a9ad878b862880069b6db31ce4f9fa6826c @marijnh marijnh committed Sep 10, 2012
Showing with 2 additions and 17 deletions.
  1. +2 −17 lib/util/runmode-standalone.js
@@ -2,21 +2,6 @@
function splitLines(string){ return string.split(/\r?\n|\r/); };
-// Counts the column offset in a string, taking tabs into account.
-// Used mostly to find indentation.
-function countColumn(string, end) {
- tabSize = 4;
- if (end == null) {
- end = string.search(/[^\s\u00a0]/);
- if (end == -1) end = string.length;
- }
- for (var i = 0, n = 0; i < end; ++i) {
- if (string.charAt(i) == "\t") n += tabSize - (n % tabSize);
- else ++n;
- }
- return n;
-}
-
function StringStream(string) {
this.pos = this.start = 0;
this.string = string;
@@ -51,8 +36,8 @@ StringStream.prototype = {
if (found > -1) {this.pos = found; return true;}
},
backUp: function(n) {this.pos -= n;},
- column: function() {return countColumn(this.string, this.start);},
- indentation: function() {return countColumn(this.string);},
+ column: function() {return this.start;},
+ indentation: function() {return 0;},
match: function(pattern, consume, caseInsensitive) {
if (typeof pattern == "string") {
function cased(str) {return caseInsensitive ? str.toLowerCase() : str;}

0 comments on commit 4ec75a9

Please sign in to comment.