Keep module docs as one string.
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
use crate::parser::{ParseResult, ParseState};
|
||||
use crate::{Engine, OptimizationLevel, Scope, AST};
|
||||
use std::mem;
|
||||
#[cfg(feature = "no_std")]
|
||||
use std::prelude::v1::*;
|
||||
|
||||
@@ -225,9 +224,7 @@ impl Engine {
|
||||
let mut state = ParseState::new(self, scope, tokenizer_control);
|
||||
let mut ast = self.parse(&mut stream.peekable(), &mut state, optimization_level)?;
|
||||
#[cfg(feature = "metadata")]
|
||||
ast.set_doc(mem::take(
|
||||
&mut state.tokenizer_control.borrow_mut().global_comments,
|
||||
));
|
||||
ast.set_doc(state.tokenizer_control.borrow().global_comments.join("\n"));
|
||||
Ok(ast)
|
||||
}
|
||||
/// Compile a string containing an expression into an [`AST`],
|
||||
|
Reference in New Issue
Block a user