vicis-core 0.2.0

Manipulate LLVM-IR in Pure Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::PreemptionSpecifier;
use nom::{
    branch::alt,
    bytes::complete::tag, //take_until},
    // character::complete::{char, digit1},
    combinator::map,
    error::VerboseError,
    IResult,
};

pub fn parse(source: &str) -> IResult<&str, PreemptionSpecifier, VerboseError<&str>> {
    alt((
        map(tag("dso_local"), |_| PreemptionSpecifier::DsoLocal),
        map(tag("dso_preemptable"), |_| {
            PreemptionSpecifier::DsoPreemptable
        }),
    ))(source)
}