vala.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. Language: Vala
  3. Author: Antono Vasiljev <antono.vasiljev@gmail.com>
  4. Description: Vala is a new programming language that aims to bring modern programming language features to GNOME developers without imposing any additional runtime requirements and without using a different ABI compared to applications and libraries written in C.
  5. Website: https://wiki.gnome.org/Projects/Vala
  6. Category: system
  7. */
  8. function vala(hljs) {
  9. return {
  10. name: 'Vala',
  11. keywords: {
  12. keyword:
  13. // Value types
  14. 'char uchar unichar int uint long ulong short ushort int8 int16 int32 int64 uint8 '
  15. + 'uint16 uint32 uint64 float double bool struct enum string void '
  16. // Reference types
  17. + 'weak unowned owned '
  18. // Modifiers
  19. + 'async signal static abstract interface override virtual delegate '
  20. // Control Structures
  21. + 'if while do for foreach else switch case break default return try catch '
  22. // Visibility
  23. + 'public private protected internal '
  24. // Other
  25. + 'using new this get set const stdout stdin stderr var',
  26. built_in:
  27. 'DBus GLib CCode Gee Object Gtk Posix',
  28. literal:
  29. 'false true null'
  30. },
  31. contains: [
  32. {
  33. className: 'class',
  34. beginKeywords: 'class interface namespace',
  35. end: /\{/,
  36. excludeEnd: true,
  37. illegal: '[^,:\\n\\s\\.]',
  38. contains: [ hljs.UNDERSCORE_TITLE_MODE ]
  39. },
  40. hljs.C_LINE_COMMENT_MODE,
  41. hljs.C_BLOCK_COMMENT_MODE,
  42. {
  43. className: 'string',
  44. begin: '"""',
  45. end: '"""',
  46. relevance: 5
  47. },
  48. hljs.APOS_STRING_MODE,
  49. hljs.QUOTE_STRING_MODE,
  50. hljs.C_NUMBER_MODE,
  51. {
  52. className: 'meta',
  53. begin: '^#',
  54. end: '$',
  55. }
  56. ]
  57. };
  58. }
  59. export { vala as default };