parser.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import * as scope from '../scope/index.js';
  2. import atrule from '../atrule/index.js';
  3. import pseudo from '../pseudo/index.js';
  4. import * as node from '../node/index-parse.js';
  5. export default {
  6. parseContext: {
  7. default: 'StyleSheet',
  8. stylesheet: 'StyleSheet',
  9. atrule: 'Atrule',
  10. atrulePrelude(options) {
  11. return this.AtrulePrelude(options.atrule ? String(options.atrule) : null);
  12. },
  13. mediaQueryList: 'MediaQueryList',
  14. mediaQuery: 'MediaQuery',
  15. condition(options) {
  16. return this.Condition(options.kind);
  17. },
  18. rule: 'Rule',
  19. selectorList: 'SelectorList',
  20. selector: 'Selector',
  21. block() {
  22. return this.Block(true);
  23. },
  24. declarationList: 'DeclarationList',
  25. declaration: 'Declaration',
  26. value: 'Value'
  27. },
  28. features: {
  29. supports: {
  30. selector() {
  31. return this.Selector();
  32. }
  33. },
  34. container: {
  35. style() {
  36. return this.Declaration();
  37. }
  38. }
  39. },
  40. scope,
  41. atrule,
  42. pseudo,
  43. node
  44. };