Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
fireairforce committed Oct 15, 2024
1 parent b01dad3 commit 2286c37
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import defer * as ns from "x";
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
source: crates/biome_formatter_test/src/snapshot_builder.rs
info: js/module/import/import_defer_attribute.js
---
# Input

```js
import defer * as ns from "x";
```


=============================

# Outputs

## Output 1

-----
Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Quote style: Double Quotes
JSX quote style: Double Quotes
Quote properties: As needed
Trailing commas: All
Semicolons: Always
Arrow parentheses: Always
Bracket spacing: true
Bracket same line: false
Attribute Position: Auto
-----

```js
import defer * as ns from "x";
```
18 changes: 1 addition & 17 deletions crates/biome_js_parser/src/syntax/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,23 +296,7 @@ fn parse_import_clause(p: &mut JsParser) -> ParsedSyntax {

// test js import_defer_clause
// import defer * as yNamespace from "y";
let is_defer = 'is_defer: {
if !p.at(T![defer]) {
break 'is_defer false;
}

if matches!(p.nth(1), T![*] | T!['{']) {
break 'is_defer true;
}

if !is_nth_at_identifier_binding(p, 1) {
break 'is_defer false;
}

!p.nth_at(1, T![from]) || p.nth_at(2, T![from])
};

if is_defer {
if p.at(T![defer]) && p.nth_at(1, T![*]) {
p.eat(T![defer]);
}

Expand Down

0 comments on commit 2286c37

Please sign in to comment.