|
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:
784 bytes
|
| Rev | Line | |
|---|
| [9af201e] | 1 | "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _keywords = require('../parser/tokenizer/keywords');
|
|---|
| 2 | var _types = require('../parser/tokenizer/types');
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 | /**
|
|---|
| 6 | * Starting at a potential `with` or (legacy) `assert` token, remove the import
|
|---|
| 7 | * attributes if they exist.
|
|---|
| 8 | */
|
|---|
| 9 | function removeMaybeImportAttributes(tokens) {
|
|---|
| 10 | if (
|
|---|
| 11 | tokens.matches2(_types.TokenType._with, _types.TokenType.braceL) ||
|
|---|
| 12 | (tokens.matches2(_types.TokenType.name, _types.TokenType.braceL) && tokens.matchesContextual(_keywords.ContextualKeyword._assert))
|
|---|
| 13 | ) {
|
|---|
| 14 | // assert
|
|---|
| 15 | tokens.removeToken();
|
|---|
| 16 | // {
|
|---|
| 17 | tokens.removeToken();
|
|---|
| 18 | tokens.removeBalancedCode();
|
|---|
| 19 | // }
|
|---|
| 20 | tokens.removeToken();
|
|---|
| 21 | }
|
|---|
| 22 | } exports.removeMaybeImportAttributes = removeMaybeImportAttributes;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.