You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.4 KiB

4 years ago
  1. // CSS Syntax Module Level 3
  2. // https://www.w3.org/TR/css-syntax-3/
  3. var TYPE = {
  4. EOF: 0, // <EOF-token>
  5. Ident: 1, // <ident-token>
  6. Function: 2, // <function-token>
  7. AtKeyword: 3, // <at-keyword-token>
  8. Hash: 4, // <hash-token>
  9. String: 5, // <string-token>
  10. BadString: 6, // <bad-string-token>
  11. Url: 7, // <url-token>
  12. BadUrl: 8, // <bad-url-token>
  13. Delim: 9, // <delim-token>
  14. Number: 10, // <number-token>
  15. Percentage: 11, // <percentage-token>
  16. Dimension: 12, // <dimension-token>
  17. WhiteSpace: 13, // <whitespace-token>
  18. CDO: 14, // <CDO-token>
  19. CDC: 15, // <CDC-token>
  20. Colon: 16, // <colon-token> :
  21. Semicolon: 17, // <semicolon-token> ;
  22. Comma: 18, // <comma-token> ,
  23. LeftSquareBracket: 19, // <[-token>
  24. RightSquareBracket: 20, // <]-token>
  25. LeftParenthesis: 21, // <(-token>
  26. RightParenthesis: 22, // <)-token>
  27. LeftCurlyBracket: 23, // <{-token>
  28. RightCurlyBracket: 24, // <}-token>
  29. Comment: 25
  30. };
  31. var NAME = Object.keys(TYPE).reduce(function(result, key) {
  32. result[TYPE[key]] = key;
  33. return result;
  34. }, {});
  35. module.exports = {
  36. TYPE: TYPE,
  37. NAME: NAME
  38. };