-
-
Notifications
You must be signed in to change notification settings - Fork 499
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(codegen): print inline legal comments
part of #7050
- Loading branch information
Showing
8 changed files
with
169 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use crate::snapshot; | ||
|
||
#[test] | ||
fn legal_comment() { | ||
let cases = | ||
vec!["/* @license */foo;", "/* @preserve */foo;", "//! KEEP\nfoo;", "/*! KEEP */\nfoo;"]; | ||
|
||
snapshot("legal_comments", &cases); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
crates/oxc_codegen/tests/integration/snapshots/legal_comments.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
source: crates/oxc_codegen/tests/integration/main.rs | ||
--- | ||
########## 0 | ||
/* @license */foo; | ||
---------- | ||
/* @license */foo; | ||
|
||
########## 1 | ||
/* @preserve */foo; | ||
---------- | ||
/* @preserve */foo; | ||
|
||
########## 2 | ||
//! KEEP | ||
foo; | ||
---------- | ||
//! KEEP | ||
foo; | ||
|
||
########## 3 | ||
/*! KEEP */ | ||
foo; | ||
---------- | ||
/*! KEEP */ | ||
foo; |