Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: bower_components/google-code-prettify/src/lang-tex.js

Issue 786953007: npm_modules: Fork bower_components into Polymer 0.4.0 and 0.5.0 versions (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (C) 2011 Martin S.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 /**
16 * @fileoverview
17 * Support for tex highlighting as discussed on
18 * <a href="http://meta.tex.stackexchange.com/questions/872/text-immediate-follo wing-double-backslashes-is-highlighted-as-macro-inside-a-code/876#876">meta.tex. stackexchange.com</a>.
19 *
20 * @author Martin S.
21 */
22
23 PR['registerLangHandler'](
24 PR['createSimpleLexer'](
25 [
26 // whitespace
27 [PR['PR_PLAIN'], /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'],
28 // all comments begin with '%'
29 [PR['PR_COMMENT'], /^%[^\r\n]*/, null, '%']
30 ],
31 [
32 //[PR['PR_DECLARATION'], /^\\([egx]?def|(new|renew|provide)(command|env ironment))\b/],
33 // any command starting with a \ and contains
34 // either only letters (a-z,A-Z), '@' (internal macros)
35 [PR['PR_KEYWORD'], /^\\[a-zA-Z@]+/],
36 // or contains only one character
37 [PR['PR_KEYWORD'], /^\\./],
38 // Highlight dollar for math mode and ampersam for tabular
39 [PR['PR_TYPE'], /^[$&]/],
40 // numeric measurement values with attached units
41 [PR['PR_LITERAL'],
42 /[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],
43 // punctuation usually occurring within commands
44 [PR['PR_PUNCTUATION'], /^[{}()\[\]=]+/]
45 ]),
46 ['latex', 'tex']);
OLDNEW
« no previous file with comments | « bower_components/google-code-prettify/src/lang-tcl.js ('k') | bower_components/google-code-prettify/src/lang-vb.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698