From cf544d3c7e4ba3fc00a41afbb4e5242044579940 Mon Sep 17 00:00:00 2001 From: Jeff Date: Mon, 28 Aug 2023 09:51:04 -0400 Subject: [PATCH] Write docs --- src/interface.rs | 4 ++-- src/lib.rs | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/interface.rs b/src/interface.rs index a20bdde..77f7193 100644 --- a/src/interface.rs +++ b/src/interface.rs @@ -1,3 +1,5 @@ +//! The top level of Dust's API with functions in interpret Dust code. + use crate::{token, tree, Result, Value, VariableMap}; /// Evaluate the given expression string. @@ -27,8 +29,6 @@ pub fn eval(string: &str) -> Result { /// context.set_value("three".into(), 3.into()).unwrap(); // Do proper error handling here /// assert_eq!(eval_with_context("one + two + three", &mut context), Ok(Value::from(6))); /// ``` -/// -/// *See the [crate doc](index.html) for more examples and explanations of the expression format.* pub fn eval_with_context(input: &str, context: &mut VariableMap) -> Result { let without_comments = input .lines() diff --git a/src/lib.rs b/src/lib.rs index ee4f8db..9319ac5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,8 @@ -#![doc = include_str!("../README.md")] +//! The Dust library is used to implement the Dust language, `src/main.rs` implements the command +//! line binary. +//! +//! Using this library is simple and straightforward, see the [inferface] module for instructions on +//! interpreting Dust code. Most of the language's features are implemented in the [tools] module. #![forbid(unsafe_code)] pub use crate::{