Fix remaining doc tests
This commit is contained in:
parent
8f0d07b546
commit
a46e5dd365
@ -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());
|
||||
|
@ -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>);
|
||||
|
Loading…
Reference in New Issue
Block a user