use-php-token 0.0.1

PHP token metadata primitives for RustUse.
Documentation
  • Coverage
  • 12.99%
    10 out of 77 items documented1 out of 26 items with examples
  • Size
  • Source code size: 12.16 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 996.67 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-php
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-php-token

PHP token metadata primitives for RustUse.

Experimental

use-php-token is experimental while use-php remains below 0.3.0.

Example

use use_php_token::{PhpToken, PhpTokenCategory, PhpTokenSpan, PhpTokenText};

let token = PhpToken::new(
    PhpTokenCategory::Identifier,
    PhpTokenText::new("$value")?,
    PhpTokenSpan::new(4, 10)?,
);

assert_eq!(token.category(), PhpTokenCategory::Identifier);
assert_eq!(token.text().as_str(), "$value");
# Ok::<(), use_php_token::PhpTokenError>(())

Scope

  • Token categories, delimiter labels, comment labels, operators, literals, and identifiers.
  • Lightweight token text and span metadata.

Non-goals

  • A PHP lexer, tokenizer, parser, or grammar implementation.

License

Licensed under either Apache-2.0 or MIT.