diff --git a/README.md b/README.md
index 8587cba2..c1ac7c10 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# A dead simple parser package for Go
-[![Godoc](https://godoc.org/github.com/alecthomas/participle?status.svg)](http://godoc.org/github.com/alecthomas/participle) [![CircleCI](https://img.shields.io/circleci/project/github/alecthomas/participle.svg)](https://circleci.com/gh/alecthomas/participle)
- [![Go Report Card](https://goreportcard.com/badge/github.com/alecthomas/participle)](https://goreportcard.com/report/github.com/alecthomas/participle) [![Slack chat](https://img.shields.io/static/v1?logo=slack&style=flat&label=slack&color=green&message=gophers)](https://gophers.slack.com/messages/CN9DS8YF3)
+[![PkgGoDev](https://pkg.go.dev/badge/github.com/alecthomas/participle/v2)](https://pkg.go.dev/github.com/alecthomas/participle/v2) [![CircleCI](https://img.shields.io/circleci/project/github/alecthomas/participle.svg)](https://circleci.com/gh/alecthomas/participle)
+ [![Go Report Card](https://goreportcard.com/badge/github.com/alecthomas/participle/v2)](https://goreportcard.com/report/github.com/alecthomas/participle/v2) [![Slack chat](https://img.shields.io/static/v1?logo=slack&style=flat&label=slack&color=green&message=gophers)](https://gophers.slack.com/messages/CN9DS8YF3)
@@ -208,8 +208,8 @@ your own lexer.
Configure your parser with a lexer via `participle.Lexer()`.
To use your own Lexer you will need to implement two interfaces:
-[Definition](https://godoc.org/github.com/alecthomas/participle/lexer#Definition)
-and [Lexer](https://godoc.org/github.com/alecthomas/participle/lexer#Lexer).
+[Definition](https://pkg.go.dev/github.com/alecthomas/participle/v2#Definition)
+and [Lexer](https://pkg.go.dev/github.com/alecthomas/participle/v2#Lexer).
### Experimental - code generation
@@ -224,25 +224,25 @@ while producing O(1) garbage.
## Options
-The Parser's behaviour can be configured via [Options](https://godoc.org/github.com/alecthomas/participle#Option).
+The Parser's behaviour can be configured via [Options](https://pkg.go.dev/github.com/alecthomas/participle/v2#Option).
## Examples
-There are several [examples](https://github.com/alecthomas/participle/tree/master/_examples) included:
+There are several [examples](https://github.com/alecthomas/participle/v2/tree/master/_examples) included:
Example | Description
--------|---------------
-[BASIC](https://github.com/alecthomas/participle/tree/master/_examples/basic) | A lexer, parser and interpreter for a [rudimentary dialect](https://caml.inria.fr/pub/docs/oreilly-book/html/book-ora058.html) of BASIC.
-[EBNF](https://github.com/alecthomas/participle/tree/master/_examples/ebnf) | Parser for the form of EBNF used by Go.
-[Expr](https://github.com/alecthomas/participle/tree/master/_examples/expr) | A basic mathematical expression parser and evaluator.
-[GraphQL](https://github.com/alecthomas/participle/tree/master/_examples/graphql) | Lexer+parser for GraphQL schemas
-[HCL](https://github.com/alecthomas/participle/tree/master/_examples/hcl) | A parser for the [HashiCorp Configuration Language](https://github.com/hashicorp/hcl).
-[INI](https://github.com/alecthomas/participle/tree/master/_examples/ini) | An INI file parser.
-[Protobuf](https://github.com/alecthomas/participle/tree/master/_examples/protobuf) | A full [Protobuf](https://developers.google.com/protocol-buffers/) version 2 and 3 parser.
-[SQL](https://github.com/alecthomas/participle/tree/master/_examples/sql) | A *very* rudimentary SQL SELECT parser.
-[Thrift](https://github.com/alecthomas/participle/tree/master/_examples/thrift) | A full [Thrift](https://thrift.apache.org/docs/idl) parser.
-[TOML](https://github.com/alecthomas/participle/blob/master/_examples/toml/main.go) | A [TOML](https://github.com/toml-lang/toml) parser.
+[BASIC](https://github.com/alecthomas/participle/v2/tree/master/_examples/basic) | A lexer, parser and interpreter for a [rudimentary dialect](https://caml.inria.fr/pub/docs/oreilly-book/html/book-ora058.html) of BASIC.
+[EBNF](https://github.com/alecthomas/participle/v2/tree/master/_examples/ebnf) | Parser for the form of EBNF used by Go.
+[Expr](https://github.com/alecthomas/participle/v2/tree/master/_examples/expr) | A basic mathematical expression parser and evaluator.
+[GraphQL](https://github.com/alecthomas/participle/v2/tree/master/_examples/graphql) | Lexer+parser for GraphQL schemas
+[HCL](https://github.com/alecthomas/participle/v2/tree/master/_examples/hcl) | A parser for the [HashiCorp Configuration Language](https://github.com/hashicorp/hcl).
+[INI](https://github.com/alecthomas/participle/v2/tree/master/_examples/ini) | An INI file parser.
+[Protobuf](https://github.com/alecthomas/participle/v2/tree/master/_examples/protobuf) | A full [Protobuf](https://developers.google.com/protocol-buffers/) version 2 and 3 parser.
+[SQL](https://github.com/alecthomas/participle/v2/tree/master/_examples/sql) | A *very* rudimentary SQL SELECT parser.
+[Thrift](https://github.com/alecthomas/participle/v2/tree/master/_examples/thrift) | A full [Thrift](https://thrift.apache.org/docs/idl) parser.
+[TOML](https://github.com/alecthomas/participle/v2/blob/master/_examples/toml/main.go) | A [TOML](https://github.com/toml-lang/toml) parser.
Included below is a full GraphQL lexer and parser:
@@ -256,9 +256,9 @@ import (
"github.com/alecthomas/kong"
"github.com/alecthomas/repr"
- "github.com/alecthomas/participle"
- "github.com/alecthomas/participle/lexer"
- "github.com/alecthomas/participle/lexer/stateful"
+ "github.com/alecthomas/participle/v2"
+ "github.com/alecthomas/participle/v2/lexer"
+ "github.com/alecthomas/participle/v2/lexer/stateful"
)
type File struct {
@@ -377,7 +377,7 @@ A compiled `Parser` instance can be used concurrently. A `LexerDefinition` can b
There are a few areas where Participle can provide useful feedback to users of your parser.
-1. Errors returned by [Parser.Parse*()](https://godoc.org/github.com/alecthomas/participle#Parser.ParseReader) will be of type [Error](https://godoc.org/github.com/alecthomas/participle#Error). This will contain positional information where available.
+1. Errors returned by [Parser.Parse*()](https://pkg.go.dev/github.com/alecthomas/participle/v2#Parser.ParseReader) will be of type [Error](https://pkg.go.dev/github.com/alecthomas/participle/v2#Error). This will contain positional information where available.
2. Participle will make a best effort to return as much of the AST up to the error location as possible.
3. Any node in the AST containing a field `Pos lexer.Position` will be automatically
populated from the nearest matching token.
@@ -403,7 +403,7 @@ recursion must be eliminated by restructuring your grammar.
Participle supports outputting an EBNF grammar from a Participle parser. Once
the parser is constructed simply call `String()`.
-eg. The [GraphQL example](https://github.com/alecthomas/participle/blob/cbe0cc62a3ad95955311002abd642f11543cb8ed/_examples/graphql/main.go#L14-L61)
+eg. The [GraphQL example](https://github.com/alecthomas/participle/v2/blob/cbe0cc62a3ad95955311002abd642f11543cb8ed/_examples/graphql/main.go#L14-L61)
gives in the following EBNF:
```ebnf
@@ -416,4 +416,4 @@ TypeRef = "[" TypeRef "]" | ident "!"? .
Value = ident .
Schema = "schema" "{" Field* "}" .
Enum = "enum" ident "{" ident* "}" .
-```
\ No newline at end of file
+```
diff --git a/_examples/basic/ast.go b/_examples/basic/ast.go
index 36deb34c..ce85d252 100644
--- a/_examples/basic/ast.go
+++ b/_examples/basic/ast.go
@@ -5,7 +5,7 @@ import (
"io"
"strings"
- "github.com/alecthomas/participle/lexer"
+ "github.com/alecthomas/participle/v2/lexer"
)
// Parse a BASIC program.
diff --git a/_examples/basic/eval.go b/_examples/basic/eval.go
index e616cc41..7cb7fd50 100644
--- a/_examples/basic/eval.go
+++ b/_examples/basic/eval.go
@@ -8,7 +8,7 @@ import (
"github.com/alecthomas/repr"
- "github.com/alecthomas/participle"
+ "github.com/alecthomas/participle/v2"
)
type Evaluatable interface {
diff --git a/_examples/basic/main.go b/_examples/basic/main.go
index bd2a25dc..4128bb13 100644
--- a/_examples/basic/main.go
+++ b/_examples/basic/main.go
@@ -6,9 +6,9 @@ import (
"github.com/alecthomas/kong"
- "github.com/alecthomas/participle"
- "github.com/alecthomas/participle/lexer"
- "github.com/alecthomas/participle/lexer/stateful"
+ "github.com/alecthomas/participle/v2"
+ "github.com/alecthomas/participle/v2/lexer"
+ "github.com/alecthomas/participle/v2/lexer/stateful"
)
var (
diff --git a/_examples/ebnf/main.go b/_examples/ebnf/main.go
index d93cc782..88116266 100644
--- a/_examples/ebnf/main.go
+++ b/_examples/ebnf/main.go
@@ -9,7 +9,7 @@ import (
"gopkg.in/alecthomas/kingpin.v2"
- "github.com/alecthomas/participle"
+ "github.com/alecthomas/participle/v2"
)
var (
diff --git a/_examples/expr/main.go b/_examples/expr/main.go
index d90f66fd..e06291ff 100644
--- a/_examples/expr/main.go
+++ b/_examples/expr/main.go
@@ -10,7 +10,7 @@ import (
"github.com/alecthomas/kong"
- "github.com/alecthomas/participle"
+ "github.com/alecthomas/participle/v2"
)
var cli struct {
diff --git a/_examples/expr2/main.go b/_examples/expr2/main.go
index ff54acf0..fd31e76c 100644
--- a/_examples/expr2/main.go
+++ b/_examples/expr2/main.go
@@ -6,7 +6,7 @@ import (
"github.com/alecthomas/kong"
"github.com/alecthomas/repr"
- "github.com/alecthomas/participle"
+ "github.com/alecthomas/participle/v2"
)
// Based on http://www.craftinginterpreters.com/parsing-expressions.html
diff --git a/_examples/go.mod b/_examples/go.mod
index 78e00dd6..33e7b7f3 100644
--- a/_examples/go.mod
+++ b/_examples/go.mod
@@ -1,11 +1,11 @@
-module github.com/alecthomas/participle/_examples
+module github.com/alecthomas/participle/v2/_examples
go 1.14
require (
github.com/alecthomas/go-thrift v0.0.0-20170109061633-7914173639b2
github.com/alecthomas/kong v0.2.11
- github.com/alecthomas/participle v0.4.1
+ github.com/alecthomas/participle/v2 v2.0.0-alpha1
github.com/alecthomas/repr v0.0.0-20200325044227-4184120f674c
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
@@ -13,4 +13,4 @@ require (
gopkg.in/alecthomas/kingpin.v2 v2.2.6
)
-replace github.com/alecthomas/participle => ../
+replace github.com/alecthomas/participle/v2 => ../
diff --git a/_examples/go.sum b/_examples/go.sum
index 8e32046b..cacefb9d 100644
--- a/_examples/go.sum
+++ b/_examples/go.sum
@@ -5,8 +5,8 @@ github.com/alecthomas/kong v0.2.8 h1:VSWWkD1TZij2967FcfVwgRwlp3khCA0liZIkUI9hTdU
github.com/alecthomas/kong v0.2.8/go.mod h1:kQOmtJgV+Lb4aj+I2LEn40cbtawdWJ9Y8QLq+lElKxE=
github.com/alecthomas/kong v0.2.11 h1:RKeJXXWfg9N47RYfMm0+igkxBCTF4bzbneAxaqid0c4=
github.com/alecthomas/kong v0.2.11/go.mod h1:kQOmtJgV+Lb4aj+I2LEn40cbtawdWJ9Y8QLq+lElKxE=
-github.com/alecthomas/participle v0.4.1 h1:P2PJWzwrSpuCWXKnzqvw0b0phSfH1kJo4p2HvLynVsI=
-github.com/alecthomas/participle v0.4.1/go.mod h1:T8u4bQOSMwrkTWOSyt8/jSFPEnRtd0FKFMjVfYBlqPs=
+github.com/alecthomas/participle/v2 v0.4.1 h1:P2PJWzwrSpuCWXKnzqvw0b0phSfH1kJo4p2HvLynVsI=
+github.com/alecthomas/participle/v2 v0.4.1/go.mod h1:T8u4bQOSMwrkTWOSyt8/jSFPEnRtd0FKFMjVfYBlqPs=
github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ=
github.com/alecthomas/repr v0.0.0-20200325044227-4184120f674c h1:MVVbswUlqicyj8P/JljoocA7AyCo62gzD0O7jfvrhtE=
github.com/alecthomas/repr v0.0.0-20200325044227-4184120f674c/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ=
diff --git a/_examples/graphql/main.go b/_examples/graphql/main.go
index ac7924e1..efb55c69 100644
--- a/_examples/graphql/main.go
+++ b/_examples/graphql/main.go
@@ -7,9 +7,9 @@ import (
"github.com/alecthomas/kong"
"github.com/alecthomas/repr"
- "github.com/alecthomas/participle"
- "github.com/alecthomas/participle/lexer"
- "github.com/alecthomas/participle/lexer/stateful"
+ "github.com/alecthomas/participle/v2"
+ "github.com/alecthomas/participle/v2/lexer"
+ "github.com/alecthomas/participle/v2/lexer/stateful"
)
type File struct {
diff --git a/_examples/hcl/main.go b/_examples/hcl/main.go
index 445798cc..9c146d4c 100644
--- a/_examples/hcl/main.go
+++ b/_examples/hcl/main.go
@@ -10,7 +10,7 @@ import (
"github.com/alecthomas/repr"
- "github.com/alecthomas/participle"
+ "github.com/alecthomas/participle/v2"
)
type Bool bool
diff --git a/_examples/ini/main.go b/_examples/ini/main.go
index 41b6b2a7..e997af67 100644
--- a/_examples/ini/main.go
+++ b/_examples/ini/main.go
@@ -3,9 +3,9 @@ package main
import (
"os"
- "github.com/alecthomas/participle"
- "github.com/alecthomas/participle/lexer"
- "github.com/alecthomas/participle/lexer/stateful"
+ "github.com/alecthomas/participle/v2"
+ "github.com/alecthomas/participle/v2/lexer"
+ "github.com/alecthomas/participle/v2/lexer/stateful"
"github.com/alecthomas/repr"
)
diff --git a/_examples/json/main.go b/_examples/json/main.go
index 02d84373..6e43d7f0 100644
--- a/_examples/json/main.go
+++ b/_examples/json/main.go
@@ -5,7 +5,7 @@ import (
"fmt"
"os"
- "github.com/alecthomas/participle"
+ "github.com/alecthomas/participle/v2"
)
type pathExpr struct {
diff --git a/_examples/precedenceclimbing/main.go b/_examples/precedenceclimbing/main.go
index dee0f496..03062879 100644
--- a/_examples/precedenceclimbing/main.go
+++ b/_examples/precedenceclimbing/main.go
@@ -18,8 +18,8 @@ import (
"github.com/alecthomas/repr"
- "github.com/alecthomas/participle"
- "github.com/alecthomas/participle/lexer"
+ "github.com/alecthomas/participle/v2"
+ "github.com/alecthomas/participle/v2/lexer"
)
type opInfo struct {
diff --git a/_examples/protobuf/main.go b/_examples/protobuf/main.go
index b0efcfb8..9aa1ff47 100644
--- a/_examples/protobuf/main.go
+++ b/_examples/protobuf/main.go
@@ -8,8 +8,8 @@ import (
"github.com/alecthomas/kong"
"github.com/alecthomas/repr"
- "github.com/alecthomas/participle"
- "github.com/alecthomas/participle/lexer"
+ "github.com/alecthomas/participle/v2"
+ "github.com/alecthomas/participle/v2/lexer"
)
type Proto struct {
diff --git a/_examples/sql/main.go b/_examples/sql/main.go
index ebc7038f..b76c9e0a 100644
--- a/_examples/sql/main.go
+++ b/_examples/sql/main.go
@@ -4,9 +4,9 @@ package main
import (
"github.com/alecthomas/kong"
- "github.com/alecthomas/participle"
- "github.com/alecthomas/participle/lexer"
- "github.com/alecthomas/participle/lexer/stateful"
+ "github.com/alecthomas/participle/v2"
+ "github.com/alecthomas/participle/v2/lexer"
+ "github.com/alecthomas/participle/v2/lexer/stateful"
"github.com/alecthomas/repr"
)
diff --git a/_examples/stateful/main.go b/_examples/stateful/main.go
index d61dbd67..e6fdfee3 100644
--- a/_examples/stateful/main.go
+++ b/_examples/stateful/main.go
@@ -5,9 +5,9 @@ import (
"github.com/alecthomas/repr"
- "github.com/alecthomas/participle"
- "github.com/alecthomas/participle/lexer"
- "github.com/alecthomas/participle/lexer/stateful"
+ "github.com/alecthomas/participle/v2"
+ "github.com/alecthomas/participle/v2/lexer"
+ "github.com/alecthomas/participle/v2/lexer/stateful"
)
type Terminal struct {
diff --git a/_examples/thrift/lexer_gen.go b/_examples/thrift/lexer_gen.go
index c1564a61..a2e9b11b 100644
--- a/_examples/thrift/lexer_gen.go
+++ b/_examples/thrift/lexer_gen.go
@@ -7,8 +7,8 @@ import (
"strings"
"unicode/utf8"
- "github.com/alecthomas/participle"
- "github.com/alecthomas/participle/lexer"
+ "github.com/alecthomas/participle/v2"
+ "github.com/alecthomas/participle/v2/lexer"
)
var Lexer lexer.Definition = definitionImpl{}
diff --git a/_examples/thrift/main.go b/_examples/thrift/main.go
index 36257030..9b34b5e6 100644
--- a/_examples/thrift/main.go
+++ b/_examples/thrift/main.go
@@ -16,10 +16,10 @@ import (
"github.com/alecthomas/repr"
- "github.com/alecthomas/participle"
- "github.com/alecthomas/participle/experimental/codegen"
- "github.com/alecthomas/participle/lexer"
- "github.com/alecthomas/participle/lexer/stateful"
+ "github.com/alecthomas/participle/v2"
+ "github.com/alecthomas/participle/v2/experimental/codegen"
+ "github.com/alecthomas/participle/v2/lexer"
+ "github.com/alecthomas/participle/v2/lexer/stateful"
)
var (
diff --git a/_examples/thrift/main_test.go b/_examples/thrift/main_test.go
index 7ef1c74f..aff3789a 100644
--- a/_examples/thrift/main_test.go
+++ b/_examples/thrift/main_test.go
@@ -8,7 +8,7 @@ import (
thriftparser "github.com/alecthomas/go-thrift/parser"
"github.com/stretchr/testify/require"
- "github.com/alecthomas/participle"
+ "github.com/alecthomas/participle/v2"
)
var (
diff --git a/_examples/toml/main.go b/_examples/toml/main.go
index db86da03..e128349b 100644
--- a/_examples/toml/main.go
+++ b/_examples/toml/main.go
@@ -5,9 +5,9 @@ import (
"github.com/alecthomas/kong"
- "github.com/alecthomas/participle"
- "github.com/alecthomas/participle/lexer"
- "github.com/alecthomas/participle/lexer/stateful"
+ "github.com/alecthomas/participle/v2"
+ "github.com/alecthomas/participle/v2/lexer"
+ "github.com/alecthomas/participle/v2/lexer/stateful"
"github.com/alecthomas/repr"
)
diff --git "a/_examples/\302\265c/main.go" "b/_examples/\302\265c/main.go"
index 8d218c9e..77b62ecd 100644
--- "a/_examples/\302\265c/main.go"
+++ "b/_examples/\302\265c/main.go"
@@ -3,9 +3,9 @@ package main
import (
"github.com/alecthomas/repr"
- "github.com/alecthomas/participle"
- "github.com/alecthomas/participle/lexer"
- "github.com/alecthomas/participle/lexer/stateful"
+ "github.com/alecthomas/participle/v2"
+ "github.com/alecthomas/participle/v2/lexer"
+ "github.com/alecthomas/participle/v2/lexer/stateful"
)
// https://www.it.uu.se/katalog/aleji304/CompilersProject/uc.html
diff --git a/api.go b/api.go
index bb803595..1fbcbc21 100644
--- a/api.go
+++ b/api.go
@@ -1,7 +1,7 @@
package participle
import (
- "github.com/alecthomas/participle/lexer"
+ "github.com/alecthomas/participle/v2/lexer"
)
// Capture can be implemented by fields in order to transform captured tokens into field values.
diff --git a/cmd/railroad/main.go b/cmd/railroad/main.go
index 2f6c2188..a867296f 100644
--- a/cmd/railroad/main.go
+++ b/cmd/railroad/main.go
@@ -6,7 +6,7 @@ import (
"github.com/alecthomas/repr"
- "github.com/alecthomas/participle/ebnf"
+ "github.com/alecthomas/participle/v2/ebnf"
)
const (
diff --git a/context.go b/context.go
index efa6e5e1..38e2c41a 100644
--- a/context.go
+++ b/context.go
@@ -3,7 +3,7 @@ package participle
import (
"reflect"
- "github.com/alecthomas/participle/lexer"
+ "github.com/alecthomas/participle/v2/lexer"
)
type contextFieldSet struct {
diff --git a/ebnf/ebnf.go b/ebnf/ebnf.go
index 0230854c..2abf3a9b 100644
--- a/ebnf/ebnf.go
+++ b/ebnf/ebnf.go
@@ -13,7 +13,7 @@ import (
"fmt"
"io"
- "github.com/alecthomas/participle"
+ "github.com/alecthomas/participle/v2"
)
var parser = participle.MustBuild(&EBNF{})
diff --git a/error.go b/error.go
index a0fab6ed..41d9269d 100644
--- a/error.go
+++ b/error.go
@@ -3,7 +3,7 @@ package participle
import (
"fmt"
- "github.com/alecthomas/participle/lexer"
+ "github.com/alecthomas/participle/v2/lexer"
)
// Error represents an error while parsing.
diff --git a/error_test.go b/error_test.go
index 5a668f1f..618e2319 100644
--- a/error_test.go
+++ b/error_test.go
@@ -5,7 +5,7 @@ import (
"github.com/stretchr/testify/assert"
- "github.com/alecthomas/participle"
+ "github.com/alecthomas/participle/v2"
)
func TestErrorReporting(t *testing.T) {
diff --git a/experimental/codegen/lexer.go b/experimental/codegen/lexer.go
index 9ddd3124..df87c418 100644
--- a/experimental/codegen/lexer.go
+++ b/experimental/codegen/lexer.go
@@ -9,7 +9,7 @@ import (
"text/template"
"unicode/utf8"
- "github.com/alecthomas/participle/lexer/stateful"
+ "github.com/alecthomas/participle/v2/lexer/stateful"
)
var backrefRe = regexp.MustCompile(`(\\+)(\d)`)
@@ -45,8 +45,8 @@ import (
"strings"
"unicode/utf8"
- "github.com/alecthomas/participle"
- "github.com/alecthomas/participle/lexer"
+ "github.com/alecthomas/participle/v2"
+ "github.com/alecthomas/participle/v2/lexer"
)
var Lexer lexer.Definition = definitionImpl{}
diff --git a/experimental/codegen/lexer_gen_test.go b/experimental/codegen/lexer_gen_test.go
index 55710ee5..e367c625 100644
--- a/experimental/codegen/lexer_gen_test.go
+++ b/experimental/codegen/lexer_gen_test.go
@@ -6,8 +6,8 @@ import (
"strings"
"unicode/utf8"
- "github.com/alecthomas/participle"
- "github.com/alecthomas/participle/lexer"
+ "github.com/alecthomas/participle/v2"
+ "github.com/alecthomas/participle/v2/lexer"
)
var Lexer lexer.Definition = definitionImpl{}
diff --git a/experimental/codegen/lexer_test.go b/experimental/codegen/lexer_test.go
index eef77599..89a2b046 100644
--- a/experimental/codegen/lexer_test.go
+++ b/experimental/codegen/lexer_test.go
@@ -8,9 +8,9 @@ import (
"github.com/stretchr/testify/require"
- "github.com/alecthomas/participle/experimental/codegen"
- "github.com/alecthomas/participle/lexer"
- "github.com/alecthomas/participle/lexer/stateful"
+ "github.com/alecthomas/participle/v2/experimental/codegen"
+ "github.com/alecthomas/participle/v2/lexer"
+ "github.com/alecthomas/participle/v2/lexer/stateful"
)
var (
diff --git a/go.mod b/go.mod
index 8c03b07a..1e0d3a62 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,7 @@
-module github.com/alecthomas/participle
+module github.com/alecthomas/participle/v2/v2
require (
+ github.com/alecthomas/participle/v2 v2.0.0-alpha1
github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/stretchr/testify v1.4.0
diff --git a/go.sum b/go.sum
index 951315b7..3727c75f 100644
--- a/go.sum
+++ b/go.sum
@@ -1,3 +1,8 @@
+github.com/alecthomas/participle v0.6.0 h1:Pvo8XUCQKgIywVjz/+Ci3IsjGg+g/TdKkMcfgghKCEw=
+github.com/alecthomas/participle v0.6.0/go.mod h1:HfdmEuwvr12HXQN44HPWXR0lHmVolVYe4dyL6lQ3duY=
+github.com/alecthomas/participle v0.7.0 h1:OixCz5fNURNBU6WGFnjHgs7PfVRLgWpexXwl5s/6h1c=
+github.com/alecthomas/participle/v2 v2.0.0-alpha1 h1:ouqZsiwVYbyl4liVrbU7BaVxqnhF3me8wJ+kW0uEiv8=
+github.com/alecthomas/participle/v2 v2.0.0-alpha1/go.mod h1:kPFs05qle86ZkCGXcLcM72PNESH6DA4YJUDn/ebwPyw=
github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1 h1:GDQdwm/gAcJcLAKQQZGOJ4knlw+7rfEQQcmwTbt4p5E=
github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
diff --git a/grammar.go b/grammar.go
index 92990127..438eb12a 100644
--- a/grammar.go
+++ b/grammar.go
@@ -5,7 +5,7 @@ import (
"reflect"
"text/scanner"
- "github.com/alecthomas/participle/lexer"
+ "github.com/alecthomas/participle/v2/lexer"
)
type generatorContext struct {
diff --git a/lexer/stateful/stateful.go b/lexer/stateful/stateful.go
index c58b5daa..c2f7a17c 100644
--- a/lexer/stateful/stateful.go
+++ b/lexer/stateful/stateful.go
@@ -36,8 +36,8 @@ import (
"unicode"
"unicode/utf8"
- "github.com/alecthomas/participle"
- "github.com/alecthomas/participle/lexer"
+ "github.com/alecthomas/participle/v2"
+ "github.com/alecthomas/participle/v2/lexer"
)
var (
diff --git a/lexer/stateful/stateful_test.go b/lexer/stateful/stateful_test.go
index 263a0aa9..830164fa 100644
--- a/lexer/stateful/stateful_test.go
+++ b/lexer/stateful/stateful_test.go
@@ -8,8 +8,8 @@ import (
"github.com/alecthomas/repr"
"github.com/stretchr/testify/require"
- "github.com/alecthomas/participle"
- "github.com/alecthomas/participle/lexer"
+ "github.com/alecthomas/participle/v2"
+ "github.com/alecthomas/participle/v2/lexer"
)
var interpolatedRules = Rules{
diff --git a/lookahead_test.go b/lookahead_test.go
index 68b92aea..cda11ed6 100644
--- a/lookahead_test.go
+++ b/lookahead_test.go
@@ -5,7 +5,7 @@ import (
"github.com/stretchr/testify/require"
- "github.com/alecthomas/participle"
+ "github.com/alecthomas/participle/v2"
)
func TestIssue3Example1(t *testing.T) {
diff --git a/map.go b/map.go
index 29f70228..20981b7b 100644
--- a/map.go
+++ b/map.go
@@ -5,7 +5,7 @@ import (
"strconv"
"strings"
- "github.com/alecthomas/participle/lexer"
+ "github.com/alecthomas/participle/v2/lexer"
)
type mapperByToken struct {
diff --git a/map_test.go b/map_test.go
index fbc21332..4f1edc92 100644
--- a/map_test.go
+++ b/map_test.go
@@ -6,9 +6,9 @@ import (
"github.com/stretchr/testify/require"
- "github.com/alecthomas/participle"
- "github.com/alecthomas/participle/lexer"
- "github.com/alecthomas/participle/lexer/stateful"
+ "github.com/alecthomas/participle/v2"
+ "github.com/alecthomas/participle/v2/lexer"
+ "github.com/alecthomas/participle/v2/lexer/stateful"
)
func TestUpper(t *testing.T) {
diff --git a/nodes.go b/nodes.go
index 2f36972f..3d9ecb18 100644
--- a/nodes.go
+++ b/nodes.go
@@ -8,7 +8,7 @@ import (
"strconv"
"strings"
- "github.com/alecthomas/participle/lexer"
+ "github.com/alecthomas/participle/v2/lexer"
)
var (
diff --git a/options.go b/options.go
index 22f36b60..e7c820d9 100644
--- a/options.go
+++ b/options.go
@@ -1,7 +1,7 @@
package participle
import (
- "github.com/alecthomas/participle/lexer"
+ "github.com/alecthomas/participle/v2/lexer"
)
// An Option to modify the behaviour of the Parser.
diff --git a/parser.go b/parser.go
index c322b82c..be1fa82f 100644
--- a/parser.go
+++ b/parser.go
@@ -7,7 +7,7 @@ import (
"reflect"
"strings"
- "github.com/alecthomas/participle/lexer"
+ "github.com/alecthomas/participle/v2/lexer"
)
// A Parser for a particular grammar and lexer.
diff --git a/parser_test.go b/parser_test.go
index d1847e94..1dd6883d 100644
--- a/parser_test.go
+++ b/parser_test.go
@@ -10,9 +10,9 @@ import (
"github.com/stretchr/testify/require"
- "github.com/alecthomas/participle"
- "github.com/alecthomas/participle/lexer"
- "github.com/alecthomas/participle/lexer/stateful"
+ "github.com/alecthomas/participle/v2"
+ "github.com/alecthomas/participle/v2/lexer"
+ "github.com/alecthomas/participle/v2/lexer/stateful"
)
func TestProductionCapture(t *testing.T) {
diff --git a/stringer.go b/stringer.go
index fc77a452..eee3ae75 100644
--- a/stringer.go
+++ b/stringer.go
@@ -5,7 +5,7 @@ import (
"fmt"
"strings"
- "github.com/alecthomas/participle/lexer"
+ "github.com/alecthomas/participle/v2/lexer"
)
type stringerVisitor struct {
diff --git a/struct.go b/struct.go
index b1f864a1..72fde6d9 100644
--- a/struct.go
+++ b/struct.go
@@ -8,7 +8,7 @@ import (
"text/scanner"
"unicode/utf8"
- "github.com/alecthomas/participle/lexer"
+ "github.com/alecthomas/participle/v2/lexer"
)
// A structLexer lexes over the tags of struct fields while tracking the current field.
diff --git a/struct_test.go b/struct_test.go
index 3990ddfa..b85ddb76 100644
--- a/struct_test.go
+++ b/struct_test.go
@@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/require"
- "github.com/alecthomas/participle/lexer"
+ "github.com/alecthomas/participle/v2/lexer"
)
func TestStructLexerTokens(t *testing.T) {