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

Unified Diff: lib/src/prism/components/prism-ocaml.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, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/prism/components/prism-objectivec.min.js ('k') | lib/src/prism/components/prism-ocaml.min.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/prism/components/prism-ocaml.js
diff --git a/lib/src/prism/components/prism-ocaml.js b/lib/src/prism/components/prism-ocaml.js
new file mode 100644
index 0000000000000000000000000000000000000000..fd3234faf6e41b4493b85ebc3500ef6070645e86
--- /dev/null
+++ b/lib/src/prism/components/prism-ocaml.js
@@ -0,0 +1,21 @@
+Prism.languages.ocaml = {
+ 'comment': /\(\*[\s\S]*?\*\)/,
+ 'string': [
+ /"(?:\\.|[^\\\r\n"])*"/,
+ /(['`])(?:\\(?:\d+|x[\da-f]+|.)|(?!\1)[^\\\r\n])\1/i
+ ],
+ 'number': /\b-?(?:0x[\da-f][\da-f_]+|(?:0[bo])?\d[\d_]*\.?[\d_]*(?:e[+-]?[\d_]+)?)/i,
+ 'type': {
+ pattern: /\B['`][a-z\d_]*/i,
+ alias: 'variable'
+ },
+ 'directive': {
+ pattern: /\B#[a-z\d_]+/i,
+ alias: 'function'
+ },
+ 'keyword': /\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|object|of|open|prefix|private|rec|then|sig|struct|to|try|type|val|value|virtual|where|while|with)\b/,
+ 'boolean': /\b(?:false|true)\b/,
+ // Custom operators are allowed
+ 'operator': /:=|[=<>@^|&+\-*\/$%!?~][!$%&\*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lxor|lsl|lsr|mod|nor|or)\b/,
+ 'punctuation': /[(){}\[\]|_.,:;]/
+};
« no previous file with comments | « lib/src/prism/components/prism-objectivec.min.js ('k') | lib/src/prism/components/prism-ocaml.min.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698