{"modulePath":"github.com/expr-lang/expr","version":"v1.18.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package lexer\n\n## Types\n\n```go\ntype Kind string\n```\n\n```go\nconst (\n\tIdentifier Kind = \"Identifier\"\n\tNumber     Kind = \"Number\"\n\tString     Kind = \"String\"\n\tBytes      Kind = \"Bytes\"\n\tOperator   Kind = \"Operator\"\n\tBracket    Kind = \"Bracket\"\n\tEOF        Kind = \"EOF\"\n)\n```\n\n```go\ntype Lexer struct {\n\n\t// When true, keywords `if`/`else` are not treated as operators and\n\t// will be emitted as identifiers instead (for compatibility with custom if()).\n\tDisableIfOperator bool\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc New() *Lexer\n```\nNew returns a reusable lexer.\n\n```go\nfunc (l *Lexer) Next() (Token, error)\n```\n\n```go\nfunc (l *Lexer) Reset(source file.Source)\n```\n\n```go\ntype Token struct {\n\tfile.Location\n\tKind  Kind\n\tValue string\n}\n```\n\n```go\nfunc Lex(source file.Source) ([]Token, error)\n```\nLex will buffer and return the tokens of a disposable \\*[Lexer](#Lexer).\n\n```go\nfunc (t Token) Is(kind Kind, values ...string) bool\n```\n\n```go\nfunc (t Token) String() string\n```\n\n","path":"github.com/expr-lang/expr/parser/lexer","name":"lexer","synopsis":"","isRedistributable":true}
