vicis_core/ir/module/preemption_specifier/parser.rs
1use super::PreemptionSpecifier;
2use nom::{
3    branch::alt,
4    bytes::complete::tag, //take_until},
5    // character::complete::{char, digit1},
6    combinator::map,
7    error::VerboseError,
8    IResult,
9};
10
11pub fn parse(source: &str) -> IResult<&str, PreemptionSpecifier, VerboseError<&str>> {
12    alt((
13        map(tag("dso_local"), |_| PreemptionSpecifier::DsoLocal),
14        map(tag("dso_preemptable"), |_| {
15            PreemptionSpecifier::DsoPreemptable
16        }),
17    ))(source)
18}