use nom::{bytes::complete::tag, combinator::value, IResult};
use crate::intermediate::{ASN1Type, ASN1Value, NULL};
use super::common::skip_ws_and_comments;
pub fn null_value(input: &str) -> IResult<&str, ASN1Value> {
value(ASN1Value::Null, skip_ws_and_comments(tag(NULL)))(input)
}
pub fn null(input: &str) -> IResult<&str, ASN1Type> {
value(ASN1Type::Null, skip_ws_and_comments(tag(NULL)))(input)
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn parses_null() {
assert_eq!(
null(" --who would put a comment here?--NULL").unwrap().1,
ASN1Type::Null
)
}
}