spidior 0.2.1

A tool for handling sed-like substitution tasks where pesky source code semantics are getting in the way.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::regexparser::ast::*;

grammar;

pub Queries: Box<Queries> = {
    Query => Box::new(Queries::Query(<>)),
    <l:Query> "," <r:Queries> => Box::new(Queries::Queries(l, r)),
};

Query: Box<Query> = {
    <l:Name> "=" <r:Name> => Box::new(Query::Kv(l, r)),
    "functions" => Box::new(Query::Fun),
};

Name: String = {
    r"[^=,]*" => <>.to_string(),
}