vala.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. */
  7. function vala(hljs) {
  8. return {
  9. name: 'Vala',
  10. keywords: {
  11. keyword:
  12. // Value types
  13. 'char uchar unichar int uint long ulong short ushort int8 int16 int32 int64 uint8 '
  14. + 'uint16 uint32 uint64 float double bool struct enum string void '
  15. // Reference types
  16. + 'weak unowned owned '
  17. // Modifiers
  18. + 'async signal static abstract interface override virtual delegate '
  19. // Control Structures
  20. + 'if while do for foreach else switch case break default return try catch '
  21. // Visibility
  22. + 'public private protected internal '
  23. // Other
  24. + 'using new this get set const stdout stdin stderr var',
  25. built_in:
  26. 'DBus GLib CCode Gee Object Gtk Posix',
  27. literal:
  28. 'false true null'
  29. },
  30. contains: [
  31. {
  32. className: 'class',
  33. beginKeywords: 'class interface namespace',
  34. end: /\{/,
  35. excludeEnd: true,
  36. illegal: '[^,:\\n\\s\\.]',
  37. contains: [ hljs.UNDERSCORE_TITLE_MODE ]
  38. },
  39. hljs.C_LINE_COMMENT_MODE,
  40. hljs.C_BLOCK_COMMENT_MODE,
  41. {
  42. className: 'string',
  43. begin: '"""',
  44. end: '"""',
  45. relevance: 5
  46. },
  47. hljs.APOS_STRING_MODE,
  48. hljs.QUOTE_STRING_MODE,
  49. hljs.C_NUMBER_MODE,
  50. {
  51. className: 'meta',
  52. begin: '^#',
  53. end: '$',
  54. }
  55. ]
  56. };
  57. }
  58. export { vala as default };