v2 was released in November 2020. It contains the following changes, some of
which are backwards-incompatible:
Added optional LexString() and LexBytes() methods that lexer
definitions can implement to fast-path lexing of bytes and strings.
A new stateful lexer has been added.
A filename must now be passed to all Parse*() and Lex*() methods.
The text/scanner lexer no longer automatically unquotes strings or
supports arbitary length single quoted strings. The tokens it produces are
identical to that of the text/scanner package. Use Unquote() to remove
quotes.
Tok and EndTok will no longer be populated.
If a field named Token []lexer.Token exists it will be populated with the
raw tokens that the node parsed from the lexer.
Support capturing directly into lexer.Token fields. eg.
type ast struct {
Head lexer.Token `@Ident`
Tail []lexer.Token `@(Ident*)`
}
Add an experimental/codegen for stateful lexers. This provides ~10x
performance improvement with zero garbage when lexing strings.
The regex lexer has been removed.
The ebnf lexer has been removed.
All future work on lexing will be put into the stateful lexer.
The need for DropToken has been removed.
Commits
f07d82d Allow custom types to be used for Pos, EndPos and Token.
4ddfe8b chore(deps): update dependency golangci-lint to v1.52.1
39d263e chore(deps): update dependency goreleaser to v1.16.2
096f26a chore(deps): update dependency golangci-lint to v1.52.0
2754010 chore(deps): update dependency goreleaser to v1.16.1
3080db5 chore(deps): update dependency go to v1.20.2
7396515 chore(deps): update dependency goreleaser to v1.16.0
ef998eb fix(deps): update module github.com/alecthomas/assert/v2 to v2.2.2
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps github.com/alecthomas/participle/v2 from 2.0.0-beta.5 to 2.0.0.
Release notes
Sourced from github.com/alecthomas/participle/v2's releases.
Changelog
Sourced from github.com/alecthomas/participle/v2's changelog.
Commits
f07d82d
Allow custom types to be used for Pos, EndPos and Token.4ddfe8b
chore(deps): update dependency golangci-lint to v1.52.139d263e
chore(deps): update dependency goreleaser to v1.16.2096f26a
chore(deps): update dependency golangci-lint to v1.52.02754010
chore(deps): update dependency goreleaser to v1.16.13080db5
chore(deps): update dependency go to v1.20.27396515
chore(deps): update dependency goreleaser to v1.16.0ef998eb
fix(deps): update module github.com/alecthomas/assert/v2 to v2.2.23a0bfd1
Automerge Renovate branchese6cb455
fix(deps): update module github.com/alecthomas/kong to v0.7.1 (#318)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)