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.
19 lines
376 B
19 lines
376 B
2 years ago
|
import { Ident } from '../../tokenizer/index.js';
|
||
|
|
||
|
export const name = 'Identifier';
|
||
|
export const structure = {
|
||
|
name: String
|
||
|
};
|
||
|
|
||
|
export function parse() {
|
||
|
return {
|
||
|
type: 'Identifier',
|
||
|
loc: this.getLocation(this.tokenStart, this.tokenEnd),
|
||
|
name: this.consume(Ident)
|
||
|
};
|
||
|
}
|
||
|
|
||
|
export function generate(node) {
|
||
|
this.token(Ident, node.name);
|
||
|
}
|