pub fn validate_gaussian_syntax(
content: &str,
section_name: &str,
) -> Result<(), ParseError>Expand description
Validates basic Gaussian syntax patterns.
Implements comprehensive validation for Gaussian input syntax to ensure that content will not break Gaussian execution. This function checks for:
- Invalid characters that would cause parsing errors
- Malformed keyword structures
- Remaining comment artifacts
§Arguments
content- The content to validate for Gaussian compatibilitysection_name- The name of the section being validated for error reporting
§Returns
Ok(()) if the content is valid, or Err(ParseError::GaussianSyntaxError)
with detailed information about the validation failure
§Examples
use omecp::parser::validate_gaussian_syntax;
// Valid Gaussian keywords
assert!(validate_gaussian_syntax("TD(NStates=5) Root=1", "TAIL_a").is_ok());
// Invalid content with newlines
assert!(validate_gaussian_syntax("TD(NStates=5)\nRoot=1", "TAIL_a").is_err());
// Invalid content with comment characters
assert!(validate_gaussian_syntax("TD(NStates=5) # comment", "TAIL_a").is_err());