summaryrefslogtreecommitdiff
path: root/bench/src/parsing.rs
diff options
context:
space:
mode:
Diffstat (limited to 'bench/src/parsing.rs')
-rw-r--r--bench/src/parsing.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/bench/src/parsing.rs b/bench/src/parsing.rs
index d9064a63..dd5e1279 100644
--- a/bench/src/parsing.rs
+++ b/bench/src/parsing.rs
@@ -3,6 +3,7 @@ use iai::{black_box, main};
use typst::diag::TypResult;
use typst::loading::FileId;
use typst::parse::{parse, Scanner, TokenMode, Tokens};
+use typst::source::SourceFile;
use typst::syntax::SyntaxTree;
const SRC: &str = include_str!("../../tests/typ/coma.typ");
@@ -32,7 +33,8 @@ fn bench_tokenize() -> usize {
}
fn bench_parse() -> TypResult<SyntaxTree> {
- parse(FileId::from_raw(0), black_box(SRC))
+ let source = SourceFile::new(FileId::from_raw(0), black_box(SRC).into());
+ parse(&source)
}
main!(bench_decode, bench_scan, bench_tokenize, bench_parse);