index.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import { parseLanguageRangeList } from './lang.js';
  2. const selectorList = {
  3. parse() {
  4. return this.createSingleNodeList(
  5. this.SelectorList()
  6. );
  7. }
  8. };
  9. const selector = {
  10. parse() {
  11. return this.createSingleNodeList(
  12. this.Selector()
  13. );
  14. }
  15. };
  16. const identList = {
  17. parse() {
  18. return this.createSingleNodeList(
  19. this.Identifier()
  20. );
  21. }
  22. };
  23. const langList = {
  24. parse: parseLanguageRangeList
  25. };
  26. const nth = {
  27. parse() {
  28. return this.createSingleNodeList(
  29. this.Nth()
  30. );
  31. }
  32. };
  33. export default {
  34. 'dir': identList,
  35. 'has': selectorList,
  36. 'lang': langList,
  37. 'matches': selectorList,
  38. 'is': selectorList,
  39. '-moz-any': selectorList,
  40. '-webkit-any': selectorList,
  41. 'where': selectorList,
  42. 'not': selectorList,
  43. 'nth-child': nth,
  44. 'nth-last-child': nth,
  45. 'nth-last-of-type': nth,
  46. 'nth-of-type': nth,
  47. 'slotted': selector,
  48. 'host': selector,
  49. 'host-context': selector
  50. };