Compare commits

..

No commits in common. "664d33a68178239a9b9799d5c1b9e08958dd8d5c" and "3e7a39e968644ee925598f792fdc597b55a2529f" have entirely different histories.

14 changed files with 25 additions and 37 deletions

View File

@ -40,7 +40,7 @@ jobs:
sudo dpkg --add-architecture i386 sudo dpkg --add-architecture i386
sudo apt update sudo apt update
sudo apt install -y gcc-multilib libssl-dev:i386 pkg-config:i386 sudo apt install -y gcc-multilib libssl-dev:i386 pkg-config:i386
- uses: dtolnay/rust-toolchain@1.87.0 - uses: dtolnay/rust-toolchain@1.85.0
with: with:
targets: ${{ matrix.bits == 32 && 'i686-unknown-linux-gnu' || '' }} targets: ${{ matrix.bits == 32 && 'i686-unknown-linux-gnu' || '' }}
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
@ -73,7 +73,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.87.0 - uses: dtolnay/rust-toolchain@1.85.0
with: with:
components: clippy, rustfmt components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2

View File

@ -44,7 +44,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.87.0 - uses: dtolnay/rust-toolchain@1.85.0
with: with:
target: ${{ matrix.target }} target: ${{ matrix.target }}

View File

@ -25,13 +25,15 @@ impl Eval for ast::FuncCall<'_> {
fn eval(self, vm: &mut Vm) -> SourceResult<Self::Output> { fn eval(self, vm: &mut Vm) -> SourceResult<Self::Output> {
let span = self.span(); let span = self.span();
let callee = self.callee(); let callee = self.callee();
let in_math = in_math(callee);
let callee_span = callee.span(); let callee_span = callee.span();
let args = self.args(); let args = self.args();
let trailing_comma = args.trailing_comma();
vm.engine.route.check_call_depth().at(span)?; vm.engine.route.check_call_depth().at(span)?;
// Try to evaluate as a call to an associated function or field. // Try to evaluate as a call to an associated function or field.
let (callee_value, args_value) = if let ast::Expr::FieldAccess(access) = callee { let (callee, args) = if let ast::Expr::FieldAccess(access) = callee {
let target = access.target(); let target = access.target();
let field = access.field(); let field = access.field();
match eval_field_call(target, field, args, span, vm)? { match eval_field_call(target, field, args, span, vm)? {
@ -48,15 +50,9 @@ impl Eval for ast::FuncCall<'_> {
(callee.eval(vm)?, args.eval(vm)?.spanned(span)) (callee.eval(vm)?, args.eval(vm)?.spanned(span))
}; };
let func_result = callee_value.clone().cast::<Func>(); let func_result = callee.clone().cast::<Func>();
if in_math && func_result.is_err() {
if func_result.is_err() && in_math(callee) { return wrap_args_in_math(callee, callee_span, args, trailing_comma);
return wrap_args_in_math(
callee_value,
callee_span,
args_value,
args.trailing_comma(),
);
} }
let func = func_result let func = func_result
@ -65,11 +61,8 @@ impl Eval for ast::FuncCall<'_> {
let point = || Tracepoint::Call(func.name().map(Into::into)); let point = || Tracepoint::Call(func.name().map(Into::into));
let f = || { let f = || {
func.call(&mut vm.engine, vm.context, args_value).trace( func.call(&mut vm.engine, vm.context, args)
vm.world(), .trace(vm.world(), point, span)
point,
span,
)
}; };
// Stacker is broken on WASM. // Stacker is broken on WASM.

View File

@ -128,7 +128,8 @@ impl Downloader {
} }
// Configure native TLS. // Configure native TLS.
let connector = tls.build().map_err(io::Error::other)?; let connector =
tls.build().map_err(|err| io::Error::new(io::ErrorKind::Other, err))?;
builder = builder.tls_connector(Arc::new(connector)); builder = builder.tls_connector(Arc::new(connector));
builder.build().get(url).call() builder.build().get(url).call()

View File

@ -708,13 +708,12 @@ pub fn fract(
} }
} }
/// Rounds a number to the nearest integer. /// Rounds a number to the nearest integer away from zero.
/// ///
/// Half-integers are rounded away from zero. /// Optionally, a number of decimal places can be specified.
/// ///
/// Optionally, a number of decimal places can be specified. If negative, its /// If the number of digits is negative, its absolute value will indicate the
/// absolute value will indicate the amount of significant integer digits to /// amount of significant integer digits to remove before the decimal point.
/// remove before the decimal point.
/// ///
/// Note that this function will return the same type as the operand. That is, /// Note that this function will return the same type as the operand. That is,
/// applying `round` to a [`float`] will return a `float`, and to a [`decimal`], /// applying `round` to a [`float`] will return a `float`, and to a [`decimal`],

View File

@ -41,7 +41,7 @@ use crate::layout::{BlockElem, Size};
/// receives the page's dimensions minus its margins. This is mostly useful in /// receives the page's dimensions minus its margins. This is mostly useful in
/// combination with [measurement]($measure). /// combination with [measurement]($measure).
/// ///
/// To retrieve the _remaining_ height of the page rather than its full size, /// To retrieve the _remaining_ size of the page rather than its full size, you
/// you can wrap your `layout` call in a `{block(height: 1fr)}`. This works /// you can wrap your `layout` call in a `{block(height: 1fr)}`. This works
/// because the block automatically grows to fill the remaining space (see the /// because the block automatically grows to fill the remaining space (see the
/// [fraction] documentation for more details). /// [fraction] documentation for more details).

View File

@ -125,9 +125,6 @@ pub struct FigureElem {
/// ///
/// ```example /// ```example
/// #set page(height: 200pt) /// #set page(height: 200pt)
/// #show figure: set place(
/// clearance: 1em,
/// )
/// ///
/// = Introduction /// = Introduction
/// #figure( /// #figure(

View File

@ -261,9 +261,9 @@ pub enum NumberingKind {
LowerRoman, LowerRoman,
/// Uppercase Roman numerals (I, II, III, etc.). /// Uppercase Roman numerals (I, II, III, etc.).
UpperRoman, UpperRoman,
/// Lowercase Greek letters (α, β, γ, etc.). /// Lowercase Greek numerals (Α, Β, Γ, etc.).
LowerGreek, LowerGreek,
/// Uppercase Greek letters (Α, Β, Γ, etc.). /// Uppercase Greek numerals (α, β, γ, etc.).
UpperGreek, UpperGreek,
/// Paragraph/note-like symbols: *, †, ‡, §, ¶, and ‖. Further items use /// Paragraph/note-like symbols: *, †, ‡, §, ¶, and ‖. Further items use
/// repeated symbols. /// repeated symbols.

View File

@ -373,7 +373,6 @@ pub struct Decoration {
/// A kind of decorative line. /// A kind of decorative line.
#[derive(Debug, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Clone, Eq, PartialEq, Hash)]
#[allow(clippy::large_enum_variant)]
pub enum DecoLine { pub enum DecoLine {
Underline { Underline {
stroke: Stroke<Abs>, stroke: Stroke<Abs>,

View File

@ -185,7 +185,6 @@ struct Cast {
} }
/// A pattern in a cast, e.g.`"ascender"` or `v: i64`. /// A pattern in a cast, e.g.`"ascender"` or `v: i64`.
#[allow(clippy::large_enum_variant)]
enum Pattern { enum Pattern {
Str(syn::LitStr), Str(syn::LitStr),
Ty(syn::Pat, syn::Type), Ty(syn::Pat, syn::Type),

View File

@ -27,6 +27,7 @@
//! [module]: crate::foundations::Module //! [module]: crate::foundations::Module
//! [content]: crate::foundations::Content //! [content]: crate::foundations::Content
//! [laid out]: typst_layout::layout_document //! [laid out]: typst_layout::layout_document
//! [document]: crate::model::Document
//! [frame]: crate::layout::Frame //! [frame]: crate::layout::Frame
pub extern crate comemo; pub extern crate comemo;

View File

@ -12,7 +12,6 @@ Let's start with a broad overview of the directories in this repository:
- `crates/typst-cli`: Typst's command line interface. This is a relatively small - `crates/typst-cli`: Typst's command line interface. This is a relatively small
layer on top of the compiler and the exporters. layer on top of the compiler and the exporters.
- `crates/typst-eval`: The interpreter for the Typst language. - `crates/typst-eval`: The interpreter for the Typst language.
- `crates/typst-html`: The HTML exporter.
- `crates/typst-ide`: Exposes IDE functionality. - `crates/typst-ide`: Exposes IDE functionality.
- `crates/typst-kit`: Contains various default implementation of - `crates/typst-kit`: Contains various default implementation of
functionality used in `typst-cli`. functionality used in `typst-cli`.

6
flake.lock generated
View File

@ -112,13 +112,13 @@
"rust-manifest": { "rust-manifest": {
"flake": false, "flake": false,
"locked": { "locked": {
"narHash": "sha256-BwfxWd/E8gpnXoKsucFXhMbevMlVgw3l0becLkIcWCU=", "narHash": "sha256-irgHsBXecwlFSdmP9MfGP06Cbpca2QALJdbN4cymcko=",
"type": "file", "type": "file",
"url": "https://static.rust-lang.org/dist/channel-rust-1.87.0.toml" "url": "https://static.rust-lang.org/dist/channel-rust-1.85.0.toml"
}, },
"original": { "original": {
"type": "file", "type": "file",
"url": "https://static.rust-lang.org/dist/channel-rust-1.87.0.toml" "url": "https://static.rust-lang.org/dist/channel-rust-1.85.0.toml"
} }
}, },
"systems": { "systems": {

View File

@ -10,7 +10,7 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
rust-manifest = { rust-manifest = {
url = "https://static.rust-lang.org/dist/channel-rust-1.87.0.toml"; url = "https://static.rust-lang.org/dist/channel-rust-1.85.0.toml";
flake = false; flake = false;
}; };
}; };