perl-builtins 0.11.0

Builtin symbol metadata for Perl parser and LSP tooling
Documentation
  • Coverage
  • 100%
    6 out of 6 items documented0 out of 2 items with examples
  • Size
  • Source code size: 122.67 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.06 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 21s Average build duration of successful builds.
  • all releases: 21s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • EffortlessMetrics/perl-lsp
    0 1 46
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • EffortlessSteven

perl-builtins

Builtin function signatures and metadata for Perl parser and LSP tooling.

Part of the tree-sitter-perl-rs workspace.

Overview

Provides two complementary lookup mechanisms for 200+ Perl built-in functions (including file test operators):

  • builtin_signatures -- HashMap-based store with OnceLock lazy init. Each entry carries multiple signature variants and a documentation string (BuiltinSignature). Used for signature help and hover.
  • builtin_signatures_phf -- Re-export of the perl-builtins-phf microcrate, which provides compile-time phf::Map tables (BUILTIN_SIGS, BUILTIN_FULL_SIGS) for O(1) lookups with zero runtime allocation. Exposes get_param_names, is_builtin, and builtin_count helpers. Used for inlay hints and completion.

Categories covered

I/O, strings, arrays, hashes, file/directory ops, file test operators (-e, -f, ...), processes, math, sockets/network, IPC, user/group, time, modules, control flow, tied variables, and more.

Usage

use perl_builtins::builtin_signatures_phf::{is_builtin, get_param_names};

assert!(is_builtin("print"));
assert_eq!(get_param_names("open"), &["FILEHANDLE", "MODE", "FILENAME"]);

License

MIT OR Apache-2.0