rasn-compiler 0.16.0

An ASN.1 compiler producing bindings for the rasn framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use nom::{bytes::complete::tag, combinator::value, Parser};

use crate::{input::Input, intermediate::*};

use super::{common::skip_ws_and_comments, error::ParserResult};

/// Tries to parse an ASN1 EXTERNAL
///
/// *`input` - [Input]-wrapped string slice to be matched against
///
/// `external` will try to match an EXTERNAL declaration in the `input` string.
/// If the match succeeds, the lexer will consume the match and return the remaining string
/// and an `ASN1Type::External` value representing the ASN1 declaration.
/// If the match fails, the lexer will not consume the input and will return an error.
pub fn external(input: Input<'_>) -> ParserResult<'_, ASN1Type> {
    value(ASN1Type::External, skip_ws_and_comments(tag(EXTERNAL))).parse(input)
}