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

Side by Side Diff: lib/src/prism/components/prism-bison.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
OLDNEW
(Empty)
1 Prism.languages.bison = Prism.languages.extend('c', {});
2
3 Prism.languages.insertBefore('bison', 'comment', {
4 'bison': {
5 // This should match all the beginning of the file
6 // including the prologue(s), the bison declarations and
7 // the grammar rules.
8 pattern: /^[\s\S]*?%%[\s\S]*?%%/,
9 inside: {
10 'c': {
11 // Allow for one level of nested braces
12 pattern: /%\{[\s\S]*?%\}|\{(?:\{[^}]*\}|[^{}])*\ }/,
13 inside: {
14 'delimiter': {
15 pattern: /^%?\{|%?\}$/,
16 alias: 'punctuation'
17 },
18 'bison-variable': {
19 pattern: /[$@](?:<[^\s>]+>)?[\w$ ]+/,
20 alias: 'variable',
21 inside: {
22 'punctuation': /<|>/
23 }
24 },
25 rest: Prism.languages.c
26 }
27 },
28 'comment': Prism.languages.c.comment,
29 'string': Prism.languages.c.string,
30 'property': /\S+(?=:)/,
31 'keyword': /%\w+/,
32 'number': {
33 pattern: /(^|[^@])\b(?:0x[\da-f]+|\d+)/i,
34 lookbehind: true
35 },
36 'punctuation': /%[%?]|[|:;\[\]<>]/
37 }
38 }
39 });
OLDNEW
« no previous file with comments | « lib/src/prism/components/prism-batch.min.js ('k') | lib/src/prism/components/prism-bison.min.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698