[rust] mark generated code, skip formatting
Joe Savona committed
Jul 14, 2023 at 15:46 UTC
a39545a5758d24709b8922685736efd9f9d9e660
2 files changed
+7
-1
compiler/forget/crates/forget_estree/src/generated.rs
+2
@@ -1,3 +1,5 @@
1
+// @generated
2
+#![cfg_attr(rustfmt, rustfmt_skip)]
3
use std::num::NonZeroU32;
4
use serde::{Serialize, Deserialize};
5
use crate::{JsValue, Binding, SourceRange};
compiler/forget/crates/forget_estree_codegen/src/codegen.rs
+5
-1
@@ -13,7 +13,11 @@ pub fn estree() -> String {
13
let raw = grammar.codegen().to_string();
14
15
let parsed = syn::parse_file(&raw).unwrap();
16
- prettyplease::unparse(&parsed)
16
+ format!(
17
+ "// {}generated\n#![cfg_attr(rustfmt, rustfmt_skip)]\n{}",
18
+ '\u{0040}',
19
+ prettyplease::unparse(&parsed)
20
+ )
21
}
22
23
#[derive(Serialize, Deserialize, Debug)]