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

Side by Side Diff: bower_components/google-code-prettify/src/lang-llvm.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) 2013 Nikhil Dabas
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 /**
17 * @fileoverview
18 * Registers a language handler for LLVM.
19 * From https://gist.github.com/ndabas/2850418
20 *
21 *
22 * To use, include prettify.js and this file in your HTML page.
23 * Then put your code in an HTML tag like
24 * <pre class="prettyprint lang-llvm">(my LLVM code)</pre>
25 *
26 *
27 * The regular expressions were adapted from:
28 * https://github.com/hansstimer/llvm.tmbundle/blob/76fedd8f50fd6108b1780c51d79f be3223de5f34/Syntaxes/LLVM.tmLanguage
29 *
30 * http://llvm.org/docs/LangRef.html#constants describes the language grammar.
31 *
32 * @author Nikhil Dabas
33 */
34 PR['registerLangHandler'](
35 PR['createSimpleLexer'](
36 [
37 // Whitespace
38 [PR['PR_PLAIN'], /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'],
39 // A double quoted, possibly multi-line, string.
40 [PR['PR_STRING'], /^!?\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/, null, '"'] ,
41 // comment.llvm
42 [PR['PR_COMMENT'], /^;[^\r\n]*/, null, ';']
43 ],
44 [
45 // variable.llvm
46 [PR['PR_PLAIN'], /^[%@!](?:[-a-zA-Z$._][-a-zA-Z$._0-9]*|\d+)/],
47
48 // According to http://llvm.org/docs/LangRef.html#well-formedness
49 // These reserved words cannot conflict with variable names, because no ne of them start with a prefix character ('%' or '@').
50 [PR['PR_KEYWORD'], /^[A-Za-z_][0-9A-Za-z_]*/, null],
51
52 // constant.numeric.float.llvm
53 [PR['PR_LITERAL'], /^\d+\.\d+/],
54
55 // constant.numeric.integer.llvm
56 [PR['PR_LITERAL'], /^(?:\d+|0[xX][a-fA-F0-9]+)/],
57
58 // punctuation
59 [PR['PR_PUNCTUATION'], /^[()\[\]{},=*<>:]|\.\.\.$/]
60 ]),
61 ['llvm', 'll']);
OLDNEW
« no previous file with comments | « bower_components/google-code-prettify/src/lang-lisp.js ('k') | bower_components/google-code-prettify/src/lang-lua.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698