summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/typst-eval/src/vm.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/crates/typst-eval/src/vm.rs b/crates/typst-eval/src/vm.rs
index 1c8331b6..adf7dd76 100644
--- a/crates/typst-eval/src/vm.rs
+++ b/crates/typst-eval/src/vm.rs
@@ -1,4 +1,5 @@
use comemo::Tracked;
+use typst_library::diag::warning;
use typst_library::engine::Engine;
use typst_library::foundations::{Context, IntoValue, Scopes, Value};
use typst_library::World;
@@ -47,6 +48,16 @@ impl<'a> Vm<'a> {
if self.inspected == Some(var.span()) {
self.trace(value.clone());
}
+ // This will become an error in the parser if 'is' becomes a keyword.
+ if var.get() == "is" {
+ self.engine.sink.warn(warning!(
+ var.span(),
+ "`is` will likely become a keyword in future versions and will \
+ not be allowed as an identifier";
+ hint: "rename this variable to avoid future errors";
+ hint: "try `is_` instead"
+ ));
+ }
self.scopes.top.define_ident(var, value);
}