Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
gobwas committed May 30, 2016
1 parent 2d73328 commit 510a175
Show file tree
Hide file tree
Showing 16 changed files with 1,184 additions and 1,171 deletions.
403 changes: 199 additions & 204 deletions compiler.go → compiler/compiler.go

Large diffs are not rendered by default.

573 changes: 573 additions & 0 deletions compiler/compiler_test.go

Large diffs are not rendered by default.

548 changes: 0 additions & 548 deletions compiler_test.go

This file was deleted.

9 changes: 7 additions & 2 deletions glob.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package glob

import (
"github.com/gobwas/glob/parser"
"github.com/gobwas/glob/syntax"
)

// Glob represents compiled glob pattern.
type Glob interface {
Match(string) bool
Expand Down Expand Up @@ -32,7 +37,7 @@ type Glob interface {
// comma-separated (without spaces) patterns
//
func Compile(pattern string, separators ...rune) (Glob, error) {
ast, err := parse(newLexer(pattern))
ast, err := syntax.Parse(pattern)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -63,7 +68,7 @@ func QuoteMeta(s string) string {
// a byte loop is correct because all meta characters are ASCII
j := 0
for i := 0; i < len(s); i++ {
if special(s[i]) {
if syntax.Special(s[i]) {
b[j] = '\\'
j++
}
Expand Down
2 changes: 1 addition & 1 deletion match/any.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package match

import (
"fmt"
"github.com/gobwas/glob/strings"
"github.com/gobwas/glob/util/strings"
)

type Any struct {
Expand Down
2 changes: 1 addition & 1 deletion match/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package match

import (
"fmt"
"github.com/gobwas/glob/runes"
"github.com/gobwas/glob/util/runes"
"unicode/utf8"
)

Expand Down
2 changes: 1 addition & 1 deletion match/single.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package match

import (
"fmt"
"github.com/gobwas/glob/runes"
"github.com/gobwas/glob/util/runes"
"unicode/utf8"
)

Expand Down
48 changes: 0 additions & 48 deletions parser/ast.go

This file was deleted.

Loading

0 comments on commit 510a175

Please sign in to comment.