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.

26 lines
692 B

4 years ago
  1. var TYPE = require('../../tokenizer').TYPE;
  2. var rawMode = require('../node/Raw').mode;
  3. var COMMA = TYPE.Comma;
  4. // var( <ident> , <value>? )
  5. module.exports = function() {
  6. var children = this.createList();
  7. this.scanner.skipSC();
  8. // NOTE: Don't check more than a first argument is an ident, rest checks are for lexer
  9. children.push(this.Identifier());
  10. this.scanner.skipSC();
  11. if (this.scanner.tokenType === COMMA) {
  12. children.push(this.Operator());
  13. children.push(this.parseCustomProperty
  14. ? this.Value(null)
  15. : this.Raw(this.scanner.tokenIndex, rawMode.exclamationMarkOrSemicolon, false)
  16. );
  17. }
  18. return children;
  19. };