mirror of
https://github.com/typst/typst
synced 2025-05-20 03:55:29 +08:00
This commit is contained in:
parent
6a7182fcf7
commit
93e6638bfe
@ -180,7 +180,7 @@ impl Show for RefElem {
|
|||||||
let numbering = refable
|
let numbering = refable
|
||||||
.numbering()
|
.numbering()
|
||||||
.ok_or_else(|| {
|
.ok_or_else(|| {
|
||||||
eco_format!("cannot reference {} without numbering", elem.func().name())
|
eco_format!("cannot reference {0} without numbering - did you mean to use `#set {0}(numbering: \"1.\")`?", elem.func().name())
|
||||||
})
|
})
|
||||||
.at(span)?;
|
.at(span)?;
|
||||||
|
|
||||||
|
@ -242,7 +242,7 @@ impl CastInfo {
|
|||||||
if parts.iter().any(|p| p == "length");
|
if parts.iter().any(|p| p == "length");
|
||||||
if !matching_type;
|
if !matching_type;
|
||||||
then {
|
then {
|
||||||
write!(msg, ": a length needs a unit – did you mean {i}pt?").unwrap();
|
write!(msg, ": a length needs a unit - did you mean {i}pt?").unwrap();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ impl<'a> Scopes<'a> {
|
|||||||
#[cold]
|
#[cold]
|
||||||
fn unknown_variable(var: &str) -> EcoString {
|
fn unknown_variable(var: &str) -> EcoString {
|
||||||
if var.contains('-') {
|
if var.contains('-') {
|
||||||
eco_format!("unknown variable: {} – if you meant to use subtraction, try adding spaces around the minus sign.", var)
|
eco_format!("unknown variable: {} - if you meant to use subtraction, try adding spaces around the minus sign.", var)
|
||||||
} else {
|
} else {
|
||||||
eco_format!("unknown variable: {}", var)
|
eco_format!("unknown variable: {}", var)
|
||||||
}
|
}
|
||||||
|
@ -1060,7 +1060,7 @@ fn for_loop(p: &mut Parser) {
|
|||||||
p.assert(SyntaxKind::For);
|
p.assert(SyntaxKind::For);
|
||||||
pattern(p);
|
pattern(p);
|
||||||
if p.at(SyntaxKind::Comma) {
|
if p.at(SyntaxKind::Comma) {
|
||||||
p.expected("keyword `in`. did you mean to use a destructuring pattern?");
|
p.expected("keyword `in` - did you mean to use a destructuring pattern?");
|
||||||
if !p.eat_if(SyntaxKind::Ident) {
|
if !p.eat_if(SyntaxKind::Ident) {
|
||||||
p.eat_if(SyntaxKind::Underscore);
|
p.eat_if(SyntaxKind::Underscore);
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
// Destructuring without parentheses.
|
// Destructuring without parentheses.
|
||||||
// Error: 7 expected keyword `in`. did you mean to use a destructuring pattern?
|
// Error: 7 expected keyword `in` - did you mean to use a destructuring pattern?
|
||||||
#for k, v in (a: 4, b: 5) {
|
#for k, v in (a: 4, b: 5) {
|
||||||
dont-care
|
dont-care
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// Ref: false
|
// Ref: false
|
||||||
|
|
||||||
---
|
---
|
||||||
// Error: 1:17-1:19 expected length, found integer: a length needs a unit – did you mean 12pt?
|
// Error: 1:17-1:19 expected length, found integer: a length needs a unit - did you mean 12pt?
|
||||||
#set text(size: 12)
|
#set text(size: 12)
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -11,12 +11,17 @@
|
|||||||
a = 1-a
|
a = 1-a
|
||||||
a = a -1
|
a = a -1
|
||||||
|
|
||||||
// Error: 7-10 unknown variable: a-1 – if you meant to use subtraction, try adding spaces around the minus sign.
|
// Error: 7-10 unknown variable: a-1 - if you meant to use subtraction, try adding spaces around the minus sign.
|
||||||
a = a-1
|
a = a-1
|
||||||
}
|
}
|
||||||
|
|
||||||
---
|
---
|
||||||
#{
|
#{
|
||||||
// Error: 3-6 unknown variable: a-1 – if you meant to use subtraction, try adding spaces around the minus sign.
|
// Error: 3-6 unknown variable: a-1 - if you meant to use subtraction, try adding spaces around the minus sign.
|
||||||
a-1 = 2
|
a-1 = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
---
|
||||||
|
= Heading <intro>
|
||||||
|
// Error: 1:20-1:26 cannot reference heading without numbering - did you mean to use `#set heading(numbering: "1.")`?
|
||||||
|
Can not be used as @intro
|
||||||
|
Loading…
x
Reference in New Issue
Block a user