projects
/
gnome.introspection-doc-generator
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JSDOC/Packer.vala
[gnome.introspection-doc-generator]
/
JSDOC
/
TokenReader.vala
diff --git
a/JSDOC/TokenReader.vala
b/JSDOC/TokenReader.vala
index
a30fcd2
..
699aea4
100644
(file)
--- a/
JSDOC/TokenReader.vala
+++ b/
JSDOC/TokenReader.vala
@@
-1,8
+1,8
@@
//<script type="text/javascript">
//<script type="text/javascript">
-
-
+// test code
+
//const Token = imports.Token.Token;
//const Lang = imports.Lang.Lang;
//const Token = imports.Token.Token;
//const Lang = imports.Lang.Lang;
@@
-10,6
+10,9
@@
@class Search a {@link JSDOC.TextStream} for language tokens.
*/
@class Search a {@link JSDOC.TextStream} for language tokens.
*/
+
+
+
namespace JSDOC {
public class TokenArray: Object {
namespace JSDOC {
public class TokenArray: Object {
@@
-52,6
+55,13
@@
namespace JSDOC {
public new Token get(int i) {
return this.tokens.get(i);
}
public new Token get(int i) {
return this.tokens.get(i);
}
+ public void dump()
+ {
+ foreach(var token in this.tokens) {
+ print(token.asString() +"\n");
+ }
+ }
+
}
public errordomain TokenReader_Error {
}
public errordomain TokenReader_Error {
@@
-188,7
+198,7
@@
namespace JSDOC {
public bool read_word (TextStream stream, TokenArray tokens)
{
string found = "";
public bool read_word (TextStream stream, TokenArray tokens)
{
string found = "";
- while (!stream.lookEOF() && Lang.isWordChar(
(string)stream.look
())) {
+ while (!stream.lookEOF() && Lang.isWordChar(
stream.look().to_string
())) {
found += stream.next();
}
found += stream.next();
}
@@
-252,7
+262,12
@@
namespace JSDOC {
{
string found = "";
{
string found = "";
- while (!stream.lookEOF() && Lang.punc(found + (string)stream.look()).length > 0) {
+ while (!stream.lookEOF()) {
+ var ns = stream.look().to_string();
+
+ if (null == Lang.punc(found + ns )) {
+ break;
+ }
found += stream.next();
}
found += stream.next();
}
@@
-390,12
+405,16
@@
namespace JSDOC {
(stream.look() == '<' && stream.look(1) == '!' && stream.look(2) == '-' && stream.look(3) == '-' && (""!=(found=stream.next(4))))
) {
var line = this.line;
(stream.look() == '<' && stream.look(1) == '!' && stream.look(2) == '-' && stream.look(3) == '-' && (""!=(found=stream.next(4))))
) {
var line = this.line;
- while (!stream.lookEOF() && !Lang.isNewline((string)stream.look())) {
+ while (!stream.lookEOF()) {
+ //print(stream.look().to_string());
+ if ( Lang.isNewline(stream.look().to_string())) {
+ break;
+ }
found += stream.next();
}
found += stream.next();
}
- //if (!stream.lookEOF()) { // what? << eat the EOL?
+ if (!stream.lookEOF()) { // lookinng for end of line... if we got it, then do not eat the character..
found += stream.next();
found += stream.next();
-
//
}
+ }
if (this.keepComments) {
tokens.push(new Token(found, "COMM", "SINGLE_LINE_COMM", line));
}
if (this.keepComments) {
tokens.push(new Token(found, "COMM", "SINGLE_LINE_COMM", line));
}
@@
-418,10
+437,10
@@
namespace JSDOC {
while (!stream.lookEOF()) {
if (stream.look() == '\\') {
while (!stream.lookEOF()) {
if (stream.look() == '\\') {
- if (Lang.isNewline(
(string)stream.look(1
))) {
+ if (Lang.isNewline(
stream.look(1).to_string(
))) {
do {
stream.next();
do {
stream.next();
- } while (!stream.lookEOF() && Lang.isNewline(
(string)stream.look
()));
+ } while (!stream.lookEOF() && Lang.isNewline(
stream.look().to_string
()));
str += "\\\n";
}
else {
str += "\\\n";
}
else {
@@
-480,7
+499,7
@@
namespace JSDOC {
var found = "";
var found = "";
- while (!stream.lookEOF() && Lang.isNumber(found+
(string)stream.look
())){
+ while (!stream.lookEOF() && Lang.isNumber(found+
stream.look().to_string
())){
found += stream.next();
}
found += stream.next();
}
@@
-504,7
+523,7
@@
namespace JSDOC {
var found = stream.next(2);
while (!stream.lookEOF()) {
var found = stream.next(2);
while (!stream.lookEOF()) {
- if (Lang.isHexDec(found) && !Lang.isHexDec(found+
(string)stream.look
())) { // done
+ if (Lang.isHexDec(found) && !Lang.isHexDec(found+
stream.look().to_string
())) { // done
tokens.push(new Token(found, "NUMB", "HEX_DEC", this.line));
return true;
}
tokens.push(new Token(found, "NUMB", "HEX_DEC", this.line));
return true;
}
@@
-545,7
+564,7
@@
namespace JSDOC {
if (stream.look() == '/') {
regex += stream.next();
if (stream.look() == '/') {
regex += stream.next();
- while (GLib.Regex.match_simple("[gmi]",
(string)stream.look
())) {
+ while (GLib.Regex.match_simple("[gmi]",
stream.look().to_string
())) {
regex += stream.next();
}
regex += stream.next();
}