Unverified Commit de52c00b authored by Benjamin Woodruff's avatar Benjamin Woodruff Committed by GitHub

Turbopack: Fix turbopack-swc-ast-explorer with multi-line inputs (#81635)

Previously this was only parsing the first line of input

```
cargo run -p swc-ast-explorer <turbopack/crates/turbopack-tests/tests/snapshot/comptime/assignment/input/index.js | less
```
parent b5f2517a
use std::{io::stdin, sync::Arc}; use std::{
io::{Read, stdin},
sync::Arc,
};
use anyhow::Result; use anyhow::Result;
use clap::Parser; use clap::Parser;
...@@ -25,7 +28,7 @@ fn main() -> Result<()> { ...@@ -25,7 +28,7 @@ fn main() -> Result<()> {
let args = Args::parse(); let args = Args::parse();
let mut contents = String::new(); let mut contents = String::new();
stdin().read_line(&mut contents)?; stdin().read_to_string(&mut contents)?;
let sm = Arc::new(SourceMap::default()); let sm = Arc::new(SourceMap::default());
let file = sm.new_source_file(FileName::Anon.into(), contents); let file = sm.new_source_file(FileName::Anon.into(), contents);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment