From a46e5dd3653face7979fd231caea11ad52b9d92b Mon Sep 17 00:00:00 2001 From: Jeff Date: Sat, 10 Aug 2024 04:32:27 -0400 Subject: [PATCH] Fix remaining doc tests --- dust-lang/src/analyzer.rs | 8 ++++---- dust-lang/src/value.rs | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dust-lang/src/analyzer.rs b/dust-lang/src/analyzer.rs index 83b49cc..b5ea5b1 100644 --- a/dust-lang/src/analyzer.rs +++ b/dust-lang/src/analyzer.rs @@ -23,8 +23,8 @@ use crate::{ /// # use dust_lang::*; /// let input = "x = 1 + false"; /// let abstract_tree = parse(input).unwrap(); -/// let variables = HashMap::new(); -/// let result = analyze(&abstract_tree, &variables); +/// let mut context = Context::new(); +/// let result = analyze(&abstract_tree, &mut context); /// /// assert!(result.is_err()); /// ``` @@ -45,8 +45,8 @@ pub fn analyze( /// # use dust_lang::*; /// let input = "x = 1 + false"; /// let abstract_tree = parse(input).unwrap(); -/// let variables = HashMap::new(); -/// let analyzer = Analyzer::new(&abstract_tree, &variables); +/// let mut context = Context::new(); +/// let mut analyzer = Analyzer::new(&abstract_tree, &mut context); /// let result = analyzer.analyze(); /// /// assert!(result.is_err()); diff --git a/dust-lang/src/value.rs b/dust-lang/src/value.rs index b940d81..6e1b491 100644 --- a/dust-lang/src/value.rs +++ b/dust-lang/src/value.rs @@ -43,11 +43,11 @@ use crate::{identifier::Identifier, AbstractSyntaxTree, Context, Type, Vm, VmErr /// /// ``` /// # use std::collections::HashMap; -/// # use dust_lang::{Type, Value}; -/// let variables = HashMap::new(); +/// # use dust_lang::*; +/// let context = Context::new(); /// let value = Value::integer(42); /// -/// assert_eq!(value.r#type(&variables), Type::Integer); +/// assert_eq!(value.r#type(&context), Type::Integer); /// ``` #[derive(Clone, Debug, PartialEq)] pub struct Value(Arc);