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.
- GoKeyword
Parse Error - Error returned when parsing Go vocabulary fails.
- GoPredeclared
Identifier - Common Go predeclared identifiers.
- GoReserved
Word - Go reserved vocabulary: keywords plus common predeclared identifiers.
Functions§
- is_
go_ keyword - Returns whether
inputis a Go keyword. - is_
go_ predeclared_ identifier - Returns whether
inputis a common Go predeclared identifier. - is_
go_ reserved_ word - Returns whether
inputis a Go keyword or common predeclared identifier.