import.js 1005 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. var TYPE = require('../../tokenizer').TYPE;
  2. var STRING = TYPE.String;
  3. var IDENTIFIER = TYPE.Identifier;
  4. var URL = TYPE.Url;
  5. var LEFTPARENTHESIS = TYPE.LeftParenthesis;
  6. module.exports = {
  7. parse: {
  8. prelude: function() {
  9. var children = this.createList();
  10. this.scanner.skipSC();
  11. switch (this.scanner.tokenType) {
  12. case STRING:
  13. children.push(this.String());
  14. break;
  15. case URL:
  16. children.push(this.Url());
  17. break;
  18. default:
  19. this.scanner.error('String or url() is expected');
  20. }
  21. if (this.scanner.lookupNonWSType(0) === IDENTIFIER ||
  22. this.scanner.lookupNonWSType(0) === LEFTPARENTHESIS) {
  23. children.push(this.WhiteSpace());
  24. children.push(this.MediaQueryList());
  25. }
  26. return children;
  27. },
  28. block: null
  29. }
  30. };