Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
595 bytes
|
Line | |
---|
1 | var TYPE = require('../../tokenizer').TYPE;
|
---|
2 |
|
---|
3 | var HASH = TYPE.Hash;
|
---|
4 |
|
---|
5 | // <hash-token>
|
---|
6 | module.exports = {
|
---|
7 | name: 'IdSelector',
|
---|
8 | structure: {
|
---|
9 | name: String
|
---|
10 | },
|
---|
11 | parse: function() {
|
---|
12 | var start = this.scanner.tokenStart;
|
---|
13 |
|
---|
14 | // TODO: check value is an ident
|
---|
15 | this.eat(HASH);
|
---|
16 |
|
---|
17 | return {
|
---|
18 | type: 'IdSelector',
|
---|
19 | loc: this.getLocation(start, this.scanner.tokenStart),
|
---|
20 | name: this.scanner.substrToCursor(start + 1)
|
---|
21 | };
|
---|
22 | },
|
---|
23 | generate: function(node) {
|
---|
24 | this.chunk('#');
|
---|
25 | this.chunk(node.name);
|
---|
26 | }
|
---|
27 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.