5 JSDOC
.TextStream
= function(text
) {
6 if (typeof(text
) == "undefined") text
= "";
12 JSDOC
.TextStream
.prototype.look
= function(n
) {
13 if (typeof n
== "undefined") n
= 0;
15 if (this.cursor
+n
< 0 || this.cursor
+n
>= this.text
.length
) {
16 var result
= new String("");
20 return this.text
.charAt(this.cursor
+n
);
23 JSDOC
.TextStream
.prototype.next
= function(n
) {
24 if (typeof n
== "undefined") n
= 1;
25 if (n
< 1) return null;
28 for (var i
= 0; i
< n
; i
++) {
29 if (this.cursor
+i
< this.text
.length
) {
30 pulled
+= this.text
.charAt(this.cursor
+i
);
33 var result
= new String("");