peginator_macro 0.7.0

Convenience macros for using peginator (a PEG parser generator)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Copyright (C) 2022, Alex Badics
// This file is part of peginator
// Licensed under the MIT license. See LICENSE file in the project root for details.

use peginator::PegParser;
use peginator_macro::peginate;

peginate!("@export Simple = c:char;");

#[test]
fn test_macro() {
    let s: Simple = Simple::parse("xyz").unwrap();
    assert_eq!(s.c, 'x');
}