AFLplusplus / AFLplusplus/LibAFL

Nautilus Grammar Macro

オープン
#3,343 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Rust
スター
2.6k
フォーク
481
平均マージ
2日 30分
マージ済み PR(30日)
16

説明

**Is your feature request related to a problem? Please describe.**
When writing Nautilus grammar, I've found it's annoying to use a separate file or just have to embed it in my Rust code in a way that doesn't benefit from Rust's typing system.

**Describe the solution you'd like**
I want there to be some sort of macro that makes it easy to make a Nautilus grammar, is checked at compile time, and just allows for more synergy in my code.

**Describe alternatives you've considered**
I've looked around for a macro that does something similar but I haven't found anything. The only alternatives are ones I don't really like working with, e.g. `NautilusContext::from_file` or hand rolling a vector in my code using `NautilusContext::with_rules`

**Additional context**
I made a [small macro crate](https://github.com/AshrafIbrahim03/nautilus-macro) that solves the exact problem I describe. I don't have a lot of experience making macros, but this seemed like a nice place to start. I would appreciate some feedback if this seems like a good feature.

The macro makes a Vec<[(&str,&[u8])]> which is what's needed by `NautilusContext::with_rules`. Using this macro with `NautilusContext::with_rules` allows for compile time checked Nautilus grammar definitions.

I figured making a PoC before directly submitting a PR would be better.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。