Skip to main content
← OpenMECP Documentation

validate_gaussian_keywords

Function validate_gaussian_keywords 

Source
pub fn validate_gaussian_keywords(content: &str) -> Result<(), ParseError>
Expand description

Validates Gaussian keyword syntax.

Performs basic validation to ensure the content contains valid Gaussian syntax after comment filtering. Checks for:

  • Invalid characters that would break Gaussian input
  • Proper keyword formatting

§Arguments

  • content - The cleaned content to validate

§Returns

Ok(()) if the content is valid, or Err(ParseError) with details about the validation failure

§Examples

use omecp::parser::validate_gaussian_keywords;

// Valid content
assert!(validate_gaussian_keywords("TD(NStates=5) Root=1").is_ok());

// Invalid content with newlines
assert!(validate_gaussian_keywords("TD(NStates=5)\nRoot=1").is_err());