Add Eiffel programming language definition.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
diff --git a/components.js b/components.js
index 94a440e..8803042 100644
--- a/components.js
+++ b/components.js
@@ -58,6 +58,10 @@ var components = {
"title": "C-like",
"option": "default"
},
+ "eiffel": {
+ "title": "Eiffel",
+ "option": "default"
+ },
"javascript": {
"title": "JavaScript",
"option": "default",
diff --git a/components/prism-eiffel.js b/components/prism-eiffel.js
new file mode 100644
index 0000000..444e686
--- /dev/null
+++ b/components/prism-eiffel.js
@@ -0,0 +1,27 @@
+Prism.languages.eiffel = {
+ 'string': [
+ // Aligned-verbatim-strings (verbatim option not supported)
+ /"\[(?:[^"%\b\f\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[cC][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*|\d(?:_?\d)*)\/)*?]"/g,
+ // Non-aligned-verbatim-strings (verbatim option not supported)
+ /"\{(?:[^"%\b\f\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[cC][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*|\d(?:_?\d)*)\/)*?}"/g,
+ // Single-line string
+ /"(?:[^%\b\f\n\r\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[cC][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*|\d(?:_?\d)*)\/)*?"/g
+ ],
+ // (comments including quoted strings not supported)
+ 'comment': /--.*/,
+ // normal char | special char | char code
+ 'char': /'(?:[^%\b\f\n\r\t\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[cC][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*|\d(?:_?\d)*)\/)'/g,
+ 'keyword': /\b(?:across|agent|alias|all|and|attached|as|assign|attribute|check|class|convert|create|Current|debug|deferred|detachable|do|else|elseif|end|ensure|expanded|export|external|feature|from|frozen|if|implies|inherit|inspect|invariant|like|local|loop|not|note|obsolete|old|once|or|Precursor|redefine|rename|require|rescue|Result|retry|select|separate|some|then|undefine|until|variant|Void|when|xor)\b/gi,
+ 'boolean': /\b(?:True|False)\b/gi,
+ 'number': [
+ // Decimal
+ {
+ pattern: /(\s)(?:\d(?:_?\d)*\.|(?:(?:\d(?:_?\d)*)?\.(?:\d(?:_?\d)*)?(?:[eE][+-]?)?)?\d(?:_?\d)*)(?=\s)/g,
+ lookbehind: true
+ },
+ // hexa | octal | bin
+ /\b0(?:[xX][\da-fA-F](?:_?[\da-fA-F])*|[cC][0-7](?:_?[0-7])*|[bB][01](?:_?[01])*)\b/g
+ ],
+ 'punctuation': /:=|<<|>>|\(\||\|\)|->|\.(?=\w)|[{}[\];(),:?]/g,
+ 'operator': /\\\\|\|\.\.\||\.\.|\/[~\/]?|[><\/]=?|[-+*^=~]/g
+};