1 //<script type="text/javscript">
10 public class TextStreamChar : Object {
13 public TextStreamChar(char val, bool eof=false) {
19 public class TextStream : Object {
25 public TextStream (string text = "")
30 //stdout.printf ("%s", text);
31 this.length = text.length; // text.char_count(); //text.length;
35 public string lookS(int n = 0)
38 if (this.cursor+n < 0 || this.cursor+n >= this.length) {
41 return this.text.get_char(this.cursor+n).to_string(); // this.text[this.cursor+n]; //
43 public char lookC(int n = 0)
46 if (this.cursor+n < 0 || this.cursor+n >= this.length) {
49 return this.text[this.cursor+n];
53 public bool lookEOF(int n = 0)
55 if (this.cursor+n < 0 || this.cursor+n >= this.length) {
62 * @param n - number of characters to return..
64 public string nextS(int n = 1)
67 if (n < 1) { //?? eof???
74 if (this.cursor+i < this.length) {
75 var add = this.text.get_char(this.cursor+i).to_string();
84 this.cursor += pulled.length; // i?
92 if (this.cursor+1 < this.length) {
93 return this.text[this.cursor++];;