mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-15 15:30:00 -04:00
rewrite... TWO!!
This commit is contained in:
parent
6d03da6d85
commit
6edad29dbb
9 changed files with 273 additions and 135 deletions
|
@ -65,8 +65,6 @@ fn main() -> Result<()> {
|
|||
eprintln!("{}", err.with_source_code(source.clone()));
|
||||
}
|
||||
|
||||
println!("changes: {:#?}", res.changes);
|
||||
|
||||
println!(
|
||||
"rewritten:\n{}",
|
||||
String::from_utf8(res.js).context("failed to parse rewritten js")?
|
||||
|
@ -160,6 +158,10 @@ function $wrap(val) {
|
|||
return val;
|
||||
}
|
||||
|
||||
const $gwrap = $wrap;
|
||||
|
||||
function $scramitize(val) { return val }
|
||||
|
||||
function assert(val) {
|
||||
if (!val) fail();
|
||||
}
|
||||
|
@ -172,7 +174,7 @@ function check(val) {
|
|||
.unwrap();
|
||||
|
||||
let rewritten = dorewrite(&content).unwrap();
|
||||
println!("{:?}", rewritten);
|
||||
println!("{}", std::str::from_utf8(&rewritten.js).unwrap());
|
||||
|
||||
context.eval(Source::from_bytes(&rewritten.js)).unwrap();
|
||||
println!("PASS");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue