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:
d950cd0
)
JSDOC/TokenReader.vala
author
Alan Knowles
<alan@roojs.com>
Tue, 15 Sep 2015 09:21:23 +0000
(17:21 +0800)
committer
Alan Knowles
<alan@roojs.com>
Tue, 15 Sep 2015 09:21:23 +0000
(17:21 +0800)
JSDOC/TokenReader.vala
patch
|
blob
|
history
diff --git
a/JSDOC/TokenReader.vala
b/JSDOC/TokenReader.vala
index
dab8616
..
29deac8
100644
(file)
--- a/
JSDOC/TokenReader.vala
+++ b/
JSDOC/TokenReader.vala
@@
-347,23
+347,34
@@
namespace JSDOC {
/**
@returns {Boolean} Was the token found?
*/
/**
@returns {Boolean} Was the token found?
*/
- read_mlcomment : function(/**JSDOC.TokenStream*/stream, tokens) {
- if (stream.look() == "/" && stream.look(1) == "*") {
- var found = stream.next(2);
- var c = '';
- var line = this.line;
- while (!stream.look().eof && !(stream.look(-1) == "/" && stream.look(-2) == "*")) {
- c = stream.next();
- if (c == "\n") this.line++;
- found += c;
+ public bool read_mlcomment (TokenStream stream, TokenArray tokens)
+ {
+ if (stream.look() != "/") {
+ return false;
+ }
+ if (stream.look(1) != "*") {
+ return false;
+ }
+ var found = stream.next(2);
+ var c = '';
+ var line = this.line;
+ while (!stream.lookEOF() && !(stream.look(-1) == "/" && stream.look(-2) == "*")) {
+ c = stream.next();
+ if (c == "\n") {
+ this.line++;
}
}
-
- // to start doclet we allow /** or /*** but not /**/ or /****
- if (/^\/\*\*([^\/]|\*[^*])/.test(found) && this.keepDocs) tokens.push(new Token(found, "COMM", "JSDOC", this.line));
- else if (this.keepComments) tokens.push(new Token(found, "COMM", "MULTI_LINE_COMM", line));
- return true;
+ found += c;
}
}
- return false;
+
+ // to start doclet we allow /** or /*** but not /**/ or /****
+ //if (found.length /^\/\*\*([^\/]|\*[^*])/.test(found) && this.keepDocs) {
+ if ((this.keepDocs && found.length > 4 && found.index_of("/**") == 0 && found[3] != "/") {
+ tokens.push(new Token(found, "COMM", "JSDOC", this.line));
+ } else if (this.keepComments) {
+ tokens.push(new Token(found, "COMM", "MULTI_LINE_COMM", line));
+ }
+ return true;
+
},
/**
},
/**