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:
e9d0b3f
)
JSDOC/TextStream.vala
author
Alan Knowles
<alan@roojs.com>
Tue, 15 Sep 2015 09:25:32 +0000
(17:25 +0800)
committer
Alan Knowles
<alan@roojs.com>
Tue, 15 Sep 2015 09:25:32 +0000
(17:25 +0800)
JSDOC/TextStream.vala
patch
|
blob
|
history
diff --git
a/JSDOC/TextStream.vala
b/JSDOC/TextStream.vala
index
153495f
..
4ebddae
100644
(file)
--- a/
JSDOC/TextStream.vala
+++ b/
JSDOC/TextStream.vala
@@
-20,19
+20,21
@@
namespace JSDOC {
string text;
int cursor;
string text;
int cursor;
+ int length;
public TextStream (string text = "")
{
this.text = text;
public TextStream (string text = "")
{
this.text = text;
+ this.length = text.char_count()
this.cursor = 0;
}
public char look(int n = 0)
{
this.cursor = 0;
}
public char look(int n = 0)
{
- if (this.cursor+n < 0 || this.cursor+n >= this.
text.
length) {
+ if (this.cursor+n < 0 || this.cursor+n >= this.length) {
return '\0';
}
return this.text[this.cursor+n];
return '\0';
}
return this.text[this.cursor+n];
@@
-40,7
+42,7
@@
namespace JSDOC {
public bool lookEOF(int n = 0)
{
public bool lookEOF(int n = 0)
{
- if (this.cursor+n < 0 || this.cursor+n >= this.
text.length
) {
+ if (this.cursor+n < 0 || this.cursor+n >= this.
length)
) {
return true;
}
return false
return true;
}
return false
@@
-56,7
+58,7
@@
namespace JSDOC {
char pulled;
for (var i = 0; i < n; i++) {
char pulled;
for (var i = 0; i < n; i++) {
- if (this.cursor+i < this.
text.
length) {
+ if (this.cursor+i < this.length) {
pulled += this.text.get_char(this.cursor+i);
} else {
eof =true;
pulled += this.text.get_char(this.cursor+i);
} else {
eof =true;