Add Engine::disable_doc_comments and smarter doc-comments treatment.
This commit is contained in:
@@ -29,7 +29,7 @@ fn test_comments() -> Result<(), Box<EvalAltResult>> {
|
||||
#[cfg(not(feature = "no_function"))]
|
||||
#[test]
|
||||
fn test_comments_doc() -> Result<(), Box<EvalAltResult>> {
|
||||
let engine = Engine::new();
|
||||
let mut engine = Engine::new();
|
||||
|
||||
let ast = engine.compile(
|
||||
r"
|
||||
@@ -54,6 +54,16 @@ fn test_comments_doc() -> Result<(), Box<EvalAltResult>> {
|
||||
)
|
||||
.is_err());
|
||||
|
||||
engine.compile(
|
||||
r"
|
||||
///////////////
|
||||
let x = 42;
|
||||
|
||||
/***************/
|
||||
let x = 42;
|
||||
",
|
||||
)?;
|
||||
|
||||
let ast = engine.compile(
|
||||
r"
|
||||
/** Hello world
|
||||
@@ -78,5 +88,17 @@ fn test_comments_doc() -> Result<(), Box<EvalAltResult>> {
|
||||
)
|
||||
.is_err());
|
||||
|
||||
engine.set_doc_comments(false);
|
||||
|
||||
engine.compile(
|
||||
r"
|
||||
/// Hello world!
|
||||
let x = 42;
|
||||
|
||||
/** Hello world! */
|
||||
let x = 42;
|
||||
",
|
||||
)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
Reference in New Issue
Block a user