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::*;
/// 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());

View File

@ -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<ValueInner>);