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

Side by Side Diff: lib/src/prism/components/prism-nim.js

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates Created 5 years, 1 month 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
« no previous file with comments | « lib/src/prism/components/prism-nginx.min.js ('k') | lib/src/prism/components/prism-nim.min.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 Prism.languages.nim = {
2 'comment': /#.*/,
3 // Double-quoted strings can be prefixed by an identifier (Generalized r aw string literals)
4 // Character literals are handled specifically to prevent issues with nu meric type suffixes
5 'string': /(?:(?:\b(?!\d)(?:\w|\\x[8-9a-fA-F][0-9a-fA-F])+)?(?:"""[\s\S] *?"""(?!")|"(?:\\[\s\S]|""|[^"\\])*")|'(?:\\(?:\d+|x[\da-fA-F]{2}|.)|[^'])')/,
6 // The negative look ahead prevents wrong highlighting of the .. operato r
7 'number': /\b(?:0[xXoObB][\da-fA-F_]+|\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:[e E][+-]?\d[\d_]*)?)(?:'?[iuf]\d*)?/,
8 'keyword': /\b(?:addr|as|asm|atomic|bind|block|break|case|cast|concept|c onst|continue|converter|defer|discard|distinct|do|elif|else|end|enum|except|expo rt|finally|for|from|func|generic|if|import|include|interface|iterator|let|macro| method|mixin|nil|object|out|proc|ptr|raise|ref|return|static|template|try|tuple| type|using|var|when|while|with|without|yield)\b/,
9 'function': {
10 pattern: /(?:(?!\d)(?:\w|\\x[8-9a-fA-F][0-9a-fA-F])+|`[^`\r\n]+` )\*?(?:\[[^\]]+\])?(?=\s*\()/,
11 inside: {
12 'operator': /\*$/
13 }
14 },
15 // We don't want to highlight operators inside backticks
16 'ignore': {
17 pattern: /`[^`\r\n]+`/,
18 inside: {
19 'punctuation': /`/
20 }
21 },
22 'operator': {
23 // Look behind and look ahead prevent wrong highlighting of punc tuations [. .] {. .} (. .)
24 // but allow the slice operator .. to take precedence over them
25 // One can define his own operators in Nim so all combination of operators might be an operator.
26 pattern: /(^|[({\[](?=\.\.)|(?![({\[]\.).)(?:(?:[=+\-*\/<>@$~&%| !?^:\\]|\.\.|\.(?![)}\]]))+|\b(?:and|div|of|or|in|is|isnot|mod|not|notin|shl|shr |xor)\b)/m,
27 lookbehind: true
28 },
29 'punctuation': /[({\[]\.|\.[)}\]]|[`(){}\[\],:]/
30 };
OLDNEW
« no previous file with comments | « lib/src/prism/components/prism-nginx.min.js ('k') | lib/src/prism/components/prism-nim.min.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698