Skip to main content
← OpenMECP Documentation

is_comment_line

Function is_comment_line 

Source
pub fn is_comment_line(line: &str) -> bool
Expand description

Checks if a line is a comment line.

A line is considered a comment if it starts with ‘#’ after trimming leading whitespace.

§Arguments

  • line - The line to check

§Returns

true if the line is a comment, false otherwise

§Examples

use omecp::parser::is_comment_line;

assert_eq!(is_comment_line("# This is a comment"), true);
assert_eq!(is_comment_line("  # Indented comment"), true);
assert_eq!(is_comment_line("TD(NStates=5)"), false);
assert_eq!(is_comment_line(""), false);