harn-builtin-macros 0.8.98
“#[harn_builtin] proc-macro: emits a runtime registration entry plus a parser BuiltinSignature from a single annotated function.”
Contains an unbounded block loopLarge registry install base (10k+ downloads)
SHA-25683a8d426668033c0a938032af414e830e667e8c49fbff2ae9732151f7cce24a4
MaleculeO(S)H(Db)Md
Evidence
1//! Hand-rolled mini-grammar parser for the Harn-style signature string.
2//!
3//! Grammar (informal):
4//!
5//! ```text
6//! sig = type …
30:5… follows the type to mark the field as optional. This keeps each kind
31//! unambiguous.
32
33use proc_macro2::{Span, TokenStream as TokenStream2};
34use quote::quote;
35
36#[derive(Debug, Clone, Eq, PartialEq)]
⋯4 lines
162:31… ral type. Simple: no escape sequences except \" and \\.
163 let start = i + 1;
164 i += 1;
165 let mut buf = St …
330:4… // First ident.
331 params.push(self.expect_ident()?);
332 loop {
333 match self.peek() {
334 Some(Tok::Comma) => {
335 self.bump();
336 // E …
12:63… edits required.
13
14extern crate proc_macro;
15
16use proc_macro::TokenStream;
17use proc_macro2::TokenStream as TokenStream2;
18use quote::{format_ident, quote};
19use syn::parse::{Parse, ParseStream};
20use syn::punctuated::Punctuated;
21use syn::spanned::Spanned;
22use syn::{parse_macro_input, Expr, ItemFn, LitBool, LitStr, Meta, Token};
23
24mod sig_parser;
25
26/// Marks a Rust function as the runtime handler for a Harn builtin. Emits a
27/// …
No evidence locations were recorded for this file. Raw result