|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
472 bytes
|
| Line | |
|---|
| 1 | "use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|---|
| 2 | var _types = require('../parser/tokenizer/types');
|
|---|
| 3 |
|
|---|
| 4 | /**
|
|---|
| 5 | * Get all identifier names in the code, in order, including duplicates.
|
|---|
| 6 | */
|
|---|
| 7 | function getIdentifierNames(code, tokens) {
|
|---|
| 8 | const names = [];
|
|---|
| 9 | for (const token of tokens) {
|
|---|
| 10 | if (token.type === _types.TokenType.name) {
|
|---|
| 11 | names.push(code.slice(token.start, token.end));
|
|---|
| 12 | }
|
|---|
| 13 | }
|
|---|
| 14 | return names;
|
|---|
| 15 | } exports.default = getIdentifierNames;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.