mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-12 12:31:22 +00:00
@ -908,7 +908,7 @@ impl syn::synom::Synom for BindgenAttr {
|
||||
call!(term, "getter") >>
|
||||
val: option!(do_parse!(
|
||||
punct!(=) >>
|
||||
s: syn!(syn::Ident) >>
|
||||
s: call!(term2ident) >>
|
||||
(s)
|
||||
)) >>
|
||||
(val)
|
||||
@ -918,7 +918,7 @@ impl syn::synom::Synom for BindgenAttr {
|
||||
call!(term, "setter") >>
|
||||
val: option!(do_parse!(
|
||||
punct!(=) >>
|
||||
s: syn!(syn::Ident) >>
|
||||
s: call!(term2ident) >>
|
||||
(s)
|
||||
)) >>
|
||||
(val)
|
||||
@ -931,7 +931,7 @@ impl syn::synom::Synom for BindgenAttr {
|
||||
do_parse!(
|
||||
call!(term, "js_namespace") >>
|
||||
punct!(=) >>
|
||||
ns: syn!(syn::Ident) >>
|
||||
ns: call!(term2ident) >>
|
||||
(ns)
|
||||
)=> { BindgenAttr::JsNamespace }
|
||||
|
|
||||
@ -952,7 +952,7 @@ impl syn::synom::Synom for BindgenAttr {
|
||||
do_parse!(
|
||||
call!(term, "js_name") >>
|
||||
punct!(=) >>
|
||||
ns: syn!(syn::Ident) >>
|
||||
ns: call!(term2ident) >>
|
||||
(ns)
|
||||
)=> { BindgenAttr::JsName }
|
||||
));
|
||||
@ -995,6 +995,19 @@ fn term<'a>(cursor: syn::buffer::Cursor<'a>, name: &str) -> syn::synom::PResult<
|
||||
syn::parse_error()
|
||||
}
|
||||
|
||||
fn term2ident<'a>(cursor: syn::buffer::Cursor<'a>)
|
||||
-> syn::synom::PResult<'a, syn::Ident>
|
||||
{
|
||||
if let Some((term, next)) = cursor.term() {
|
||||
let n = term.to_string();
|
||||
if !n.starts_with("'") {
|
||||
let i = syn::Ident::new(&n, term.span());
|
||||
return Ok((i, next));
|
||||
}
|
||||
}
|
||||
syn::parse_error()
|
||||
}
|
||||
|
||||
fn assert_no_lifetimes(decl: &mut syn::FnDecl) {
|
||||
struct Walk;
|
||||
|
||||
|
Reference in New Issue
Block a user