Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Maiori44 committed Nov 12, 2023
1 parent bab5005 commit 26596b6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions core/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2333,6 +2333,7 @@ fn parse_tokens_internal<'a>(
/// let (codes, variables, ..) = preprocess_code(
/// unsafe { code.as_bytes_mut() },
/// 1,
/// 1,
/// false,
/// &filename,
/// &options,
Expand Down
17 changes: 13 additions & 4 deletions core/src/preprocessor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,12 +669,19 @@ pub fn read_file(
/// use clue_core::{preprocessor::preprocess_code, env::Options};
///
/// fn main() -> Result<(), String> {
/// let options = Options::default();
/// let mut code = include_str!("../../examples/macro.clue").to_owned();
/// let options = Options::default();
/// let mut code = include_str!("../../examples/macro.clue").to_owned();
///
/// let (code, vars, ..) = preprocess_code(&mut code.into_bytes(), 1, false, &String::from("macro.clue"), &options)?;
/// let (code, vars, ..) = preprocess_code(
/// &mut code.into_bytes(),
/// 1,
/// 1,
/// false,
/// &String::from("macro.clue"),
/// &options
/// )?;
///
/// Ok(())
/// Ok(())
/// }
#[allow(clippy::blocks_in_if_conditions)]
pub fn preprocess_code(
Expand Down Expand Up @@ -1371,6 +1378,7 @@ impl CodesInfo<'_> {
/// let (codes, variables, ..) = preprocess_code(
/// unsafe { code.as_bytes_mut() },
/// 1,
/// 1,
/// false,
/// &filename,
/// &options,
Expand Down Expand Up @@ -1437,6 +1445,7 @@ pub fn preprocess_codes(
/// let (codes, variables, ..) = preprocess_code(
/// unsafe { code.as_bytes_mut() },
/// 1,
/// 1,
/// false,
/// &filename,
/// &options,
Expand Down
1 change: 1 addition & 0 deletions core/src/scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,7 @@ static KEYWORDS: phf::Map<&'static [u8], KeywordType> = phf_map! {
/// let (codes, variables, ..) = preprocess_code(
/// unsafe { code.as_bytes_mut() },
/// 1,
/// 1,
/// false,
/// &filename,
/// &options,
Expand Down

0 comments on commit 26596b6

Please sign in to comment.