step21.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. module.exports = function(hljs) {
  2. var STEP21_IDENT_RE = '[A-Z_][A-Z0-9_.]*';
  3. var STEP21_KEYWORDS = {
  4. keyword: 'HEADER ENDSEC DATA'
  5. };
  6. var STEP21_START = {
  7. className: 'meta',
  8. begin: 'ISO-10303-21;',
  9. relevance: 10
  10. };
  11. var STEP21_CLOSE = {
  12. className: 'meta',
  13. begin: 'END-ISO-10303-21;',
  14. relevance: 10
  15. };
  16. return {
  17. aliases: ['p21', 'step', 'stp'],
  18. case_insensitive: true, // STEP 21 is case insensitive in theory, in practice all non-comments are capitalized.
  19. lexemes: STEP21_IDENT_RE,
  20. keywords: STEP21_KEYWORDS,
  21. contains: [
  22. STEP21_START,
  23. STEP21_CLOSE,
  24. hljs.C_LINE_COMMENT_MODE,
  25. hljs.C_BLOCK_COMMENT_MODE,
  26. hljs.COMMENT('/\\*\\*!', '\\*/'),
  27. hljs.C_NUMBER_MODE,
  28. hljs.inherit(hljs.APOS_STRING_MODE, {illegal: null}),
  29. hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}),
  30. {
  31. className: 'string',
  32. begin: "'", end: "'"
  33. },
  34. {
  35. className: 'symbol',
  36. variants: [
  37. {
  38. begin: '#', end: '\\d+',
  39. illegal: '\\W'
  40. }
  41. ]
  42. }
  43. ]
  44. };
  45. };