Skip to main content

perl_semantic_analyzer/
lib.rs

1//! Semantic analysis, symbol extraction, and type inference for Perl.
2//!
3//! Walks a parsed AST to build scoped symbol tables, resolve declarations and
4//! references, and perform lightweight type inference. The resulting semantic
5//! model powers go-to-definition, find-references, and diagnostic providers
6//! in the LSP server.
7
8#![deny(unsafe_code)]
9#![deny(unreachable_pub)]
10#![deny(clippy::print_stderr, clippy::print_stdout)]
11#![cfg_attr(
12    test,
13    allow(
14        clippy::panic,
15        clippy::unwrap_used,
16        clippy::expect_used,
17        clippy::print_stderr,
18        clippy::print_stdout
19    )
20)]
21#![warn(rust_2018_idioms)]
22#![warn(missing_docs)]
23#![warn(clippy::all)]
24#![allow(
25    clippy::too_many_lines,
26    clippy::module_name_repetitions,
27    clippy::cast_possible_truncation,
28    clippy::cast_sign_loss,
29    clippy::cast_precision_loss,
30    clippy::cast_possible_wrap,
31    clippy::must_use_candidate,
32    clippy::missing_errors_doc,
33    clippy::missing_panics_doc,
34    clippy::wildcard_imports,
35    clippy::enum_glob_use,
36    clippy::match_same_arms,
37    clippy::if_not_else,
38    clippy::struct_excessive_bools,
39    clippy::items_after_statements,
40    clippy::return_self_not_must_use,
41    clippy::unused_self,
42    clippy::collapsible_match,
43    clippy::collapsible_if,
44    clippy::only_used_in_recursion,
45    clippy::items_after_test_module,
46    clippy::while_let_loop,
47    clippy::single_range_in_vec_init,
48    clippy::arc_with_non_send_sync,
49    clippy::needless_range_loop,
50    clippy::result_large_err,
51    clippy::if_same_then_else,
52    clippy::should_implement_trait,
53    clippy::manual_flatten,
54    clippy::needless_raw_string_hashes,
55    clippy::single_char_pattern,
56    clippy::uninlined_format_args
57)]
58
59pub use perl_parser_core::{Node, NodeKind, SourceLocation};
60pub use perl_parser_core::{
61    Parser, ast, edit, error, parser, parser_context, position, pragma_tracker, quote_parser, util,
62};
63pub use perl_workspace::workspace_index;
64
65/// Semantic analysis, symbol extraction, and type inference.
66pub mod analysis;
67
68pub use analysis::class_model;
69#[cfg(not(target_arch = "wasm32"))]
70pub use analysis::declaration;
71#[cfg(not(target_arch = "wasm32"))]
72pub use analysis::index;
73pub use analysis::scope_analyzer;
74pub use analysis::semantic;
75pub use analysis::symbol;
76pub use analysis::type_inference;