vala.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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', end: '{', excludeEnd: true,
  34. illegal: '[^,:\\n\\s\\.]',
  35. contains: [
  36. hljs.UNDERSCORE_TITLE_MODE
  37. ]
  38. },
  39. hljs.C_LINE_COMMENT_MODE,
  40. hljs.C_BLOCK_COMMENT_MODE,
  41. {
  42. className: 'string',
  43. begin: '"""', end: '"""',
  44. relevance: 5
  45. },
  46. hljs.APOS_STRING_MODE,
  47. hljs.QUOTE_STRING_MODE,
  48. hljs.C_NUMBER_MODE,
  49. {
  50. className: 'meta',
  51. begin: '^#', end: '$',
  52. relevance: 2
  53. }
  54. ]
  55. };
  56. }
  57. module.exports = vala;