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

Side by Side Diff: bower_components/google-code-prettify/src/lang-dart.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 Google Inc.
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 /**
18 * @fileoverview
19 * Registers a language handler Dart.
20 * Loosely structured based on the DartLexer in Pygments: http://pygments.org/.
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-dart">(Dart code)</pre>
25 *
26 * @author armstrong.timothy@gmail.com
27 */
28
29 PR['registerLangHandler'](
30 PR['createSimpleLexer'](
31 [
32 // Whitespace.
33 [PR['PR_PLAIN'], /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0']
34 ],
35 [
36 // Script tag.
37 [PR['PR_COMMENT'], /^#!(?:.*)/],
38
39 // `import`, `library`, `part of`, `part`, `as`, `show`, and `hide`
40 // keywords.
41 [PR['PR_KEYWORD'], /^\b(?:import|library|part of|part|as|show|hide)\b/i],
42
43 // Single-line comments.
44 [PR['PR_COMMENT'], /^\/\/(?:.*)/],
45
46 // Multiline comments.
47 [PR['PR_COMMENT'], /^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//], // */
48
49 // `class` and `interface` keywords.
50 [PR['PR_KEYWORD'], /^\b(?:class|interface)\b/i],
51
52 // General keywords.
53 [PR['PR_KEYWORD'], /^\b(?:assert|break|case|catch|continue|default|do|else |finally|for|if|in|is|new|return|super|switch|this|throw|try|while)\b/i],
54
55 // Declaration keywords.
56 [PR['PR_KEYWORD'], /^\b(?:abstract|const|extends|factory|final|get|impleme nts|native|operator|set|static|typedef|var)\b/i],
57
58 // Keywords for types.
59 [PR['PR_TYPE'], /^\b(?:bool|double|Dynamic|int|num|Object|String|void)\b/i ],
60
61 // Keywords for constants.
62 [PR['PR_KEYWORD'], /^\b(?:false|null|true)\b/i],
63
64 // Multiline strings, single- and double-quoted.
65 [PR['PR_STRING'], /^r?[\']{3}[\s|\S]*?[^\\][\']{3}/],
66 [PR['PR_STRING'], /^r?[\"]{3}[\s|\S]*?[^\\][\"]{3}/],
67
68 // Normal and raw strings, single- and double-quoted.
69 [PR['PR_STRING'], /^r?\'(\'|(?:[^\n\r\f])*?[^\\]\')/],
70 [PR['PR_STRING'], /^r?\"(\"|(?:[^\n\r\f])*?[^\\]\")/],
71
72 // Identifiers.
73 [PR['PR_PLAIN'], /^[a-z_$][a-z0-9_]*/i],
74
75 // Operators.
76 [PR['PR_PUNCTUATION'], /^[~!%^&*+=|?:<>/-]/],
77
78 // Hex numbers.
79 [PR['PR_LITERAL'], /^\b0x[0-9a-f]+/i],
80
81 // Decimal numbers.
82 [PR['PR_LITERAL'], /^\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i],
83 [PR['PR_LITERAL'], /^\b\.\d+(?:e[+-]?\d+)?/i],
84
85 // Punctuation.
86 [PR['PR_PUNCTUATION'], /^[(){}\[\],.;]/]
87 ]),
88 ['dart']);
OLDNEW
« no previous file with comments | « bower_components/google-code-prettify/src/lang-css.js ('k') | bower_components/google-code-prettify/src/lang-erlang.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698