1
0

Fix remaining doc tests

This commit is contained in:
Jeff 2024-08-10 04:32:27 -04:00
parent 8f0d07b546
commit a46e5dd365
2 changed files with 7 additions and 7 deletions

View File

@ -23,8 +23,8 @@ use crate::{
/// # use dust_lang::*; /// # use dust_lang::*;
/// let input = "x = 1 + false"; /// let input = "x = 1 + false";
/// let abstract_tree = parse(input).unwrap(); /// let abstract_tree = parse(input).unwrap();
/// let variables = HashMap::new(); /// let mut context = Context::new();
/// let result = analyze(&abstract_tree, &variables); /// let result = analyze(&abstract_tree, &mut context);
/// ///
/// assert!(result.is_err()); /// assert!(result.is_err());
/// ``` /// ```
@ -45,8 +45,8 @@ pub fn analyze(
/// # use dust_lang::*; /// # use dust_lang::*;
/// let input = "x = 1 + false"; /// let input = "x = 1 + false";
/// let abstract_tree = parse(input).unwrap(); /// let abstract_tree = parse(input).unwrap();
/// let variables = HashMap::new(); /// let mut context = Context::new();
/// let analyzer = Analyzer::new(&abstract_tree, &variables); /// let mut analyzer = Analyzer::new(&abstract_tree, &mut context);
/// let result = analyzer.analyze(); /// let result = analyzer.analyze();
/// ///
/// assert!(result.is_err()); /// assert!(result.is_err());

View File

@ -43,11 +43,11 @@ use crate::{identifier::Identifier, AbstractSyntaxTree, Context, Type, Vm, VmErr
/// ///
/// ``` /// ```
/// # use std::collections::HashMap; /// # use std::collections::HashMap;
/// # use dust_lang::{Type, Value}; /// # use dust_lang::*;
/// let variables = HashMap::new(); /// let context = Context::new();
/// let value = Value::integer(42); /// 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)] #[derive(Clone, Debug, PartialEq)]
pub struct Value(Arc<ValueInner>); pub struct Value(Arc<ValueInner>);