mirror of
https://github.com/typst/typst
synced 2025-08-11 21:57:55 +08:00
Compare commits
No commits in common. "20dd19c64ef03619c49c1a2dfb011988c82d9e2a" and "c417b17442501d4146a897468fe296067696cefe" have entirely different histories.
20dd19c64e
...
c417b17442
@ -44,10 +44,11 @@ impl Eval for ast::ModuleImport<'_> {
|
||||
}
|
||||
|
||||
// If there is a rename, import the source itself under that name.
|
||||
let bare_name = self.bare_name();
|
||||
let new_name = self.new_name();
|
||||
if let Some(new_name) = new_name {
|
||||
if let ast::Expr::Ident(ident) = self.source() {
|
||||
if ident.as_str() == new_name.as_str() {
|
||||
if let Ok(source_name) = &bare_name {
|
||||
if source_name == new_name.as_str() {
|
||||
// Warn on `import x as x`
|
||||
vm.engine.sink.warn(warning!(
|
||||
new_name.span(),
|
||||
@ -56,7 +57,6 @@ impl Eval for ast::ModuleImport<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
// Define renamed module on the scope.
|
||||
vm.define(new_name, source.clone());
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,6 @@ description: Changes slated to appear in Typst 0.13.0
|
||||
result in a warning
|
||||
- The default show rules of various built-in elements like lists, quotes, etc.
|
||||
were adjusted to ensure they produce/don't produce paragraphs as appropriate
|
||||
- Removed support for booleans and content in [`outline.indent`]
|
||||
- The [`outline`] function was fully reworked to improve its out-of-the-box
|
||||
behavior **(Breaking change)**
|
||||
- [Outline entries]($outline.entry) are now [blocks]($block) and are thus
|
||||
@ -313,20 +312,8 @@ feature flag.
|
||||
functions directly accepting both paths and bytes
|
||||
- The `sect` and its variants in favor of `inter`, and `integral.sect` in favor
|
||||
of `integral.inter`
|
||||
|
||||
## Removals
|
||||
- Removed `style` function and `styles` argument of [`measure`], use a [context]
|
||||
expression instead **(Breaking change)**
|
||||
- Removed `state.display` function, use [`state.get`] instead
|
||||
**(Breaking change)**
|
||||
- Removed `location` argument of [`state.at`], [`counter.at`], and [`query`]
|
||||
**(Breaking change)**
|
||||
- Removed compatibility behavior where [`counter.display`] worked without
|
||||
[context] **(Breaking change)**
|
||||
- Removed compatibility behavior of [`locate`] **(Breaking change)**
|
||||
- Removed compatibility behavior of type/str comparisons
|
||||
(e.g. `{int == "integer"}`) which was temporarily introduced in Typst 0.8
|
||||
**(Breaking change)**
|
||||
- Fully removed type/str compatibility behavior (e.g. `{int == "integer"}`)
|
||||
which was temporarily introduced in Typst 0.8 **(Breaking change)**
|
||||
|
||||
## Development
|
||||
- The `typst::compile` function is now generic and can return either a
|
||||
|
@ -255,10 +255,6 @@
|
||||
// Warning: 17-21 unnecessary import rename to same name
|
||||
#import enum as enum
|
||||
|
||||
--- import-rename-necessary ---
|
||||
#import "module.typ" as module: a
|
||||
#test(module.a, a)
|
||||
|
||||
--- import-rename-unnecessary-mixed ---
|
||||
// Warning: 17-21 unnecessary import rename to same name
|
||||
#import enum as enum: item
|
||||
@ -267,6 +263,10 @@
|
||||
// Warning: 31-35 unnecessary import rename to same name
|
||||
#import enum as enum: item as item
|
||||
|
||||
--- import-item-rename-unnecessary-string ---
|
||||
// Warning: 25-31 unnecessary import rename to same name
|
||||
#import "module.typ" as module
|
||||
|
||||
--- import-item-rename-unnecessary-but-ok ---
|
||||
#import "modul" + "e.typ" as module
|
||||
#test(module.b, 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user