gherkin.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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: '\\|',
  24. end: '\\|\\w*$',
  25. contains: [
  26. {
  27. className: 'string',
  28. begin: '[^|]+'
  29. }
  30. ]
  31. },
  32. {
  33. className: 'variable',
  34. begin: '<',
  35. end: '>'
  36. },
  37. hljs.HASH_COMMENT_MODE,
  38. {
  39. className: 'string',
  40. begin: '"""',
  41. end: '"""'
  42. },
  43. hljs.QUOTE_STRING_MODE
  44. ]
  45. };
  46. }
  47. module.exports = gherkin;