Add stab tag for metamethods
This commit is contained in:
parent
cbb47840e4
commit
da5acd6bc8
@ -9,12 +9,12 @@ use std::{
|
|||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
pub mod stub_types {
|
pub mod stub_types {
|
||||||
pub struct any;
|
pub struct any;
|
||||||
pub type nil = ();
|
pub struct nil;
|
||||||
pub type boolean = bool;
|
pub type boolean = bool;
|
||||||
pub type lightuserdata = *mut ();
|
pub struct lightuserdata;
|
||||||
pub type number = f64;
|
pub struct number;
|
||||||
pub type integer = i64;
|
pub struct integer;
|
||||||
pub type string = &'static str;
|
pub type string = String;
|
||||||
pub struct table;
|
pub struct table;
|
||||||
pub struct function;
|
pub struct function;
|
||||||
pub struct userdata;
|
pub struct userdata;
|
||||||
|
@ -763,13 +763,13 @@ fn inject_merged_drop(registry: &mut Registry, lua: Option<&LuaFunction>) -> Res
|
|||||||
|
|
||||||
fn document_ffi_function(func: &mut ImplItemFn) {
|
fn document_ffi_function(func: &mut ImplItemFn) {
|
||||||
func.attrs.insert(0, parse_quote!(#[doc =
|
func.attrs.insert(0, parse_quote!(#[doc =
|
||||||
r#"<span class="stab" title="This is a C/FFI function." style="float: right; font-weight: 500; margin-left: 3px; padding-left: 5px; padding-right: 5px;">FFI</span>"#
|
r#"<span class="stab" title="This function is implemented in Rust and called via FFI." style="float: right; background: #fff5d6; font-weight: 500; margin-left: 3px; padding-left: 5px; padding-right: 5px;">FFI</span>"#
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn document_lua_function(func: &mut ImplItemFn) {
|
fn document_lua_function(func: &mut ImplItemFn) {
|
||||||
func.attrs.insert(0, parse_quote!(#[doc =
|
func.attrs.insert(0, parse_quote!(#[doc =
|
||||||
r#"<span class="stab" title="This is a Lua function." style="float: right; font-weight: 500; margin-left: 3px; padding-left: 5px; padding-right: 5px;">Lua</span>"#
|
r#"<span class="stab" title="This function is implemented in Lua." style="float: right; background: #ebf5ff; font-weight: 500; margin-left: 3px; padding-left: 5px; padding-right: 5px;">Lua</span>"#
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -799,6 +799,10 @@ fn document_metamethod(func: &mut ImplItemFn, method: Metamethod) {
|
|||||||
_ => format!("This is a metamethod and cannot be called directly."),
|
_ => format!("This is a metamethod and cannot be called directly."),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
func.attrs.insert(0, parse_quote!(#[doc =
|
||||||
|
r#"<span class="stab" title="This function is a metamethod." style="float: right; background: #ebf5ff; margin-left: 3px; padding-left: 5px; padding-right: 5px;">Metamethod</span>"#
|
||||||
|
]));
|
||||||
|
|
||||||
func.attrs.push(parse_quote!(#[doc = ""]));
|
func.attrs.push(parse_quote!(#[doc = ""]));
|
||||||
func.attrs.push(parse_quote!(#[doc = #s]));
|
func.attrs.push(parse_quote!(#[doc = #s]));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user