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