1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
var TYPE = require('../../tokenizer').TYPE;
var IDENTIFIER = TYPE.Identifier;
var COMMA = TYPE.Comma;
var SEMICOLON = TYPE.Semicolon;
var HYPHENMINUS = TYPE.HyphenMinus;
var EXCLAMATIONMARK = TYPE.ExclamationMark;
// var '(' ident (',' <value>? )? ')'
module.exports = function() {
var children = this.createList();
this.scanner.skipSC();
var identStart = this.scanner.tokenStart;
this.scanner.eat(HYPHENMINUS);
if (this.scanner.source.charCodeAt(this.scanner.tokenStart) !== HYPHENMINUS) {
this.scanner.error('HyphenMinus is expected');
}
this.scanner.eat(IDENTIFIER);
children.push({
type: 'Identifier',
loc: this.getLocation(identStart, this.scanner.tokenStart),
name: this.scanner.substrToCursor(identStart)
});
this.scanner.skipSC();
if (this.scanner.tokenType === COMMA) {
children.push(this.Operator());
children.push(this.parseCustomProperty
? this.Value(null)
: this.Raw(this.scanner.currentToken, EXCLAMATIONMARK, SEMICOLON, false, false)
);
}
return children;
};