Lines Matching +full:js +full:- +full:tokens
8 // <script type=text/javascript src=prettify.js></script>
91 * n tokens can be represented as a series n - 1 token ends, as long as
111 * @param style one of the token styles defined in designdoc-template, or null
187 var i = 0, j = s.length - 1;
189 while (j > i && PR_isSpaceChar(s.charAt(j))) { --j; }
199 suffix == s.substring(s.length - suffix.length, s.length);
230 var pos = -1;
238 pos = i - 1;
256 pos = -1;
291 start = i - 1;
320 * of split tokens.
324 var tokens = new Array(); // the output
339 var tokLen = end - posAbs;
340 var remainingInChunk = chunk.token.length - posChunk;
343 tokens.push(
351 tokLen = end - posAbs;
352 remainingInChunk = chunk.token.length - posChunk;
356 tokens.push(
364 return tokens;
367 /** splits markup tokens into declarations, tags, and source chunks.
374 // generate a list of the ends of tokens.
388 var tokenStart = -1; // the start of the current token
393 // <script>document.writeln('<!--');</script>
444 if ('-' == ch) {
461 if ('-' == ch) { state = 5; }
464 if ('-' == ch) { state = 6; }
470 } else if ('-' == ch) {
554 /** splits the given string into comment, string, and "other" tokens.
557 * The result array may contain spurious zero length tokens. Ignore them.
563 var tokenEnds = new Array(); // positions of ends of tokens in absolute space
565 var delim = -1; // string delimiter
596 tokenEnds.push(new PR_TokenEnd(k + i - 1, PR_PLAIN));
599 tokenEnds.push(new PR_TokenEnd(k + i - 1, PR_PLAIN));
604 --i;
641 // if set to -1 then it will cause a reentry to state 0 without consuming
647 nstate = -2;
666 nstate = -1;
674 // 0.1 and 3e-6
675 // are each split into multiple tokens
677 nstate = -1;
683 nstate = -1;
717 t.substring(t.length - 2) == '_t') {
735 if (nstate == -1) {
738 i--;
761 function PR_splitTagAttributes(tokens) { argument
767 for (var ci = 0; ci < tokens.length; ++ci) {
768 var tok = tokens[ci];
875 function PR_splitSourceNodes(tokens) { argument
884 for (var ci = 0, nc = tokens.length; ci < nc; ++ci) {
885 var tok = tokens[ci];
887 tokens.push(tok);
950 // push remaining tag and attribute tokens from the opening tag
975 * ['"foo"'] -> ['"', 'foo', '"']
978 function PR_splitAttributeQuotes(tokens) { argument
980 for (var i = 0; i < tokens.length; ++i) {
981 if (PR_PLAIN = tokens[i].style) {
986 for (var i = tokens.length; --i >= 0;) {
987 if (PR_PLAIN = tokens[i].style) {
992 if (null == firstPlain) { return tokens; }
995 var fs = tokens[firstPlain].token;
998 return tokens;
1002 var ls = tokens[lastPlain].token;
1004 if (lpos < 0) { lpos = ls.length - 1; }
1013 tokensOut.push(tokens[i]);
1021 tokensOut.push(tokens[i]);
1024 tokens.push(new PR_Token(ls.substring(0, lpos), PR_PLAIN));
1026 tokens.push(tokens[lastPlain]);
1032 for (var i = lastPlain + 1; i < tokens.length; ++i) {
1033 tokensOut.push(tokens[i]);
1042 function PR_splitSourceAttributes(tokens) { argument
1049 for (var ci = 0, nc = tokens.length; ci < nc; ++ci) {
1050 var tok = tokens[ci];
1094 * This code assumes that < tokens are html escaped, but " are not.
1107 // positions of ends of tokens in order
1113 // split non comment|string tokens on whitespace and word boundaries
1132 * This code assumes that < tokens are html escaped, but " are not.
1137 * <!-- ... --> comment
1176 // last non-whitespace character is a >
1181 for (var j = chunks.length; --j >= 0;) {
1201 var tokens = PR_lexOne(s);
1204 for (var i = 0; i < tokens.length; i++) {
1205 var t = tokens[i];