Skip to main content

Crate use_go_keyword

Crate use_go_keyword 

Source
Expand description

§use-go-keyword

Go keyword and predeclared identifier primitives for RustUse.

§Experimental

use-go-keyword is experimental while use-go remains below 0.3.0.

§Example

use use_go_keyword::{GoKeyword, is_go_predeclared_identifier, is_go_reserved_word};

let keyword: GoKeyword = "func".parse()?;

assert_eq!(keyword.to_string(), "func");
assert!(is_go_predeclared_identifier("nil"));
assert!(is_go_reserved_word("package"));

§Scope

  • Go keyword labels with source spelling.
  • Common Go predeclared identifiers.
  • A small reserved-word wrapper for keyword or predeclared identifier membership.

§Non-goals

  • Identifier validation.
  • Go source-code parsing.
  • Version-specific language feature decisions.

§License

Licensed under either Apache-2.0 or MIT.

Enums§

GoKeyword
Go source keywords.
GoKeywordParseError
Error returned when parsing Go vocabulary fails.
GoPredeclaredIdentifier
Common Go predeclared identifiers.
GoReservedWord
Go reserved vocabulary: keywords plus common predeclared identifiers.

Functions§

is_go_keyword
Returns whether input is a Go keyword.
is_go_predeclared_identifier
Returns whether input is a common Go predeclared identifier.
is_go_reserved_word
Returns whether input is a Go keyword or common predeclared identifier.