gherkin.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. Language: Gherkin
  3. Author: Sam Pikesley (@pikesley) <sam.pikesley@theodi.org>
  4. Description: Gherkin is the format for cucumber specifications. It is a domain specific language which helps you to describe business behavior without the need to go into detail of implementation.
  5. Website: https://cucumber.io/docs/gherkin/
  6. */
  7. function gherkin (hljs) {
  8. return {
  9. name: 'Gherkin',
  10. aliases: ['feature'],
  11. keywords: 'Feature Background Ability Business\ Need Scenario Scenarios Scenario\ Outline Scenario\ Template Examples Given And Then But When',
  12. contains: [
  13. {
  14. className: 'symbol',
  15. begin: '\\*',
  16. relevance: 0
  17. },
  18. {
  19. className: 'meta',
  20. begin: '@[^@\\s]+'
  21. },
  22. {
  23. begin: '\\|', end: '\\|\\w*$',
  24. contains: [
  25. {
  26. className: 'string',
  27. begin: '[^|]+'
  28. }
  29. ]
  30. },
  31. {
  32. className: 'variable',
  33. begin: '<', end: '>'
  34. },
  35. hljs.HASH_COMMENT_MODE,
  36. {
  37. className: 'string',
  38. begin: '"""', end: '"""'
  39. },
  40. hljs.QUOTE_STRING_MODE
  41. ]
  42. };
  43. }
  44. module.exports = gherkin;