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 apt update
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:
targets: ${{ matrix.bits == 32 && 'i686-unknown-linux-gnu' || '' }}
- uses: Swatinem/rust-cache@v2
@ -73,7 +73,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.87.0
- uses: dtolnay/rust-toolchain@1.85.0
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2

View File

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

View File

@ -25,13 +25,15 @@ impl Eval for ast::FuncCall<'_> {
fn eval(self, vm: &mut Vm) -> SourceResult<Self::Output> {
let span = self.span();
let callee = self.callee();
let in_math = in_math(callee);
let callee_span = callee.span();
let args = self.args();
let trailing_comma = args.trailing_comma();
vm.engine.route.check_call_depth().at(span)?;
// 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 field = access.field();
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))
};
let func_result = callee_value.clone().cast::<Func>();
if func_result.is_err() && in_math(callee) {
return wrap_args_in_math(
callee_value,
callee_span,
args_value,
args.trailing_comma(),
);
let func_result = callee.clone().cast::<Func>();
if in_math && func_result.is_err() {
return wrap_args_in_math(callee, callee_span, args, trailing_comma);
}
let func = func_result
@ -65,11 +61,8 @@ impl Eval for ast::FuncCall<'_> {
let point = || Tracepoint::Call(func.name().map(Into::into));
let f = || {
func.call(&mut vm.engine, vm.context, args_value).trace(
vm.world(),
point,
span,
)
func.call(&mut vm.engine, vm.context, args)
.trace(vm.world(), point, span)
};
// Stacker is broken on WASM.

View File

@ -128,7 +128,8 @@ impl Downloader {
}
// 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.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
/// absolute value will indicate the amount of significant integer digits to
/// remove before the decimal point.
/// If the number of digits is negative, its absolute value will indicate the
/// amount of significant integer digits to remove before the decimal point.
///
/// 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`],

View File

@ -41,7 +41,7 @@ use crate::layout::{BlockElem, Size};
/// receives the page's dimensions minus its margins. This is mostly useful in
/// 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
/// because the block automatically grows to fill the remaining space (see the
/// [fraction] documentation for more details).

View File

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

View File

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

View File

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

View File

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

View File

@ -27,6 +27,7 @@
//! [module]: crate::foundations::Module
//! [content]: crate::foundations::Content
//! [laid out]: typst_layout::layout_document
//! [document]: crate::model::Document
//! [frame]: crate::layout::Frame
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
layer on top of the compiler and the exporters.
- `crates/typst-eval`: The interpreter for the Typst language.
- `crates/typst-html`: The HTML exporter.
- `crates/typst-ide`: Exposes IDE functionality.
- `crates/typst-kit`: Contains various default implementation of
functionality used in `typst-cli`.

6
flake.lock generated
View File

@ -112,13 +112,13 @@
"rust-manifest": {
"flake": false,
"locked": {
"narHash": "sha256-BwfxWd/E8gpnXoKsucFXhMbevMlVgw3l0becLkIcWCU=",
"narHash": "sha256-irgHsBXecwlFSdmP9MfGP06Cbpca2QALJdbN4cymcko=",
"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": {
"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": {

View File

@ -10,7 +10,7 @@
inputs.nixpkgs.follows = "nixpkgs";
};
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;
};
};