Skip to main content

Crate use_php_syntax

Crate use_php_syntax 

Source
Expand description

§use-php-syntax

PHP syntax label primitives for RustUse.

§Experimental

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

§Example

use use_php_syntax::{PhpDeclarationKind, PhpKeyword, PhpModifier, is_php_keyword};

assert!(is_php_keyword("class"));
assert_eq!(PhpKeyword::Readonly.as_str(), "readonly");
assert_eq!(PhpDeclarationKind::Trait.to_string(), "trait");
assert_eq!("final".parse::<PhpModifier>()?, PhpModifier::Final);

§Scope

  • PHP keyword, visibility, declaration, modifier, and control-flow labels.

§Non-goals

  • PHP parsing, syntax trees, formatting, linting, or grammar validation.

§License

Licensed under either Apache-2.0 or MIT.

Enums§

PhpControlFlowLabel
PhpDeclarationKind
PhpKeyword
PhpModifier
PhpSyntaxError
Error returned when PHP syntax metadata cannot be parsed.
PhpVisibility

Functions§

is_php_keyword
is_php_modifier