projects
/
gnome.introspection-doc-generator
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cbb5544
)
JSDOC/TextStream.vala
author
Alan Knowles
<alan@roojs.com>
Thu, 10 Sep 2015 09:48:09 +0000
(17:48 +0800)
committer
Alan Knowles
<alan@roojs.com>
Thu, 10 Sep 2015 09:48:09 +0000
(17:48 +0800)
JSDOC/TextStream.vala
patch
|
blob
|
history
diff --git
a/JSDOC/TextStream.vala
b/JSDOC/TextStream.vala
index
277b518
..
cc0c364
100644
(file)
--- a/
JSDOC/TextStream.vala
+++ b/
JSDOC/TextStream.vala
@@
-29,34
+29,34
@@
namespace JSDOC {
this.cursor = 0;
}
this.cursor = 0;
}
- public
c
har look(int n = 0) {
+ public
TextStreamC
har look(int n = 0) {
if (this.cursor+n < 0 || this.cursor+n >= this.text.length) {
if (this.cursor+n < 0 || this.cursor+n >= this.text.length) {
- var result = new String("");
- result.eof = true;
- return result;
+ return new TextStreamChar('\0', true);
}
}
- return
this.text.charAt(this.cursor+n
);
+ return
new TextStreamChar(this.text[this.cursor+n], false
);
},
},
- next : function(n) {
- if (typeof n == "undefined") n = 1;
- if (n < 1) return null;
+ public TextStreamChar? next(int n = 1)
+ {
+
+ if (n < 1) {
+ return null;
+ }
- var pulled = "";
- for (var i = 0; i < n; i++) {
- if (this.cursor+i < this.text.length) {
- pulled += this.text.charAt(this.cursor+i);
- }
- else {
- var result = new String("");
- result.eof = true;
- return result;
- }
+ var pulled = "";
+ for (var i = 0; i < n; i++) {
+ if (this.cursor+i < this.text.length) {
+ pulled += this.text.charAt(this.cursor+i);
+ } else {
+ return new TextStreamChar('\0', true);
+
}
}
-
- this.cursor += n;
- return pulled;
}
}
+
+ this.cursor += n;
+ return new TextStreamChar(pulled, false);
+
+ }
});
\ No newline at end of file
});
\ No newline at end of file