source: frontend/node_modules/sucrase/dist/esm/util/getIdentifierNames.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 2 weeks ago

Fix frontend appearance

  • Property mode set to 100644
File size: 369 bytes
Line 
1
2import {TokenType as tt} from "../parser/tokenizer/types";
3
4/**
5 * Get all identifier names in the code, in order, including duplicates.
6 */
7export default function getIdentifierNames(code, tokens) {
8 const names = [];
9 for (const token of tokens) {
10 if (token.type === tt.name) {
11 names.push(code.slice(token.start, token.end));
12 }
13 }
14 return names;
15}
Note: See TracBrowser for help on using the repository browser.