Skip to content

Commit

Permalink
Update readme examples, fixes #66
Browse files Browse the repository at this point in the history
  • Loading branch information
tdewolff committed Nov 17, 2020
1 parent d949168 commit a539aff
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions css/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ or add the following import and run project with `go get`
### Usage
The following initializes a new Lexer with io.Reader `r`:
``` go
l := css.NewLexer(r)
l := css.NewLexer(parse.NewInput(r))
```

To tokenize until EOF an error, use:
Expand Down Expand Up @@ -75,7 +75,7 @@ import (

// Tokenize CSS3 from stdin.
func main() {
l := css.NewLexer(os.Stdin)
l := css.NewLexer(parse.NewInput(os.Stdin))
for {
tt, text := l.Next()
switch tt {
Expand All @@ -99,7 +99,7 @@ func main() {
The following creates a new Parser.
``` go
// true because this is the content of an inline style attribute
p := css.NewParser(bytes.NewBufferString("color: red;"), true)
p := css.NewParser(parse.NewInput(bytes.NewBufferString("color: red;")), true)
```

To iterate over the stylesheet, use:
Expand Down Expand Up @@ -137,7 +137,7 @@ import (

func main() {
// true because this is the content of an inline style attribute
p := css.NewParser(bytes.NewBufferString("color: red;"), true)
p := css.NewParser(parse.NewInput(bytes.NewBufferString("color: red;")), true)
out := ""
for {
gt, _, data := p.Next()
Expand Down
4 changes: 2 additions & 2 deletions html/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ or add the following import and run project with `go get`
### Usage
The following initializes a new Lexer with io.Reader `r`:
``` go
l := html.NewLexer(r)
l := html.NewLexer(parse.NewInput(r))
```

To tokenize until EOF an error, use:
Expand Down Expand Up @@ -65,7 +65,7 @@ import (

// Tokenize HTML from stdin.
func main() {
l := html.NewLexer(os.Stdin)
l := html.NewLexer(parse.NewInput(os.Stdin))
for {
tt, data := l.Next()
switch tt {
Expand Down
4 changes: 2 additions & 2 deletions js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ or add the following import and run project with `go get`
### Usage
The following initializes a new Lexer with io.Reader `r`:
``` go
l := js.NewLexer(r)
l := js.NewLexer(parse.NewInput(r))
```

To tokenize until EOF an error, use:
Expand Down Expand Up @@ -46,7 +46,7 @@ import (

// Tokenize JS from stdin.
func main() {
l := js.NewLexer(os.Stdin)
l := js.NewLexer(parse.NewInput(os.Stdin))
for {
tt, text := l.Next()
switch tt {
Expand Down
4 changes: 2 additions & 2 deletions json/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ or add the following import and run project with `go get`
### Usage
The following initializes a new Parser with io.Reader `r`:
``` go
p := json.NewParser(r)
p := json.NewParser(parse.NewInput(r))
```

To tokenize until EOF an error, use:
Expand Down Expand Up @@ -56,7 +56,7 @@ import (

// Tokenize JSON from stdin.
func main() {
p := json.NewParser(os.Stdin)
p := json.NewParser(parse.NewInput(os.Stdin))
for {
gt, text := p.Next()
switch gt {
Expand Down
4 changes: 2 additions & 2 deletions xml/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ or add the following import and run project with `go get`
### Usage
The following initializes a new Lexer with io.Reader `r`:
``` go
l := xml.NewLexer(r)
l := xml.NewLexer(parse.NewInput(r))
```

To tokenize until EOF an error, use:
Expand Down Expand Up @@ -68,7 +68,7 @@ import (

// Tokenize XML from stdin.
func main() {
l := xml.NewLexer(os.Stdin)
l := xml.NewLexer(parse.NewInput(os.Stdin))
for {
tt, data := l.Next()
switch tt {
Expand Down

0 comments on commit a539aff

Please sign in to comment.