Doc and method reorg

This commit is contained in:
Tim Schaub
2013-06-11 13:24:01 -06:00
parent 6d0badcf2a
commit 38c8927ae2
+23 -23
View File
@@ -134,7 +134,7 @@ ol.expression.Lexer = function(source) {
/** /**
* Scan the next token and throw if it doesn't match. * Scan the next token and throw if it isn't a punctuator that matches input.
* @param {string} value Token value. * @param {string} value Token value.
*/ */
ol.expression.Lexer.prototype.expect = function(value) { ol.expression.Lexer.prototype.expect = function(value) {
@@ -426,6 +426,20 @@ ol.expression.Lexer.prototype.next = function() {
}; };
/**
* Peek at the next token, but don't advance the index.
*
* @return {ol.expression.Token} The upcoming token.
*/
ol.expression.Lexer.prototype.peek = function() {
var currentIndex = this.index_;
var token = this.next();
this.nextIndex_ = this.index_;
this.index_ = currentIndex;
return token;
};
/** /**
* Scan hex literal as numeric token. * Scan hex literal as numeric token.
* *
@@ -792,6 +806,14 @@ ol.expression.Lexer.prototype.scanStringLiteral_ = function(quote) {
}; };
/**
* After peeking, skip may be called to advance the cursor without re-scanning.
*/
ol.expression.Lexer.prototype.skip = function() {
this.index_ = this.nextIndex_;
};
/** /**
* Skip all whitespace. * Skip all whitespace.
* @return {number} The character code of the first non-whitespace character. * @return {number} The character code of the first non-whitespace character.
@@ -809,25 +831,3 @@ ol.expression.Lexer.prototype.skipWhitespace_ = function() {
} }
return code; return code;
}; };
/**
* Peek at the next token, but don't advance the index.
*
* @return {ol.expression.Token} The upcoming token.
*/
ol.expression.Lexer.prototype.peek = function() {
var currentIndex = this.index_;
var token = this.next();
this.nextIndex_ = this.index_;
this.index_ = currentIndex;
return token;
};
/**
* After peeking, skip may be called to advance the cursor without re-scanning.
*/
ol.expression.Lexer.prototype.skip = function() {
this.index_ = this.nextIndex_;
};