Crates.io | combine-proc-macro |
lib.rs | combine-proc-macro |
version | 0.3.1 |
source | src |
created_at | 2019-04-28 21:19:36.60354 |
updated_at | 2019-05-01 03:15:10.591157 |
description | Support for using `combine` parser combinators with the `proc_macro` API. |
homepage | |
repository | https://github.com/kestred/combine-proc-macro |
max_upload_size | |
id | 130795 |
size | 36,368 |
A library that allows proc_macro function-like macros to be parsed using the combine parser combinator crate.
Put this in your Cargo.toml
:
[dependencies]
combine-proc-macro = "0.3.1"
And this in your crate root:
extern crate combine_proc_macro;
To learn how the library is used, see some examples:
hello_macro
in the documentation.crabwise-antlr-parser
.#[proc_macro]
implemented using crabwise-antlr-parser
.When writing a #[proc_macro_derive]
the input is Rust source code which is
well supported by the syn
crate. However, when writing a #[proc_macro]
macro, it is common to want to define a custom domain specific language.
This crate allows you to write a parser for your DSL using the combine
parser combinator library. It also preserves the source span information
in the parsed result such that rustc
can provide correct source locations
for identifiers and literals that are re-used in the output.
This library is licensed under the terms of both the MIT license and the Apache License (Version 2.0), and may include packages written by third parties which carry their own copyright notices and license terms.
See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.