- /**
- @returns {Boolean} Was the token found?
- */
- read_dbquote : function(/**JSDOC.TokenStream*/stream, tokens) {
- if (stream.look() == "\"") {
- // find terminator
- var string = stream.next();
-
- while (!stream.look().eof) {
- if (stream.look() == "\\") {
- if (Lang.isNewline(stream.look(1))) {
- do {
- stream.next();
- } while (!stream.look().eof && Lang.isNewline(stream.look()));
- string += "\\\n";
+ /**
+ @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;
+ }
+
+ // 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;
+ }
+ return false;
+ },
+
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_slcomment : function(/**JSDOC.TokenStream*/stream, tokens) {
+ var found;
+ if (
+ (stream.look() == "/" && stream.look(1) == "/" && (found=stream.next(2)))
+ ||
+ (stream.look() == "<" && stream.look(1) == "!" && stream.look(2) == "-" && stream.look(3) == "-" && (found=stream.next(4)))
+ ) {
+ var line = this.line;
+ while (!stream.look().eof && !Lang.isNewline(stream.look())) {
+ found += stream.next();
+ }
+ if (!stream.look().eof) {
+ found += stream.next();
+ }
+ if (this.keepComments) {
+ tokens.push(new Token(found, "COMM", "SINGLE_LINE_COMM", line));
+ }
+ this.line++;
+ return true;
+ }
+ return false;
+ },
+
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_dbquote : function(/**JSDOC.TokenStream*/stream, tokens) {
+ if (stream.look() == "\"") {
+ // find terminator
+ var string = stream.next();
+
+ while (!stream.look().eof) {
+ if (stream.look() == "\\") {
+ if (Lang.isNewline(stream.look(1))) {
+ do {
+ stream.next();
+ } while (!stream.look().eof && Lang.isNewline(stream.look()));
+ string += "\\\n";
+ }
+ else {
+ string += stream.next(2);
+ }
+ }
+ else if (stream.look() == "\"") {
+ string += stream.next();
+ tokens.push(new Token(string, "STRN", "DOUBLE_QUOTE", this.line));
+ return true;