Lines Matching +defs:_ +defs:a

7  * You may obtain a copy of the License at
168 // Given a list of URLs to stylesheets, loads the first that loads without
217 function (_, name, value) {
227 // prevent a MITM from rewrite prettify mid-flight.
237 // a script is finished loading.
287 * You may obtain a copy of the License at
303 * For a fairly comprehensive set of languages see the
304 * <a href="https://github.com/google/code-prettify#for-which-languages-does-it-work">README</a>
305 * file that came with this source. At a minimum, the lexer should work on a
308 * and a subset of Perl, but, because of commenting conventions, doesn't work on
325 * starts with "lang-" followed by a file extension, specifies the file type.
377 * Pretty print a chunk of code.
380 * Typically, a filename extension like 'cpp' or 'java'.
451 * token style for a string literal
456 * token style for a keyword
461 * token style for a comment
466 * token style for a type
471 * token style for a literal value. e.g. 1, null, true.
476 * token style for a punctuation string.
492 * token style for a markup declaration such as a DOCTYPE.
513 * A class that indicates a section of markup that is not code, e.g. to allow
523 // CAVEAT: this does not properly handle the case where a regular
524 // expression immediately follows another since a regular expression may
527 // TODO: maybe style special characters inside a regexp as punctuation.
530 * A set of tokens that can precede a regular expression literal in
536 * Specifically, I've removed any keywords that can't precede a regexp
537 * literal in a syntactically legal javascript program, and I've removed the
538 * "in" keyword since it's not a keyword in many languages, and might be used
539 * as a count of inches.
542 * it fails to distinguish between (a=++/b/i) and (a++/b/i) but it works
552 * Given a group of {@link RegExp}s, returns a {@code RegExp} that globally
554 * Since it matches globally, if the input strings have a start-of-input
557 * @return {RegExp} a global regex.
568 } else if (/[a-z]/i.test(regex.source.replace(
569 /\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ''))) {
660 ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1] - a[1]); });
691 + '\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]' // a character set
692 + '|\\\\u[A-Fa-f0-9]{4}' // a unicode escape
693 + '|\\\\x[A-Fa-f0-9]{2}' // a hex escape
694 + '|\\\\[0-9]+' // a back-reference or octal escape
696 + '|\\(\\?[:!=]' // start of a non-capturing group
697 + '|[\\(\\)\\^]' // start/end of a group, or line start
722 // an octal escape sequence does not turn into a backreference
723 // to a capturing group from an earlier regex.
769 /[a-zA-Z]/g,
794 * Split markup into a string of source code and an array mapping ranges in
822 * where #1 is a reference to the {@code "print "} text node above, and so
921 * there is a single child element that contains all the non-space textual
939 /** Given triples of [style, pattern, context] returns a lexing function,
941 * returns a decoration list of the form
943 * where index_n is an index into the sourceCode, and style_n is a style
947 * The stylePatterns is a list whose elements have the form
950 * Style is a style constant like PR_PLAIN, or can be a string of the
951 * form 'lang-FOO', where FOO is a language extension describing the
966 * so the generic tag rule would identify it as a tag.
968 * Pattern must only match prefixes, and if it matches a prefix, then that
969 * match is considered a token with the same style.
978 * a known character. Must have a shortcut string.
982 * @return {function (JobT)} a function that takes an undecorated job and
983 * attaches a list of decorations.
1113 /** returns a function that produces a list of decorations from source text.
1115 * This code treats ", ', and ` as string delimiters, and \ as a string
1119 * although in those cases a single string literal may be broken up into
1124 * @param {Object} options a set of optional parameters.
1125 * @return {function (JobT)} a function that examines the source code
1126 * in the input job and builds a decoration list which it attaches to
1168 /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,
1195 // A regular expression literal starts with a slash that is
1206 // finally closed by a /.
1232 // A word is a sequence of characters considered as a single
1241 // which means that only a '#' after /(?:^|[{}|&$;<>\s])/ starts a
1253 // suggests that this definition is compatible with a
1254 // default mode that tries to use a single token definition
1260 // by a punctuation character. We could try to exclude # after
1262 // If that does turn out to be a problem, we should change the below
1272 [PR_LITERAL, /^@[a-z_$][a-z_$@0-9]*/i, null],
1273 [PR_TYPE, /^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/, null],
1274 [PR_PLAIN, /^[a-z_$][a-z_$@0-9]*/i, null],
1279 + '0x[a-f0-9]+'
1281 + '|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)'
1286 + '[a-z]*', 'i'),
1305 * Given a DOM subtree, wraps it in a list, and puts each line into its own
1309 * HTMLOListElement, and each line is moved into a separate list item.
1338 // Discard the <BR> since it is now flush against a </LI>.
1368 // Split a line after the given node.
1372 // would require us to create a bunch of empty copies.
1429 // Stick a class on the LIs so that stylesheets can
1523 // Emitting Windows standard issue linebreaks (CRLF) causes a blank
1536 if (sourceIndex < spanEnd) { // Split off a text node.
1563 /** Register a language handler for the given file extensions.
1564 * @param {function (JobT)} handler a function from source code to a list
1565 * of decorations. Takes a single argument job which describes the
1581 // Treat it as markup if the first non whitespace character is a < and
1582 // the last non-whitespace character is a >.
1606 ['lang-in.tag', /^(<\/?[a-z][^<>]*>)/i]
1616 [PR_TAG, /^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],
1617 [PR_ATTRIB_NAME, /^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],
1716 * Pretty print a chunk of code.
1719 * Typically, a filename extension like 'cpp' or 'java'.
1732 // We assume that the inner HTML is from a trusted source.
1734 // when it is injected into a <pre> tag.
1736 // http://stackoverflow.com/questions/195363/inserting-a-newline-into-a-pre-tag-ie-javascript
1771 // fetch a list of nodes to rewrite
1786 // The loop is broken into a series of continuations to make sure that we
1787 // don't make the browser unresponsive when rewriting a large page.
1805 // Look for a preceding comment like
1811 // <?foo?> is parsed by HTML 5 to a comment node (8)
1812 // like <!--?foo?-->, but in XML is a processing instruction
1824 function (_, name, value) { attrs[name] = value; });
1852 // If the classes includes a language extensions, use it.
1855 // the language extension "cpp" is used to find a language handler
1857 // HTML5 recommends that a language be specified using "language-"
1891 // Look for a class like linenums or linenums:<n> where <n> is the
1920 // finish up in a continuation
1963 // The Asynchronous Module Definition (AMD) API specifies a
1967 // To allow a clear indicator that a global define function (as
1969 // any global define function SHOULD have a property called "amd"
1971 // other existing JavaScript code that could have defined a define()