openinfer-dsl 0.1.0

Rust-embedded DSL for defining OpenInfer graphs with explicit control flow and memory semantics.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use syn::parse::{ParseStream, Result};
use syn::{parenthesized, LitStr};

pub fn parse_pattern(input: ParseStream) -> Result<LitStr> {
    let content;
    parenthesized!(content in input);
    if content.peek(LitStr) {
        content.parse()
    } else {
        Err(content.error("expected string literal for pattern"))
    }
}