mirror of
https://github.com/typst/typst
synced 2025-08-24 03:34:14 +08:00
test: hack to support compiling with --no-default-features
This commit is contained in:
parent
702fa063a1
commit
4cb04fd41c
@ -12,8 +12,6 @@ use typst_syntax::{
|
|||||||
};
|
};
|
||||||
use unscanny::Scanner;
|
use unscanny::Scanner;
|
||||||
|
|
||||||
use crate::world::{read, system_path};
|
|
||||||
|
|
||||||
/// Collects all tests from all files.
|
/// Collects all tests from all files.
|
||||||
///
|
///
|
||||||
/// Returns:
|
/// Returns:
|
||||||
@ -390,9 +388,17 @@ impl<'a> Parser<'a> {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(feature = "default"))]
|
||||||
|
fn parse_range_external(&mut self, _file: FileId) -> Option<Range<usize>> {
|
||||||
|
panic!("external file ranges are not expected when testing `typst_syntax`");
|
||||||
|
}
|
||||||
|
|
||||||
/// Parse a range in an external file, optionally abbreviated as just a position
|
/// Parse a range in an external file, optionally abbreviated as just a position
|
||||||
/// if the range is empty.
|
/// if the range is empty.
|
||||||
|
#[cfg(feature = "default")]
|
||||||
fn parse_range_external(&mut self, file: FileId) -> Option<Range<usize>> {
|
fn parse_range_external(&mut self, file: FileId) -> Option<Range<usize>> {
|
||||||
|
use crate::world::{read, system_path};
|
||||||
|
|
||||||
let path = match system_path(file) {
|
let path = match system_path(file) {
|
||||||
Ok(path) => path,
|
Ok(path) => path,
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user