Skip to content

Commit

Permalink
Add Go modules support for v2
Browse files Browse the repository at this point in the history
  • Loading branch information
tdewolff committed Nov 6, 2018
1 parent 3b56c4a commit e17a589
Show file tree
Hide file tree
Showing 22 changed files with 35 additions and 30 deletions.
6 changes: 3 additions & 3 deletions css/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Run the following command

or add the following import and run project with `go get`

import "github.com/tdewolff/parse/css"
import "github.com/tdewolff/parse/v2/css"

## Lexer
### Usage
Expand Down Expand Up @@ -70,7 +70,7 @@ package main
import (
"os"

"github.com/tdewolff/parse/css"
"github.com/tdewolff/parse/v2/css"
)

// Tokenize CSS3 from stdin.
Expand Down Expand Up @@ -132,7 +132,7 @@ import (
"bytes"
"fmt"

"github.com/tdewolff/parse/css"
"github.com/tdewolff/parse/v2/css"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions css/lex.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"io"
"strconv"

"github.com/tdewolff/parse"
"github.com/tdewolff/parse/buffer"
"github.com/tdewolff/parse/v2"
"github.com/tdewolff/parse/v2/buffer"
)

// TokenType determines the type of token, eg. a number or a semicolon.
Expand Down
2 changes: 1 addition & 1 deletion css/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io"
"strconv"

"github.com/tdewolff/parse"
"github.com/tdewolff/parse/v2"
)

var wsBytes = []byte(" ")
Expand Down
2 changes: 1 addition & 1 deletion css/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"
"testing"

"github.com/tdewolff/parse"
"github.com/tdewolff/parse/v2"
"github.com/tdewolff/test"
)

Expand Down
2 changes: 1 addition & 1 deletion css/util.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package css // import "github.com/tdewolff/parse/css"

import "github.com/tdewolff/parse/buffer"
import "github.com/tdewolff/parse/v2/buffer"

// IsIdent returns true if the bytes are a valid identifier.
func IsIdent(b []byte) bool {
Expand Down
2 changes: 1 addition & 1 deletion error.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"io"

"github.com/tdewolff/parse/buffer"
"github.com/tdewolff/parse/v2/buffer"
)

// Error is a parsing error returned by parser. It contains a message and an offset at which the error occurred.
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/tdewolff/parse/v2

require github.com/tdewolff/test v1.0.0
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/tdewolff/test v1.0.0 h1:jOwzqCXr5ePXEPGJaq2ivoR6HOCi+D5TPfpoyg8yvmU=
github.com/tdewolff/test v1.0.0/go.mod h1:DiQUlutnqlEvdvhSn2LPGy4TFwRauAaYDsL+683RNX4=
4 changes: 2 additions & 2 deletions html/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Run the following command

or add the following import and run project with `go get`

import "github.com/tdewolff/parse/html"
import "github.com/tdewolff/parse/v2/html"

## Lexer
### Usage
Expand Down Expand Up @@ -60,7 +60,7 @@ package main
import (
"os"

"github.com/tdewolff/parse/html"
"github.com/tdewolff/parse/v2/html"
)

// Tokenize HTML from stdin.
Expand Down
4 changes: 2 additions & 2 deletions html/lex.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"io"
"strconv"

"github.com/tdewolff/parse"
"github.com/tdewolff/parse/buffer"
"github.com/tdewolff/parse/v2"
"github.com/tdewolff/parse/v2/buffer"
)

// TokenType determines the type of token, eg. a number or a semicolon.
Expand Down
2 changes: 1 addition & 1 deletion html/lex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"
"testing"

"github.com/tdewolff/parse"
"github.com/tdewolff/parse/v2"
"github.com/tdewolff/test"
)

Expand Down
2 changes: 1 addition & 1 deletion html/util.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package html // import "github.com/tdewolff/parse/html"

import "github.com/tdewolff/parse"
import "github.com/tdewolff/parse/v2"

var (
singleQuoteEntityBytes = []byte("'")
Expand Down
4 changes: 2 additions & 2 deletions js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Run the following command

or add the following import and run project with `go get`

import "github.com/tdewolff/parse/js"
import "github.com/tdewolff/parse/v2/js"

## Lexer
### Usage
Expand Down Expand Up @@ -59,7 +59,7 @@ package main
import (
"os"

"github.com/tdewolff/parse/js"
"github.com/tdewolff/parse/v2/js"
)

// Tokenize JS from stdin.
Expand Down
2 changes: 1 addition & 1 deletion js/lex.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"
"unicode"

"github.com/tdewolff/parse/buffer"
"github.com/tdewolff/parse/v2/buffer"
)

var identifierStart = []*unicode.RangeTable{unicode.Lu, unicode.Ll, unicode.Lt, unicode.Lm, unicode.Lo, unicode.Nl, unicode.Other_ID_Start}
Expand Down
4 changes: 2 additions & 2 deletions json/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Run the following command

or add the following import and run project with `go get`

import "github.com/tdewolff/parse/json"
import "github.com/tdewolff/parse/v2/json"

## Parser
### Usage
Expand Down Expand Up @@ -51,7 +51,7 @@ package main
import (
"os"

"github.com/tdewolff/parse/json"
"github.com/tdewolff/parse/v2/json"
)

// Tokenize JSON from stdin.
Expand Down
4 changes: 2 additions & 2 deletions json/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"io"
"strconv"

"github.com/tdewolff/parse"
"github.com/tdewolff/parse/buffer"
"github.com/tdewolff/parse/v2"
"github.com/tdewolff/parse/v2/buffer"
)

// GrammarType determines the type of grammar
Expand Down
2 changes: 1 addition & 1 deletion json/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"
"testing"

"github.com/tdewolff/parse"
"github.com/tdewolff/parse/v2"
"github.com/tdewolff/test"
)

Expand Down
2 changes: 1 addition & 1 deletion position.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io"
"strings"

"github.com/tdewolff/parse/buffer"
"github.com/tdewolff/parse/v2/buffer"
)

// Position returns the line and column number for a certain position in a file. It is useful for recovering the position in a file that caused an error.
Expand Down
4 changes: 2 additions & 2 deletions xml/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Run the following command

or add the following import and run project with `go get`

import "github.com/tdewolff/parse/xml"
import "github.com/tdewolff/parse/v2/xml"

## Lexer
### Usage
Expand Down Expand Up @@ -63,7 +63,7 @@ package main
import (
"os"

"github.com/tdewolff/parse/xml"
"github.com/tdewolff/parse/v2/xml"
)

// Tokenize XML from stdin.
Expand Down
4 changes: 2 additions & 2 deletions xml/lex.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"io"
"strconv"

"github.com/tdewolff/parse"
"github.com/tdewolff/parse/buffer"
"github.com/tdewolff/parse/v2"
"github.com/tdewolff/parse/v2/buffer"
)

// TokenType determines the type of token, eg. a number or a semicolon.
Expand Down
2 changes: 1 addition & 1 deletion xml/lex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"
"testing"

"github.com/tdewolff/parse"
"github.com/tdewolff/parse/v2"
"github.com/tdewolff/test"
)

Expand Down
2 changes: 1 addition & 1 deletion xml/util.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package xml // import "github.com/tdewolff/parse/xml"

import "github.com/tdewolff/parse"
import "github.com/tdewolff/parse/v2"

var (
ltEntityBytes = []byte("<")
Expand Down

0 comments on commit e17a589

Please sign in to comment.