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

Unified Diff: lib/src/prism/components/prism-prolog.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-processing.min.js ('k') | lib/src/prism/components/prism-prolog.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-prolog.js
diff --git a/lib/src/prism/components/prism-prolog.js b/lib/src/prism/components/prism-prolog.js
new file mode 100644
index 0000000000000000000000000000000000000000..86c04d4aae573f94005552ec7912e986ac7b11e3
--- /dev/null
+++ b/lib/src/prism/components/prism-prolog.js
@@ -0,0 +1,17 @@
+Prism.languages.prolog = {
+ // Syntax depends on the implementation
+ 'comment': [
+ /%.+/,
+ /\/\*[\s\S]*?\*\//
+ ],
+ // Depending on the implementation, strings may allow escaped newlines and quote-escape
+ 'string': /(["'])(?:\1\1|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
+ 'builtin': /\b(?:fx|fy|xf[xy]?|yfx?)\b/,
+ 'variable': /\b[A-Z_]\w*/,
+ // FIXME: Should we list all null-ary predicates (not followed by a parenthesis) like halt, trace, etc.?
+ 'function': /\b[a-z]\w*(?:(?=\()|\/\d+)/,
+ 'number': /\b\d+\.?\d*/,
+ // Custom operators are allowed
+ 'operator': /[:\\=><\-?*@\/;+^|!$.]+|\b(?:is|mod|not|xor)\b/,
+ 'punctuation': /[(){}\[\],]/
+};
« no previous file with comments | « lib/src/prism/components/prism-processing.min.js ('k') | lib/src/prism/components/prism-prolog.min.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698