1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//! Pasta Search Module - Lua bindings for scene and word search.
//!
//! This module provides the `@pasta_search` Lua module that exposes
//! scene and word search functionality from pasta_core.
//!
//! # Module Registration
//!
//! Use `register()` to register the module with a Lua instance:
//!
//! ```rust,ignore
//! use pasta_lua::search;
//!
//! let lua = mlua::Lua::new();
//! search::register(&lua, scene_registry, word_registry)?;
//!
//! // Now Lua scripts can use:
//! // local SEARCH = require "@pasta_search"
//! // local global_name, local_name = SEARCH:search_scene("シーン", "親シーン")
//! ```
pub use SearchContext;
pub use SearchError;
use ;
use ;
/// Create the `@pasta_search` module table.
///
/// This function creates a Lua UserData containing the SearchContext.
/// The SearchContext provides all search methods as Lua methods.
///
/// # Arguments
/// * `lua` - The Lua instance
/// * `scene_registry` - SceneRegistry from transpilation
/// * `word_registry` - WordDefRegistry from transpilation
///
/// # Returns
/// A Lua UserData representing the `@pasta_search` module
/// Register the `@pasta_search` module with a Lua instance.
///
/// This function calls `loader()` and registers the result in `package.loaded`
/// so that `require "@pasta_search"` returns the module.
///
/// # Arguments
/// * `lua` - The Lua instance
/// * `scene_registry` - SceneRegistry from transpilation
/// * `word_registry` - WordDefRegistry from transpilation
///
/// # Returns
/// The registered module (UserData)