prism-eiffel.js 1.1 KB

123456789101112131415161718192021222324
  1. Prism.languages.eiffel = {
  2. 'string': [
  3. // Single-line string
  4. /"(?:%\s+%|%"|.)*?"/,
  5. // Aligned-verbatim-strings
  6. /"([^[]*)\[[\s\S]+?\]\1"/,
  7. // Non-aligned-verbatim-strings
  8. /"([^{]*)\{[\s\S]+?\}\1"/
  9. ],
  10. // (comments including quoted strings not supported)
  11. 'comment': /--.*/,
  12. // normal char | special char | char code
  13. 'char': /'(?:%'|.)+?'/,
  14. '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/i,
  15. 'boolean': /\b(?:True|False)\b/i,
  16. 'number': [
  17. // hexa | octal | bin
  18. /\b0[xcb][\da-f](?:_*[\da-f])*\b/i,
  19. // Decimal
  20. /(?:\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?[eE][+-]?)?\d(?:_*\d)*|\d(?:_*\d)*\.?/
  21. ],
  22. 'punctuation': /:=|<<|>>|\(\||\|\)|->|\.(?=\w)|[{}[\];(),:?]/,
  23. 'operator': /\\\\|\|\.\.\||\.\.|\/[~\/]?|[><\/]=?|[-+*^=~]/
  24. };