From: Alan Knowles Date: Thu, 10 Sep 2015 09:49:50 +0000 (+0800) Subject: JSDOC/TextStream.vala X-Git-Url: http://git.roojs.org/?p=gnome.introspection-doc-generator;a=commitdiff_plain;h=fa9f2fa5d1c4fe7dfc4e442df2ea0d263c700846 JSDOC/TextStream.vala --- diff --git a/JSDOC/TextStream.vala b/JSDOC/TextStream.vala index cc0c364..599ed8b 100644 --- a/JSDOC/TextStream.vala +++ b/JSDOC/TextStream.vala @@ -29,18 +29,20 @@ namespace JSDOC { this.cursor = 0; } - public TextStreamChar look(int n = 0) { - + public char look(int n = 0, out bool eof) + { + eof = false; if (this.cursor+n < 0 || this.cursor+n >= this.text.length) { - return new TextStreamChar('\0', true); + eof = true; + return '\0'; } - return new TextStreamChar(this.text[this.cursor+n], false); + return this.text[this.cursor+n]; }, - public TextStreamChar? next(int n = 1) + public char next(int n = 1, out bool eof) { - + eof = false; if (n < 1) { return null; } @@ -50,13 +52,16 @@ namespace JSDOC { if (this.cursor+i < this.text.length) { pulled += this.text.charAt(this.cursor+i); } else { - return new TextStreamChar('\0', true); + eof =true; + return '\0'; + } } this.cursor += n; - return new TextStreamChar(pulled, false); + return pulled; } - }); \ No newline at end of file + } +} \ No newline at end of file